/* ============ Fonts (self-hosted, OFL) ============ */
@font-face { font-family: 'Cinzel'; src: url('/assets/fonts/cinzel-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('/assets/fonts/cinzel-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('/assets/fonts/cinzel-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/assets/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; size-adjust: 112%; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/assets/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; size-adjust: 112%; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/assets/fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; size-adjust: 112%; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

/* ============ Tokens ============ */
:root {
  --void: #030304;
  --bg: #060607;
  --bg-2: #0b0b0d;
  --panel: rgba(255, 255, 255, .022);
  --panel-solid: #0d0d10;
  --panel-2: rgba(255, 255, 255, .045);
  --line: rgba(255, 248, 230, .08);
  --line-2: rgba(255, 248, 230, .14);
  --text: #f2eee5;
  --muted: #a39e93;
  --dim: #6c685f;
  --gold: #e8d3a0;
  --gold-2: #b99358;
  --gold-glow: rgba(232, 211, 160, .35);
  --accent: var(--gold);
  --creator: #ff7d5a;
  --creator-glow: rgba(255, 125, 90, .28);
  --researcher: #7fd6ff;
  --researcher-glow: rgba(127, 214, 255, .26);
  --ok: #63d6a3;
  --warn: #f0b75e;
  --err: #ff6f6f;
  --radius: .25rem;
  --radius-lg: .375rem;
  --cjk: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', var(--cjk);
  --display: 'Cinzel', 'Noto Serif SC', 'Songti SC', var(--cjk);
  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* 英文 / 葡语：西文衬线用 Cormorant Garamond（字面偏小，size-adjust 放大到与中文衬线相近），标题仍是 Cinzel */
html:lang(en), html:lang(pt-BR) { --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif; }

/* ============ Base ============ */
* { box-sizing: border-box; }
html { background: var(--void); scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (min-width: 1440px) { html { font-size: clamp(16px, calc(100vw / 90), 24px); } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: .9375rem; line-height: 1.7; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body::before { /* film grain */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: rgba(232, 211, 160, .3); color: #fff; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre { font-family: var(--mono); }
img, svg, canvas { display: block; }
.wrap { max-width: 75rem; margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 640px) { .wrap { padding: 0 1rem; } }

[hidden] { display: none !important; }
.row > * { min-width: 0; }
.hint { font-size: .78rem; color: var(--dim); margin-top: .375rem; }
.hint b { color: var(--muted); font-weight: 500; }
.tok-hint { display: block; font-size: .78rem; color: var(--dim); line-height: 1.6; min-height: 1.25rem; }

/* ============ Typography ============ */
h1, h2, h3, .display { font-feature-settings: 'palt'; }
.display { font-family: var(--display); font-weight: 600; letter-spacing: .04em; }
.eyebrow { display: inline-flex; align-items: center; gap: .75rem; font-family: var(--display); font-size: .75rem; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: ''; width: 1.75rem; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.gold-text { background: linear-gradient(180deg, #fff8e7 0%, var(--gold) 55%, var(--gold-2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }

/* ============ Nav ============ */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; transition: background .4s, border-color .4s, backdrop-filter .4s; border-bottom: 1px solid transparent; }
.nav.scrolled, .nav.solid { background: rgba(5, 5, 6, .72); backdrop-filter: blur(1.125rem) saturate(1.2); -webkit-backdrop-filter: blur(1.125rem) saturate(1.2); border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; height: 4.25rem; gap: 2.5rem; }
.nav-pad { height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .75rem; font-family: var(--display); font-weight: 700; font-size: 1.0625rem; letter-spacing: .28em; }
.brand small { font-family: var(--sans); font-weight: 500; font-size: .6875rem; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.brand-mark { width: .5625rem; height: 1.5rem; border-radius: 1px; background: linear-gradient(180deg, #1c1b19, #050505); border: 1px solid rgba(232, 211, 160, .55); box-shadow: 0 0 .875rem var(--gold-glow), inset 0 0 .375rem rgba(232, 211, 160, .25); position: relative; }
.brand-mark::after { content: ''; position: absolute; left: 50%; top: .1875rem; bottom: .1875rem; width: 1px; transform: translateX(-50%); background: linear-gradient(180deg, transparent, var(--gold), transparent); }
.nav-links { display: flex; gap: 2rem; font-size: .8438rem; letter-spacing: .06em; color: var(--muted); }
.nav-links a { position: relative; padding: .25rem 0; transition: color .2s; }
.nav-links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.125rem; height: 1px; background: var(--gold); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-right { margin-left: auto; display: flex; gap: .625rem; align-items: center; }
/* 761–1024px：导航链接与按钮同时显示，去掉副标题、收紧间距，西文也放得下 */
@media (max-width: 1024px) { .brand small { display: none; } .nav .wrap { gap: 1.5rem; } .nav-links { gap: 1.25rem; } }
@media (max-width: 760px) { .nav-links { display: none; } .brand small { display: none; } .nav .wrap { gap: 1rem; } }
.nav-short { display: none; }
/* 窄屏：注册按钮用短文案，收紧间距，西文的长按钮也放得下 */
@media (max-width: 480px) {
  .nav-long { display: none; } .nav-short { display: inline; }
  .nav .wrap { gap: .75rem; } .nav-right { gap: .375rem; } .nav .btn-sm { padding: 0 .625rem; }
  .brand { letter-spacing: .2em; } .lang-switch summary { min-width: 0; padding: 0 .5rem; }
}
@media (max-width: 360px) {
  .brand { letter-spacing: .14em; gap: .5rem; } .nav .btn-sm { padding: 0 .5rem; }
  .lang-switch summary::after { display: none; }
}

.lang-switch { position: relative; }
.lang-switch summary { list-style: none; cursor: pointer; height: 2rem; min-width: 2.75rem; padding: 0 .625rem; display: inline-flex; align-items: center; justify-content: center; gap: .375rem; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: .75rem; letter-spacing: .1em; color: var(--muted); transition: .2s; user-select: none; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary::after { content: ''; width: .3125rem; height: .3125rem; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-.125rem); }
.lang-switch summary:hover, .lang-switch[open] summary { color: var(--gold); border-color: rgba(232, 211, 160, .45); }
.lang-menu { position: absolute; right: 0; top: calc(100% + .375rem); min-width: 8.5rem; padding: .375rem; background: #0e0e10; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .6); z-index: 60; display: grid; }
.lang-menu a { padding: .5rem .75rem; border-radius: .125rem; font-size: .8438rem; color: var(--muted); white-space: nowrap; }
.lang-menu a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.lang-menu a.on { color: var(--gold); }

/* ============ Buttons ============ */
.btn { --h: 2.5rem; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .625rem; height: var(--h); padding: 0 1.25rem; border-radius: var(--radius); border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); cursor: pointer; font-size: .8438rem; font-weight: 500; letter-spacing: .06em; transition: border-color .25s, background .25s, color .25s, box-shadow .25s, transform .25s var(--ease); white-space: nowrap; }
.btn:hover { border-color: rgba(232, 211, 160, .45); background: rgba(232, 211, 160, .05); }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #17130b; border: 0; background: linear-gradient(180deg, #fbf1d8 0%, var(--gold) 50%, #c9a669 100%); box-shadow: 0 0 0 1px rgba(255, 240, 200, .35) inset, 0 .625rem 2.5rem -.625rem var(--gold-glow); font-weight: 600; }
.btn-primary:hover { background: linear-gradient(180deg, #fff7e4 0%, #f0dcab 50%, #d3b175 100%); box-shadow: 0 0 0 1px rgba(255, 240, 200, .5) inset, 0 .875rem 3.125rem -.5rem rgba(232, 211, 160, .55); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: transparent; border-color: transparent; }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: rgba(255, 111, 111, .5); background: rgba(255, 111, 111, .06); }
.btn-sm { --h: 2rem; padding: 0 .875rem; font-size: .7812rem; }
.btn-lg { --h: 3.25rem; padding: 0 1.875rem; font-size: .9062rem; letter-spacing: .1em; }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(.25rem); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ============ Surfaces ============ */
.card { position: relative; min-width: 0; overflow-wrap: anywhere; background: linear-gradient(180deg, #0f0f11, #0b0b0d); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.625rem; }
.card.glow::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(180deg, rgba(232, 211, 160, .4), transparent 40%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.corner { position: relative; }
.corner::after { content: ''; position: absolute; inset: .5rem; pointer-events: none; background:
  linear-gradient(var(--gold), var(--gold)) top left / .625rem 1px no-repeat, linear-gradient(var(--gold), var(--gold)) top left / 1px .625rem no-repeat,
  linear-gradient(var(--gold), var(--gold)) top right / .625rem 1px no-repeat, linear-gradient(var(--gold), var(--gold)) top right / 1px .625rem no-repeat,
  linear-gradient(var(--gold), var(--gold)) bottom left / .625rem 1px no-repeat, linear-gradient(var(--gold), var(--gold)) bottom left / 1px .625rem no-repeat,
  linear-gradient(var(--gold), var(--gold)) bottom right / .625rem 1px no-repeat, linear-gradient(var(--gold), var(--gold)) bottom right / 1px .625rem no-repeat; opacity: .5; }
.tag { display: inline-flex; align-items: center; gap: .375rem; font-size: .7188rem; letter-spacing: .08em; padding: .1875rem .625rem; border-radius: .125rem; border: 1px solid var(--line-2); color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.tag.creator { color: var(--creator); border-color: rgba(255, 125, 90, .35); background: rgba(255, 125, 90, .06); }
.tag.researcher { color: var(--researcher); border-color: rgba(127, 214, 255, .35); background: rgba(127, 214, 255, .06); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }

.section { position: relative; padding: 8.75rem 0; }
.section-head { max-width: 45rem; margin-bottom: 3.5rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow::after { content: ''; width: 1.75rem; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.section-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.875rem, 4.2vw, 3.125rem); line-height: 1.18; margin: 1.125rem 0 1rem; letter-spacing: .02em; }
.section-head p { color: var(--muted); font-size: 1rem; margin: 0; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); border: 0; margin: 0; }
@media (max-width: 640px) { .section { padding: 6rem 0; } }

.banner { padding: .75rem 1rem; border-radius: var(--radius); font-size: .8438rem; border: 1px solid; }
.banner a { text-decoration: underline; text-underline-offset: .1875rem; }
.banner.warn { color: var(--warn); border-color: rgba(240, 183, 94, .3); background: rgba(240, 183, 94, .06); }
.banner.err { color: var(--err); border-color: rgba(255, 111, 111, .3); background: rgba(255, 111, 111, .06); }
.banner.ok { color: var(--ok); border-color: rgba(99, 214, 163, .3); background: rgba(99, 214, 163, .06); }

/* ============ Forms ============ */
.field { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.field label { font-size: .75rem; letter-spacing: .08em; color: var(--muted); }
.input { height: 2.75rem; padding: 0 .875rem; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2); border-radius: var(--radius); outline: none; width: 100%; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: rgba(232, 211, 160, .6); box-shadow: 0 0 0 .1875rem rgba(232, 211, 160, .08); }
.input::placeholder { color: var(--dim); }
textarea.input { height: auto; padding: .75rem .875rem; resize: vertical; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.125rem) 1.1875rem, calc(100% - .8125rem) 1.1875rem; background-size: .3125rem .3125rem; background-repeat: no-repeat; padding-right: 2.125rem; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); padding: .1875rem; background: rgba(0, 0, 0, .3); }
.seg button { border: 0; background: transparent; padding: .375rem 1rem; border-radius: .125rem; cursor: pointer; color: var(--muted); font-size: .7812rem; letter-spacing: .06em; transition: .2s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: rgba(232, 211, 160, .12); color: var(--gold); box-shadow: 0 0 0 1px rgba(232, 211, 160, .25) inset; }

/* ============ Code ============ */
pre.code { background: rgba(0, 0, 0, .55); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem 1.375rem; overflow-x: auto; font-size: .8125rem; line-height: 1.75; margin: 0; color: #d8d4ca; }
code.inline { overflow-wrap: anywhere; background: rgba(232, 211, 160, .07); border: 1px solid rgba(232, 211, 160, .14); color: #efe2c2; padding: 1px .4375rem; border-radius: .1875rem; font-size: .86em; }
.tok-k { color: #e0b97a; } .tok-s { color: #a8d5a2; } .tok-c { color: #5f5b54; font-style: italic; } .tok-n { color: #f39b7a; }
.code-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.code-tabs button { border: 0; background: transparent; padding: .625rem 1rem; font-size: .75rem; letter-spacing: .1em; color: var(--dim); cursor: pointer; position: relative; font-family: var(--mono); }
.code-tabs button:hover { color: var(--text); }
.code-tabs button.on { color: var(--gold); }
.code-tabs button.on::after { content: ''; position: absolute; left: .75rem; right: .75rem; bottom: -1px; height: 1px; background: var(--gold); box-shadow: 0 0 .625rem var(--gold); }
.code-tabs + pre.code, .code-tabs + .copy-wrap pre.code { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
.copy-wrap { position: relative; }
.copy-btn { position: absolute; top: .75rem; right: .75rem; }

/* ============ Tables ============ */
table.t { width: 100%; border-collapse: collapse; font-size: .8438rem; }
table.t th { text-align: left; color: var(--dim); font-weight: 500; font-size: .6875rem; text-transform: uppercase; letter-spacing: .14em; padding: .75rem .875rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: .8125rem .875rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr, table.t tr { transition: background .2s; }
table.t tr:hover td { background: rgba(255, 255, 255, .015); }
.table-wrap { overflow-x: auto; }

/* ============ Footer ============ */
.footer { position: relative; border-top: 1px solid var(--line); padding: 3.5rem 0 4rem; color: var(--dim); font-size: .8125rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.footer .links { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }

/* ============ Toast / modal ============ */
#toast { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%) translateY(1rem); opacity: 0; background: rgba(15, 14, 12, .92); backdrop-filter: blur(.75rem); border: 1px solid rgba(232, 211, 160, .3); color: var(--text); padding: .6875rem 1.25rem; border-radius: var(--radius); font-size: .8438rem; letter-spacing: .04em; transition: .3s var(--ease); pointer-events: none; z-index: 200; box-shadow: 0 .625rem 2.5rem rgba(0, 0, 0, .5); }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ============ Motion ============ */
[data-reveal] { opacity: 0; transform: translateY(1.75rem); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}

/* ============ Page header (inner pages) ============ */
.page-head { position: relative; padding: 9.375rem 0 4rem; text-align: center; overflow: hidden; }
.page-head::before { content: ''; position: absolute; left: 50%; top: -16.25rem; width: 56.25rem; height: 37.5rem; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(232, 211, 160, .13), transparent 70%); pointer-events: none; }
.page-head h1 { position: relative; font-family: var(--display); font-weight: 700; font-size: clamp(2.25rem, 5.5vw, 4rem); letter-spacing: .04em; line-height: 1.12; text-wrap: balance; margin: 1.25rem 0 .875rem; }
.page-head p { position: relative; color: var(--muted); font-size: 1rem; margin: 0 auto; max-width: 35rem; }
.page-head .eyebrow::after { content: ''; width: 1.75rem; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

/* 验证码输入框：数字用宽字距，占位提示保持正常字距，西文也放得下 */
.code-row .input::placeholder, #v-code::placeholder { letter-spacing: .02em; font-family: var(--sans); }
