/*
 * /privacy and /terms. Static files in public/ are not processed by Vite, so this
 * repeats the landing page's palette (src/theme/tokens.css values; accent and
 * tertiary text darkened in light mode for 4.5:1 body-text contrast) instead of
 * importing it. No scripts, no remote assets.
 */

@font-face {
  font-family: 'ZCOOL KuaiLe';
  src: url('/assets/fonts/ZCOOLKuaiLe-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --page: rgb(246 239 226);
  --page-rgb: 246 239 226;
  --card: rgb(252 247 237);
  --border: rgb(224 206 185 / 0.66);
  --text: rgb(62 50 38);
  --text-secondary: rgb(115 102 86);
  --text-tertiary: rgb(116 103 87);
  --heading: rgb(102 74 50);
  --accent: rgb(138 154 91);
  --accent-text: rgb(96 112 54);
  --accent-muted: rgb(225 230 203);
  --accent-warm: rgb(218 103 76);
  --button-text: rgb(252 249 242);
  --button: rgb(96 112 54);
  --shadow: rgb(163 122 79 / 0.14);
  --font-cute: 'ZCOOL KuaiLe', 'Yuanti SC', 'HanziPen SC', ui-rounded, system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --max: 760px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: rgb(17 18 22);
    --page-rgb: 17 18 22;
    --card: rgb(28 31 38);
    --border: rgb(70 76 92 / 0.7);
    --text: rgb(240 242 248);
    --text-secondary: rgb(177 184 200);
    --text-tertiary: rgb(141 149 165);
    --heading: rgb(240 230 216);
    --accent: rgb(184 201 133);
    --accent-text: rgb(184 201 133);
    --accent-muted: rgb(51 59 36);
    --accent-warm: rgb(255 154 125);
    --button-text: rgb(18 21 26);
    --button: rgb(184 201 133);
    --shadow: rgb(0 0 0 / 0.3);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---- Top bar (same shape as the landing page) ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgb(var(--page-rgb) / 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--max);
  height: 60px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--heading);
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 4px 10px var(--shadow);
}

.brand span {
  font-family: var(--font-cute);
  font-size: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-family: var(--font-cute);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

/* ---- Document ---- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
}

.doc-header {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--accent-text);
}

h1,
h2 {
  font-family: var(--font-cute);
  font-weight: 400;
  font-synthesis: none;
  color: var(--heading);
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 8vw, 44px);
  line-height: 1.2;
}

.meta {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-tertiary);
}

.summary {
  margin: 0 0 32px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 10px 24px var(--shadow);
}

.summary h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.summary ul {
  margin: 0;
  padding-left: 1.2em;
}

.summary li + li {
  margin-top: 6px;
}

section {
  margin-top: 36px;
}

section h2 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  font-size: 24px;
  line-height: 1.35;
}

h3 {
  margin: 20px 0 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--heading);
}

p,
ul,
ol {
  margin: 0 0 12px;
}

ul,
ol {
  padding-left: 1.3em;
}

li + li {
  margin-top: 4px;
}

strong {
  font-weight: 600;
}

.note {
  color: var(--text-secondary);
  font-size: 15px;
}

.table-wrap {
  overflow-x: auto;
  margin: 8px 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

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

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

tr:last-child td {
  border-bottom: none;
}

th {
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
}

/* ---- Footer ---- */

.footer {
  padding: 24px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-tertiary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  max-width: var(--max);
  margin: 0 auto;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.footer-inner a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-inner a:hover,
.footer-inner a[aria-current='page'] {
  color: var(--accent-text);
}

.footer-copy {
  margin: 0 0 0 auto;
}

/* Narrow screens: the three-column table becomes one card per row. */
@media (max-width: 560px) {
  .table-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table-stack tr {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }

  .table-stack tr:last-child {
    border-bottom: none;
  }

  .table-stack td {
    display: block;
    padding: 0;
    border: none;
  }

  .table-stack td:first-child {
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--heading);
  }

  .table-stack td[data-label]::before {
    content: attr(data-label);
    color: var(--text-tertiary);
  }
}
