/* ============================================================
   368MEGA · base.css — 设计 token + 通用组件（全站共用）
   布局族: dark-gold-hero-cards · 移动优先 375px → 768px 断点
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  /* palette */
  --bg: #1C2850;            /* 深夜蓝底 */
  --bg-2: #182245;          /* 更深（页脚/页头） */
  --surface: #223161;       /* 卡片面 */
  --surface-2: #27376E;     /* 卡片面-亮 */
  --primary: #EBAC01;       /* 品牌金 */
  --primary-600: #C28E01;   /* 金-按压 */
  --primary-soft: rgba(235, 172, 1, 0.13);
  --accent: #0DFFC4;        /* 薄荷绿点缀 */
  --accent-soft: rgba(0, 222, 168, 0.12);
  --text: #F8FAFC;          /* 主文字 */
  --muted: #B0BBCA;         /* 次文字 */
  --border: rgba(148, 163, 184, 0.22);
  --danger: #FA9D9D;
  --on-primary: #483200;    /* 金底上的深字 */

  /* typography */
  --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-h1: clamp(1.75rem, 4.5vw, 2.6rem);
  --fs-h2: clamp(1.35rem, 3.2vw, 1.85rem);
  --fs-h3: 1.12rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --lh: 1.7;

  /* spacing scale */
  --sp-1: 0.25rem; --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem;     --sp-7: 3rem;    --sp-8: 4rem;

  /* radius & shadow */
  --r-sm: 2px; --r-md: 4px; --r-lg: 6px; --r-pill: 3px;
  --shadow-1: 0 2px 10px rgba(2, 6, 23, 0.45);
  --shadow-2: 0 10px 32px rgba(2, 6, 23, 0.55);
  --shadow-gold: 0 6px 24px rgba(245, 179, 1, 0.25);

  /* misc */
  --header-h: 64px;
  --max-w: 1160px;
}

/* ---------- 2. Reset & baseline ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--sp-3); font-weight: 800; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--sp-3); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--primary); }
ul, ol { margin: 0 0 var(--sp-3); padding-left: 1.3rem; }
li { margin-bottom: var(--sp-2); }
strong { color: var(--primary); font-weight: 700; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--sp-4); }

/* ---------- 3. Header / nav（CSS-only 汉堡菜单） ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 15, 30, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; gap: var(--sp-4); min-height: var(--header-h); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); }
.brand img { height: 56px; width: auto; }
.header-cta { margin-left: auto; display: flex; gap: var(--sp-2); }
.nav-burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; cursor: pointer; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px; background: transparent;
}
.nav-burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.site-nav { display: none; width: 100%; padding-bottom: var(--sp-3); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.site-nav a {
  display: block; padding: var(--sp-3) var(--sp-2); color: var(--text);
  border-radius: var(--r-sm); font-weight: 600; min-height: 44px;
}
.site-nav a:hover, .site-nav a.is-active { background: var(--primary-soft); color: var(--primary); }
.site-nav.open { display: block; }
@media (min-width: 768px) {
  .nav-burger { display: none; }
  .site-nav { display: block !important; width: auto; padding: 0; }
  .site-nav ul { flex-direction: row; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
  .site-nav a { padding: var(--sp-2) var(--sp-3); }
}

/* ---------- 4. Buttons / chips / badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-weight: 700; font-size: var(--fs-small); cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-gold); }
.btn-primary:hover { background: var(--primary-600); color: var(--on-primary); }
.btn-accent { background: var(--accent); color: #0C4C3A; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: var(--sp-4) var(--sp-6); font-size: 1rem; }

.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: var(--fs-small); color: var(--muted);
}
.chip-gold { background: var(--primary-soft); border-color: rgba(245, 179, 1, 0.4); color: var(--primary); }
.chip-green { background: var(--accent-soft); border-color: rgba(0, 212, 160, 0.4); color: var(--accent); }

/* ---------- 5. Sections & cards ---------- */
.section { padding-block: var(--sp-7); }
.section-alt { background: var(--bg-2); }
.section-head { max-width: 720px; margin: 0 auto var(--sp-6); text-align: center; }
.section-head p { color: var(--muted); }
.section-title { position: relative; padding-bottom: var(--sp-3); }
.section-title::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 56px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--primary), var(--accent));
}
.section-head.left, .section-head.left .section-title::after { text-align: left; left: 0; transform: none; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-5);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(245, 179, 1, 0.5); }
.card h3 { color: var(--primary); }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 1.4rem; font-weight: 800;
  margin-bottom: var(--sp-3);
}
.card-cta { margin-top: var(--sp-3); }

.grid { display: grid; gap: var(--sp-4); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--sp-4); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 6. Hero ---------- */
.hero { padding-block: var(--sp-7) var(--sp-8); background:
  radial-gradient(1100px 420px at 80% -10%, rgba(245, 179, 1, 0.14), transparent 60%),
  radial-gradient(800px 360px at 0% 110%, rgba(0, 212, 160, 0.10), transparent 55%),
  var(--bg); }
.hero-inner { display: grid; gap: var(--sp-6); align-items: center; }
.hero h1 span { color: var(--primary); }
.hero-lead { color: var(--muted); font-size: 1.05rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-5) 0; }
.hero-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.hero-media { position: relative; }
.hero-media img { border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--shadow-2); }
@media (min-width: 768px) { .hero-inner { grid-template-columns: 1.15fr 0.85fr; } }

/* ---------- 7. Steps / FAQ / breadcrumb ---------- */
.steps { display: grid; gap: var(--sp-4); }
.step { display: flex; gap: var(--sp-4); align-items: flex-start; }
.step-num {
  flex: 0 0 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary); font-weight: 800;
}

.faq-list { display: grid; gap: var(--sp-3); }
.faq-list details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4);
}
.faq-list summary {
  cursor: pointer; font-weight: 700; list-style: none; min-height: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--primary); font-size: 1.4rem; line-height: 1; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details > p { margin: var(--sp-3) 0 0; color: var(--muted); }

.breadcrumb { padding-block: var(--sp-3); font-size: var(--fs-small); color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: var(--sp-2); color: var(--border); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- 8. Article prose / utility ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: var(--sp-6); }
.prose h3 { color: var(--primary); margin-top: var(--sp-5); }
.prose img { border-radius: var(--r-md); margin-block: var(--sp-5); }
.prose ul, .prose ol { color: var(--muted); }
.prose li strong, .prose p strong { color: var(--text); }

.note {
  background: var(--accent-soft); border: 1px solid rgba(0, 212, 160, 0.35);
  border-radius: var(--r-md); padding: var(--sp-4); color: var(--muted);
}
.note strong { color: var(--accent); }

.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: var(--fs-small); }
th, td { padding: var(--sp-3) var(--sp-4); text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--primary); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.cta-band {
  background: linear-gradient(120deg, rgba(245, 179, 1, 0.16), rgba(0, 212, 160, 0.10));
  border: 1px solid rgba(245, 179, 1, 0.35); border-radius: var(--r-lg);
  padding: var(--sp-6); text-align: center;
}
.cta-band .btn { margin: var(--sp-2); }

.related-links { display: grid; gap: var(--sp-3); }
@media (min-width: 768px) { .related-links { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 9. Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding-block: var(--sp-7) var(--sp-4); margin-top: var(--sp-7); }
.footer-grid { display: grid; gap: var(--sp-5); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h3 { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
.footer-about { color: var(--muted); font-size: var(--fs-small); }
.footer-bottom {
  margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between;
  color: var(--muted); font-size: var(--fs-small);
}

/* ---------- 10. Back-to-top / misc ---------- */
.to-top {
  position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; box-shadow: var(--shadow-gold);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
