/* Sophy web · 发布页（/、/releases）与浏览器小页面
   版式：Figma「Sophy demos › 方向 D 柔光书桌」（41:4）——大留白、衬线大标题、白色药丸、漂浮小物件、唯一的深色公式卡。
   风格：客户端 v1「玻璃书桌」（frontend/src/styles.css，docs/DESIGN_LANGUAGE.md）——同一套墨色与暖灰、
   右上角一团很淡的高亮色光晕、独立漂浮的大块是玻璃、Source Serif 4 细斜体写课程公式、手绘 “!” 标志、弹簧动效。
   同一时间只有一种颜色：--accent（橘红）。 */

:root {
  /* —— 客户端的变量（同名同值） —— */
  --bg: #ffffff;
  --text: #1d1d1f;
  --text-2: #58544f;
  --text-3: #86827c;
  --ink: #1d1d1f;
  --on-ink: #ffffff;
  --hair: rgba(29, 29, 31, .06);
  --hair-2: rgba(29, 29, 31, .12);
  --plain: rgba(255, 255, 255, .62);
  --plain-strong: rgba(255, 255, 255, .86);
  --sunk: rgba(29, 29, 31, .05);
  --glass: rgba(255, 255, 255, .5);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-edge: rgba(255, 255, 255, .9);
  --glass-shadow: 0 0 0 .5px rgba(64, 51, 38, .08), 0 14px 36px rgba(64, 51, 38, .07), inset 0 1px 0 rgba(255, 255, 255, .95);
  --glass-blur: blur(22px) saturate(165%);
  --lift: 0 6px 16px rgba(64, 51, 38, .07), inset 0 1px 0 rgba(255, 255, 255, .9);
  --glow-a: .16;
  --accent: #ff5a1f;
  --on-accent: #ffffff;
  --accent-ink: #d9440f;
  --accent-soft: rgba(255, 90, 31, .1);
  --accent-mark: rgba(255, 90, 31, .22);
  --accent-line: color-mix(in srgb, var(--accent) 65%, transparent);
  --accent-glow: 0 4px 14px -4px var(--accent-mark), 0 0 12px -2px var(--accent-soft);
  --font-title: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-latin: "Instrument Serif", "Noto Serif SC", Georgia, serif;
  --font-formula: "Source Serif 4", "Instrument Serif", Georgia, serif;
  --font-ui: "Instrument Sans", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, ui-monospace, Menlo, monospace;

  /* —— 方向 D 的版式变量（取值改成客户端的墨色、暖灰与暖色阴影） —— */
  --muted: var(--text-3);
  --faint: #b3aea7;
  --wordmark: var(--text);
  --object: #1d1d1f;         /* 唯一的深色小物件（公式卡）；深色主题里反过来变浅 */
  --on-object: #ffffff;
  --object-sub: #9a958e;
  --surface: #ffffff;        /* 书桌托盘里的实心小物件 */
  --surface-2: #fbfaf8;
  --chip: #f4f2ef;
  --paper: #f2f0ec;
  --tint-1: #f3efe9; --tint-2: #eef0f2; --tint-3: #f4eee7; --tint-4: #f0efed;
  --wheel-a: #f8f7f5; --wheel-b: #e2e0dc;
  --folder-a: #ece8e2; --folder-b: #d8d4cd;
  --ghost: #eeece9; --ghost-2: #e4e1dd; --ghost-3: #f2f0ed;
  --rule: var(--hair-2);
  --sh-pill: var(--lift), 0 1px 2px rgba(64, 51, 38, .05);
  --sh-pill-hover: 0 12px 28px rgba(64, 51, 38, .11), inset 0 1px 0 rgba(255, 255, 255, .9);
  --sh-chip: 0 2px 6px rgba(64, 51, 38, .05);
  --sh-widget: 0 8px 18px rgba(64, 51, 38, .09);
  --sh-ink: 0 8px 18px rgba(29, 29, 31, .2);
  --sh-tray: 0 0 0 .5px rgba(64, 51, 38, .08), 0 4px 10px rgba(64, 51, 38, .04), 0 40px 80px rgba(64, 51, 38, .1);
  --hl: inset 0 1px 0 rgba(255, 255, 255, .95);
  --serif: var(--font-title);
  --serif-latin: var(--font-latin);
  --sans: var(--font-ui);
  --zh: var(--font-ui);
  --mono: var(--font-mono);
  --hand: "Kalam", "Comic Sans MS", cursive;   /* 手写只留在纸上 */

  /* 弹簧曲线：与客户端 motion.tsx 同一个阶跃响应采样 */
  --spring: linear(0, 0.057, 0.2, 0.385, 0.581, 0.763, 0.916, 1.031, 1.108, 1.15, 1.163, 1.154, 1.132, 1.102, 1.07, 1.04, 1.015, 0.996, 0.983, 0.976, 0.973, 0.975, 0.978, 0.983, 0.988, 0.993, 0.997, 1.001, 1.003, 1.004, 1.004, 1.004, 1.004, 1.003, 1.002, 1.001, 1);
  --spring-soft: linear(0, 0.056, 0.184, 0.339, 0.494, 0.633, 0.749, 0.839, 0.907, 0.954, 0.986, 1.005, 1.015, 1.019, 1.02, 1.018, 1.015, 1.012, 1.009, 1.006, 1.004, 1.003, 1.001, 1.001, 1, 1, 1, 1, 1, 1, 1);
  --spring-snappy: linear(0, 0.076, 0.262, 0.5, 0.739, 0.945, 1.099, 1.193, 1.231, 1.225, 1.189, 1.136, 1.079, 1.028, 0.987, 0.961, 0.948, 0.946, 0.952, 0.964, 0.977, 0.99, 1, 1.007, 1.012, 1.013, 1.012, 1.009, 1.006, 1.003, 1.001, 0.999, 0.998, 0.997, 0.997, 0.998, 1);
  --ease-out: var(--spring-soft);
  color-scheme: light;
}

/* 深色：客户端的近黑底 + 暗玻璃 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161617; --text: #f2f0ed; --text-2: #c4c0ba; --text-3: #8a867f;
    --ink: #f2f0ed; --on-ink: #1d1d1f;
    --hair: rgba(255, 255, 255, .07); --hair-2: rgba(255, 255, 255, .14);
    --plain: rgba(255, 255, 255, .05); --plain-strong: rgba(255, 255, 255, .1); --sunk: rgba(255, 255, 255, .06);
    --glass: rgba(34, 33, 32, .55); --glass-strong: rgba(34, 33, 32, .9); --glass-edge: rgba(255, 255, 255, .08);
    --glass-shadow: 0 0 0 .5px rgba(255, 255, 255, .06), 0 14px 36px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    --lift: 0 6px 16px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .05);
    --glow-a: .12;
    --accent-ink: #ff8a5c; --accent-soft: rgba(255, 90, 31, .14);
    --faint: #5f5b56; --object: #ecebe7; --on-object: #1d1d1f; --object-sub: #6b6763;
    --surface: #1e1d1c; --surface-2: #1a1918; --chip: #2a2826; --paper: #252321;
    --tint-1: #2a2725; --tint-2: #25272a; --tint-3: #2c2724; --tint-4: #272625;
    --wheel-a: #2b2a28; --wheel-b: #1b1a19; --folder-a: #312f2c; --folder-b: #242220;
    --ghost: #232220; --ghost-2: #2a2826; --ghost-3: #201f1e;
    --sh-pill: var(--lift); --sh-pill-hover: 0 12px 28px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
    --sh-chip: 0 2px 6px rgba(0, 0, 0, .4); --sh-widget: 0 8px 18px rgba(0, 0, 0, .45);
    --sh-ink: 0 8px 18px rgba(0, 0, 0, .5); --sh-tray: 0 0 0 .5px rgba(255, 255, 255, .06), 0 40px 80px rgba(0, 0, 0, .5);
    --hl: inset 0 1px 0 rgba(255, 255, 255, .06);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; font-variant-emoji: text; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased; overflow-x: clip; position: relative; isolation: isolate;
}
/* 背景光晕：与客户端一致——直径 760 的正圆，高亮色 16%，贴右上角，模糊 */
body::before { content: ""; position: absolute; right: -220px; top: -260px; width: 760px; height: 760px; border-radius: 50%;
  background: var(--accent); opacity: var(--glow-a); filter: blur(90px); pointer-events: none; z-index: -1; }
a { color: inherit; }
img { display: block; }
::selection { background: var(--accent-mark); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4 { font-weight: 400; letter-spacing: -.01em; }

/* ---------- 光标光晕（glow.js） ---------- */
:root { --mx: 50vw; --my: 50vh; }
.cursor-glow { position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  pointer-events: none; z-index: -1; opacity: 0; transition: opacity .6s ease; will-change: transform;
  transform: translate3d(var(--mx), var(--my), 0);
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--accent) 16%, transparent) 0%, color-mix(in srgb, var(--accent) 12%, transparent) 30%,
    color-mix(in srgb, var(--accent) 5.1%, transparent) 60%, color-mix(in srgb, var(--accent) 1.1%, transparent) 88%, transparent 100%); }
.spot-on .cursor-glow { opacity: 1; }

/* ---------- 玻璃：只给独立漂浮的大块（顶栏胶囊、卡片） ---------- */
.glass, .card {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); position: relative;
}
.glass::before, .card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(300px circle at var(--sx, -999px) var(--sy, -999px), color-mix(in srgb, var(--accent) 5%, transparent), transparent 65%);
  opacity: 0; transition: opacity .5s ease; }
.spot-on .glass::before, .spot-on .card::before { opacity: 1; }

/* ---------- 药丸按钮（方向 D 的大药丸，客户端的浅底 + 轻抬阴影；主操作墨黑） ---------- */
.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--hair-2);
  background: var(--plain-strong); color: var(--text); box-shadow: var(--lift);
  font: 500 14px/1 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: translate .6s var(--spring), box-shadow .3s, background .15s;
}
.pill:hover { translate: 0 -2px; background: var(--surface); box-shadow: var(--sh-pill-hover); color: var(--text); }
.pill:active { translate: 0 1px; }
.pill.lg { height: 54px; padding: 0 30px; font-size: 16px; }
.pill.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.pill.ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); box-shadow: 0 6px 14px rgba(29, 29, 31, .16); }
.pill.ink:hover { opacity: .88; }
.pill.flat { box-shadow: none; border-color: transparent; background: transparent; }
.pill.flat:hover { background: var(--sunk); box-shadow: none; translate: none; }
.pill[disabled], .pill.disabled { opacity: .4; pointer-events: none; }
.pill .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.live { animation: m-breathe 1.8s ease-in-out infinite; }
@keyframes m-breathe { 0%, 100% { scale: 1; } 50% { scale: 1.45; } }

/* ---------- 课程药丸 + 公式徽章（客户端 FxBadge：代表符号，Source Serif 4 细斜体） ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 16px 5px 6px; border-radius: 999px;
  background: var(--plain-strong); border: 1px solid var(--hair); box-shadow: var(--lift);
  color: var(--text-2); font: 13px/1 var(--font-ui); text-decoration: none; white-space: nowrap;
  transition: translate .6s var(--spring), scale .5s var(--spring);
}
a.chip:hover, button.chip:hover { scale: 1.04; }
.badge, .fx-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--plain-strong); border: 1px solid var(--hair); color: var(--text);
  font: italic 300 16px/1 var(--font-formula); transition: rotate .6s var(--spring), scale .6s var(--spring);
}
.badge.cjk, .fx-badge.cjk { font: 400 12px/1 var(--font-title); }
.badge.round { width: 46px; height: 46px; font-size: 24px; }
.badge.round.cjk { font-size: 17px; }
.chip:hover .badge { rotate: -14deg; scale: 1.1; }
.fx { font-family: var(--font-formula); font-style: italic; font-weight: 300; letter-spacing: -.01em; white-space: nowrap; }
.fx .cjk { font-family: var(--font-title); font-style: normal; letter-spacing: .04em; font-size: .9em; }

/* ---------- 文字 ---------- */
.display { font: 300 clamp(44px, 7vw, 76px)/1.18 var(--font-title); letter-spacing: -.04em; margin: 0; color: var(--text); text-wrap: balance; }
.h2 { font: 300 clamp(30px, 4vw, 40px)/1.3 var(--font-title); letter-spacing: -.03em; margin: 0; color: var(--text); }
.h3 { font: 400 22px/1.35 var(--font-title); margin: 0; color: var(--text); }
.latin { font: 400 20px/1.3 var(--font-latin); color: var(--text-3); }
.caps { font: 500 11px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-3); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hand { font-family: var(--hand); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }

/* ---------- 顶栏：常规软件官网的排法（左标志 + 导航，右登录 / 下载），滚动后变成玻璃 ---------- */
.site-head { position: sticky; top: 0; z-index: 30; transition: background .3s, box-shadow .3s; }
.site-head.scrolled { background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: 0 1px 0 var(--hair); }
.site-head-in { display: flex; align-items: center; gap: 18px; max-width: 1180px; margin: 0 auto; height: 64px; padding: 0 24px;
  animation: m-drop .7s var(--spring-soft) .05s both; }
.site-head .grow { flex: 1; }
.site-head .pill.sm { height: 36px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.wordmark .logo-mark { color: var(--text); transition: rotate .6s var(--spring), scale .6s var(--spring); }
.wordmark:hover .logo-mark { rotate: -16deg; scale: 1.08; }
.wordmark span { font: 600 21px/1 var(--font-ui); letter-spacing: -.03em; color: var(--wordmark); }
.head-nav { margin: 0 0 0 10px; background: transparent; }
.me { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; text-decoration: none;
  color: var(--text-2); font-size: 13px; border: 1px solid var(--hair); background: var(--plain); transition: background .15s; }
.me:hover, .me.on { background: var(--plain-strong); color: var(--text); box-shadow: var(--lift); }
.me .fx-badge { width: 28px; height: 28px; font-size: 14px; }
.me-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 分段控件 + 滑动指示块（客户端 .tabs 与 motionKit 的 .m-pill） ---------- */
.tabs { position: relative; display: flex; width: max-content; max-width: 100%; gap: 2px; padding: 4px; border-radius: 999px; background: var(--sunk); }
.tabs > a, .tabs > button { position: relative; z-index: 1; background: none; border: none; padding: 6px 16px; border-radius: 999px; cursor: pointer;
  color: var(--text-2); text-decoration: none; font: 14px var(--font-ui); transition: color .15s; }
.tabs > a:hover, .tabs > button:hover { color: var(--text); }
.tabs > .active { color: var(--text); font-weight: 500; background: var(--plain-strong); box-shadow: var(--lift); }
.m-pill { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; border-radius: 999px; background: var(--plain-strong); box-shadow: var(--lift); }
.tabs.m-has-pill > .active { background: transparent; box-shadow: none; }

/* ---------- 形变按钮（客户端 MotionButton） ---------- */
.mbtn { will-change: transform; transform-origin: 50% 50%; }
.mbtn-mask { display: inline-block; height: 1.3em; overflow: hidden; vertical-align: top; }
.mbtn-label { display: flex; flex-direction: column; will-change: transform; }
.mbtn-label > span { height: 1.3em; line-height: 1.3em; white-space: nowrap; }
.pill.block { display: flex; width: 100%; }
button.pill { font-family: var(--font-ui); }
button.pill:disabled { opacity: .45; cursor: not-allowed; translate: none; box-shadow: none; }

/* ---------- 页脚 ---------- */
.footer {
  display: flex; flex-wrap: wrap; gap: 12px 36px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 28px 40px 32px;
  color: var(--text-3); font-size: 12px; border-top: 1px solid var(--hair);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent-ink); }
.footer .spacer { flex: 1; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--hair-2);
  margin-right: 6px; vertical-align: 1px; }
.status-dot.ok { background: var(--accent); animation: m-breathe 1.8s ease-in-out infinite; }

/* ---------- 卡片：玻璃 ---------- */
.card { border-radius: 28px; }
.card.pad { padding: 28px; }

/* ---------- 表单：客户端的浅底圆角 ---------- */
label.field { display: block; font: 500 12.5px var(--font-ui); color: var(--text-2); margin: 16px 0 6px; }
.input, input:not([type]), input[type=text], input[type=password], input[type=email], input[type=search], input[type=url], select, textarea {
  width: 100%; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--hair-2);
  background: var(--plain-strong); color: var(--text); font: 14px/1.4 var(--font-ui); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 120px; padding: 10px 14px; resize: vertical; line-height: 1.6; }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.code { height: 54px; text-align: center; font: 500 22px/1 var(--font-mono); letter-spacing: .14em; }

/* ---------- 提示：状态用笔法，不用颜色 ---------- */
.notice { border: 1px solid var(--hair); border-radius: 16px; padding: 11px 16px; font-size: 13.5px; color: var(--text); background: var(--plain);
  margin: 14px 0; animation: m-drop .55s var(--spring) both; }
.notice.error { border: 1.5px solid var(--ink); }
.notice.accent { border-color: var(--accent-line); box-shadow: var(--accent-glow); }

/* ---------- 动效（客户端 styles.css 的入场动画） ---------- */
@keyframes m-rise { from { translate: 0 18px; scale: .975; opacity: 0; } }
@keyframes m-rise-sm { from { translate: 0 10px; opacity: 0; } }
@keyframes m-drop { from { translate: 0 -10px; scale: .98; opacity: 0; } }
@keyframes m-fade { from { opacity: 0; } }
.rise { animation: m-rise .8s var(--spring-soft) both; }
.rise.d1 { animation-delay: .05s; } .rise.d2 { animation-delay: .1s; } .rise.d3 { animation-delay: .15s; }
.rise.d4 { animation-delay: .2s; } .rise.d5 { animation-delay: .24s; }
/* 滚动到时才升起（motion.js 加 .in）；没有脚本时直接显示 */
.js .reveal:not(.in) { opacity: 0; }
.reveal.in { animation: m-rise .9s var(--spring-soft) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal:not(.in) { opacity: 1; }
  .m-pill { display: none; }
  .tabs.m-has-pill > .active { background: var(--plain-strong); box-shadow: var(--lift); }
}

@media (max-width: 760px) {
  .site-head-in { gap: 8px; height: 56px; padding: 0 12px; }
  .hide-sm, .me-name { display: none !important; }
  .me { padding: 3px; }
  .head-nav { margin-left: 0; }
  .head-nav > a { padding: 6px 10px; font-size: 13px; }
  .wordmark span { font-size: 19px; }
  .footer { padding: 24px 16px; }
}
