:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --text: #1d1f23;
  --muted: #666b73;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #e7f0ff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

.container { max-width: 880px; margin: 0 auto; padding: 24px; }

/* Header */
.header { text-align: center; padding: 24px 0 12px; }
.header h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: 0.2px; }
.header p { color: var(--muted); margin: 0; }

/* Nav */
.nav { position: sticky; top: 0; background: var(--bg); z-index: 10; border-bottom: 1px solid var(--border); margin: 0 -24px; padding: 8px 24px; }
.nav ul { list-style: none; display: flex; gap: 8px; overflow-x: auto; padding: 0; margin: 0; }
.nav a { display: inline-block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--accent-soft); color: var(--accent); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Main */
.main { padding-top: 16px; }
.section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 16px 0; }
.section h2 { margin-top: 0; font-size: 22px; }
.section h3, .section h4 { margin-top: 20px; }
.section p { margin: 10px 0; color: var(--text); }
.section ul { padding-left: 20px; }
.section li { margin: 6px 0; }

/* Notice / callouts */
.notice { border-left: 4px solid #fb923c; background: #fff7ed; padding: 12px 12px; border-radius: 10px; margin-top: 12px; }
.notice strong { color: #c2410c; }
.highlight, .security-list { background: var(--bg); border: 1px dashed var(--border); border-radius: 10px; padding: 12px; margin-top: 12px; }

/* Info grid */
.info-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.info-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }

/* Footer */
.footer { margin-top: 24px; padding: 16px 0 40px; color: var(--muted); border-top: 1px solid var(--border); text-align: center; position: relative; }

/* Scroll to top */
.scroll-top { position: fixed; right: 20px; bottom: 20px; width: 40px; height: 40px; border: none; border-radius: 20px; background: var(--accent); color: #fff; cursor: pointer; box-shadow: 0 8px 20px rgba(0,0,0,.12); display: none; align-items: center; justify-content: center; font-size: 16px; }
.scroll-top:hover { background: #1d4ed8; }
.scroll-top:focus { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* Anchored target highlight */
:target { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }

/* Links */
a { color: var(--accent); }

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1218;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #9aa4b2;
    --border: #1f2937;
    --accent: #60a5fa;
    --accent-soft: rgba(96,165,250,.15);
  }
  .notice { background: #2a1a0e; border-left-color: #f59e0b; }
}

/* Print */
@media print {
  body { background: #fff; }
  .nav, .scroll-top { display: none !important; }
  .section { border: none; background: #fff; }
  .container { padding: 0; }
}