:root {
  --paper: #f8f7f3;
  --surface: #ffffff;
  --ink: #111827;
  --body: #334155;
  --muted: #64748b;
  --navy: #0f1b33;
  --slate: #1e3a5f;
  --gold: #8b6914;
  --rule: #e2dfd5;
  --rule-strong: #cfc9b8;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--body); font-family: var(--font-sans); line-height: 1.6; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.mono { font-family: var(--font-mono); }
.small { font-size: 0.84rem; }
.muted { color: var(--muted); }

.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); min-height: 71px; display: flex; align-items: center; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 10px 0; flex-wrap: wrap; }
.brand-lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand-wordmark { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.08rem; line-height: 1.2; }
.brand-tagline { font-size: 0.76rem; color: var(--muted); }
.header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav-list { list-style: none; display: flex; gap: 14px; margin: 0; padding: 0; align-items: center; }
.nav-btn, .nav-ext-link { text-decoration: none; color: var(--body); font-size: 0.9rem; font-weight: 600; padding: 4px 2px; border-bottom: 2px solid transparent; }
.nav-btn.active, .nav-btn:hover { color: var(--navy); border-bottom-color: var(--navy); }
.nav-ext-sep { border-left: 1px solid var(--rule-strong); padding-left: 12px; }
.lang-switch { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 6px; overflow: hidden; background: #fff; }
.lang-btn, .lang-link { padding: 4px 10px; font-size: 0.78rem; font-weight: 600; text-decoration: none; color: var(--body); border-right: 1px solid var(--rule); }
.lang-link:last-child { border-right: 0; }
.lang-btn.active { background: var(--navy); color: #fff; }

.site-main { padding: 28px 0 46px; }
.hero-band { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--navy); border-radius: 8px; padding: 24px 28px; margin-bottom: 22px; }
.hero-kicker { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.hero-title { font-family: var(--font-serif); font-size: 1.65rem; color: var(--navy); margin: 0 0 10px; }
.hero-lead { font-size: 0.95rem; color: var(--body); margin: 0 0 16px; max-width: 82ch; }
.hero-actions { margin-bottom: 18px; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-top: 14px; border-top: 1px solid var(--rule); }
.metric-cell { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; }
.metric-label { font-size: 0.75rem; color: var(--muted); }
.metric-val { font-size: 1.25rem; font-weight: 700; color: var(--navy); margin-top: 2px; }

.proj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.proj-card { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--slate); border-radius: 8px; padding: 20px 22px; display: flex; flex-direction: column; }
.proj-card.proj-news { border-top-color: var(--gold); }
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.proj-code { font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.proj-title { font-family: var(--font-serif); font-size: 1.16rem; color: var(--navy); margin: 0 0 4px; }
.proj-sub { font-size: 0.8rem; color: var(--muted); margin: 0 0 10px; }
.proj-desc { font-size: 0.88rem; margin: 0 0 12px; flex: 1 1 auto; }
.proj-meta { margin: 0 0 12px; padding: 10px 12px; background: var(--paper); border-radius: 6px; border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.proj-meta div { display: flex; gap: 8px; font-size: 0.8rem; }
.proj-meta dt { font-weight: 700; color: var(--navy); white-space: nowrap; }
.proj-meta dd { margin: 0; color: var(--body); }
.proj-live { color: var(--slate); margin-bottom: 10px; min-height: 1.2em; }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.badge.intl { background: #edf2f8; color: #1e3a5f; border: 1px solid #c6d5e8; }
.badge.warn { background: #fef9eb; color: #8b5a00; border: 1px solid #ead29c; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 0.86rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--slate); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--rule-strong); }
.btn-secondary:hover { background: var(--paper); }

.section-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 20px 22px; margin-bottom: 18px; }
.section-card h2 { font-family: var(--font-serif); font-size: 1.12rem; color: var(--navy); margin: 0 0 12px; }
.table-wrap { overflow-x: auto; }
table.booktabs { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.booktabs th, table.booktabs td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.booktabs thead th { border-top: 2px solid var(--navy); border-bottom: 1.5px solid var(--navy); color: var(--muted); white-space: nowrap; }

.console-grid, .about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.gov-form { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--navy); border-radius: 8px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.gov-form h2 { font-family: var(--font-serif); font-size: 1.08rem; color: var(--navy); margin: 0; }
.gov-form input, .gov-form textarea, .toolbar input { padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: 5px; font: inherit; font-size: 0.86rem; }
.scope-row { display: flex; gap: 8px; flex-wrap: wrap; }
.scope-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 5px; background: var(--paper); border: 1px solid var(--rule-strong); font-size: 0.8rem; cursor: pointer; }
.warn-note { background: #fef9eb; border: 1px solid #ead29c; color: #7c5100; padding: 8px 10px; border-radius: 5px; margin: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.code-box { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 10px; overflow-x: auto; font-size: 0.78rem; }

.site-footer { border-top: 1px solid var(--rule); padding: 20px 0 32px; font-size: 0.82rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-links a, .footer-sisters a { color: var(--slate); text-decoration: none; }
.footer-sisters { margin: 8px 0 0; }

@media (max-width: 860px) {
  .metric-strip, .proj-grid, .console-grid, .about-grid { grid-template-columns: 1fr; }
}
