:root {
  --bg: #f3efe4;
  --surface: #fbf8f1;
  --surface-2: #e6decc;
  --text: #1c1914;
  --text-muted: #4e463c;
  --accent: #1a4f7a;
  --accent-ink: #f7f3ea;
  --border: #cfc4ae;
  --ring: #1a4f7a;
  --ok: #1d5c3d;
  --warn: #7a5410;
  --danger: #8c2f24;
  --info: #1a4f7a;
  --cta: #7a2e22;
  --cta-ink: #f8f1e6;
  --cta-deep: #5e2218;
  --cta-wash: rgba(18, 42, 64, 0.28);
  --cta-press: rgba(12, 28, 42, 0.22);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --shadow-1: 0 1px 0 rgba(28, 25, 20, 0.08);
  --container: 740px;
  --container-wide: 1040px;
  --rail: 232px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: 180ms;
  --cta-loop: 2.8s;
  --cta-echo: 3.2s;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-wrap: break-word;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

h1, h2, h3 {
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 var(--space-4);
}

h2 {
  font-size: 26px;
  line-height: 1.3;
  margin: var(--space-7) 0 var(--space-4);
}

h3 {
  font-size: 20px;
  line-height: 1.4;
  margin: var(--space-5) 0 var(--space-3);
}

p, li, dd { margin: 0 0 var(--space-4); }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--cta); }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: -40px;
  background: var(--surface);
  color: var(--text);
  padding: var(--space-2) var(--space-3);
  z-index: 50;
}

.skip:focus { top: var(--space-3); }

.shell {
  min-height: 100vh;
}

.rail {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.rail summary {
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  font-size: 16px;
  list-style: none;
}

.rail summary::-webkit-details-marker { display: none; }

.rail-head { padding: var(--space-4) var(--space-4) 0; }

.rail-mark {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 22px;
  line-height: 1.3;
}

.rail-mark a {
  color: var(--text);
  text-decoration: none;
}

.rail-sub {
  margin: var(--space-1) 0 var(--space-4);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.rail nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0 var(--space-4) var(--space-4);
}

.rail nav a {
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-2);
  border-bottom: 1px solid var(--border);
}

.rail nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}

.sheet {
  max-width: var(--container);
  padding: var(--space-6) var(--space-4) var(--space-5);
}

.sheet-wide { max-width: var(--container-wide); }

.kicker {
  margin: 0 0 var(--space-2);
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
}

.tide-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.tide-tools button {
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.tide-tools button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin: 0 0 var(--space-5);
  border-top: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.6;
}

caption {
  text-align: left;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 20px;
  padding: var(--space-3) 0;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 15px;
}

tbody tr:nth-child(even) td { background: var(--surface); }

.num {
  font-variant-numeric: tabular-nums;
  font-family: "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: 14px;
}

.name-stack {
  margin: 0;
  padding: 0;
  list-style: none;
}

.name-stack li {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.name-stack strong {
  display: block;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 20px;
  margin-bottom: var(--space-2);
}

.split { display: block; }

@media (min-width: 960px) {
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(200px, 0.7fr);
    gap: var(--space-6);
    align-items: start;
  }
}

.side-note {
  margin: var(--space-5) 0;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.side-note p:last-child { margin-bottom: 0; }

dl.fields { margin: 0 0 var(--space-5); }

dl.fields div {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

dt { font-weight: 700; }

dd { margin: 0; }

ol.steps { padding-left: 1.2em; }

ol.steps li { padding-bottom: var(--space-2); }

.faq details {
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.site-foot {
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-4) var(--space-5);
  max-width: calc(var(--container-wide) + var(--rail));
}

.site-foot .brand-link {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 20px;
  color: var(--text);
}

.foot-line {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}

a[data-site-cta] {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 32px));
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: var(--cta);
  color: var(--cta-ink);
  text-decoration: none;
  font-size: 17px;
  line-height: 1.3;
  text-align: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

a[data-site-cta]:hover,
a[data-site-cta]:focus-visible,
a[data-site-cta]:active {
  background: var(--cta-deep);
  color: var(--cta-ink);
}

a[data-site-cta]::before,
a[data-site-cta]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

a[data-site-cta]::before {
  background: radial-gradient(140% 180% at 50% 120%, var(--cta-wash) 0%, transparent 62%);
  opacity: 0;
  animation: tide-ink-rise var(--cta-loop) var(--ease) infinite;
}

a[data-site-cta]::after {
  box-shadow: inset 0 0 0 0 transparent;
  animation: hull-press var(--cta-echo) var(--ease) infinite;
}

@keyframes tide-ink-rise {
  0%, 52% { opacity: 0; transform: translateY(3px); }
  70% { opacity: 0.28; transform: translateY(0); }
  86%, 100% { opacity: 0; transform: translateY(0); }
}

@keyframes hull-press {
  0%, 62% { box-shadow: inset 0 0 0 0 transparent; }
  74% { box-shadow: inset 0 10px 18px var(--cta-press); }
  88%, 100% { box-shadow: inset 0 0 0 0 transparent; }
}

@media (min-width: 960px) {
  .shell {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    align-items: start;
  }

  .rail {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    border-bottom: 0;
    border-right: 1px solid var(--border);
    padding-top: var(--space-5);
  }

  .rail summary {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .rail nav { display: flex !important; }

  .sheet { padding: var(--space-7) var(--space-7) var(--space-6); }

  .site-foot {
    grid-column: 2;
    padding-left: var(--space-7);
    padding-right: var(--space-7);
  }
}

@media (max-width: 720px) {
  h1 { font-size: 28px; }

  a[data-site-cta] {
    left: 14px;
    right: 14px;
    width: auto;
    transform: none;
    bottom: calc(10px + env(safe-area-inset-bottom));
    min-height: 54px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  a[data-site-cta]::before,
  a[data-site-cta]::after {
    animation: none;
  }

  a[data-site-cta]::before {
    opacity: 0.18;
    transform: none;
  }

  a[data-site-cta]::after {
    box-shadow: inset 0 10px 16px var(--cta-press);
  }
}
