@import url("/css/site-nav.css");

:root {
  --bg: #0f0e0c;
  --surface: #1a1814;
  --surface2: #221f1a;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f5f0e8;
  --muted: #9c958a;
  --accent: #e8b86d;
  --accent-dim: rgba(232, 184, 109, 0.14);
  --law: #7eb8da;
  --law-dim: rgba(126, 184, 218, 0.1);
  --ok: #6ecf9a;
  --warn: #f0a060;
  --danger: #e87878;
  --radius: 14px;
  --max: 1080px;
}

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

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 45% at 10% -5%, rgba(232, 184, 109, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 35% at 95% 5%, rgba(126, 184, 218, 0.07), transparent 50%),
    var(--bg);
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page { max-width: var(--max); margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.back { color: var(--muted); font-size: 0.88rem; }
.back:hover { color: var(--accent); text-decoration: none; }
.top-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.top-link {
  font-size: 0.82rem; font-weight: 600; padding: 0.4rem 0.75rem; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
}
.top-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.top-link.primary { background: var(--accent-dim); border-color: rgba(232, 184, 109, 0.35); color: var(--accent); }

.hero { margin-bottom: 1.75rem; max-width: 42rem; }
.hero h1 {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.hero .lead { color: var(--muted); font-size: 1rem; margin-bottom: 0.65rem; }
.hero .meta { font-size: 0.78rem; color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.toc-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.65rem;
}
.toc a {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.15rem;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.toc a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }
.toc-extra { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.toc-extra a { font-size: 0.8rem; }

.topic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 1rem;
}
.topic-head { margin-bottom: 1.15rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.topic-head h2 {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}
.topic-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.65rem; }
.tag {
  font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 6px;
  background: var(--law-dim); color: var(--law);
}
.topic-summary { color: var(--muted); font-size: 0.95rem; }

.blocks { display: grid; gap: 0.85rem; }
.block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1rem;
}
.block-head {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.65rem;
}
.block-head.law { color: var(--law); }
.block-head.cond { color: var(--accent); }
.block-head.pay { color: var(--ok); }
.block-head.rights { color: #8ec8f0; }
.block-head.warn { color: var(--warn); }

.law-item {
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--law);
  background: var(--law-dim);
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}
.law-item:last-child { margin-bottom: 0; }
.law-item cite {
  display: block; font-style: normal; font-weight: 600;
  font-size: 0.76rem; color: var(--law); margin-bottom: 0.2rem;
}

.list { margin: 0; padding-left: 1.15rem; font-size: 0.9rem; }
.list li { margin-bottom: 0.4rem; }
.list.warn li { color: #f5c99a; }

.pay-box { font-size: 0.9rem; }
.pay-box p { margin-bottom: 0.45rem; }
.pay-note { font-size: 0.84rem; color: var(--muted); margin-top: 0.35rem; }
.pay-link {
  display: inline-block; margin-top: 0.65rem;
  font-size: 0.84rem; font-weight: 600; padding: 0.45rem 0.8rem;
  border-radius: 8px; background: rgba(110, 207, 154, 0.12);
  border: 1px solid rgba(110, 207, 154, 0.3); color: var(--ok);
  text-decoration: none;
}
.pay-link:hover { background: rgba(110, 207, 154, 0.2); text-decoration: none; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 1rem;
}
.panel h2 {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  list-style: none;
}
.step {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  font-size: 0.78rem; font-weight: 700; margin-bottom: 0.45rem;
}
.step strong { display: block; font-size: 0.9rem; margin-bottom: 0.25rem; }
.step span { font-size: 0.84rem; color: var(--muted); }

.faq { display: grid; gap: 0.5rem; }
.faq details {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 0.75rem 0.9rem;
  font-size: 0.9rem; font-weight: 600; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq p { padding: 0 0.9rem 0.85rem; font-size: 0.86rem; color: var(--muted); }

.sources { font-size: 0.88rem; color: var(--muted); }
    .sources ul { margin: 0.5rem 0 0 1.1rem; }
    .ref-item {
      padding: 0.75rem 0; border-bottom: 1px solid rgba(255,255,255,0.06);
      font-size: 0.88rem; line-height: 1.5;
    }
    .ref-item:last-child { border-bottom: none; }
    .ref-period { font-size: 0.78rem; font-weight: 700; color: var(--accent); margin-bottom: 0.2rem; }
    .hero .hero-note {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(232, 184, 109, 0.08);
  border: 1px solid rgba(232, 184, 109, 0.18);
}

.purpose-banner {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.ref-intro { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.75rem; }

.ref-details summary {
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  list-style: none;
  margin-bottom: 0.75rem;
}
.ref-details summary::-webkit-details-marker { display: none; }
.ref-details[open] summary { margin-bottom: 1rem; }

.retry-btn {
  margin-top: 0.5rem;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.retry-btn:active { opacity: 0.85; }

.disclaimer {
  margin-top: 1.5rem; font-size: 0.78rem; color: var(--muted);
  line-height: 1.55; opacity: 0.9;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .toc {
    position: static;
    display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.75rem;
  }
  .toc-label, .toc-extra { display: none; }
  .toc a {
    display: inline-block; padding: 0.35rem 0.6rem;
    border: 1px solid var(--border); border-left: 1px solid var(--border);
    border-radius: 999px; margin: 0; font-size: 0.78rem;
  }
  .toc a.active { border-color: var(--accent); }
}
