/* ══════════════════════════════════════════════════════════════
   polish.css —— 全站统一的视觉规范与动效（最后加载，覆盖前面各层）

   一套字体：界面文字一律用系统无衬线（SF / 苹方），数字用等宽数字（tabular-nums），
            等宽字体只留给代码。
   一套盒子：浅灰面板（--panel）承载内容，不描边、不加分隔线；圆角只有 12 / 16 / 22 / 30 四档。
   一套控件：按钮、输入框、下拉框同一高度体系（30 / 36 / 40），主按钮用所在模块的渐变色。
   一套动效：弹性曲线 --spring 用于按下与切换，--ease-out 用于出现；尊重「减少动态效果」。
   ══════════════════════════════════════════════════════════════ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --mono: var(--font);                       /* 旧样式里大量用了 --mono，这里统一改回界面字体 */

  --surface: #ffffff;
  --panel: #f5f5f7;
  --panel-hover: #efeff3;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.13);
  --text-tertiary: #a1a1a6;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* 缓动曲线（全站统一用这几条贝塞尔曲线，CSS 里不再出现浏览器默认的 ease）：
     --ease      日常过渡（颜色、透明度、阴影）：苹果官网那条，起步稍快、收尾很长
     --ease-out  出现、展开、滑入：快速冲出、缓慢停稳（expo out）
     --ease-io   来回往复、循环呼吸：两头慢中间快
     --ease-in   消失、收起：慢慢加速离开
     --spring    弹一下（按钮、图标）：略微冲过头再回来
     --spring-soft 大块元素移动（标签滑块、卡片）：只冲一点点 */
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.85, 0.35);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.34, 1.25, 0.64, 1);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 10px 30px -14px rgba(0, 0, 0, 0.2);
  --shadow-3: 0 24px 60px -24px rgba(0, 0, 0, 0.3);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.003em;
  font-synthesis: none;                 /* 缺字重时不要合成假粗体，交给苹方/SF 自己的字重 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, .hero h1, .cover-title, .h-title, .card-head h2, .tile-title {
  font-family: var(--font-display);
}
code, kbd, .code { font-family: var(--code); font-size: 0.92em; }

/* 数字一律等宽数字，列表里上下对得齐 */
.metric .v, .metric .s, .badge, .tbl, .chip, .kpis, .h-num, .count, .news-meta, .vt-q-st, .ext-meta,
.lc-t, .rt-v, .order, .hit .s, .preset .sb, .card-head .sub, .legend, .mono, .dy-counts b, .tw-mini b,
.vt-usage-top b, #nw-sel, .stat-value {
  font-variant-numeric: tabular-nums;
}
.mono { font-family: var(--font); }

/* ---------- 顶栏 ---------- */

.topnav {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.topnav.scrolled { border-bottom-color: var(--line); background: rgba(255, 255, 255, 0.82); }
.wordmark { font-family: var(--font-display); font-weight: 700; cursor: pointer; transition: opacity 0.2s var(--ease); }
.wordmark:hover { opacity: 0.6; }
.tabs { background: rgba(0, 0, 0, 0.045); border-radius: 12px; padding: 3px; }
.tab { font-size: 13px; padding: 6px 14px; border-radius: 9px; font-weight: 500; transition: color 0.25s var(--ease); }
.has-thumb > .thumb { border-radius: 9px; transition: transform 0.5s var(--spring-soft), width 0.5s var(--spring-soft), height 0.5s var(--spring-soft), opacity 0.2s var(--ease); }
.seg { background: rgba(0, 0, 0, 0.045); padding: 3px; }
.seg-btn { font-size: 13px; padding: 6px 15px; font-weight: 500; }
.seg.has-thumb > .thumb { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
#status-badge { border-radius: 999px; padding: 3px 10px; font-weight: 500; }

/* 滚动进度条：长页面顶部一条细细的主题渐变 */
.scroll-progress {
  position: fixed; left: 0; top: 0; z-index: 70;
  height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(var(--sp, 0));
  background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3));
  opacity: calc(var(--sp, 0) * 8);
  pointer-events: none;
}

/* ---------- 标题层级 ---------- */

.hero { padding: 76px 0 36px; }
.hero h1 { font-size: 60px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; margin: 0; }
.card-head h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.stats-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.group-title {
  font-family: var(--font); text-transform: none; letter-spacing: 0;
  font-size: 13px; font-weight: 600; color: var(--g2, var(--accent));
}

/* 流动的渐变标题 */
.grad {
  background-size: 220% 100%;
  animation: gradFlow 9s var(--ease-io) infinite alternate;
}
@keyframes gradFlow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* ---------- 统一的盒子 ---------- */

.card {
  background: var(--panel);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: none;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.card-head { border-bottom: 0; padding: 20px 24px 8px; gap: 12px; }
.card-head .sub { font-size: 13px; color: var(--text-secondary); }
.card-body { padding: 14px 24px 24px; }
.card-body.tight { padding: 4px 10px 10px; }
.page-wide > .card, .page > .card, section > .card { margin-bottom: 20px; }

.metric {
  background: var(--panel);
  border: 0;
  border-radius: var(--r-lg);
  padding: 22px 24px 20px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.metric .k {
  font-family: var(--font); text-transform: none; letter-spacing: 0;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.metric .v {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin-top: 10px;
}
.metric .s { font-family: var(--font); font-size: 13px; margin-top: 6px; }

/* 列表：面板里的一行行内容，悬停时浮起一块白底 */
.hit {
  border-bottom: 0;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  position: relative;
  transition: background 0.25s var(--ease), transform 0.35s var(--spring-soft);
}
.hit + .hit::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 0;
  height: 1px; background: var(--line);
  transition: opacity 0.2s var(--ease);
}
@media (hover: hover) {
  .card .hit:hover { background: var(--surface); }
  .card .hit:hover::before, .card .hit:hover + .hit::before { opacity: 0; }
}
.hit .s { font-family: var(--font); font-weight: 600; }
.hit .t { font-family: var(--font); font-size: 12px; }

.tbl { font-size: 14px; }
.tbl th {
  font-family: var(--font); text-transform: none; letter-spacing: 0;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  border-bottom: 1px solid var(--line);
}
.tbl td { font-family: var(--font); border-bottom: 1px solid var(--line); padding-top: 12px; padding-bottom: 12px; }

.order {
  background: var(--surface);
  border-left: 0;
  border-radius: var(--r-md);
  padding: 16px 18px 14px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.order::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--line-strong);
}
.order.buy::before { background: linear-gradient(180deg, #34c759, #1a8f3c); }
.order.sell::before { background: linear-gradient(180deg, #ff6b6b, #d70015); }
.order .sym { font-family: var(--font-display); font-size: 17px; }
.order .meta { font-family: var(--font); font-size: 13px; }

.chip {
  font-family: var(--font); font-weight: 500; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 9px 5px 13px; margin: 0 6px 8px 0;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.35s var(--spring), box-shadow 0.25s var(--ease);
}
.chip.custom { border-color: color-mix(in srgb, var(--g2, var(--accent)) 55%, transparent); }
.chip .x { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.chip .x:hover { background: rgba(215, 0, 21, 0.1); }
label.chip { padding: 6px 14px 6px 10px; }
label.chip:has(input:checked) {
  border-color: transparent;
  background: color-mix(in srgb, var(--g2, var(--accent)) 12%, var(--surface));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g2, var(--accent)) 60%, transparent);
}
label.chip:active { transform: scale(0.95); }

.badge {
  font-family: var(--font); font-weight: 600; font-size: 11.5px;
  border-radius: 999px; padding: 2px 8px; letter-spacing: 0;
  background: rgba(0, 0, 0, 0.055);
}

.preset {
  border: 0; border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 4px;
  transition: background 0.2s var(--ease), transform 0.35s var(--spring-soft);
}
.preset:hover { background: var(--panel-hover); }
.preset.on { background: var(--surface); box-shadow: var(--shadow-1); }
.preset .nm { font-size: 14.5px; }
.preset .sb { font-family: var(--font); font-size: 12px; }

/* 说明文字统一成小号灰字（原来有几处是 15px 黑字） */
.hint, .field .hint {
  font-size: 13px; line-height: 1.65; color: var(--text-secondary);
}
.field label {
  font-family: var(--font); text-transform: none; letter-spacing: 0;
  font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px;
}
.legend { font-family: var(--font); font-size: 13px; }
.empty-state { color: var(--text-secondary); font-size: 14px; }
.panel-note { font-size: 13px; }

/* ---------- 统一的控件 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border: 0; border-radius: 999px;
  background: rgba(0, 0, 0, 0.055); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.3s var(--ease), transform 0.4s var(--spring), filter 0.2s var(--ease);
}
.btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.09); border-color: transparent; }
.btn:active:not(:disabled) { transform: scale(0.94); transition-duration: 0.1s; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--g2, var(--accent)) 35%, transparent); }
.btn-sm { height: 30px; padding: 0 13px; font-size: 13px; min-height: 0; }
.btn-primary {
  color: #fff;
  background: linear-gradient(95deg, var(--g1), var(--g2) 55%, var(--g3));
  box-shadow: 0 8px 22px -12px color-mix(in srgb, var(--g2) 90%, transparent);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(95deg, var(--g1), var(--g2) 55%, var(--g3));
  filter: brightness(1.06) saturate(1.08);
  box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--g2) 95%, transparent);
}
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: rgba(215, 0, 21, 0.1); }
.btn:disabled { opacity: 0.4; }
.btn-link { transition: opacity 0.2s var(--ease); }
.btn-link:hover { text-decoration: none; opacity: 0.7; }

.inp, select.inp {
  height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px;
  transition: border-color 0.2s var(--ease), box-shadow 0.3s var(--ease-out), background 0.2s var(--ease);
}
textarea.inp { height: auto; padding: 12px 14px; line-height: 1.6; }
.inp::placeholder { color: var(--text-tertiary); }
.inp:hover { border-color: rgba(0, 0, 0, 0.22); }
.inp:focus {
  border-color: color-mix(in srgb, var(--g2, var(--accent)) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--g2, var(--accent)) 16%, transparent);
}
select.inp, select {
  appearance: none; -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
  cursor: pointer;
}
.search-xl .inp { height: 54px; border-radius: var(--r-md); padding: 0 20px 0 50px; font-size: 17px; }
.list-toolbar { align-items: center; }
.list-toolbar .inp, .list-toolbar select { height: 36px; font-size: 14px; }

input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 0; flex: 0 0 auto;
  border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface);
  display: inline-grid; place-content: center; cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.35s var(--spring);
}
input[type="checkbox"]::after {
  content: ""; width: 10px; height: 6px;
  border: solid #fff; border-width: 0 0 2px 2px;
  transform: rotate(-45deg) scale(0); margin-top: -2px;
  transition: transform 0.35s var(--spring);
}
input[type="checkbox"]:checked { background: var(--g2, var(--accent)); border-color: transparent; }
input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
input[type="checkbox"]:active { transform: scale(0.88); }
label.chip input[type="checkbox"] { width: 16px; height: 16px; border-radius: 5px; margin-right: 6px !important; }
label.chip input[type="checkbox"]::after { width: 8px; height: 5px; }

/* ---------- 浮动保存栏 ---------- */

.savebar {
  position: sticky; bottom: 18px; z-index: 30;
  margin: 18px auto 0; max-width: 760px;
  padding: 8px 8px 8px 22px;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-3), 0 0 0 1px var(--line);
}
.savebar .sec { font-size: 13px; }
#nw-sel, #pool-state { font-family: var(--font); font-weight: 600; font-size: 15px; }

/* ---------- 单词本（沿用插件结构，统一字号与盒子） ---------- */

.list-toolbar .seg { flex: 0 0 auto; }
.stats-section .grid { gap: 14px; }
.entry-row { padding: 20px 4px; border-bottom-color: var(--line); transition: background 0.25s var(--ease); }
.entry-word { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.entry-sentence { border-left-color: color-mix(in srgb, var(--g2, var(--accent)) 40%, var(--line)); }
.entry-sentence-tag { border-color: var(--line); border-radius: 999px; }

/* 首页半宽卡片只剩标题后，光晕铺开一些，避免成一团一团的色斑 */
.cover-sm .glow { inset: -140% -30%; opacity: 0.8; }

/* 单词本工具栏：搜索框 · 分段筛选 · 排序，一行排开 */
.list-toolbar { flex-wrap: nowrap; gap: 10px; }
.list-toolbar #w-search { flex: 1 1 180px; width: auto; max-width: none !important; }
.list-toolbar #w-sort { flex: 0 0 auto; width: auto; max-width: none !important; }
#stg-layout { align-items: start; }

/* ---------- 进度条 ---------- */

.bar { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.06); }
.bar > i { border-radius: 999px; background: linear-gradient(90deg, var(--g1), var(--g2)); transition: width 0.9s var(--ease-out); }

/* ---------- 光斑：鼠标经过卡片时跟着移动的柔光 ---------- */

@media (hover: hover) and (pointer: fine) {
  .card::after, .metric::after, .tile::after, .vt-head::after, .tf-fig::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
      color-mix(in srgb, var(--g2, var(--accent)) 9%, transparent), transparent 62%);
    opacity: 0; transition: opacity 0.45s var(--ease);
  }
  .card:hover::after, .metric:hover::after, .tile:hover::after, .vt-head:hover::after, .tf-fig:hover::after {
    opacity: 1;
  }
  .tile::after { background: radial-gradient(700px circle at var(--mx, 50%) var(--my, 50%),
      color-mix(in srgb, var(--g2, var(--accent)) 10%, transparent), transparent 60%); }
  .tf-fig, .vt-head { position: relative; isolation: isolate; overflow: hidden; }

  /* 小卡片跟着鼠标轻微倾斜 */
  .metric:not(.reveal), .metric.reveal.in, .td-cell, .td-cell:hover, .dy-cell {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
    transition: transform 0.6s var(--ease-out), box-shadow 0.5s var(--ease-out);
    will-change: transform;
  }
  .metric:hover { --lift: -2px; box-shadow: var(--shadow-2); }
  .td-cell:hover { --lift: -3px; }
}

/* 带磁吸效果的主按钮 */
.magnetic { transform: translate(var(--tx, 0px), var(--ty, 0px)); transition: transform 0.5s var(--spring), background-position 0.8s var(--ease), box-shadow 0.35s var(--ease); }
.magnetic:active { transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0.95); }

/* ---------- 出现动效 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  filter: blur(6px);
  transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out), filter 0.9s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; filter: none; }
/* 列表行数量多，只做位移和淡入，不做模糊，省性能 */
.hit.reveal, .entry-row.reveal, .stat-row.reveal, .vt-row.reveal, .order.reveal {
  filter: none; transform: translateY(14px);
  transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out);
}
.vt-row { animation: rowIn 0.55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } }

/* 登录后整个应用柔和地浮现 */
#app.app-enter { animation: appIn 0.9s var(--ease-out) both; }
@keyframes appIn { from { opacity: 0; transform: scale(0.985); filter: blur(8px); } }

/* 模块切换（支持 View Transitions 的浏览器） */
::view-transition-old(root) { animation: vtOut 0.28s var(--ease) both; }
::view-transition-new(root) { animation: vtIn 0.55s var(--ease-out) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px) scale(0.995); filter: blur(4px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(14px) scale(0.995); filter: blur(6px); } }
.topnav, .bottombar { view-transition-name: chrome-nav; }
.bottombar { view-transition-name: chrome-bar; }
::view-transition-old(chrome-nav), ::view-transition-new(chrome-nav),
::view-transition-old(chrome-bar), ::view-transition-new(chrome-bar) { animation: none; }

/* 弹层：弹性放大 */
.dy-sheet, .dy-view { transition: transform 0.55s var(--spring-soft); }
.lang-menu { transform-origin: top right; animation: menuIn 0.35s var(--spring-soft); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(0.94); } }

/* 保险箱密码点：输入时弹一下 */
.vt-dots i.on { animation: dotPop 0.35s var(--spring); }
@keyframes dotPop { 0% { transform: scale(0.6); } 100% { transform: scale(1.08); } }
.vt-pad button { transition: background 0.15s var(--ease), transform 0.4s var(--spring); }
.vt-pad button:active { transform: scale(0.9); transition-duration: 0.08s; }

.topnav-right .btn { transition: background 0.2s var(--ease), transform 0.35s var(--spring); }
.topnav-right .btn:hover:not(:disabled) { transform: translateY(-1px); }
.tile:hover .grad { animation-duration: 4.5s; }
.bottombar button.active svg { animation: tabPop 0.45s var(--spring); }
@keyframes tabPop { 0% { transform: scale(0.82); } 60% { transform: translateY(-2px) scale(1.12); } }

/* 首页数字带、卡片 CTA */
.tile-cta { transition: background-position 0.8s var(--ease), transform 0.5s var(--spring), box-shadow 0.35s var(--ease); }
.h-cell { transition: background 0.4s var(--ease); }
@media (hover: hover) { .h-cell:hover { background: var(--panel); } }

/* ---------- 手写体：只用于英文与法文标题 ----------
   Caveat（OFL，来自 Google Fonts 开源仓库），按标题用到的字符裁过，45 KB。
   中文标题保持系统字体（苹方 / SF），不用书法体。
   苹果开机那句 hello 是苹果自己画的字形，没有公开字体，这是最接近的替代。 */

@font-face {
  font-family: 'KuchaHand';
  src: url('/fonts/hand-latin.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0020-007F, U+00A0-00FF, U+0152-0153, U+2013-2014, U+2018-2019, U+201C-201D, U+2026;
}
@property --hp { syntax: '<percentage>'; inherits: false; initial-value: 100%; }

/* ---------- 首页首屏：欢迎语居中，两行，第二行渐变 ---------- */

.h-hero { padding-left: 24px; padding-right: 24px; }
.h-hero-inner {
  width: 100%; max-width: 1080px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.h-title {
  margin: 0 0 34px;
  font-family: var(--font-display);
  font-size: clamp(46px, 6.6vw, 96px);
  font-weight: 700; line-height: 1.08; letter-spacing: -0.035em;
  text-wrap: balance;
}
/* 标题从左往右一笔笔显出来 */
.h-title span, .hero h1 span {
  -webkit-mask-image: linear-gradient(100deg, #000 var(--hp), transparent calc(var(--hp) + 12%));
  mask-image: linear-gradient(100deg, #000 var(--hp), transparent calc(var(--hp) + 12%));
}
.h-title .write, .hero h1 .write { animation: handWrite 1.15s cubic-bezier(0.45, 0.08, 0.35, 1) both; }
.h-title .grad.write { animation-duration: 1.35s; animation-delay: 0.62s; }
.hero h1 .write { animation-duration: 0.95s; }
@keyframes handWrite { from { --hp: -8%; } to { --hp: 112%; } }
.h-title .h-l1 { display: block; color: var(--text); }
.h-title .grad {
  display: inline-block;
  padding: 0 0.06em 0.18em;           /* 渐变字是背景裁出来的，手写体下伸得多，留足空间 */
  margin-bottom: -0.18em;
}
/* 英文和法文：手写体，字面偏小所以字号大一档 */
html[lang="en"] .h-title, html[lang="fr"] .h-title,
html[lang="en"] .hero h1, html[lang="fr"] .hero h1 {
  font-family: 'KuchaHand', var(--font-display);
  font-weight: 400; letter-spacing: 0; line-height: 1.18;
}
html[lang="en"] .h-title, html[lang="fr"] .h-title { font-size: clamp(46px, 6.8vw, 104px); }
html[lang="en"] .hero h1, html[lang="fr"] .hero h1 { font-size: 72px; }
html[lang="en"] .hero h1 .grad, html[lang="fr"] .hero h1 .grad {
  display: inline-block; padding: 0 0.06em 0.16em; margin-bottom: -0.16em;
}
.h-langs { margin: 0; }
.h-cue { bottom: 28px; }
/* 光晕以标题为中心左右对称铺开，并随鼠标、滚动轻轻浮动 */
.h-hero .h-glow {
  inset: 12% -8% 8%; height: auto;
  transform: translate3d(calc(var(--gx, 0) * 22px), calc(var(--gy, 0) * 16px + var(--p, 0) * 40px), 0);
  transition: transform 1.2s var(--ease-out);
  background:
    radial-gradient(30% 36% at 32% 50%, color-mix(in srgb, var(--g1) 20%, transparent), transparent 70%),
    radial-gradient(30% 36% at 68% 50%, color-mix(in srgb, var(--g2) 18%, transparent), transparent 70%),
    radial-gradient(26% 30% at 50% 66%, color-mix(in srgb, var(--g3) 13%, transparent), transparent 70%);
}

/* ---------- 照片淡入 ---------- */

.td-cell, .dy-cell, .dy-th {
  background-image: linear-gradient(90deg, var(--panel), rgba(0, 0, 0, 0.05), var(--panel));
  background-size: 200% 100%;
}
.td-cell { animation: shimmer 1.4s linear infinite; }
.dy-cell { animation: dyIn 0.55s var(--ease-out) both, shimmer 1.4s linear infinite; animation-delay: calc(var(--i, 0) * 22ms), 0s; }
.dy-th { animation: dyIn 0.35s var(--ease-out) both, shimmer 1.4s linear infinite; }
.td-cell:has(img.loaded), .td-cell:has(.dy-textcell) { animation: none; background-image: none; }
.dy-cell:has(img.loaded), .dy-cell:has(.dy-textcell) {
  animation: dyIn 0.55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 22ms); background-image: none;
}
.dy-th:has(img.loaded), .dy-th.bad { animation: dyIn 0.35s var(--ease-out) both; background-image: none; }
.td-cell img, .dy-cell img, .dy-track img, .dy-th img { opacity: 0; transition: opacity 0.6s var(--ease); }
.td-cell img.loaded, .dy-cell img.loaded, .dy-track img.loaded, .dy-th img.loaded { opacity: 1; }

/* ---------- 联系 ---------- */

.ct-list { display: grid; gap: 20px; max-width: 620px; margin: 0 auto; }
.ct-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 44px 32px 36px; border-radius: var(--r-xl); background: var(--panel);
}
.ct-icon {
  width: 64px; height: 64px; border-radius: 20px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3));
  box-shadow: 0 14px 32px -14px color-mix(in srgb, var(--g2) 85%, transparent);
  animation: ctFloat 5s var(--ease-io) infinite;
}
.ct-icon svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes ctFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.ct-label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.ct-value {
  margin: 6px 0 24px; text-decoration: none;
  font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em;
  overflow-wrap: anywhere; line-height: 1.2;
}
.ct-value:hover { opacity: 0.85; }
.ct-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ct-actions .btn { height: 40px; padding: 0 20px; font-size: 15px; text-decoration: none; }
.ct-actions .btn.done { background: color-mix(in srgb, #34c759 18%, transparent); color: #1a8f3c; }
.ct-qr { margin: 30px 0 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ct-qr[hidden] { display: none; }
.ct-qr-box {
  width: 168px; height: 168px; padding: 14px; border-radius: 20px; background: var(--surface);
  box-shadow: var(--shadow-2);
}
.ct-qr-box svg { width: 100%; height: 100%; display: block; }
.ct-qr-box svg rect[fill="#000000"], .ct-qr-box svg path { fill: #1d1d1f; }
.ct-qr-skel { width: 100%; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--panel), var(--line), var(--panel)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.ct-qr figcaption { font-size: 13px; color: var(--text-secondary); }
.h-foot .tile-cta { margin-top: 6px; }

/* ---------- 主屏幕 App：底部提示卡 ---------- */

.app-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 250;
  display: flex; justify-content: center;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.app-sheet-card {
  pointer-events: auto; position: relative;
  width: min(440px, 100%);
  display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center;
  padding: 18px 18px 16px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow-3), 0 0 0 1px var(--line);
  transform: translateY(calc(100% + 48px)); opacity: 0;
  transition: transform 0.6s var(--spring-soft), opacity 0.3s var(--ease);
}
.app-sheet.open .app-sheet-card { transform: none; opacity: 1; }
.app-sheet-icon {
  width: 52px; height: 52px; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0071e3, #7a5af8 55%, #e0457b);
}
.app-sheet-icon img { width: 100%; height: 100%; display: block; }
.app-sheet-icon svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-sheet-text { min-width: 0; }
.app-sheet-text b { display: block; font-size: 16px; font-weight: 600; padding-right: 24px; overflow-wrap: anywhere; }
.app-sheet-text p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.app-sheet-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.app-sheet-actions .btn { height: 38px; padding: 0 18px; text-decoration: none; }
.app-sheet-x {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.05); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.app-sheet-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* ---------- Face ID 登录设备管理（保险箱 · 安全设置） ---------- */

.pk-manage { margin: 4px 0 18px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface); }
.pk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pk-head b { font-size: 15px; font-weight: 600; }
#pk-add[hidden] { display: none; }
.pk-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pk-row:first-child { border-top: 0; }
.pk-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pk-name b { font-size: 14px; font-weight: 600; }
.pk-name small { flex-basis: 100%; font-size: 12px; color: var(--text-secondary); }
.pk-del.arm { background: var(--danger); color: #fff; }
.pk-empty { font-size: 13px; color: var(--text-secondary); padding: 6px 0; }

/* ---------- 从主屏幕打开时 ---------- */

@media (display-mode: standalone) {
  html { -webkit-tap-highlight-color: transparent; }
  body { overscroll-behavior-y: none; }
  .topnav, .bottombar, .tabs, .seg, .btn, .tile-cta, .vt-pad { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

/* ---------- 顶栏放不下时：不折行，徽标只在量化板块出现，窄了按钮只留图标 ---------- */
.topnav .tab, .topnav-right .btn, #status-badge { white-space: nowrap; }
body:not([data-mod="quant"]) #status-badge { display: none; }
.nav-ic { display: inline-flex; align-items: center; gap: 5px; }
.nav-ic svg { display: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1279px) {
  .topnav-right { gap: 6px; }
  .nav-ic { width: 32px; padding: 0 !important; justify-content: center; }
  .nav-ic svg { display: block; }
  .nav-ic span { display: none; }
  #status-badge { display: none; }
}

.sv-proxy { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sv-proxy-ip span { display: block; font-size: 13px; color: var(--text-secondary); }
.sv-proxy-ip b { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; display: inline-block; }
.sv-proxy-ip b.flash { animation: ipFlash 1.4s var(--ease-out); }
@keyframes ipFlash { 0% { color: var(--g2); transform: scale(1.12); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--g2) 60%, transparent)); } 100% { transform: none; } }
.sv-proxy-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#sv-rotate.busy { opacity: 0.6; }
.sv-danger { color: #d70015; }
.sv-sublog { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.sv-sl { display: grid; grid-template-columns: 96px 130px minmax(0, 1fr) 130px 64px; gap: 10px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; font-variant-numeric: tabular-nums; animation: aiLine 0.4s var(--ease-out) both; }
.sv-sl:first-child { border-top: 0; }
.sv-sl > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-sl-t, .sv-sl-loc { color: var(--text-secondary); }
.sv-sl-ok { text-align: right; color: #1f9d55; }
.sv-sl.bad .sv-sl-ok { color: #d70015; }
.sv-sl.bad { background: color-mix(in srgb, #ff453a 6%, transparent); }
@media (max-width: 734px) {
  .sv-sl { grid-template-columns: 80px minmax(0, 1fr) 56px; row-gap: 2px; }
  .sv-sl-loc, .sv-sl-ua { grid-column: 2; font-size: 12px; }
  .sv-sl-ok { grid-column: 3; grid-row: 1; }
}

/* ---------- AI 助手（新闻 / 量化） ---------- */

.ai-box { background: var(--panel); border-radius: 22px; padding: 18px 20px 16px; margin: 0 auto 26px; max-width: 860px; }
.ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-head b { font-size: 15px; font-weight: 600; }
.ai-head small { font-size: 12px; color: var(--text-secondary); }
.ai-head .ai-clear { margin-left: auto; font-size: 13px; }
.ai-spark { width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3)); }
.ai-spark svg { width: 17px; height: 17px; fill: #fff; }
.ai-log { display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow-y: auto; overscroll-behavior: contain; }
.ai-log:not(:empty) { margin: 6px 0 14px; padding-right: 2px; }
.ai-msg { font-size: 14.5px; line-height: 1.65; max-width: 100%; animation: aiIn 0.35s var(--ease-out) both; }
@keyframes aiIn { from { opacity: 0; transform: translateY(6px); } }
.ai-user { align-self: flex-end; max-width: 80%; padding: 8px 14px; border-radius: 16px 16px 4px 16px; color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2) 60%, var(--g3)); overflow-wrap: anywhere; }
.ai-bot { align-self: stretch; }
.ai-bot.err { color: #d70015; font-size: 13px; }
.ai-ans p { margin: 0 0 6px; }
.ai-ans ul { margin: 4px 0 8px; padding-left: 20px; }
.ai-ans li { margin: 2px 0; }
.ai-dots { display: inline-flex; gap: 4px; padding: 8px 2px; }
.ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--g2); animation: aiDot 1s var(--ease-io) infinite; }
.ai-dots i:nth-child(2) { animation-delay: 0.15s; } .ai-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiDot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.ai-card { background: var(--surface); border-radius: 16px; padding: 12px 14px; margin-top: 8px; min-width: 0; }
.ai-card-h { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-secondary); margin-bottom: 6px; }
.ai-card > a { font-size: 14px; overflow-wrap: anywhere; }
.ai-news { list-style: none; margin: 0; padding: 0; }
.ai-news li { padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; }
.ai-news li:first-child { border-top: 0; padding-top: 2px; }
.ai-news a { display: block; font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.ai-news a:hover { color: var(--g3); }
.ai-why { margin: 3px 0 0; font-size: 13px; line-height: 1.55; color: var(--text); opacity: 0.82; }
.ai-news small { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; overflow-wrap: anywhere; }
.ai-empty { font-size: 13px; color: var(--text-secondary); }
.ai-quotes { display: flex; flex-direction: column; }
.ai-q { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.ai-q:first-child { border-top: 0; }
.ai-q > div:first-child { flex: 1; min-width: 0; }
.ai-q b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ai-q small { display: block; font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-q-r { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.ai-q-r span { font-size: 12.5px; }
.ai-spk { width: 96px; height: 28px; flex: none; fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.ai-spk.up { stroke: #1f9d55; } .ai-spk.down { stroke: #d70015; }
.ai-pf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.ai-pf div { display: flex; flex-direction: column; }
.ai-pf span { font-size: 12px; color: var(--text-secondary); }
.ai-pf b { font-size: 16px; font-variant-numeric: tabular-nums; }
.ai-pf-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ai-tag { font-size: 12.5px; padding: 3px 10px; border-radius: 12px; background: var(--panel); font-variant-numeric: tabular-nums; }
.ai-tag.up { color: #1f9d55; } .ai-tag.down { color: #d70015; }

.h-ai { padding: 8px 22px 0; }
.h-ai .ai-box { margin-bottom: 40px; }
.ai-nav { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 9px 14px 9px 16px; border: 0; border-radius: 12px;
  font: inherit; font-size: 14px; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2) 60%, var(--g3));
  transition: transform 0.25s var(--spring); }
.ai-nav:hover { transform: translateX(2px); }
.ai-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-act { border: 0; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g2) 45%, transparent); }
.ai-act-l { display: block; font-size: 15px; margin: 2px 0 6px; }
.ai-act .ai-news li { font-size: 13px; }
.ai-act .ai-news small { display: inline; margin-right: 6px; }
.ai-act-btns { display: flex; gap: 8px; margin-top: 10px; }
.ai-act-msg { font-size: 13px; color: var(--text-secondary); margin-top: 8px; min-height: 0; }
.ai-act-msg:empty { display: none; }
.ai-act.done { box-shadow: none; opacity: 0.85; }
.ai-act.done .ai-act-btns { display: none; }
.ai-act.err .ai-act-msg { color: #d70015; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ai-chip { font: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--text); transition: transform 0.2s var(--spring), background 0.2s var(--ease); }
.ai-chip:hover { transform: translateY(-1px); }
.ai-form { display: flex; gap: 8px; }
.ai-input { flex: 1; min-width: 0; height: 40px; background: var(--surface); }
.ai-send { min-height: 40px; padding: 0 18px; }
.ai-box.busy .ai-send, .ai-box.busy .ai-chip { opacity: 0.5; pointer-events: none; }

/* ---------- 云服务器 ---------- */

.sv-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.sv-state { display: flex; align-items: center; gap: 12px; }
.sv-state b { display: block; font-size: 17px; font-weight: 600; }
.sv-state small { display: block; font-size: 13px; color: var(--text-secondary); }
.sv-dot { width: 10px; height: 10px; border-radius: 50%; background: #c7c7cc; flex: none; }
.sv-state[data-state="on"] .sv-dot { background: #30d158; box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.5); animation: svPulse 2s var(--ease-out) infinite; }
.sv-state[data-state="off"] .sv-dot { background: #ff453a; }
@keyframes svPulse { to { box-shadow: 0 0 0 10px rgba(48, 209, 88, 0); } }
.sv-actions { display: flex; gap: 8px; }
.sv-actions .btn { min-height: 36px; }
#sv-live[aria-pressed="true"] { filter: saturate(1.2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g2) 25%, transparent); }
.sv-msg { min-height: 20px; font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }

.sv-usage { background: var(--panel); border-radius: 22px; padding: 26px 28px 22px; margin-bottom: 14px; }
.sv-label { font-size: 13px; color: var(--text-secondary); }
.sv-big { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 16px; }
.sv-big span {
  font-size: 56px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums;
  background-image: linear-gradient(92deg, var(--g1), var(--g2) 52%, var(--g3)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sv-big small { font-size: 20px; font-weight: 600; color: var(--text-secondary); }
.sv-bar { position: relative; height: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.06); overflow: hidden; }
.sv-bar i { display: block; height: 100%; width: 0; border-radius: 12px; background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3)); transition: width 0.8s var(--ease-out); }
.sv-bar i[data-level="near"] { background: linear-gradient(90deg, #ff9f0a, #ff6b00); }
.sv-bar i[data-level="over"] { background: linear-gradient(90deg, #ff453a, #d70015); }
.sv-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.9); }
.sv-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.sv-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.sv-tile { background: var(--panel); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sv-tile span { font-size: 13px; color: var(--text-secondary); }
.sv-tile b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-tile small { font-size: 12px; color: var(--text-tertiary, #a1a1a6); }

.sv-panel { background: var(--panel); border-radius: 22px; padding: 20px 24px 22px; margin-bottom: 14px; }
.sv-panel h3 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.sv-days { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.sv-day { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.sv-day i { width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--g2), var(--g3)); transition: height 0.6s var(--ease-out); }
.sv-day span { font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sv-empty { margin: auto; font-size: 13px; color: var(--text-secondary); }
.sv-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.sv-info div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.sv-info dt { font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.sv-info dd { margin: 0; font-size: 14px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.sv-ok { color: #1f9d55; }
.sv-bad { color: #d70015; }
.sv-note { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin: 6px 4px 0; }

/* ══════════════ 平板 ══════════════ */
@media (max-width: 1068px) {
  .topnav-inner { padding: 0 16px; }
  .topnav .tab { padding: 6px 10px; }
  .hero { padding: 60px 0 30px; }
  .hero h1 { font-size: 50px; }
  html[lang="en"] .hero h1, html[lang="fr"] .hero h1 { font-size: 60px; }
}
@media (max-width: 900px) and (min-width: 735px) {
  .topnav .tab { padding: 6px 7px; font-size: 12px; }
  .wordmark { font-size: 13px; }
}

/* ══════════════ 手机 ══════════════ */
@media (max-width: 734px) {
  body { font-size: 15px; }
  .ai-box { padding: 14px 14px 12px; border-radius: 16px; }
  .ai-user { max-width: 88%; }
  .ai-spk { width: 64px; }
  .ai-head small { display: none; }
  .sv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-info { grid-template-columns: 1fr; }
  .sv-usage { padding: 22px 20px 18px; }
  .sv-big span { font-size: 46px; }
  .sv-top { align-items: flex-start; }
  .sv-panel { padding: 18px 16px 18px; }
  .sv-days { gap: 2px; }
  .sv-day span.minor { visibility: hidden; }
  .hero { padding: 34px 0 20px; }
  .hero h1 { font-size: 38px; }
  .card { border-radius: var(--r-md); }
  .card-head { padding: 16px 16px 6px; }
  .card-body { padding: 10px 16px 18px; }
  .card-body.tight { padding: 2px 6px 6px; }
  .metric { border-radius: var(--r-md); padding: 16px 16px 14px; }
  .metric .v { font-size: 27px; }
  .metric .k, .metric .s { font-size: 12px; }
  .inp, select.inp { height: 44px; }
  .btn { height: 38px; }
  .btn-sm { height: 32px; }
  .h-hero { padding-left: 18px; padding-right: 18px; }
  .h-title { font-size: min(48px, 11.5vw); margin-bottom: 26px; }
  html[lang="en"] .h-title, html[lang="fr"] .h-title { font-size: min(52px, 12.5vw); }
  html[lang="en"] .hero h1, html[lang="fr"] .hero h1 { font-size: min(46px, 11vw); }
  .app-sheet { padding-bottom: calc(var(--bar-h) + 12px + env(safe-area-inset-bottom)); }
  .ct-card { padding: 34px 18px 28px; border-radius: 24px; }
  .ct-value { font-size: min(26px, 6.6vw); }
  .bottombar button { padding: 0 1px; }
  .bottombar button span { font-size: 9.5px; letter-spacing: -0.01em; }
  .bottombar button svg { width: 22px; height: 22px; }
  .savebar { border-radius: 20px; margin: 14px 0 0; padding: 8px 8px 8px 16px; bottom: calc(var(--bar-h) + 10px + env(safe-area-inset-bottom)); }
  /* 策略表单在手机上撑出屏幕的问题 */
  #stg-layout > *, .field-grid > *, .field, .stg-head-grid > * { min-width: 0; }
  .stg-head-grid { grid-template-columns: 1fr !important; }
  .list-toolbar { flex-wrap: wrap; }
  .list-toolbar #w-search { flex: 1 1 100%; }
  #stg-layout .inp { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .grad { animation: none; }
  .h-title .write, .hero h1 .write { animation: none; }
  .h-title span, .hero h1 span { -webkit-mask-image: none; mask-image: none; }
  .h-hero .h-glow { transform: none; }
  .bottombar button.active svg { animation: none; }
  .reveal, .reveal.in { filter: none !important; }
  #app.app-enter, .vt-row, .vt-dots i.on, .lang-menu, .ct-icon { animation: none; }
  .app-sheet-card { transition: opacity 0.2s var(--ease); transform: none; }
  .td-cell img, .dy-cell img, .dy-track img, .dy-th img { opacity: 1 !important; transition: none; }
  .metric, .td-cell, .dy-cell, .magnetic { transform: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  html { scroll-behavior: auto; }
}

/* ══════════════ 极简首页 + AI 输入条 + 动效（2026-10-08） ══════════════
   用户要求：AI 框只留必要文字；首页更简洁；更多动效。放在最后，覆盖前面的同名规则。 */

/* ---------- 首页：次要内容收起，只留标题、关键数字、入口 ---------- */
.h-band, #tq-note, #tq-pills, #t-flight .tf-fig:first-child, #t-flight .tf-fig figcaption, #t-flight .tf-cap, #t-flight .tile-note,
#t-flight .kpis > div:nth-child(3), #t-words .tf-cap, #tw-mini, #tw-latest, #t-words .ext-dl,
#td-stats, #t-flight .kpis span:last-child { display: none !important; }

/* 2026-10-09：只藏文字说明，图例、小柱状图、三条头条留着，否则图看不懂、卡片下半截是空的 */
.h-grid .tq-legend { display: flex; gap: 18px; margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); }
.h-grid .tq-legend .tq-range { margin-left: auto; font-family: var(--mono); }
.h-grid .tw-bars { height: 64px; margin: 0 0 22px; gap: 3px; }
.h-grid .tn-list { margin: 0 0 22px; }
.h-grid .tn-list li:nth-child(n+4) { display: none; }
.h-grid .tn-list li { padding: 11px 0; }
.h-grid .tn-list a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.45; }
.h-grid .tn-list li:first-child { border-top: 0; padding-top: 0; }
/* 航班卡：只留最不稳的 5 条航线的小条形图 */
.h-grid #t-flight .tf-grid { display: block; margin: 0 0 4px; }
.h-grid #t-flight .rt-row:nth-child(n+6) { display: none; }
.h-grid #t-flight .cover { order: -2; }
.h-grid #t-flight .kpis { order: -1; }
.h-grid #t-flight .rt-row { grid-template-columns: 84px 1fr 44px; }
.h-grid #tq-kpis { row-gap: 22px; }

.h-grid { max-width: 1120px; margin: 0 auto; padding: 0 22px 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.h-grid > #t-quant { grid-column: 1 / -1; }
.h-grid .tile { margin: 0; max-width: none; padding: 30px 30px 28px; border-radius: 30px; display: flex; flex-direction: column; isolation: isolate; }
.h-grid .cover { padding: 0; margin: 0 0 6px; text-align: left; max-width: none; }
.h-grid .cover .glow { inset: -80% -20% auto auto; width: 70%; height: 220%; opacity: 0.55; }
.h-grid .cover-title, .h-grid .cover-sm .cover-title { font-size: 34px; margin: 0; letter-spacing: -0.03em; }
.h-grid .big-stat { margin: 22px 0 0; justify-content: flex-start; }
.h-grid .big-stat .count { font-size: 56px; }
.h-grid .big-stat small { font-size: 15px; color: var(--text-secondary); }
.h-grid .kpis { margin-top: 18px; border: 0; }
.h-grid .kpis > div { padding-top: 0; }
.h-grid .kpis b { font-size: 34px; }
#t-flight .kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#t-flight .kpis .k-short { display: block; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.kpis .k-short { display: none; }
.h-grid .chart-host { margin-top: 10px; }
.h-grid .td-grid { margin-top: 18px; }
.h-grid .big-stat, .h-grid .kpis, .h-grid .chart-host, .h-grid .td-grid { margin-bottom: 22px; }
.h-grid .tile > .tile-cta, .h-grid .cta-row { margin: auto 0 0; align-self: flex-start; justify-content: flex-start; }
.h-grid .tile-cta { min-height: 36px; padding: 0 16px; font-size: 14px; }
.h-foot { padding-top: 70px; }

/* 卡片边缘跟着光标亮起来（pointerFX 会在 .tile 上写 --mx/--my） */
.h-grid .tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  padding: 1.5px; opacity: 0; transition: opacity 0.4s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--g2), var(--g3) 30%, transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@media (hover: hover) { .h-grid .tile:hover::after { opacity: 0.9; } }

/* 卡片随滚动进场：放大、去模糊（支持滚动时间线的浏览器；不支持的沿用原来的 .reveal） */
@supports (animation-timeline: view()) {
  .h-grid .tile { animation: tileRise linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  .h-grid .tile.reveal { transform: none; opacity: 1; filter: none; }
}
@keyframes tileRise { from { opacity: 0; transform: translateY(56px) scale(0.94); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }

/* 首屏光晕缓慢流动变色。transform 已经被指针视差占用，这里只动 hue-rotate 和独立的 scale 属性 */
.h-hero .h-glow { animation: glowDrift 16s var(--ease-io) infinite alternate, auroraDrift 22s var(--ease-io) infinite alternate; }
@keyframes auroraDrift {
  0% { scale: 1; filter: hue-rotate(0deg); }
  50% { scale: 1.1; filter: hue-rotate(40deg); }
  100% { scale: 1.03; filter: hue-rotate(-30deg); }
}

/* ---------- AI：只剩一根输入条 ---------- */
.ai-box { position: relative; background: transparent; padding: 0; border-radius: 0; max-width: 760px; }
.h-ai { padding: 10px 22px 34px; }
.h-ai .ai-box { margin-bottom: 0; }
.ai-head { display: none; }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.ai-form {
  position: relative; display: flex; align-items: center; gap: 6px; height: 54px; padding: 0 7px 0 16px; border-radius: 30px;
  background: var(--surface); box-shadow: 0 10px 34px -18px color-mix(in srgb, var(--g2) 55%, transparent), 0 1px 3px rgba(0, 0, 0, 0.06);
  isolation: isolate;
}
/* 一圈缓慢流动的渐变边；聚焦更亮，思考时转得更快 */
.ai-form::before {
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit; z-index: -1; padding: 1.5px;
  background: conic-gradient(from var(--ang), var(--g1), var(--g2), var(--g3), var(--g1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.45; animation: aiSpin 6s linear infinite; transition: opacity 0.3s var(--ease);
}
.ai-form:focus-within::before { opacity: 1; }
.ai-box.busy .ai-form::before { opacity: 1; animation-duration: 1.2s; }
@keyframes aiSpin { to { --ang: 360deg; } }
.ai-form .ai-spark { width: 22px; height: 22px; flex: none; background: none; border-radius: 0; }
.ai-form .ai-spark svg { width: 20px; height: 20px; fill: var(--g2); }
.ai-box.busy .ai-spark svg { animation: aiTwinkle 0.9s var(--ease-io) infinite; }
@keyframes aiTwinkle { 50% { transform: scale(0.75) rotate(25deg); opacity: 0.6; } }
.ai-input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 15.5px; padding: 0 4px; }
.ai-send {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--g1), var(--g2) 55%, var(--g3)); color: #fff;
  transition: transform 0.35s var(--spring), opacity 0.2s var(--ease);
}
.ai-send:hover { transform: scale(1.07); }
.ai-send:active { transform: scale(0.92); }
.ai-send svg { flex: none; min-width: 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ai-chips { justify-content: center; margin: 12px 0 0; gap: 8px; }
.ai-chip { background: transparent; color: var(--text-secondary); padding: 4px 10px; font-size: 13px; }
.ai-chip:hover { color: var(--text); background: var(--panel); }
.ai-box.has-log .ai-chips { display: none; }
.ai-clear {
  position: absolute; top: -4px; right: 0; width: 28px; height: 28px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--panel); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; z-index: 3;
}
.ai-clear[hidden] { display: none; }
.ai-clear svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ai-log:not(:empty) { margin: 0 0 14px; padding-top: 30px; }
.ai-card { background: var(--panel); }
/* 回答逐行浮现 */
.ai-ans p, .ai-ans li { animation: aiLine 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes aiLine { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } }
.ai-card { animation: aiLine 0.55s var(--ease-out) both; animation-delay: 0.15s; }
/* 思考中：三个点换成一条流光 */
.ai-dots { width: 120px; height: 6px; padding: 0; margin: 10px 0; border-radius: 6px; display: block;
  background: linear-gradient(90deg, transparent, var(--g1), var(--g2), var(--g3), transparent); background-size: 200% 100%;
  animation: aiFlow 1.1s linear infinite; }
.ai-dots i { display: none; }
@keyframes aiFlow { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 734px) {
  .h-grid { grid-template-columns: 1fr; padding: 0 16px 8px; gap: 12px; }
  .h-grid .tile { padding: 24px 20px 22px; border-radius: 22px; }
  .h-grid .cover-title, .h-grid .cover-sm .cover-title { font-size: 28px; }
  .h-grid .big-stat .count { font-size: 46px; }
  .ai-form { height: 50px; }
  .h-ai { padding: 6px 16px 26px; }
  .ai-box { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .h-grid .tile, .h-glow, .ai-form::before, .ai-ans p, .ai-ans li, .ai-card, .ai-dots { animation: none !important; }
}

/* ══════════════ 更多交互动效（2026-10-09） ══════════════ */

/* 点按水波纹 */
.btn, .tile-cta, .ai-send, .ai-chip, .ai-nav { position: relative; overflow: hidden; }
.fx-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.25) 40%, transparent 70%);
  transform: scale(0); animation: fxRipple 0.6s var(--ease-out) forwards;
}
.btn:not(.btn-primary) .fx-ripple, .ai-chip .fx-ripple { background: radial-gradient(circle, color-mix(in srgb, var(--g2) 28%, transparent), transparent 70%); }
@keyframes fxRipple { to { transform: scale(1); opacity: 0; } }

/* 成功时的星光迸发 */
.fx-burst { position: fixed; z-index: 9999; width: 0; height: 0; pointer-events: none; }
.fx-burst i {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: hsl(var(--h) 90% 60%); box-shadow: 0 0 8px hsl(var(--h) 90% 60%);
  animation: fxBurst 0.85s cubic-bezier(.15, .8, .25, 1) forwards;
}
@keyframes fxBurst {
  0% { transform: rotate(var(--a)) translateX(0) scale(1); opacity: 1; }
  100% { transform: rotate(var(--a)) translateX(var(--d)) scale(0.2); opacity: 0; }
}

/* 发送键：箭头起飞再落回 */
.ai-send.fly svg { animation: aiFly 0.6s var(--ease-out); }
@keyframes aiFly { 0% { transform: none; } 40% { transform: translateY(-22px); opacity: 0; } 41% { transform: translateY(18px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* 云服务器、AI 结果卡：悬浮微抬 + 光标柔光 */
.sv-tile, .sv-panel, .sv-usage, .ai-card, .ct-card { position: relative; isolation: isolate; transition: transform 0.45s var(--spring-soft, var(--ease-out)), box-shadow 0.45s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .sv-tile:hover, .ai-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -22px color-mix(in srgb, var(--g2) 60%, transparent); }
  .sv-tile:hover { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-3px); }
  .sv-tile::before, .sv-panel::before, .sv-usage::before, .ai-card::before, .ct-card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--g2) 11%, transparent), transparent 62%);
    opacity: 0; transition: opacity 0.4s var(--ease);
  }
  .sv-tile:hover::before, .sv-panel:hover::before, .sv-usage:hover::before, .ai-card:hover::before, .ct-card:hover::before { opacity: 1; }
}

/* 流量进度条：填充时带一道流光 */
.sv-bar i { position: relative; overflow: hidden; }
.sv-bar i::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%); animation: barShine 2.6s var(--ease-io) infinite;
}
@keyframes barShine { 60%, 100% { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .fx-ripple, .fx-burst, .ai-send.fly svg, .sv-bar i::after { animation: none !important; display: none; }
  .sv-tile:hover, .ai-card:hover { transform: none; }
}

/* ---------- 运行原理说明（登录后看） ---------- */
.h-doc { font-size: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.doc-modal { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.28); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  display: flex; justify-content: center; padding: 4vh 16px; animation: docFade 0.3s var(--ease-out); }
.doc-modal[hidden] { display: none; }
@keyframes docFade { from { opacity: 0; } }
.doc-sheet { position: relative; width: 100%; max-width: 880px; background: var(--surface); border-radius: 22px; overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.35); animation: docRise 0.45s var(--spring-soft); }
@keyframes docRise { from { transform: translateY(30px) scale(0.98); opacity: 0; } }
.doc-x { position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; z-index: 2;
  background: var(--panel); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
.doc-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.doc-body { padding: 34px 44px 50px; font-size: 15px; line-height: 1.75; color: var(--text); }
.doc-body h1 { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 14px; }
.doc-body h2 { font-size: 22px; margin: 36px 0 12px; padding-top: 6px; }
.doc-body h3 { font-size: 17px; margin: 24px 0 8px; }
.doc-body p { margin: 0 0 12px; }
.doc-body ul, .doc-body ol { margin: 0 0 12px; padding-left: 22px; }
.doc-body blockquote { margin: 0 0 16px; padding: 10px 16px; border-radius: 12px; background: var(--panel); color: var(--text-secondary); font-size: 14px; }
.doc-body hr { border: 0; height: 1px; background: var(--line); margin: 26px 0; }
.doc-body code { font-family: var(--code); font-size: 0.88em; padding: 1px 5px; border-radius: 6px; background: var(--panel); }
.doc-body pre { margin: 0 0 16px; padding: 16px 18px; border-radius: 16px; background: #0f1115; color: #e6e6e6; overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.doc-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.doc-table { overflow-x: auto; margin: 0 0 16px; border-radius: 12px; }
.doc-body table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.doc-body th, .doc-body td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-body th { background: var(--panel); font-weight: 600; white-space: nowrap; }
@media (max-width: 734px) {
  .doc-modal { padding: 0; }
  .doc-sheet { border-radius: 0; }
  .doc-body { padding: 20px 18px 40px; font-size: 14.5px; }
  .doc-body h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .doc-modal, .doc-sheet { animation: none; } }

/* ══════════════ 折叠区 + 去「AI 味」+ 交互细节（2026-10-09） ══════════════
   用户要求：AI 能做的手动功能收起来；界面别太像 AI 产品（不要彩虹边、星星图标、到处渐变光）；大范围用贝塞尔曲线。 */

/* ---------- 折叠区（新闻手动搜索、量化标的池） ---------- */
.fold { margin: 12px 0 24px; }
.fold > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  padding: 16px 4px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--text-secondary);
  transition: color 0.3s var(--ease);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover, .fold[open] > summary { color: var(--text); }
.fold-chev { width: 18px; height: 18px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.5s var(--spring-soft); }
.fold[open] .fold-chev { transform: rotate(180deg); }
.fold-body { padding-top: 4px; }
/* 支持的浏览器里，展开/收起用高度动画（贝塞尔缓动），不支持的直接开合 */
@supports (interpolate-size: allow-keywords) {
  .fold { interpolate-size: allow-keywords; }
  .fold::details-content { height: 0; overflow: clip; transition: height 0.55s var(--ease-out), content-visibility 0.55s allow-discrete; }
  .fold[open]::details-content { height: auto; }
}

/* ---------- AI 输入条：中性、克制 ---------- */
.ai-form::before { display: none; }
.ai-form .ai-spark { display: none; }
.ai-form { padding-left: 20px; box-shadow: 0 0 0 1px var(--line-strong), 0 6px 22px -16px rgba(0, 0, 0, 0.22);
  transition: box-shadow 0.35s var(--ease); }
.ai-form:focus-within { box-shadow: 0 0 0 1.5px var(--text), 0 10px 28px -16px rgba(0, 0, 0, 0.28); }
.ai-send { background: var(--text); transition: transform 0.4s var(--spring), background 0.25s var(--ease), opacity 0.25s var(--ease); }
.ai-send:hover { background: #3a3a3c; transform: scale(1.05); }
.ai-box.busy .ai-send { opacity: 0.45; }
.ai-user { background: var(--panel); color: var(--text); border-radius: 18px 18px 6px 18px; }
.ai-dots { background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.16), transparent); background-size: 200% 100%; width: 96px; height: 4px; }
.ai-act { box-shadow: inset 0 0 0 1px var(--line-strong); }
.ai-nav { background: var(--text); }
.ai-nav:hover { transform: translateX(3px); }
.ai-chip { border-radius: 10px; }

/* 成功提示：几粒小深色点，别搞彩虹 */
.fx-burst i { width: 4px; height: 4px; left: -2px; top: -2px; background: var(--text); box-shadow: none; opacity: 0.8; }

/* 首页卡片描边：从彩色渐变改成很淡的单色 */
.h-grid .tile::after { background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--g2) 45%, transparent), transparent 60%); }
@media (hover: hover) { .h-grid .tile:hover::after { opacity: 0.55; } }

/* ---------- 交互细节 ---------- */
/* 统一的键盘焦点环（只在用键盘时出现） */
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.ai-input:focus-visible, .inp:focus-visible { outline: none; }
/* 按下回弹：按下时缩一点，松开用弹簧曲线弹回 */
.btn, .tile-cta, .seg-btn, .tab, .ai-chip { transition-property: transform, background, color, box-shadow, opacity; transition-duration: 0.35s; transition-timing-function: var(--spring); }
.btn:active, .tile-cta:active, .seg-btn:active, .tab:active, .ai-chip:active { transform: scale(0.96); transition-duration: 0.12s; transition-timing-function: var(--ease-out); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fold::details-content { transition: none; }
}

/* ══════════════ 液态玻璃（2026-10-09 用户要求「能不能有玻璃效果」） ══════════════
   玻璃要有东西透过来才看得出：先给页面铺一层很淡的背景光（跟着当前板块的主题色），
   再把悬浮的界面元素做成半透明 + 背景虚化 + 上缘高光 + 下缘反光。 */
:root {
  --glass: linear-gradient(150deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.46));
  --glass-strong: linear-gradient(150deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62));
  --glass-blur: blur(24px) saturate(185%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  --glass-drop: 0 12px 34px -18px rgba(20, 20, 40, 0.28), 0 2px 6px -2px rgba(20, 20, 40, 0.06);
}

/* body 原本铺了不透明白底，会盖住下面这层背景光：白底交给 html，body 透明 */
html { background: #fff; }
body { background: transparent; }

/* 页面背景光：body 上的 data-mod 跟着板块切换，颜色取各板块的主题色，切换时慢慢过渡 */
#app::before {
  content: ""; position: fixed; inset: -10%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 34% at 12% 18%, color-mix(in srgb, var(--bg-a, #0071e3) 20%, transparent), transparent 70%),
    radial-gradient(34% 30% at 88% 30%, color-mix(in srgb, var(--bg-b, #7a5af8) 17%, transparent), transparent 70%),
    radial-gradient(40% 36% at 55% 92%, color-mix(in srgb, var(--bg-c, #e0457b) 14%, transparent), transparent 70%);
  transition: opacity 0.8s var(--ease);
  animation: bgDrift 30s var(--ease-io) infinite alternate;
}
@keyframes bgDrift { to { transform: translate3d(2%, -2%, 0) scale(1.04); } }
body[data-mod="quant"]  #app::before { --bg-a: #1db954; --bg-b: #00b3c7; --bg-c: #0a7cff; }
body[data-mod="news"]   #app::before { --bg-a: #ff8a00; --bg-b: #ff4d2e; --bg-c: #ff2d6f; }
body[data-mod="words"]  #app::before { --bg-a: #8b5cf6; --bg-b: #d946ef; --bg-c: #ff3d7f; }
body[data-mod="diary"]  #app::before { --bg-a: #f58529; --bg-b: #dd2a7b; --bg-c: #8134af; }
body[data-mod="vault"]  #app::before { --bg-a: #d4a012; --bg-b: #b7791f; --bg-c: #5b4a2e; }
body[data-mod="server"] #app::before { --bg-a: #14b8a6; --bg-b: #0ea5e9; --bg-c: #6366f1; }

/* 顶栏、手机底栏 */
.topnav, .topnav.scrolled {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 0; box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.55), 0 1px 0 rgba(0, 0, 0, 0.04);
}
.topnav .tabs { background: rgba(255, 255, 255, 0.45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), inset 0 1px 2px rgba(0, 0, 0, 0.04); }
@media (max-width: 734px) {
  .bottombar { background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-top: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 -8px 24px -18px rgba(20, 20, 40, 0.25); }
}

/* AI 输入条、语言菜单、阅读弹窗 */
.ai-form { background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--glass-drop); }
.ai-form:focus-within { box-shadow: var(--glass-edge), 0 0 0 1.5px var(--text), var(--glass-drop); }
.lang-menu { background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--glass-drop); }
.doc-sheet { background: var(--glass-strong); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--glass-edge), 0 40px 90px -30px rgba(0, 0, 0, 0.4); }

/* 卡片：首页作品卡、云服务器数据卡、AI 结果卡 */
.h-grid .tile, .sv-usage, .sv-tile, .sv-panel, .ai-card {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--glass-drop);
}
/* 玻璃上沿的一道斜向反光，鼠标经过时慢慢滑过去 */
.h-grid .tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 45%, transparent 60%);
  background-size: 250% 100%; background-position: 120% 0; transition: background-position 1.1s var(--ease-out);
}
@media (hover: hover) { .h-grid .tile:hover::before { background-position: -20% 0; } }

/* 不支持背景虚化的浏览器：退回不透明的白，保证字看得清 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topnav, .bottombar, .ai-form, .lang-menu, .doc-sheet, .h-grid .tile, .sv-usage, .sv-tile, .sv-panel, .ai-card { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { #app::before { animation: none; } .h-grid .tile::before { transition: none; } }
@media (prefers-reduced-transparency: reduce) {
  .topnav, .bottombar, .ai-form, .lang-menu, .doc-sheet, .h-grid .tile, .sv-usage, .sv-tile, .sv-panel, .ai-card { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* 单词本：三个安装包按钮、法语词标记 */
.ext-dls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lang-badge { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: #0055a4; color: #fff;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; vertical-align: 2px; }
.ext-meta-note { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }

/* 新闻结果默认只露前 15 条（2026-10-09） */
#nw-list.capped > .hit:nth-child(n+16) { display: none; }
#nw-list .nw-more { display: block; margin: 6px auto 18px; padding: 10px 18px; font-size: 13.5px; }
/* 没选新闻时不占位置，选中第一条才从底部滑出 */
#nw-bar { transition: opacity 0.35s var(--ease-out), transform 0.45s var(--spring-soft), visibility 0s; }
#nw-bar.idle { opacity: 0; visibility: hidden; transform: translateY(24px) scale(0.98); pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease), visibility 0s 0.3s; }

/* 下载按钮前的小色块：和各安装包的插件图标同色（英语蓝 / 法中红 / 法英绿 / 中英双语紫） */
.ext-dls .ext-dl::before {
  content: ""; width: 11px; height: 11px; border-radius: 3.5px; flex: 0 0 auto; margin-right: 8px;
  background: var(--ic, #0071e3); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
}
.ext-dls .ext-dl[data-v="zh"] { --ic: #d93a2b; }
.ext-dls .ext-dl[data-v="en"] { --ic: #0f8a62; }
.ext-dls .ext-dl[data-v="both"] { --ic: #5b4fe0; }

/* ══════════════ 更大的交互动画（2026-10-09） ══════════════ */

/* 1. 板块切换：新板块从点击处圆形展开，旧板块往后退、变暗变虚。
      默认的交叉淡化用 plus-lighter 混合，两层叠在一起会发白，这里改回正常叠放 */
html.vt-mod::view-transition-old(root),
html.vt-mod::view-transition-new(root) { mix-blend-mode: normal; }
html.vt-mod::view-transition-old(root) { animation: vtModOut 0.72s var(--ease-io) both; }
html.vt-mod::view-transition-new(root) { animation: vtModIn 0.78s cubic-bezier(0.7, 0, 0.18, 1) both; }
@keyframes vtModIn {
  from { clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 0px)); }
  to   { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0px)); }
}
@keyframes vtModOut { to { transform: scale(0.92); filter: brightness(0.9); opacity: 0.55; } }   /* 不做全屏模糊：最费性能，手机上会掉帧 */

/* 2. 首页卡片标题飞成板块大标题 */
::view-transition-group(mod-title) {
  z-index: 10;
  animation-duration: 0.82s;
  animation-timing-function: cubic-bezier(0.3, 1.18, 0.4, 1);   /* 落点略冲过再回来 */
}
::view-transition-old(mod-title), ::view-transition-new(mod-title) {
  animation-duration: 0.82s; height: 100%; width: auto; margin: 0 auto;
}

/* 3. 大标题入场：放大 + 模糊 + 字距拉开 → 弹性收拢。用独立的 scale/translate 属性，不占 transform（视差在用） */
.hero h1.big-in, .h-title.big-in { animation: heroBig 1.05s cubic-bezier(0.22, 1.25, 0.36, 1) both; }
@keyframes heroBig {
  from { opacity: 0; scale: 1.28; translate: 0 26px; filter: blur(18px); letter-spacing: 0.09em; }
  55%  { opacity: 1; filter: blur(0); }
  to   { opacity: 1; scale: 1; translate: 0 0; filter: none; }
}

/* 4. 首页卡片随滚动从下方带透视「立起来」。改用独立属性，卡片跟光标倾斜（transform）终于能叠上去了 */
.h-grid { perspective: 1600px; perspective-origin: 50% 0%; }
@supports (animation-timeline: view()) {
  .h-grid .tile { animation: tileDepth linear both; animation-timeline: view(); animation-range: entry 0% cover 38%; }
}
@keyframes tileDepth {
  from { opacity: 0; translate: 0 130px; scale: 0.84; rotate: x 24deg; filter: blur(14px); }
  60%  { opacity: 1; filter: blur(0); }
  to   { opacity: 1; translate: 0 0; scale: 1; rotate: x 0deg; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1.big-in, .h-title.big-in, .h-grid .tile { animation: none !important; }
  .h-grid { perspective: none; }
}

/* ---------- 手机端收紧（2026-10-11） ----------
   ① 卡片里的空状态：wordbook.css 那份上下各 60px 是给整页空状态用的，
      手机上四张空卡要划很久，卡片里收到 22px。
   ② 云服务器「代理 IP」：IP 单独占一整行、字号放大，三个按钮在下面等分，
      不再和按钮挤一行把 IP 压小。 */
@media (max-width: 734px) {
  .card .empty-state { padding: 22px 12px; font-size: 13px; }
  .sv-proxy { flex-direction: column; align-items: stretch; gap: 12px; }
  .sv-proxy-ip b { font-size: 28px; word-break: break-all; }
  .sv-proxy-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sv-proxy-btns .btn { min-height: 40px; padding: 0 6px; white-space: nowrap; }
}
