/* CarPlus Official Site — dark theme + #BDE465 accent */

:root {
  --bg-deep: #070d0a;
  --bg-mid: #0c1410;
  --bg-card: rgba(12, 22, 16, 0.72);
  --border: rgba(189, 228, 101, 0.2);
  --border-glow: rgba(189, 228, 101, 0.38);
  --accent: #bde465;
  --accent-2: #9acc4a;
  --accent-deep: #7cb342;
  --text: #eef2ea;
  --text-muted: #8a9a8c;
  --on-accent: #0a1408;
  --radius: 16px;
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(189, 228, 101, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(124, 179, 66, 0.08), transparent),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(189, 228, 101, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(189, 228, 101, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.service-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(189, 228, 101, 0.08);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.service-btn svg {
  width: 18px;
  height: 18px;
}

.service-btn:hover {
  background: rgba(189, 228, 101, 0.14);
  border-color: var(--border-glow);
}

.service-btn:active {
  transform: scale(0.97);
}

.service-modal {
  max-width: 320px;
}

.service-modal-body {
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.service-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.service-qrcode {
  width: 100%;
  max-width: 240px;
  height: auto;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: block;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(189, 228, 101, 0.3);
  flex-shrink: 0;
}

.logo-img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand .slogan {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.main {
  flex: 1;
  display: grid;
  gap: 16px;
  min-height: 0;
}

@media (orientation: landscape) and (min-width: 700px) {
  .page {
    padding: 16px 24px;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  .main {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }
}

@media (orientation: portrait), (max-width: 699px) {
  .page {
    padding: 16px 16px 32px;
    min-height: 100vh;
    height: auto;
  }

  .main { grid-template-columns: 1fr; }

  .brand h1 { font-size: 1.15rem; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(12px);
  transition: border-color 0.25s, box-shadow 0.25s;
  min-height: 0;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 32px rgba(189, 228, 101, 0.08);
}

.card-visual {
  flex: 1;
  min-height: 0;
  aspect-ratio: 850 / 543;
  border-radius: 12px;
  background: #0a100c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.card-visual .card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (orientation: landscape) and (min-width: 700px) {
  .card-visual {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
  }
}

@media (orientation: portrait), (max-width: 699px) {
  .card-visual {
    flex: none;
    min-height: 0;
  }
}

.card-tag {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  line-height: 1.35;
  opacity: 0.95;
}

.card h2 {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--text);
}

.card .desc {
  height: calc(0.82rem * 1.55 * 3);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
  text-align: left;
}

.card .desc-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--on-accent);
  box-shadow: 0 4px 20px rgba(189, 228, 101, 0.22);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(189, 228, 101, 0.35);
}

.btn-ghost {
  background: rgba(189, 228, 101, 0.08);
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(189, 228, 101, 0.14);
  border-color: var(--border-glow);
}

.card-actions .btn {
  flex: 1 1 calc(33.333% - 6px);
  min-width: 0;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 10, 0.78);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-mid);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }

.download-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.download-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.download-info-row dt {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.download-info-row dd {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.download-modal-actions {
  display: flex;
  gap: 8px;
}

.download-modal-actions .btn {
  flex: 1;
  min-width: 0;
}

.version-list {
  list-style: none;
  overflow-y: auto;
  padding: 8px 6px 8px 8px;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(189, 228, 101, 0.35) rgba(255, 255, 255, 0.04);
}

.version-list::-webkit-scrollbar {
  width: 6px;
}

.version-list::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}

.version-list::-webkit-scrollbar-thumb {
  background: rgba(189, 228, 101, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.version-list::-webkit-scrollbar-thumb:hover {
  background: rgba(189, 228, 101, 0.42);
  background-clip: padding-box;
}

.version-list::-webkit-scrollbar-thumb:active {
  background: rgba(189, 228, 101, 0.55);
  background-clip: padding-box;
}

.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  transition: background 0.15s;
}

.version-item:hover { background: rgba(189, 228, 101, 0.07); }

.version-info .ver {
  font-weight: 600;
  font-size: 0.9rem;
}

.version-info .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.version-info .note {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.85;
}

.footer {
  text-align: center;
  padding: 12px 12px 6px;
  font-size: 0.6rem;
  color: var(--text-muted);
  flex-shrink: 0;
  border-top: 1px solid rgba(189, 228, 101, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.footer-beian {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-beian-gov {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-gov-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: block;
}

.footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(189, 228, 101, 0.35);
  flex-shrink: 0;
}

.footer-meta,
.footer-copy {
  line-height: 1.45;
  opacity: 0.75;
}

.footer-copy {
  font-size: 0.55rem;
  opacity: 0.55;
}

@media (orientation: landscape) and (min-width: 700px) {
  .footer {
    padding: 8px 12px 2px;
    gap: 3px;
  }
}

@media (orientation: portrait), (max-width: 699px) {
  .footer-beian {
    flex-direction: column;
    gap: 6px;
  }

  .footer-dot {
    display: none;
  }
}
