/*
 * Public legal pages (/privacy, /terms).
 *
 * These are plain static documents served straight from the Worker's asset
 * bundle, so they must stay readable without JavaScript and without the app
 * bundle. Colours mirror the official-site palette in src/site.css.
 */

@font-face {
  font-family: "Lora";
  src: url("/fonts/lora-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0100-017F, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Work Sans";
  src: url("/fonts/work-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0100-017F, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --line: #e2e5de;
  --ink: #243b32;
  --body: #37453e;
  --muted: #66706a;
  --faint: #8b948e;
  --accent: #4f6a49;
  --accent-tint: #edf2e8;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--body);
  background:
    radial-gradient(circle at 88% 0%, #e8f0e3, transparent 40%), var(--paper);
  background-repeat: no-repeat;
  font-family:
    "Work Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    sans-serif;
  font-size: 16px;
  line-height: 1.78;
  text-rendering: optimizeLegibility;
}

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

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
}

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

/* Header ------------------------------------------------------------------ */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
}

.site-head-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(1080px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.head-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: 13px;
}

.head-nav a {
  color: var(--muted);
  text-decoration: none;
}

.head-nav a:hover {
  color: var(--ink);
}

.head-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch button {
  padding: 4px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

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

main {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  color: var(--ink);
  font-family: "Lora", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: clamp(30px, 5vw, 41px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  color: var(--faint);
  font-size: 13px;
}

.summary {
  margin: 30px 0 6px;
  padding: 18px 20px;
  border: 1px solid #dfe5d9;
  border-radius: 14px;
  background: #fbfcf8;
  color: #3b4a43;
  font-size: 14.5px;
}

.summary p {
  margin: 0;
}

.doc {
  padding-top: 8px;
}

h2 {
  margin: 42px 0 10px;
  padding-top: 6px;
  color: var(--ink);
  font-family: "Lora", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

h3 {
  margin: 24px 0 6px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 650;
}

p {
  margin: 0 0 14px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

li {
  margin: 7px 0;
}

li > p {
  margin: 0;
}

strong {
  color: var(--ink);
  font-weight: 650;
}

.table-wrap {
  margin: 16px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

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

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

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.contact-box {
  margin: 34px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.contact-box p {
  margin: 0;
}

.lang-divider {
  margin: 56px 0 8px;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Language visibility. Without JavaScript both languages stay visible. ----- */

html.js[data-lang="zh"] .en-only,
html.js[data-lang="en"] .zh-only,
html.js[data-lang="zh"] #doc-en,
html.js[data-lang="en"] #doc-zh {
  display: none;
}

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

.site-foot {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.site-foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 30px;
  color: var(--muted);
  font-size: 12px;
}

.site-foot-inner nav {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.site-foot-inner a {
  color: var(--muted);
  text-decoration: none;
}

.site-foot-inner a:hover {
  color: var(--ink);
}

.copyright {
  margin: 0;
}

@media (max-width: 640px) {
  .site-head-inner {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 0;
  }

  .head-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 16px;
  }

  main {
    padding-top: 36px;
  }

  .site-foot-inner nav {
    width: 100%;
    margin-left: 0;
  }
}

@media print {
  .site-head,
  .lang-switch,
  .site-foot nav,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 11.5pt;
  }

  main {
    width: 100%;
    padding: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  h2 {
    break-after: avoid;
  }
}
