:root {
  --ink: #162334;
  --muted: #5a6b7d;
  --paper: #fffdf7;
  --panel: #ffffff;
  --line: #d8e2e8;
  --brand: #143a5f;
  --brand-2: #0a7f82;
  --gold: #f3b23f;
  --soft: #edf7f6;
  --danger: #b00020;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(243,178,63,.20), transparent 28rem),
    radial-gradient(circle at 90% 20%, rgba(10,127,130,.18), transparent 30rem),
    linear-gradient(145deg, #fffaf0 0%, #eef8fb 48%, #f8fbff 100%);
  line-height: 1.58;
}
a { color: #0b5f8a; font-weight: 700; }
a:hover { color: #0a7f82; }
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,247,.94);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.logo { width: 58px; height: 58px; flex: 0 0 auto; }
.brand h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; letter-spacing: -.03em; font-size: clamp(1.5rem, 2vw, 2.25rem); color: var(--brand); }
.brand p { margin: 2px 0 0; color: var(--muted); }
.lang { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; padding: 22px 24px 48px; align-items: start; }
.side {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.84);
  border-radius: 18px;
  padding: 14px;
  position: sticky;
  top: 98px;
}
.nav-toggle { width: 100%; border: 0; border-radius: 12px; padding: 10px 12px; background: var(--brand); color: white; font-weight: 800; cursor: pointer; text-align: left; }
.side nav { margin-top: 10px; display: grid; gap: 6px; }
.side a { text-decoration: none; padding: 9px 10px; border-radius: 11px; color: var(--brand); }
.side a.active, .side a:hover { background: var(--soft); }
body.nav-collapsed .shell { grid-template-columns: 68px minmax(0, 1fr); }
body.nav-collapsed .side a span, body.nav-collapsed .side .nav-label { display: none; }
body.nav-collapsed .side { padding: 10px; }
body.nav-collapsed .nav-toggle { text-align: center; }
main { max-width: 1180px; }
.hero, .card, .panel {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(18px, 3vw, 34px);
  box-shadow: 0 18px 50px rgba(20,58,95,.08);
  margin-bottom: 18px;
}
.hero h2 { margin: 0 0 10px; font-size: clamp(1.8rem, 4vw, 3.4rem); line-height: 1.05; color: var(--brand); font-family: Georgia, "Times New Roman", serif; }
.lead { font-size: 1.1rem; color: #31475d; max-width: 78ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.badge { display: inline-block; background: #fff4d8; color: #6f4b00; border: 1px solid #f5d88a; border-radius: 999px; padding: 3px 9px; font-size: .86rem; font-weight: 800; margin: 2px 6px 2px 0; }
.button { display: inline-block; border-radius: 999px; padding: 11px 16px; background: var(--brand); color: white; text-decoration: none; margin: 4px 8px 4px 0; }
.button.secondary { background: var(--brand-2); }
.button:hover { color: white; filter: brightness(1.08); }
code, pre { font-family: Consolas, "Courier New", monospace; }
pre { background: #132235; color: #f3fbff; padding: 14px; border-radius: 14px; white-space: pre-wrap; }
.data-table { border-collapse: collapse; width: max-content; max-width: 100%; background: white; margin-top: 10px; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.data-table th { background: #eaf4f5; color: var(--brand); cursor: pointer; resize: horizontal; overflow: auto; white-space: normal; }
.data-table td.num, .data-table th.num { text-align: right; }
.table-tools { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; color: var(--muted); }
.table-tools label { background: #f4f8fb; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; }
.footer { padding: 22px 24px 36px; color: var(--muted); border-top: 1px solid var(--line); background: rgba(255,255,255,.65); }
.notice { border-left: 5px solid var(--gold); background: #fff9ea; padding: 12px 14px; border-radius: 14px; }
@media (max-width: 840px) {
  .topbar { position: static; align-items: flex-start; }
  .shell, body.nav-collapsed .shell { grid-template-columns: 1fr; padding: 14px; }
  .side { position: static; }
  body.nav-collapsed .side nav { display: none; }
  .lang { margin-left: 0; }
}
