/* CalcPop legal site — zero-dependency static stylesheet. */
:root {
  color-scheme: dark;
  --bg: #0e1116;
  --surface: #161b22;
  --border: rgba(255, 255, 255, 0.09);
  --primary: #6c8cff;
  --accent: #38d6c4;
  --text: #f2f4f8;
  --muted: #9aa3b2;
  --max: 880px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(108, 140, 255, 0.15), transparent 62%),
    radial-gradient(900px 560px at 92% -4%, rgba(56, 214, 196, 0.08), transparent 58%),
    var(--bg);
  font: 15px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Language visibility: Chinese is the no-JS default; site.js flips data-lang. */
html[data-lang="zh"] [data-lang="en"],
html[data-lang="en"] [data-lang="zh"] { display: none !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 17, 22, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.brand:hover { text-decoration: none; }
.brand .dot {
  width: 9px;
  height: 9px;
  align-self: center;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.brand small { color: var(--muted); font-size: 12px; font-weight: 400; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(108, 140, 255, 0.14);
  border-color: rgba(108, 140, 255, 0.3);
}

.hero { padding: 44px 0 26px; }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.28;
  letter-spacing: 0.3px;
}
.hero p { margin: 0; color: var(--muted); }
.crumb { margin-bottom: 12px !important; font-size: 13px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(22, 27, 34, 0.8);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.card {
  margin: 0 0 16px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.card h2 { margin: 0 0 12px; font-size: 17px; color: var(--primary); }

.doc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.doc-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(108, 140, 255, 0.07), transparent), var(--surface);
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.doc-card:hover { text-decoration: none; transform: translateY(-3px); border-color: rgba(108, 140, 255, 0.45); }
.doc-card .kicker { color: var(--accent); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.doc-card h2 { margin: 10px 0 8px; font-size: 21px; color: var(--text); }
.doc-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.doc-card .go { margin-top: auto; padding-top: 16px; color: var(--primary); font-size: 13px; }

.toc ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 22px;
  margin: 0;
  padding-left: 20px;
  font-size: 13.5px;
}
.toc li { padding: 3px 0; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--text); }

.clause { scroll-margin-top: 88px; }
.clause p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.clause p:last-child { margin-bottom: 0; }
.clause a { overflow-wrap: anywhere; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.contact p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; }

.site-footer {
  margin-top: 44px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.lang-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; }
.lang-switch a { padding: 4px 12px; border-radius: 999px; font-size: 12px; }
.lang-switch a.active { background: rgba(108, 140, 255, 0.18); color: var(--text); }
.lang-switch a:hover { text-decoration: none; }

@media (max-width: 560px) {
  .site-header .wrap { gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .nav { margin-left: 0; }
  .nav a { padding: 5px 9px; font-size: 12.5px; }
  .hero { padding-top: 30px; }
  .card { padding: 18px 16px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .doc-card { transition: none; }
}

@media print {
  body { background: #fff; color: #111; }
  .site-header, .lang-switch, .doc-go, .toc { display: none !important; }
  .card { background: #fff; border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
  .hero h1, .card h2, .doc-card h2 { color: #111; }
  .hero p, .clause p, .doc-card p, .chip, .facts dt, .contact p, .site-footer { color: #333; }
  a { color: #1746a2; }
}
