/* 默认值要和 modules/interface/features/appearance/api.py 的 DEFAULTS 一致。
 * 工具箱外壳 + 所有功能共用的组件样式（0.17.0 重做）。
 * 间距按 8px 网格；颜色/字体/圆角全部走 CSS 变量，「界面 → 外观与排版」可以覆盖。 */
:root {
  --bg: #fff6f9;
  --panel: #fffdfd;
  --panel-2: #fff1f5;
  --border: #f2d9e2;
  --text: #352237;
  --muted: #75616f;
  --accent: #d5336c;
  --accent-2: #a95077;
  --good: #007556;
  --warn: #8f5a1a;
  --bad: #b52f4b;
  --info: #2b6896;
  --gold: #a06a14;
  --gold-ink: #8f5c12;
  --std: #4a6fa5;
  --std-ink: #3f6092;
  --radius: 10px;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
  --base-size: 14px;
  --line-height: 1.6;
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-body: 1.6;
  --lh-dense: 1.45;
  --lh-number: 1.1;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-heavy: 800;
  --tracking-display: -.02em;
  --tracking-tight: -.01em;
  --tracking-normal: 0;
  --tracking-label: .02em;
  --tracking-caps: .08em;
  --tracking-wide: .12em;
  --measure: 68ch;
  --sidebar-w: 250px;
  /* 设计稿里的玫瑰色层次：强调文字、浅底、输入框描边 */
  --accent-strong: color-mix(in srgb, var(--accent) 92%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, #fff);
  /* 实心按钮 / 选中态专用：白天跟 --accent 一致，夜晚换成深玫瑰，白字才够对比。
   * 新加实心粉按钮只用这两个变量，不要再往 night.css 的名单里加选择器。 */
  --accent-fill: #d5336c;
  --on-accent-fill: #fff;
  --on-bad: #fff;
  --on-gold: #fff;
  --on-std: #fff;
  --btn-shadow: 0 4px 12px color-mix(in srgb, var(--accent-fill) 22%, transparent);
  --field-bg: #fffefd;
  /* 输入框、勾选框的边界：3:1，不能再用 --border 那种装饰线 */
  --control-border: #9d7d8b;
  --field-edge: var(--control-border);
  --field-hover: #7f5b6d;
  --placeholder: var(--muted);
  --overlay: #38232f66;
  --good-soft: color-mix(in srgb, var(--good) 12%, var(--panel));
  --warn-soft: color-mix(in srgb, var(--warn) 12%, var(--panel));
  --bad-soft: color-mix(in srgb, var(--bad) 12%, var(--panel));
  --info-soft: color-mix(in srgb, var(--info) 12%, var(--panel));
  --gold-soft: color-mix(in srgb, var(--gold) 14%, var(--panel));
  --std-soft: color-mix(in srgb, var(--std) 14%, var(--panel));
  /* 间距：4px 阶梯；旧的 --s1/--s2/--s3 已删，新代码只用 --space-*。 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --view-pad: var(--space-6);
  --card-pad: var(--space-4);
  --card-pad-lg: var(--space-6);
  --card-pad-sm: var(--space-3);
  --control-h: 40px;
  --control-h-sm: 34px;
  --control-h-xs: 28px;
  --icon-sm: 16px;
  --icon-md: 18px;
  --icon-lg: 20px;
  --icon-xl: 24px;
  --focus: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent-strong);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: var(--base-size)/var(--line-height) var(--sans);
  /* 数据密集的工具：数字统一等宽，数值跳动时不会左右抖（2026-11-16） */
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

:focus { outline: none; }
/* 表单控件也要有看得见的焦点：全局 :focus 去掉了 outline，下面统一补两层环。 */
.input:focus-visible,
select:not([multiple]):focus-visible,
textarea:focus-visible,
input:not([type]):focus-visible,
input[type="text"]:focus-visible,
input[type="search"]:focus-visible,
input[type="number"]:focus-visible,
input[type="date"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="color"]:focus-visible,
input[type="range"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus);
}
select:not([multiple]) { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%2375616f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; cursor: pointer; }
.gt-select-menu { position: fixed; z-index: 10000; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-float); color: var(--text); box-shadow: var(--shadow-2); font: var(--fs-md)/1.4 var(--sans); transform-origin: var(--gt-select-origin, top left); animation: gt-select-in 160ms var(--ease-out) backwards; }
.gt-select-menu.is-closing { animation: gt-select-out 120ms ease forwards; pointer-events: none; }
@keyframes gt-select-in { from { opacity: 0; transform: scale(.96); } }
@keyframes gt-select-out { to { opacity: 0; transform: scale(.98); } }
.gt-select-pill { position: absolute; top: 0; left: 4px; right: 4px; height: 30px; border-radius: var(--r-sm); background: var(--surface-active); opacity: 0; pointer-events: none; transition: transform 220ms var(--ease-out), height 150ms ease, opacity 150ms ease; }
.gt-select-menu [role="option"] { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px 0 10px; border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-md); font-weight: var(--fw-medium); cursor: pointer; }
.gt-select-menu [role="option"]:hover, .gt-select-menu [role="option"].is-current { background: transparent; color: var(--text); }
.gt-select-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-select-menu [role="option"][aria-selected="true"]::after { content: "✓"; flex: none; color: var(--accent-strong); font-size: var(--fs-xs); font-weight: 700; line-height: 1; }
.gt-select-menu [aria-disabled="true"] { opacity: .45; cursor: default; }
.gt-select-menu [aria-disabled="true"]:hover { color: var(--text); }
.gt-select-menu.compact { padding: 4px; font-size: var(--fs-md); }
.gt-select-menu.compact [role="option"] { min-height: 26px; padding: 0 8px; }
.gt-select-group { padding: 8px 10px 4px; color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 760px), (pointer: coarse) {
  .gt-select-menu [role="option"] { min-height: 40px; }
  .gt-select-menu.compact [role="option"] { min-height: 34px; }
}
@media (prefers-reduced-motion: reduce) { .gt-select-menu, .gt-select-menu.is-closing { animation: none; } .gt-select-pill { transition: none; } }
.gt-dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); background: var(--panel); box-shadow: var(--shadow-3); font: 14px/1.6 var(--sans); }
/* 弹窗别再瞬间出现（2026-11-16）：面板轻轻弹出来，遮罩淡入 */
.gt-dialog[open] { animation: gt-dialog-in var(--t-base) var(--ease-spring); }
.gt-dialog[open]::backdrop { animation: gt-fade-in 160ms ease-out; }
@keyframes gt-dialog-in { from { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes gt-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .gt-dialog[open], .gt-dialog[open]::backdrop { animation: none; } }
.gt-dialog::backdrop { background: var(--overlay); }
.gt-dialog p { margin: 0 0 20px; white-space: pre-wrap; }
.gt-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.gt-dialog-actions button { padding: 8px 18px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.gt-dialog-actions .gt-dialog-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent-fill); font-weight: 700; }
input[type="range"] { appearance: none; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, white); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border: 2px solid var(--panel); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 4px color-mix(in srgb, var(--text) 20%, transparent); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid var(--panel); border-radius: 50%; background: var(--accent); }
input[type="checkbox"], input[type="radio"] { appearance: none; width: 16px; height: 16px; flex: none; margin: 0; border: 1px solid var(--field-edge); background: var(--field-bg); vertical-align: middle; cursor: pointer; }
input[type="checkbox"] { border-radius: var(--r-sm); }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8 3 3 7-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat; border-color: var(--accent); }
input[type="radio"]:checked { border: 5px solid var(--accent); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: default; }
input[type="color"] { padding: 3px; border: 1px solid var(--field-edge); border-radius: var(--r-sm); background: var(--field-bg); cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: var(--r-sm); }
/* 全站滚动条（2026-11-17 用户：像 Mac 一样不占页面宽度，粉色细条）：原生滚动条全部藏起来，在滚的区域由 app/scrollbars.js 浮一条滑块。
   不要在页面里再给某个区域写 scrollbar-width / ::-webkit-scrollbar，否则那里又会占宽度、样子也不统一。 */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
.gt-scrollthumb { position: fixed; z-index: 10050; width: 8px; height: 8px; border-radius: 999px; opacity: 0; pointer-events: none; cursor: default; transition: opacity 240ms ease; }
.gt-scrollthumb::before { content: ""; position: absolute; border-radius: inherit; background: color-mix(in srgb, var(--accent) 62%, transparent); transition: inset 140ms ease, background-color 140ms ease; }
.gt-scrollthumb.is-y::before { inset: 0 2px 0 3px; }
.gt-scrollthumb.is-x::before { inset: 3px 0 2px 0; }
.gt-scrollthumb.is-on { opacity: 1; pointer-events: auto; transition-duration: 80ms; }
.gt-scrollthumb:hover::before, .gt-scrollthumb.is-drag::before { inset: 0; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .gt-scrollthumb, .gt-scrollthumb::before { transition: none; } }

#app { display: flex; height: 100vh; background-color: var(--bg); background-image: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 4%, transparent) 0, transparent 42%); }

/* 字号档位（2026-11-16 统一）：普通界面只用这几档，以后整体调大小只改这里。
 * 游戏同款面板（.cpanel-*）另有一套更小的字，是照游戏界面还原的，不走这些变量。 */
:root {
  --fs-2xs: 10px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-xl: 16px;
  --fs-2xl: 18px;
  --fs-3xl: 20px;
  --fs-4xl: 24px;
  --fs-5xl: 32px;
  /* 页面宽度和间距（2026-11-16 第二轮）：所有页面同一个基准宽，换页时左右留白不变；
   * 画布页要更宽靠页内栅格分配，不整页拉宽，免得留白忽宽忽窄。 */
  --w-page: 1400px;
  --gap-section: var(--space-6);
  --gap-card: var(--space-4);
  --gap-card-dense: var(--space-3);
  --gap-section-lg: var(--space-8);
  --gap-inline: var(--space-2);
  --gap-inline-sm: var(--space-1);
  /* 圆角、阴影、动效时长：全站只用这几档（2026-11-16） */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;
  --shadow-2: 0 12px 30px #70405c24;
  --shadow-3: 0 20px 60px #55344533;
  /* 悬停抬升用的一层很淡的阴影（2026-11-16） */
  --shadow-1: 0 2px 10px #5534451f;
  /* 侧栏悬停展开时浮在内容上（2026-11-18）：一层贴边的玫瑰色短影 + 一层很淡的远影，不用一大片灰影 */
  --sidebar-float-shadow: 1px 0 0 #e7c3d1, 6px 0 14px -6px #c2457a2e, 22px 0 44px -18px #5534452e;
  /* 收起 / 弹出用：先冲过头一点再回来 */
  --ease-out: cubic-bezier(.2, .9, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.45, .64, 1);
  /* 离场用：越走越快，尾巴不拖（2026-11-18 侧栏收起） */
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  /* 语义色（2026-11-16）：交界线、悬停底、选中底、浮层底，浅色夜晚各定义一次，
   * 组件里不再逐条写死，也不用在 night.css 里一个个覆盖。 */
  --line-soft: #f1e1e7;
  --surface-hover: #fbe9f0;
  --surface-active: #f9dfe9;
  --surface-float: #fffafd;
  --t-fast: 140ms;
  --t-base: 200ms;
  --t-slow: 260ms;
  --t-enter: 320ms;
}

/* ---------------- 侧边栏 ---------------- */

#sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 15px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* 悬停展开、收起只动裁切范围和阴影，不动宽度：宽度一动，右边整页每帧都要重排、文字反复换行，整页上下抖
   * （2026-11-18 用户：推着内容走的版本抖得很明显，改回浮在内容上面）。展开 260ms 缓出；收起 200ms 加速离开。 */
  transition: clip-path var(--t-slow) var(--ease-out), box-shadow var(--t-slow) var(--ease-out), background-color var(--t-slow) ease, border-color var(--t-slow) ease;
  /* 底图固定按展开宽度算，收起时只裁切/平移，不跟着侧栏一起缩小 */
  --sidebar-art-w: 530px;
}
/* 展开后右边一条 1px 亮边（2026-11-18）：收起时侧栏本来就有右边框，展开换成浮层后边框让位给这条线，收尾更干净 */
#sidebar::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-soft) 12%, var(--line-soft) 88%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow) ease;
}
/* 绯英淡化底图：侧栏始终保持粉色，不随角色配色变化。收起时图保持展开尺寸，侧栏像窗口一样盖住右边 */
#sidebar::before { content: ''; position: absolute; z-index: -1; left: calc(var(--sidebar-art-w) * -0.3415); bottom: calc(60px - var(--sidebar-art-w) * 0.1981); width: var(--sidebar-art-w); aspect-ratio: 530 / 670; background: url('assets/feiying.webp') center bottom / contain no-repeat; opacity: .1; filter: grayscale(1) sepia(1) saturate(400%) hue-rotate(292deg) contrast(.75); mask-image: linear-gradient(to bottom, transparent 0, transparent 34%, #000 62%, #000 100%); pointer-events: none; transition: transform var(--t-slow) ease, opacity var(--t-slow) ease; }

.brand { height: 64px; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 18px; margin: 0 -15px; border: 0; border-radius: var(--r-md); background: linear-gradient(90deg, transparent, var(--line-soft) 16%, var(--line-soft) 84%, transparent) bottom / 100% 1px no-repeat; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color var(--t-fast); }
.brand:hover { background-color: var(--surface-hover); }
.brand:hover .brand-text > b { color: var(--accent-strong); }
.brand-icon { position: relative; width: 36px; height: 36px; flex: 0 0 auto; border-radius: var(--r-md); display: grid; place-items: center; overflow: hidden; color: var(--on-accent-fill); background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 46%, #fff), color-mix(in srgb, var(--accent) 82%, #000)); border: 1px solid color-mix(in srgb, currentColor 55%, transparent); box-shadow: 0 5px 12px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent); transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base); }
.brand-icon img { width: 100%; height: 100%; display: block; object-fit: cover; }
/* 悬停时从图标上扫过一道很淡的高光；reduced motion 下直接隐藏 */
.brand-icon::after { content: ''; position: absolute; inset: -30% -60%; background: linear-gradient(115deg, transparent 34%, color-mix(in srgb, currentColor 38%, transparent) 47%, transparent 60%); transform: translateX(-70%) rotate(8deg); transition: transform .55s var(--ease-out); pointer-events: none; }
.brand:hover .brand-icon { transform: scale(1.05); box-shadow: var(--shadow-2); }
.brand:hover .brand-icon::after { transform: translateX(70%) rotate(8deg); }
.brand:active .brand-icon { transform: scale(.97); }
.brand-text { display: flex; flex-direction: column; gap: 3px; line-height: 1.15; min-width: 0; }
.brand-text > b { font-size: var(--fs-xl); font-weight: var(--fw-heavy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--t-fast); }
.brand-spark { margin-left: 3px; color: var(--accent); font-size: 9px; vertical-align: 2px; flex: none; }
.brand-text small { color: var(--muted); font-size: var(--fs-xs); margin-top: 0; }
.brand-text #brand-version { display: inline-flex; align-items: center; gap: 3px; }
.brand-ver { padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent-strong); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-label); }
.brand-tag { padding: 1px 5px; border-radius: 999px; background: var(--surface-active); color: var(--accent-strong); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }

.nav { flex: 1; overflow-y: auto; padding: 8px 0 0; min-height: 0; position: relative; }

/* 选中的那块底：只有一块，在菜单项之间连续滑动（app/nav-marker.js，2026-11-16 用户要求）。
 * 位置和宽高由脚本按选中项量出来，这里只管长相和过渡；快速切换时过渡会从当前位置接着走。
 * 手机底部标签栏不用这块，交叉轴 760 以下藏起来。 */
.nav-marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 0;
  border-radius: var(--r-md);
  background: var(--surface-active);
  box-shadow: inset 4px 0 var(--accent);
  opacity: 0;
  pointer-events: none;
  transition:
    /* 落下的时候稍微冲过头一点再回来（轻微回弹，2026-11-16 用户要求）；宽高不冲，免得底比菜单项大一圈 */
    top .34s cubic-bezier(.32, 1.3, .56, 1),
    left .34s cubic-bezier(.32, 1.3, .56, 1),
    width var(--t-enter) cubic-bezier(.25, .9, .3, 1),
    height var(--t-enter) cubic-bezier(.25, .9, .3, 1),
    opacity var(--t-fast) ease;
}
.nav-marker.on { opacity: 1; }
.nav-marker.no-anim { transition: none; }
/* 侧栏收起时底块跟着裁切一起缩到图标上（app/nav-marker.js 的 fold）：时长和曲线跟 #sidebar 的裁切一样，内侧竖线也同时变成收起时的 3px */
.nav-marker.is-folding { box-shadow: inset 3px 0 var(--accent); transition: top 200ms cubic-bezier(.25, .46, .45, .94), left 200ms cubic-bezier(.25, .46, .45, .94), width 200ms cubic-bezier(.25, .46, .45, .94), height 200ms cubic-bezier(.25, .46, .45, .94), box-shadow 200ms ease, opacity var(--t-fast) ease; }
@media (prefers-reduced-motion: reduce) { .nav-marker { transition: none; } }
/* 文字和图标压在滑动底上面，自身背景保持透明，选中只换颜色和字重。 */
.nav .nav-feature, .nav .nav-page { position: relative; z-index: 1; }

.nav-module { margin-bottom: var(--space-1); }
.nav-module-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 32px;
  margin-top: var(--space-3);
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}
.nav-module-title .caret { display: grid; color: var(--muted); transition: transform var(--t-slow) cubic-bezier(.34, 1.56, .64, 1); }
.nav-module.collapsed .caret { transform: rotate(-90deg); }
/* 折叠动 grid 轨道，不用量高度；高度不回弹，下面的模块不会跟着晃。收起后 visibility 隐藏，键盘也进不去。
 * 2026-11-17 美化：展开慢一点、收起快一点（退出比进入快）；内容先淡掉再收，边缘不会硬切；
 * 展开时功能一条条淡进来（sidebar.js/app.js 挂 .just-opened）。 */
.nav-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 280ms var(--ease-out); }
.nav-items-inner { min-height: 0; overflow: clip; opacity: 1; transition: opacity var(--t-base) var(--ease-out); }
.nav-module.collapsed .nav-items { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 180ms ease-in, visibility 0s linear 180ms; }
.nav-module.collapsed .nav-items-inner { opacity: 0; transition: opacity 120ms ease; }
.nav-module.just-opened .nav-items-inner > .nav-feature { animation: nav-item-in 240ms var(--ease-out) backwards; }
.nav-module.just-opened .nav-items-inner > .nav-feature:nth-child(2) { animation-delay: 25ms; }
.nav-module.just-opened .nav-items-inner > .nav-feature:nth-child(3) { animation-delay: 50ms; }
.nav-module.just-opened .nav-items-inner > .nav-feature:nth-child(4) { animation-delay: 75ms; }
.nav-module.just-opened .nav-items-inner > .nav-feature:nth-child(n + 5) { animation-delay: 100ms; }
@keyframes nav-item-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .nav-items, .nav-items-inner, .nav-module.collapsed .nav-items, .nav-module.collapsed .nav-items-inner { transition: none; }
  .nav-module.just-opened .nav-items-inner > .nav-feature { animation: none; }
}

.nav-feature, .nav-page {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  margin: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  text-align: left;
  transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav-feature:hover, .nav-page:hover { background: var(--surface-hover); color: var(--text); }
.nav-feature:active, .nav-page:active { transform: scale(.98); }
.nav-feature .icon, .nav-page .icon, .nav-feature .name, .nav-page .name { transition: transform .22s cubic-bezier(.34, 1.56, .64, 1); }
.nav-feature:hover .icon, .nav-page:hover .icon { transform: scale(1.14); }
.nav-feature:hover .name, .nav-page:hover .name { transform: translateX(2px); }
.nav-items .nav-feature + .nav-feature { margin-top: var(--space-1); }
.nav-feature.active, .nav-page.active {
  color: var(--accent-strong);
  font-weight: var(--fw-bold);
}
/* 选中的那项自己不要悬停底色：底色是下边那块滑动的 nav-marker（2026-11-16） */
.nav-feature.active:hover, .nav-page.active:hover { background: transparent; }
.nav-feature .icon, .nav-page .icon { width: 17px; flex: 0 0 auto; display: grid; place-items: center; }
.nav-feature .icon svg, .nav-page .icon svg { width: 17px; height: 17px; display: block; stroke-width: 2.1; }
.nav-feature.active .icon svg { stroke-width: 2.5; }
.nav-feature .name, .nav-page .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 收起：72px 图标栏（2026-11-17 美化）：
 * 菜单项收成 44×44 的圆角块，居中留出呼吸；悬停只给淡底，选中仍由滑动的 nav-marker 表示；
 * 品牌只留图标，悬停放大一点；名称用右侧浮动提示（sidebar.js）。分组状态和页面入口不变。 */
/* 收起态只在桌面侧栏存在；760 以下是底部标签栏，不能把收起的类带过去（否则标签栏/「更多」里的名字和关于行会被藏掉） */
@media (min-width: 761px) {
#app.sidebar-is-collapsed #sidebar { width: 72px; flex-basis: 72px; padding: 0 8px; }
#app.sidebar-is-collapsed #sidebar::before { transform: translateX(calc(var(--sidebar-art-w) * -0.094)); opacity: 0; }
/* 品牌图标收起、展开都在离左边 18px 的地方（72 宽图标栏里正好居中）：悬停展开、收起换布局那一下不横跳（2026-11-18） */
#app.sidebar-is-collapsed .brand { justify-content: flex-start; padding: 0 0 0 18px; margin: 0 -8px; }
#app.sidebar-is-collapsed .brand-text,
#app.sidebar-is-collapsed .nav-feature .name, #app.sidebar-is-collapsed .nav-page .name,
#app.sidebar-is-collapsed .sidebar-links, #app.sidebar-is-collapsed .sidebar-backup, #app.sidebar-is-collapsed .nav-page .badge { display: none; }
/* 模块标题在收起态留出原来的高度（只是看不见），功能按钮的上下位置和展开时一样，悬停展开不会跳。 */
#app.sidebar-is-collapsed .nav-module-title { visibility: hidden; pointer-events: none; }
#app.sidebar-is-collapsed .nav-module.collapsed .nav-items { grid-template-rows: 1fr; visibility: visible; }
#app.sidebar-is-collapsed .nav-module.collapsed .nav-items-inner { opacity: 1; }
#app.sidebar-is-collapsed .nav-feature, #app.sidebar-is-collapsed .nav-page { width: 44px; height: 44px; margin-left: auto; margin-right: auto; justify-content: center; padding: 0; gap: 0; }
#app.sidebar-is-collapsed .nav-page + .nav-page { margin-top: 8px; }
/* 图标和展开时一样大（17px），44px 的块里居中正好落在展开时的位置：悬停展开、收起换样式那一下图标不跳 */
#app.sidebar-is-collapsed .nav-feature .icon, #app.sidebar-is-collapsed .nav-page .icon { width: 17px; height: 17px; }
#app.sidebar-is-collapsed .nav-feature .icon svg, #app.sidebar-is-collapsed .nav-page .icon svg { width: 17px; height: 17px; }
#app.sidebar-is-collapsed .nav-marker { box-shadow: inset 3px 0 var(--accent); }
#app.sidebar-is-collapsed .nav-feature:not(.active):hover,
#app.sidebar-is-collapsed .nav-page:not(.active):hover { background: var(--surface-hover); color: var(--text); box-shadow: none; }
#app.sidebar-is-collapsed .nav-feature.active:hover,
#app.sidebar-is-collapsed .nav-page.active:hover { background: transparent; box-shadow: none; }
#app.sidebar-is-collapsed .sidebar-footer { border-top: 0; }
}
/* 悬停临时展开（2026-11-17 用户要求：默认收起，鼠标移上去展开）：
 * 展开时侧栏浮在页面上面（右边只占 72px 的位置，负的右外边距抵掉多出来的宽度），页面内容不跟着变窄。
 * 动画只动裁切范围（clip-path），侧栏里面按展开的样子排好不动。
 * 2026-11-18 曾改成占位置、推着内容走，右边整页每帧重排、文字一行行重新折，抖得很明显，用户要求改回浮层。
 * 收起时先走 200ms 的裁切（.sidebar-is-peek-out），过渡完脚本再换回静态的 72px 图标栏。 */
@media (min-width: 761px) {
  #app.sidebar-is-collapsed #sidebar,
  #app.sidebar-is-peek.sidebar-is-peek-out #sidebar { clip-path: inset(0 calc(100% - 72px) 0 0); }
  /* 浮起来的侧栏用比页面亮一档的表面（--surface-float）+ 右边一道细边 + 分层阴影，像一块面板压在内容上；
   * 2026-11-18 用户：原来和页面同色、只靠一大片灰影分开，看着发雾、没质感。 */
  #app.sidebar-is-peek #sidebar { z-index: 30; margin-right: calc(72px - var(--sidebar-w)); clip-path: inset(0 -60px 0 0); background: var(--surface-float); border-right-color: transparent; box-shadow: var(--sidebar-float-shadow); }
  #app.sidebar-is-peek #sidebar::after { opacity: 1; }
  #app.sidebar-is-peek.sidebar-is-peek-out #sidebar { box-shadow: none; transition-duration: var(--t-base); transition-timing-function: var(--ease-in); }
  #app.sidebar-is-peek.sidebar-is-peek-out #sidebar::before { transform: translateX(calc(var(--sidebar-art-w) * -0.094)); opacity: 0; }
}
@media (min-width: 761px) and (max-width: 1099px) {
  #app.sidebar-is-peek #sidebar { margin-right: calc(72px - 170px); }
}
@media (min-width: 761px) {
  /* 桌面顶栏已经有白天/夜晚按钮，侧栏底部不再重复；手机「更多」和 App 顶部被占时仍保留这个入口。 */
  #app .sidebar-footer [data-theme-toggle] { display: none; }
  /* .ghost 默认居中；展开的侧栏里首页和下面的分组左对齐，图标和文字贴在一起。 */
  #app:not(.sidebar-is-collapsed) .sidebar-footer .nav-home { justify-content: flex-start; gap: var(--space-2); padding-left: 8px; text-align: left; }
}
/* 展开时面板先走 260ms，文字按「品牌 → 分组标题 → 功能 → 底部」每项晚 12ms 淡入（最后一档约 128ms）；
 * 收起时全部 140ms 加速淡出，不逐项拖。--peek-i 由 app.js 按 DOM 顺序写在菜单项上（2026-11-18）。 */
@media (min-width: 761px) {
  #app.sidebar-is-peek .sidebar-links { --peek-i: 8; }
  #app.sidebar-is-peek .sidebar-backup { --peek-i: 9; }
  #app.sidebar-is-peek .brand-text,
  #app.sidebar-is-peek .nav-module-title,
  #app.sidebar-is-peek .nav-feature .name,
  #app.sidebar-is-peek .nav-page .name,
  #app.sidebar-is-peek .sidebar-links,
  #app.sidebar-is-peek .sidebar-backup,
  #app.sidebar-is-peek .nav-page .badge {
    animation: sidebar-peek-in var(--t-fast) var(--ease-out) backwards;
    animation-delay: calc(20ms + var(--peek-i, 0) * 12ms);
  }
  #app.sidebar-is-peek.sidebar-is-peek-out .brand-text,
  #app.sidebar-is-peek.sidebar-is-peek-out .nav-module-title,
  #app.sidebar-is-peek.sidebar-is-peek-out .nav-feature .name,
  #app.sidebar-is-peek.sidebar-is-peek-out .nav-page .name,
  #app.sidebar-is-peek.sidebar-is-peek-out .sidebar-links,
  #app.sidebar-is-peek.sidebar-is-peek-out .sidebar-backup,
  #app.sidebar-is-peek.sidebar-is-peek-out .nav-page .badge {
    animation: sidebar-peek-out var(--t-fast) var(--ease-in) forwards;
    animation-delay: 0ms;
  }
}
@keyframes sidebar-peek-in {
  from { opacity: 0; transform: translateX(-3px); }
}
@keyframes sidebar-peek-out {
  to { opacity: 0; transform: translateX(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  /* 减少动态效果：不裁切、不滑动，展开/收起直接换状态，文字也不淡入淡出。 */
  #sidebar { transition: none; }
  #sidebar::before, #sidebar::after { transition: none; }
  #app.sidebar-is-peek .brand-text,
  #app.sidebar-is-peek .nav-module-title,
  #app.sidebar-is-peek .nav-feature .name,
  #app.sidebar-is-peek .nav-page .name,
  #app.sidebar-is-peek .sidebar-links,
  #app.sidebar-is-peek .sidebar-backup,
  #app.sidebar-is-peek .nav-page .badge,
  #app.sidebar-is-peek.sidebar-is-peek-out .brand-text,
  #app.sidebar-is-peek.sidebar-is-peek-out .nav-module-title,
  #app.sidebar-is-peek.sidebar-is-peek-out .nav-feature .name,
  #app.sidebar-is-peek.sidebar-is-peek-out .nav-page .name,
  #app.sidebar-is-peek.sidebar-is-peek-out .sidebar-links,
  #app.sidebar-is-peek.sidebar-is-peek-out .sidebar-backup,
  #app.sidebar-is-peek.sidebar-is-peek-out .nav-page .badge {
    animation: none;
  }
}
/* 展开过程中内部保持完整宽度，侧栏边缘裁切内容，文字不被压缩。 */
#app:not(.sidebar-is-collapsed) .brand,
#app:not(.sidebar-is-collapsed) .sidebar-footer { width: var(--sidebar-w); }
#app:not(.sidebar-is-collapsed) .nav { width: calc(var(--sidebar-w) - 30px); }
/* 侧栏只有一套响应式规则，所有页面一样（2026-11-04 用户要求统一管理：以前抽卡规划、行动轴各自声明一套阈值，换页时侧栏宽度会变）。
   1100 以上完整宽度；761~1099 变窄成 170px（收起时 72px）；760 及以下是手机底部标签栏（见下面）。
   以前 601~760 还有一档只剩 58px 图标的侧栏，大屏手机上图标显示不出来（2026-11-04 用户截图），去掉了。
   侧栏里面的宽度要和侧栏本身同一个阈值变窄，否则底部的按钮和署名被裁掉。 */
@media (max-width: 1099px) {
  #app { min-width: 0; }
  /* 170px 展开侧栏：底图按 212% 算出来是 360px */
  #sidebar { --sidebar-art-w: 360px; }
  #app:not(.sidebar-is-collapsed) .brand,
  #app:not(.sidebar-is-collapsed) .sidebar-footer { width: 170px; }
  #app:not(.sidebar-is-collapsed) .nav { width: 140px; }
  /* 170px 宽时「绯绯狐工具箱」放不下 16px 加大间距，收一点免得被截成「绯绯狐工…」 */
  #app:not(.sidebar-is-collapsed) .brand { gap: 9px; padding: 0 12px 0 18px; }
  #app:not(.sidebar-is-collapsed) .brand-text > b { font-size: var(--fs-base); }
  #app .view { padding: 12px; min-width: 0; }
  /* 欢迎页用负边距铺满，要和变小的留白对上，否则整块往左多挪、文字贴边还多出横向滚动条 */
  #app .welcome { margin: -12px; min-height: calc(100% + 24px); }
  /* 170px 宽的侧栏放不下两个带内边距的备份按钮 */
  #app .sidebar-backup { margin: 0 8px 10px; }
  #app .sidebar-backup button { padding: 0 4px; }
}
/* 170px 只在这一段宽度里用：收起的侧栏保持 72px，更窄时是底部标签栏 */
@media (min-width: 761px) and (max-width: 1099px) {
  #app:not(.sidebar-is-collapsed) #sidebar { width: 170px; flex-basis: 170px; }
  /* 两个按钮各 59px：长标签换成「导出 / 导入」，图标补回辨识度 */
  #app .sidebar-backup button { gap: 4px; }
  #app .sidebar-backup .sb-long { display: none; }
}
/* 收起时右侧的浮动提示（2026-11-17 美化）：小圆角卡片、轻阴影，和菜单项垂直居中；不再贴着栏边当舌头。 */
#sidebar-tip { --tip-bg: var(--surface-float); position: fixed; z-index: 1000; pointer-events: none; display: flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border)); border-radius: var(--r-md); background: var(--tip-bg); color: var(--accent-strong); box-shadow: var(--shadow-2); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; animation: sidebar-tip-in var(--t-fast) var(--ease-out); }
#sidebar-tip[hidden] { display: none; }

/* ---------------- 手机：侧栏变成底部标签栏（2026-11-04 用户选的） ----------------
   断点和 sidebar.js 的 MOBILE 一致。#app:not(#_) 只是为了压过上面按宽度、收起状态、紧凑布局写的各条侧栏规则。
   四个功能沿用侧栏里的按钮（点击、高亮都不变），「更多」打开侧栏底部那块：首页、导出/导入存档、链接。 */
/* 「更多」里的首页、白天/夜晚、窗口置顶在电脑上不显示（右上角和品牌已经有）。.nav-home 都是 .ghost 按钮，
   .ghost 后面写了 display，这里多带一层 .sidebar-footer 压过它（2026-11-17 用户：左下角和右上角重复）。 */
.nav-more, .sidebar-footer .nav-home { display: none; }
/* 手机上收进「更多」的功能：桌面侧栏照常显示，这里只给手机的面板用 */
.more-features { display: none; }
@media (max-width: 760px) {
  #app:not(#_) { flex-direction: column; height: 100vh; height: 100dvh; }
  #app:not(#_) #main { order: 1; flex: 1 1 auto; min-height: 0; }
  #app:not(#_) #sidebar {
    order: 2; width: 100%; flex: 0 0 auto; flex-direction: row; align-items: stretch; padding: 0 0 env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); background: color-mix(in srgb, var(--surface-float) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 -6px 18px color-mix(in srgb, var(--text) 8%, transparent);
    overflow: visible; transition: none; z-index: 30;
  }
  #app:not(#_) #sidebar::before, #app:not(#_) #sidebar::after, #app:not(#_) .brand { display: none; }
  /* 让功能按钮和「更多」成为标签栏的直接一员，平分宽度 */
  #app:not(#_) .nav, #app:not(#_) .nav-module, #app:not(#_) .nav-items, #app:not(#_) .nav-items-inner { display: contents; }
  #app:not(#_) .nav-module-title, #app:not(#_) .gt-nav-loading, #app:not(#_) .nav-empty { display: none; }
  /* 桌面侧栏的「选中底」在底部标签栏不用（那里高亮的是图标上的圆角块） */
  #app:not(#_) .nav-marker { display: none; }
  #app:not(#_) .nav-feature, #app:not(#_) .nav-more {
    display: flex; flex: 1 1 0; min-width: 0; height: 60px; margin: 0; padding: 6px 2px 5px; flex-direction: column; justify-content: center; align-items: center; gap: 3px;
    border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  #app:not(#_) .nav-feature .icon, #app:not(#_) .nav-more .icon { width: 50px; height: 28px; border-radius: var(--r-lg); display: grid; place-items: center; transition: background-color var(--t-base), transform var(--t-fast); }
  #app:not(#_) .nav-feature .icon svg, #app:not(#_) .nav-more .icon svg { width: 21px; height: 21px; }
  #app:not(#_) .nav-feature .name, #app:not(#_) .nav-more .name { display: block; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform: none; }
  /* 标签栏格子窄（5 个功能 + 更多），名字长的功能在 feature.json 里写 shortName，这里只显示短名字；读屏仍读按钮上的全名。 */
  #app:not(#_) .nav-feature .name[data-short] { font-size: 0; }
  #app:not(#_) .nav-feature .name[data-short]::after { content: attr(data-short); font-size: var(--fs-xs); }
  #app:not(#_) .nav-feature.active, #app.more-open:not(#_) .nav-more { color: var(--accent-strong); font-weight: var(--fw-bold); background: transparent; box-shadow: none; }
  #app:not(#_) .nav-feature.active .icon, #app.more-open:not(#_) .nav-more .icon { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
  #app:not(#_) .nav-more.more-active { color: var(--accent-strong); font-weight: var(--fw-bold); }
  #app:not(#_) .nav-more.more-active .icon { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
  /* 标了 mobileMore 的功能不在底部标签栏占位，收进「更多」面板 */
  #app:not(#_) .nav-feature.nav-feature-more { display: none; }
  #app:not(#_) .more-features { display: grid; gap: 6px; }
  #app:not(#_) .more-features .nav-feature {
    display: flex; flex: none; width: 100%; height: 48px; margin: 0; padding: 0 14px; gap: 10px;
    flex-direction: row; justify-content: flex-start; align-items: center;
    border-radius: var(--r-lg); background: var(--panel-2); color: var(--text); font-size: var(--fs-lg); font-weight: 700;
  }
  #app:not(#_) .more-features .nav-feature .icon { width: 22px; height: 22px; border-radius: 0; background: none; }
  #app:not(#_) .more-features .nav-feature .icon svg { width: 20px; height: 20px; color: var(--accent-strong); }
  #app:not(#_) .more-features .nav-feature .name { flex: 1; text-align: left; font-size: var(--fs-lg); }
  #app:not(#_) .more-features .nav-feature .name[data-short] { font-size: 0; }
  #app:not(#_) .more-features .nav-feature .name[data-short]::after { font-size: var(--fs-lg); }
  #app:not(#_) .more-features .nav-feature.active { color: var(--accent-strong); }
  #app:not(#_) .nav-feature:hover, #app:not(#_) .nav-more:hover { background: transparent; }
  #app:not(#_) .nav-feature:hover .icon, #app:not(#_) .nav-feature:hover .name { transform: none; }
  #app:not(#_) .nav-feature:active .icon, #app:not(#_) .nav-more:active .icon { transform: scale(.9); }
  /* 「更多」面板：平时藏起来，打开时浮在标签栏上方 */
  #app:not(#_) .sidebar-footer { display: none; }
  #app.more-open:not(#_) .sidebar-footer {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(80px + env(safe-area-inset-bottom)); width: auto; margin: 0; padding: 20px 14px 14px; gap: 10px;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 20px; background: var(--surface-float); box-shadow: var(--shadow-3); z-index: 40;
    animation: gt-sheet-up var(--t-slow) cubic-bezier(.2, .9, .3, 1.05);
    /* exe 窗口可以缩到 480 高（挂在游戏旁边看），面板放不下时在里面滚，不顶出窗口 */
    max-height: calc(100dvh - 88px - env(safe-area-inset-bottom)); overflow-y: auto;
  }
  /* 顶部的小拖动条，一眼看出是弹出的面板 */
  #app.more-open:not(#_) .sidebar-footer::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--border); }
  /* 打开时页面压暗，点暗处收起（sidebar.js 按 pointerdown 判断） */
  #app.more-open:not(#_) #main::after { content: ""; position: absolute; inset: 0; z-index: 25; background: var(--overlay); animation: gt-fade-in var(--t-base) ease-out; }
  #app:not(#_) .sidebar-footer .nav-home { display: flex; height: 48px; padding: 0 14px; gap: 12px; border-radius: var(--r-lg); background: var(--surface-active); color: var(--text); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
  #app:not(#_) .sidebar-footer .nav-home::after { content: "›"; margin-left: auto; color: var(--muted); font-size: var(--fs-3xl); font-weight: 400; }
  #app:not(#_) .sidebar-footer .nav-home .icon svg { width: 19px; height: 19px; color: var(--accent-strong); }
  #app:not(#_) .sidebar-backup { display: grid; grid-template-columns: 1fr 1fr; padding: 0; gap: 10px; margin: 0 0 10px; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
  #app:not(#_) .sidebar-backup button { display: flex; height: 52px; padding: 0 10px; gap: 8px; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--panel)); border-radius: var(--r-lg); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); color: var(--accent-strong); font-size: var(--fs-base); font-weight: 700; white-space: nowrap; }
  #app:not(#_) .sidebar-backup button:active { transform: scale(.97); }
  #app:not(#_) .sidebar-backup svg { display: block; width: 18px; height: 18px; flex: none; }
  #app:not(#_) .sidebar-links { display: grid; margin: 0; padding: 4px 6px 0; gap: 6px; font-size: var(--fs-base); }
  #app:not(#_) .sidebar-links a { border-bottom: 0; color: var(--text); }
  #app:not(#_) .sidebar-links .sidebar-credits { font-size: var(--fs-sm); }
  /* 顶栏只放功能名：收起按钮、模块名和作者信息都不要 */
  /* 全面屏 / 刘海：顶栏避开状态栏（index.html 用了 viewport-fit=cover） */
  #app:not(#_) #topbar { height: calc(52px + env(safe-area-inset-top)); flex-wrap: nowrap; gap: 8px; padding: env(safe-area-inset-top) 14px 0; }
  /* App 全屏打开（页面铺到状态栏下面）时，App 的头像、关注、分享、关闭按钮浮在页面最上面约 90px 的位置（2026-11-04 用户截图），
     顶栏变成一条空白带让它们落在上面，不盖住页面内容；功能名不放这里（底部标签栏已经标着当前功能）。
     App 自己留了顶栏、页面从状态栏下面开始时不加（index.html 判断后加 bili-overlay） */
  html.bili-overlay #app:not(#_) #topbar { height: max(92px, calc(env(safe-area-inset-top) + 56px)); padding: 0; }
  html.bili-overlay #app:not(#_) #topbar > * { display: none; }
  #app:not(#_) #pin-toggle, #app:not(#_) #opacity-toggle, #app:not(#_) .crumb .sub { display: none; }
  /* 白天/夜晚从「更多」面板挪到页面右上角；App 顶栏被平台按钮占着时仍留在面板里 */
  #app:not(#_) .sidebar-footer .nav-home[data-theme-toggle] { display: none; }
  html.bili-overlay #app:not(#_) .sidebar-footer .nav-home[data-theme-toggle] { display: flex; }
  /* 「更多」打开时顶栏压在遮罩上面，右上角的主题按钮仍然看得到、点得到 */
  #app.more-open:not(#_) #topbar { z-index: 26; }
  /* 手机顶栏：搜索平时收成一个放大镜，点开才铺成输入框（不挤功能名）；16px 字号避免 iPhone 聚焦放大页面 */
  #app:not(#_) .topbar-search { flex: 0 0 36px; width: 36px; min-width: 36px; padding: 0; justify-content: center; overflow: hidden; }
  #app:not(#_) .topbar-search input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
  #app:not(#_) #search { font-size: var(--fs-xl); }
  #app:not(#_) .topbar-search:focus-within { position: absolute; left: 14px; right: 66px; top: 8px; z-index: 30; width: auto; min-width: 0; padding: 0 8px 0 10px; justify-content: flex-start; overflow: visible; background: var(--panel); box-shadow: var(--shadow-2); }
  #app:not(#_) .topbar-search:focus-within + .pin-toggle,
  #app:not(#_) .topbar-search:focus-within + .theme-toggle { margin-left: auto; }
  #app:not(#_) .topbar-search:focus-within input { position: static; width: auto; height: 100%; opacity: 1; flex: 1; cursor: text; }
  #app:not(#_) .topbar-results { left: 10px; right: 10px; width: auto; max-height: min(52dvh, 420px); }
  #app:not(#_) .search-kbd { display: none; }
  #app:not(#_) .crumb { gap: 9px; }
  #app:not(#_) .crumb-title { font-size: var(--fs-lg); flex: 0 1 auto; }
  #app:not(#_) .crumb-icon svg { width: 21px; height: 21px; }
  /* 保险：手机上页面主体不能被横着滑走（哪块内容多出几像素时左边会被切掉一截）；验收脚本照样查 scrollWidth，溢出不会被藏住 */
  #app:not(#_) .view { padding: 12px; min-width: 0; overflow-x: hidden; }
  #local-save-status { bottom: calc(68px + env(safe-area-inset-bottom)); right: 10px; }
  /* 更新提示条在底部标签栏上方，占满宽度，文字太长时按钮换到下一行 */
  body .gt-update-notice { left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); transform: none; max-width: none; flex-wrap: wrap; }
  /* 手机上的紧凑按钮抬到 34（主操作 .btn 本来就是 42）：换一件 / 删除 / 收起这类小按钮也点得中 */
  #app:not(#_) .view .ghost.small, #app:not(#_) .view .btn.small { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; min-width: 30px; padding: 5px 10px; }
}
@keyframes gt-sheet-up { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes gt-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #app.more-open .sidebar-footer, #app.more-open #main::after { animation: none; } }
@keyframes sidebar-tip-in { from { opacity: 0; transform: translateX(-4px); } }

/* ---------------- 专注显示（app/focus.js，页面经 ctx.focus 打开） ----------------
   侧栏（手机上是底部标签栏）、「更多」面板、顶栏（含顶栏搜索）、加载警告和装饰树叶都收起来，页面内容占满窗口；只留右上角的退出按钮。
   #app.is-focus:not(#_) 是为了压过上面手机布局的 #app:not(#_) 各条。 */
#app.is-focus:not(#_) #sidebar, #app.is-focus:not(#_) #topbar, #app.is-focus:not(#_) #warnings,
#app.is-focus:not(#_) .leaf { display: none; }
/* 右上角的小圆按钮（2026-11-16 用户试用后定，收成同样大小的图标按钮，不常驻挡内容）：退出，和它左边的透明度（app/opacity.js，
   只在 exe 置顶时有，点了才在下面展开滑杆）。页面要在右上角放东西时，用 --gt-focus-corner 给它们让位：
   从内容区右边量起要让出的宽度，没有按钮（不在专注显示、页面自己管退出）时是 0。按钮大小改了这里一起改。 */
#app { --gt-focus-btn: 30px; --gt-focus-corner: 0px; }
#app.is-focus:not(.is-bare) { --gt-focus-corner: calc(var(--gt-focus-btn) + 8px); }
#app.is-focus:not(.is-bare):has(#focus-bar .opacity-focus:not([hidden])) { --gt-focus-corner: calc(2 * var(--gt-focus-btn) + 4px + 8px); }
#focus-bar {
  /* top 15px：和页面最上面那一条 36px 高的按钮（内容区上留白 12px）垂直居中，30px 的圆钮上下各让 3px（2026-11-17 用户：两个图标没和翻步那一条对齐） */
  position: fixed; top: calc(15px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); z-index: 45;
  display: flex; align-items: center; gap: 4px;
}
#app:not(.is-focus) #focus-bar { display: none; }
#focus-bar .focus-corner-btn {
  display: grid; place-items: center; width: var(--gt-focus-btn); height: var(--gt-focus-btn); padding: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 90%, transparent); color: var(--accent-strong);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--text) 16%, transparent); opacity: .78; transition: opacity var(--t-fast);
}
#focus-bar .focus-corner-btn:hover, #focus-bar .focus-corner-btn:focus-visible, #focus-bar .focus-corner-btn[aria-expanded="true"] { opacity: 1; }
#focus-bar .focus-corner-btn svg { width: 15px; height: 15px; flex: none; }
#focus-exit[hidden], #focus-bar .opacity-focus[hidden] { display: none; }
#focus-bar .opacity-focus { position: relative; }
/* 展开的滑杆：挂在按钮下面、右边和按钮对齐，盖在页面上面（点别处、切到别的窗口、再点按钮、Esc 收回）。
 * 和按钮隔开 16px（2026-11-17 用户说 6px 贴得太近：专注显示的窄窗口里它正好压在翻步那一条的按钮下沿上）。 */
#focus-bar .opacity-pop {
  position: absolute; top: calc(100% + 16px); right: 0; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text); font-size: var(--fs-sm); white-space: nowrap; box-shadow: 0 8px 22px color-mix(in srgb, var(--text) 18%, transparent);
}
#focus-bar .opacity-pop[hidden] { display: none; }
#focus-bar .opacity-pop input[type="range"] { width: 120px; }
/* 触屏上手指要点得到 */
@media (pointer: coarse) { #app { --gt-focus-btn: 40px; } #focus-bar .focus-corner-btn { opacity: .92; } }
@media (prefers-reduced-motion: reduce) { #focus-bar .focus-corner-btn { transition: none; } }
@media (max-width: 760px) {
  /* App 全屏打开时顶栏是给 App 浮动按钮让的空白带（见上面 bili-overlay），专注时也留着，退出按钮放在它下面 */
  html.bili-overlay #app.is-focus:not(#_) #topbar { display: flex; }
  html.bili-overlay #focus-bar { top: calc(max(92px, calc(env(safe-area-inset-top) + 56px)) + 8px); }
  /* 底部标签栏收起来了，保存提示和更新提示条落回窗口底部 */
  #app.is-focus ~ #local-save-status { bottom: calc(8px + env(safe-area-inset-bottom)); }
  body #app.is-focus ~ .gt-update-notice { bottom: calc(14px + env(safe-area-inset-bottom)); }
}
/* 页面自己管退出的专注显示（ctx.focus.set(true, { bare: true })，2026-11-15 加的，现在没有页面在用，见 EXTENDING.md）：
   右上角「退出专注」和透明度那一条也收起（页面自己放退出和透明度），内容区的留白收窄；「已保存」的小字也不浮在上面（保存出错照样显示）。 */
#app.is-bare:not(#_) #focus-bar { display: none; }
#app.is-bare:not(#_) .view { padding: var(--space-2); }
#app.is-bare ~ #local-save-status:not(.is-error) { display: none; }
@media (prefers-reduced-motion: reduce) {
  #sidebar, #sidebar::before, .brand, .brand-icon, .brand-icon::after, .brand-text > b, .nav-module-title .caret, .nav-items, .nav-module.collapsed .nav-items, .nav-items-inner,
  .nav-feature, .nav-page, .nav-feature .icon, .nav-page .icon, .nav-feature .name, .nav-page .name { transition: none; }
  .nav-feature:active, .nav-page:active, .nav-feature:hover .icon, .nav-page:hover .icon, .nav-feature:hover .name, .nav-page:hover .name,
  .brand:hover .brand-icon, .brand:active .brand-icon { transform: none; }
  .brand-icon::after { display: none; }
  #sidebar-tip { animation: none; }
}

.nav-empty { color: var(--muted); padding: 12px 10px; font-size: var(--fs-sm); }

.sidebar-footer { flex: 0 0 auto; border-top: 1px solid var(--border); margin: 0 -15px; padding: 10px 15px 16px; display: flex; flex-direction: column; gap: 0; }
.sidebar-footer .nav-page { border: 0; height: var(--control-h); }
.sidebar-footer .nav-page[hidden] { display: none; }
@media (min-width: 761px) {
  #app.sidebar-is-collapsed .sidebar-footer { margin: 0 -8px; padding: 8px; }
}
/* 侧栏底部（2026-11-17 重做）：
 * 1. 导出/导入放进一条淡色底槽，选中/悬停时浮起一块白面（阴影），像一个小分段器；
 *    170 窄栏只放得下「导出 / 导入」，1100 以上带「存档」和图标 */
.sidebar-backup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px; margin: 0 12px 12px; padding: 2px; border-radius: var(--r-md); background: color-mix(in srgb, var(--text) 6%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 7%, transparent); }
.sidebar-backup button, .sidebar-backup .file-pick { min-width: 0; }
.sidebar-backup button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: var(--control-h-sm); padding: 0 6px; border: 0; border-radius: calc(var(--r-md) - 2px); background: none; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
/* .ghost.small 自带的 4px 10px 内边距比这条更具体，会把两个按钮挤得不一样宽；这里用更具体一点的选择器压回来 */
.sidebar-backup button.ghost { padding: 0 6px; }
.sidebar-backup button:hover, .sidebar-backup .file-pick:hover button { background: var(--panel); color: var(--accent-strong); box-shadow: var(--shadow-1); }
.sidebar-backup button:active { background: var(--surface-hover); box-shadow: none; }
.sidebar-backup svg { width: 14px; height: 14px; flex: none; opacity: .85; }
/* 以管理员身份运行（app/admin.js，只在 exe 里有，2026-11-17）：存档备份下面一行，左边盾牌、右边一个小开关，aria-pressed 是设置开没开。
 * 行的样子跟下面「关于与链接」一样淡，不抢功能导航；收起的 72px 侧栏里和存档备份一起藏起来。 */
.sidebar-footer .sidebar-admin { display: flex; align-items: center; gap: 7px; width: auto; min-width: 0; margin: 0 8px 4px; padding: 7px 6px; border: 0; border-radius: var(--r-md); background: none; color: var(--muted); font-size: var(--fs-sm); text-align: left; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.sidebar-admin:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-admin .icon { display: grid; place-items: center; flex: none; }
.sidebar-admin .icon svg { width: 14px; height: 14px; }
.sidebar-admin .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-admin-switch { position: relative; flex: none; width: 26px; height: 15px; border-radius: 999px; background: color-mix(in srgb, var(--text) 16%, transparent); transition: background var(--t-fast); }
.sidebar-admin-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow-1); transition: transform var(--t-fast) var(--ease-out); }
.sidebar-admin[aria-pressed="true"] { color: var(--accent-strong); }
.sidebar-admin[aria-pressed="true"] .sidebar-admin-switch { background: var(--accent); }
.sidebar-admin[aria-pressed="true"] .sidebar-admin-switch::after { transform: translateX(11px); }
.sidebar-admin:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (min-width: 761px) {
  #app.sidebar-is-collapsed .sidebar-admin { display: none; }
}
/* 170px 窄侧栏放不下一行八个字：收紧留白，名字折成两行 */
@media (min-width: 761px) and (max-width: 1099px) {
  #app .sidebar-footer .sidebar-admin { margin: 0 4px 4px; padding: 6px 4px; gap: 5px; }
  #app .sidebar-admin .name { white-space: normal; line-height: 1.3; }
  #app .sidebar-admin-switch { width: 22px; height: 13px; }
  #app .sidebar-admin-switch::after { width: 9px; height: 9px; }
  #app .sidebar-admin[aria-pressed="true"] .sidebar-admin-switch::after { transform: translateX(9px); }
}
@media (max-width: 760px) {
  /* 「更多」面板里是一整行，和存档按钮一样按触摸来 */
  #app:not(#_) .sidebar-admin { min-height: 46px; margin: 0 0 6px; padding: 0 14px; gap: 10px; border-radius: var(--r-lg); background: var(--panel-2); color: var(--text); font-size: var(--fs-base); font-weight: 700; }
  #app:not(#_) .sidebar-admin .icon svg { width: 19px; height: 19px; color: var(--accent-strong); }
  #app:not(#_) .sidebar-admin-switch { width: 34px; height: 20px; }
  #app:not(#_) .sidebar-admin-switch::after { width: 16px; height: 16px; }
  #app:not(#_) .sidebar-admin[aria-pressed="true"] .sidebar-admin-switch::after { transform: translateX(14px); }
}
@media (prefers-reduced-motion: reduce) { .sidebar-admin, .sidebar-admin-switch, .sidebar-admin-switch::after { transition: none; } }
/* 2. 链接和名单收进「关于与链接」：默认收起，点开显示仓库链接和贡献名单（以前是五行带虚线底） */
.sidebar-about { margin: 0 8px 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.sidebar-about summary { display: flex; align-items: center; gap: 7px; padding: 7px 6px; border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-sm); cursor: pointer; list-style: none; transition: background var(--t-fast), color var(--t-fast); }
.sidebar-about summary::-webkit-details-marker { display: none; }
.sidebar-about summary:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-about-icon { width: 14px; height: 14px; flex: none; }
.sidebar-about-caret { width: 13px; height: 13px; flex: none; margin-left: auto; transition: transform var(--t-base) var(--ease-out); }
.sidebar-about[open] .sidebar-about-caret { transform: rotate(180deg); }
.sidebar-links { display: grid; gap: var(--space-1); padding: 2px 6px 4px 27px; font-size: var(--fs-sm); line-height: 1.6; animation: sidebar-links-in var(--t-fast) var(--ease-out); }
@keyframes sidebar-links-in { from { opacity: 0; } }
.sidebar-links a { color: var(--muted); text-decoration: none; transition: color var(--t-fast); }
.sidebar-links a:hover { color: var(--accent-strong); }
.sidebar-links .sidebar-link { display: inline-flex; align-items: center; gap: 6px; justify-self: start; }
.sidebar-links .sidebar-link svg { width: 14px; height: 14px; flex: none; }
.sidebar-credits { display: grid; gap: 4px; margin: 0; color: var(--muted); }
.sidebar-credit-label { padding: 0; border-radius: 0; background: none; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--muted); }
.sidebar-credit-names { display: grid; gap: 2px; font-size: var(--fs-sm); line-height: 1.5; }
.sidebar-credit-names a { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 761px) {
  #app.sidebar-is-collapsed .sidebar-about { display: none; }
}
@media (max-width: 760px) {
  /* 「更多」面板里这两块跟着面板的 14px 内边距走，行高按触摸来 */
  #app:not(#_) .sidebar-backup { margin: 0 0 10px; }
  #app:not(#_) .sidebar-about { margin: 0; border-top: 1px solid var(--border); padding-top: 0; }
  #app:not(#_) .sidebar-about summary { min-height: 46px; padding: 0 2px; }
}
.file-pick { position: relative; display: flex; flex: 1; min-width: 0; }
.file-pick > button { flex: 1; width: 100%; }
.file-pick > input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 100px; }
.file-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-md); }

/* ---------------- 主区 ---------------- */

/* overflow: clip：装饰的树叶不能把页面撑宽（手机上会被滚出一截空白）；clip 不是滚动容器，脚本也滚不动它 */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; overflow: clip; }
.leaf { position: absolute; z-index: 0; width: 15px; height: 32px; border-radius: 100% 0 100% 0; background: color-mix(in srgb, var(--accent) 35%, transparent); opacity: .66; transform: rotate(39deg); pointer-events: none; }
.leaf.a { left: 493px; top: 38px; }
.leaf.b { right: 85px; top: 77px; width: 10px; height: 22px; opacity: .4; }
.leaf.c { right: 20px; bottom: 23px; }

#topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
  flex: 0 0 auto;
}
.theme-toggle, .pin-toggle { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; margin-left: auto; padding: 0; border-radius: var(--r-md); color: var(--accent-strong); }
/* 顶栏 64 高：两个角按钮保持 36×36，不再被 .ghost.small 的 28 高拉扁。 */
#theme-toggle, #pin-toggle { width: 36px; height: 36px; }
.theme-toggle svg, .pin-toggle svg { width: 20px; height: 20px; }
/* 置顶（app/pin.js，只在 exe 里有）排在夜晚模式左边，两个一起靠右 */
.pin-toggle + .theme-toggle { margin-left: 0; }
.pin-toggle[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); color: var(--accent-strong); }
.pin-sheet-toggle[aria-pressed="true"] .icon svg { stroke-width: 2.4; }
/* 窗口透明度（app/opacity.js，只在 exe 里、置顶开着时有）：顶栏在置顶按钮右边；手机布局在「更多」面板置顶那一行下面；专注显示时在退出按钮左边 */
.opacity-ctl { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--accent-strong); cursor: pointer; }
.opacity-ctl[hidden] { display: none; }
.opacity-ctl .icon { display: grid; place-items: center; flex: none; }
.opacity-ctl svg { width: 18px; height: 18px; }
.opacity-ctl input[type="range"] { width: 92px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.opacity-ctl .opacity-value { min-width: 3.2em; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--muted); }
.opacity-top { height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; }
.opacity-top + .theme-toggle { margin-left: 0; }
.opacity-sheet { height: 48px; padding: 0 14px; gap: 12px; border-radius: 12px; background: var(--panel-2); color: var(--text); font-size: var(--fs-lg); font-weight: 700; }
.opacity-sheet .icon svg { width: 19px; height: 19px; color: var(--accent-strong); }
.opacity-sheet .name { flex: none; }
.opacity-sheet input[type="range"] { flex: 1; width: auto; min-width: 0; }
/* 电脑布局用顶栏那个，侧栏底部不放（收起的侧栏也放不下滑杆） */
@media (min-width: 761px) { .opacity-sheet:not([hidden]) { display: none; } }
/* 白天显示月亮（点了变夜晚），夜晚显示太阳 */
.theme-sun, html.night .theme-moon { display: none; }
html.night .theme-sun { display: block; }
/* 切主题：从点下去的地方画个圆把新主题揭开（app/theme.js，2026-11-16）。
 * 新旧两套都是整页快照，只让上面那层（新页面）跟着圆形裁切，所以字、图标、布局全程不变形。
 * 这里把默认的整页淡入关掉，圆形由页面里的动画来画。 */
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
/* 不缩放、不挪位：两层快照一样大，group 那层默认的形变动画关掉 */
::view-transition-group(root) { animation: none; }
.crumb { display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; overflow: hidden; min-width: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.crumb-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-strong); }
.crumb-icon svg { width: 16px; height: 16px; }
.crumb-module { color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.crumb-sep { color: var(--muted); flex: none; }
.crumb-title { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-snug); overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto; }
/* 顶栏搜索（2026-11-18 晚）：输入框直接放在顶栏，和主题按钮一排；结果从顶栏下面展开。
   360 宽也放得下：输入框可以缩，Ctrl K 提示在手机隐藏。 */
.topbar-search { position: relative; display: flex; align-items: center; gap: 6px; flex: 0 1 280px; min-width: 120px; height: 36px; margin-left: auto; padding: 0 8px 0 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); color: var(--muted); transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.topbar-search:focus-within { border-color: var(--accent); background: var(--panel); box-shadow: var(--focus); }
.topbar-search-icon { width: 16px; height: 16px; flex: none; pointer-events: none; }
#search { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); outline: none; }
#search::placeholder { color: var(--placeholder); }
.topbar-search + .pin-toggle, .topbar-search + .theme-toggle { margin-left: 0; }
#app.more-open .topbar-search, #app:has(.rs-modal, .gp-modal) .topbar-search { visibility: hidden; pointer-events: none; }
.mascot-results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.mascot-results[hidden] { display: none; }
.topbar-results { position: fixed; z-index: 60; width: 320px; max-height: min(60vh, 420px); padding: 8px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-float); box-shadow: var(--shadow-3); animation: gt-search-in 160ms var(--ease-out); }
@keyframes gt-search-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .topbar-results { animation: none; } }
.mascot-hit { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: var(--r-md); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mascot-hit:hover, .mascot-hit.is-active { background: var(--accent-soft); }
.mascot-hit .icon { flex: 0 0 22px; display: grid; place-items: center; color: var(--accent); }
.mascot-hit .icon svg { width: 20px; height: 20px; }
.mascot-hit .text { min-width: 0; }
.mascot-hit b { display: block; font-size: var(--fs-base); line-height: 1.3; }
.mascot-hit small { display: block; overflow: hidden; color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.mascot-empty { padding: 10px 8px; color: var(--muted); font-size: var(--fs-md); }
.search-kbd {
  flex: none;
  font: 11px var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px 6px; line-height: 1;
  pointer-events: none;
}

#warnings { padding: 0 var(--view-pad); }
.warnbar {
  margin-top: var(--space-2);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  color: var(--warn);
  border-radius: var(--radius);
  padding: var(--space-2) 12px;
  font-size: var(--fs-sm);
}
.warnbar button { margin-left: var(--space-2); }

.view { flex: 1; overflow-y: auto; padding: var(--space-4) var(--view-pad) var(--view-pad); min-height: 0; position: relative; z-index: 1; }
/* 文档型页面在宽屏上不拉满整屏（2026-11-16，最多 1180）：一行太长、扫读距离太远。
 * 行动轴、自动排轴、战斗模拟要看整条时间轴，不在这条里，照旧占满。 */
/* 页面宽度（2026-11-16 第二轮）：所有页面同一个基准宽，居中，左右留白相等。
 * 换到别的页面时左边缘不动，不会出现「这边空一截、那边贴边」。 */
.gt-feature-root > * { width: 100%; max-width: var(--w-page); margin-inline: auto; }
.gt-feature-root.is-loading { visibility: hidden; }
/* 页面自己管高度（2026-11-15，自动排轴的成品轴先用，见 EXTENDING.md）：页面的根元素带 gt-fill 时，功能页正好拿到 .view 剩下的高度
   （顶栏、手机底部标签栏、专注显示、App 顶部空白带都已经在 .view 外面算掉了），由页面决定哪块在自己里面滚；给绯英留的底部空白不要。
   内容实在放不下（窗口太矮）时 .view 照旧整页滚。不带 gt-fill 的页面不受影响。 */
.view:has(> .gt-feature-root > .gt-fill) { display: flex; flex-direction: column; }
#app:not(#_) .view:has(> .gt-feature-root > .gt-fill)::after { display: none; }
.gt-feature-root:has(> .gt-fill) { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.gt-feature-root > .gt-fill { flex: 1 1 auto; min-height: 0; }
#boot-skeleton { display: none; }
/* exe 后台更新的提示条：桌面上放底部居中，避开右下角的吉祥物和保存状态 */
.gt-update-notice { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 37; display: flex; align-items: center; gap: var(--space-2); max-width: min(92vw, 480px); padding: var(--space-2) var(--space-4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); color: var(--text); box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 18%, transparent); font-size: var(--fs-md); }
.gt-update-notice-text { flex: 1; min-width: 0; line-height: 1.5; }
.gt-update-notice .btn { flex: none; height: 30px; padding: 0 12px; font-size: var(--fs-sm); }
.gt-update-notice .ghost { flex: none; }
/* 下载中：主句和「知道了」一行，下面一行小字（从哪下、下了多少），再下面是进度条（2026-11-14 用户要求，照 MAA 的小进度条） */
.gt-update-notice { flex-wrap: wrap; }
.gt-update-notice-detail { flex-basis: 100%; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.gt-update-progress { flex-basis: 100%; height: 8px; border-radius: var(--radius); background: var(--accent-soft); overflow: hidden; }
.gt-update-progress > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--t-enter) ease-out; }
@media (prefers-reduced-motion: reduce) { .gt-update-progress > span { transition: none; } }
.boot-pending #boot-skeleton { display: grid; }
.boot-pending .welcome { visibility: hidden; }
.gt-nav-loading { padding: 20px 12px; }
.gt-nav-loading i { display: block; height: 28px; width: 80%; margin-bottom: 16px; border-radius: var(--r-sm); background: var(--panel-2); }
.gt-nav-loading i:first-child { width: 55%; height: 18px; }
.gt-skeleton { position: absolute; inset: 18px 20px auto 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; pointer-events: none; }
.gt-skeleton-card { min-height: 390px; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); }
.gt-skeleton-card i { display: block; height: 34px; margin: 0 0 20px; border-radius: var(--r-md); background: linear-gradient(90deg, var(--panel-2), var(--surface-float), var(--panel-2)); background-size: 200% 100%; animation: gt-skeleton-shimmer 1.4s ease-in-out infinite; }
.gt-skeleton-card i:first-child { width: 40%; height: 24px; margin-bottom: 32px; }
.gt-skeleton-card i:nth-child(3) { width: 78%; }
@keyframes gt-skeleton-shimmer { to { background-position: -200% 0; } }
@media (max-width: 700px) { .gt-skeleton { grid-template-columns: 1fr; inset: 12px; } .gt-skeleton-card + .gt-skeleton-card { display: none; } }
@media (prefers-reduced-motion: reduce) { .gt-skeleton-card i { animation: none; } }

/* ---------------- 通用组件（功能界面直接用这些类名） ---------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--card-pad);
  margin-bottom: var(--gap-card);
}
.card h1 { font-size: var(--fs-3xl); margin: 0 0 var(--space-2); }
.card h2 { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin: 0 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.card h3 { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin: var(--space-6) 0 var(--space-3); color: var(--text); }

/* 页面标题（无卡片），设计稿里放在第一张卡片上方 */
.page-head { margin: var(--space-1) 0 var(--space-5); }
.page-head h1 { margin: 0 0 var(--space-1); font-size: var(--fs-3xl); font-weight: var(--fw-heavy); }
.page-head p { margin: 0; color: var(--muted); font-size: var(--fs-md); }
.card.error { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }

.muted { color: var(--muted); }
.small, small { font-size: var(--fs-sm); }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

/* 欢迎页（2026-11-18 起不用大插画）：底色就是工具箱自己的浅粉底，几团主题色光晕 + 一片淡淡的点阵，
 * 全是 CSS 画的，多大的屏都清楚；颜色全走主题变量，夜晚跟着变。绯英只在右下角当搜索吉祥物。 */
.welcome {
  min-height: calc(100% + var(--space-4) + var(--view-pad));
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--view-pad)) calc(-1 * var(--view-pad));
  padding: clamp(40px, 8vh, 72px) 40px 40px 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 80% 50%, color-mix(in srgb, var(--accent) 13%, transparent) 0, transparent 34%),
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 9%, transparent) 0, transparent 40%),
    radial-gradient(circle at 0 100%, color-mix(in srgb, var(--accent-2) 8%, transparent) 0, transparent 42%);
}
/* 点阵：越往左越淡，不压文字 */
.welcome::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 24%, transparent) 1px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to left, black 0, transparent 62%);
  mask-image: linear-gradient(to left, black 0, transparent 62%);
}
/* 首页内容块（2026-11-16 第二轮）：左边一列，最多 720；右边留给绯英 */
.home-inner { width: min(100%, 720px); display: flex; flex-direction: column; align-items: flex-start; position: relative; z-index: 1; }
.home-status { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 var(--space-3); padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line-soft)); border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-label); }
.home-status-dot { width: 5px; height: 5px; flex: none; border-radius: 50%; background: var(--accent); }
/* 品牌字（2026-11-18，参考莫娜欢迎页的大字店名）：「绯绯狐工具箱」双色字标——「绯绯狐」玫瑰色、「工具箱」正文深色，
 * 右上角一枚「绯」字朱印。不用渐变字（第一版渐变到橙金，「箱」发土）。颜色都走主题变量，夜晚跟着变。 */
.welcome {
  /* 首页天空（app/welcome-sky.js 的 canvas）读这些颜色；夜里在 night.css 换一套。
   * 2026-11-18 晚去掉幻月、樱花枝和刀光后只剩花瓣和尺刀，颜色也跟着减到这两样。 */
  --sky-petal: #f4a7c3;
  --sky-blade: #d5336c;
  --sky-ribbon: #e0457d;
  --sky-ribbon-2: #f3a5c2;
  --sky-shine: #ffffff;
  --sky-metal: #cfc6d6;
  position: relative;
  overflow: clip;
}
.home-brand { position: relative; display: flex; align-items: flex-start; gap: var(--space-2); }
.welcome h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STZhongsong", "STSong", "SimSun", serif;
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: var(--fw-heavy);
  line-height: 1.12;
  letter-spacing: 2px;
  white-space: nowrap;
  color: var(--text);
}
.home-name-mark { color: var(--accent); }

/* 狐狸面具（2026-11-18）：用侧角色块版，钉在「箱」字右上角，短绳垂下来 */
.home-title-tail { position: relative; display: inline-block; }

.home-mask {
  position: absolute;
  left: calc(100% - .16em);
  top: -.12em;
  z-index: 2;
  width: .58em;
  transform: rotate(8deg);
  transform-origin: 12% 5%;
  pointer-events: none;
  filter: drop-shadow(0 .05em .07em color-mix(in srgb, var(--text) 40%, transparent));
}
.home-mask img { display: block; width: 100%; height: auto; }
.home-title-today { margin-right: var(--space-2); color: var(--accent-strong); }
/* 「今天先做哪一步？」从大标题退成四张卡上面的小标题 */
.home-ask { margin: 0 0 var(--space-3); color: var(--text); font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.3; }
/* 分隔线：绯英的尺刀加两股丝带（2026-11-18，canvas，由 app/welcome-sky.js 画；第一版的刻度尺加实心蝴蝶结太像剪贴画，这版改成细长刀尺 + 随风飘的丝带）。
 * 尺寸固定 260×44，左边往左挪 2px 让刀柄和标题左边对齐。 */
.home-blade { display: block; width: 260px; max-width: 100%; height: auto; aspect-ratio: 260 / 44; margin: var(--space-6) 0 var(--space-6) -2px; }
/* 天空 canvas：铺满欢迎页，压在内容下面，不接鼠标（只画飘落的花瓣） */
.home-sky { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
/* 大屏（2026-11-18）：内容整块放到正中，上下左右都居中，不再缩在左上角、右边空一大片；
 * 光晕和点阵也跟着改成围着内容、四周对称（点阵中间淡、四周浓，不压字）。 */
@media (min-width: 1200px) and (min-height: 720px) {
  .welcome { justify-content: center; align-items: center; padding: var(--space-10) var(--space-12) var(--space-12); }
  .welcome {
    background-image:
      radial-gradient(ellipse 60% 55% at 50% 45%, color-mix(in srgb, var(--accent) 9%, transparent) 0, transparent 70%),
      radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 9%, transparent) 0, transparent 36%),
      radial-gradient(circle at 0 100%, color-mix(in srgb, var(--accent-2) 8%, transparent) 0, transparent 38%);
  }
  .welcome::before {
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, transparent 38%, black 100%);
    mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, transparent 38%, black 100%);
  }
  .home-inner { width: min(100%, 760px); }
  .home-tools, .home-meta { max-width: none; }
}
/* 三组之间拉开（2026-11-18，外层间距大于内层）：品牌（胶囊、字标、说明）→ 尺刀 → 任务（小标题、四张卡、两个按钮）→ 页脚 */

.row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: flex-end; }
.row.tight { gap: var(--space-1) var(--space-2); }
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.field > label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--muted); }
.field.check { flex-direction: row; align-items: center; gap: var(--space-2); }

.input, select.input {
  height: var(--control-h);
  background-color: var(--field-bg);
  border: 1px solid var(--control-border);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 0 var(--space-3);
  min-width: 90px;
  outline: none;
  font: inherit;
  font-size: var(--fs-base);
}
/* 下拉右边留出箭头的位置（上面的 padding 简写会把 select 通用规则里的 padding-right 盖掉，长名字会压到箭头）。 */
select.input:not([multiple]) { padding-right: 30px; }
.input::placeholder { color: var(--placeholder); }
textarea.input { height: auto; padding: var(--space-2) var(--space-3); }
.input:hover { border-color: var(--field-hover); }
select.is-open { border-color: var(--accent) !important; background-color: var(--surface-hover) !important; }
.input.wide { min-width: 190px; }
.input.narrow { min-width: 72px; width: 96px; }
.input.tiny { min-width: 56px; width: 72px; }

/* 通用组件：带图、可搜索的下拉（ui-shared/src/components/IconPicker.vue），各页面共用。按钮再套页面自己的输入框样式（buttonClass）。 */
.picker-button { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 4px 30px 4px 10px; text-align: left; font: inherit; font-size: var(--fs-base); cursor: pointer; }
/* 图是共享的 Avatar（.avatar）：坏图显示首字，选项没有图时写「—」。 */
.picker-button .picker-img, .picker-item .picker-img { --avatar-size: 31px; border-radius: var(--r-sm); background: transparent; font-weight: 400; }
.picker-button .pb-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-button .pb-caret { position: absolute; right: 12px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; font-size: 0; background: no-repeat center / 13px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 9 7 7 7-7' fill='none' stroke='%2375616f' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E"); }

.picker-popup {
  position: fixed; z-index: 50; padding: var(--space-3);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  animation: picker-pop var(--t-fast) ease-out;
}
.picker-popup.hidden { display: none; }
.picker-search { width: 100%; height: 36px; margin-bottom: var(--space-2); padding: 0 var(--space-3); border: 1px solid var(--control-border); border-radius: var(--r-sm); background: var(--field-bg); outline: none; font: inherit; font-size: var(--fs-md); }
.picker-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.picker-item {
  display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: var(--r-sm); border: 0;
  background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); cursor: pointer; text-align: left; min-width: 0;
}
.picker-item:hover { background: var(--surface-hover); }
.picker-item.active { background: var(--accent-soft); color: var(--accent-strong); }
.picker-item .pi-name { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 64px; }
.picker-item .pi-meta { flex: 1 1 auto; color: var(--muted); font-size: var(--fs-xs); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@keyframes picker-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .picker-popup { animation: none; } }
@media (pointer: coarse) {
  .picker-item { padding: 10px 8px; }
}

/* 带图的网格选择（ui-shared/src/components/GridPicker*.vue）：选角色、选光锥。行动轴、配速查询、角色与遗器、编队共用。 */
.gp-modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: var(--overlay); }
.gp-modal-box { display: grid; gap: 12px; align-content: start; width: min(820px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-3); }
/* 页面里的弹窗（2026-11-16）：遮罩淡进来，盒子轻轻弹一下，和外壳对话框（.gt-dialog）一个手感。
 * 以前是直接出现；盒子只有这一下 transform，播完就撤，不留定位影响。 */
.rs-modal, .gp-modal { animation: gt-modal-fade 160ms var(--ease-out); }
.rs-modal-box, .gp-modal-box { animation: gt-modal-pop 220ms var(--ease-spring); }
@keyframes gt-modal-fade { from { opacity: 0; } }
@keyframes gt-modal-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@media (prefers-reduced-motion: reduce) {
  .rs-modal, .gp-modal, .rs-modal-box, .gp-modal-box { animation: none; }
}
.gp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.gp-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.gp-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.gp { display: grid; gap: 12px; align-content: start; min-width: 0; }
.gp-tools { display: grid; gap: 10px; }
.gp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gp-chips.dim { opacity: 0.5; }
/* 筛选 / 选择用的 chip（2026-11-16 第四轮）：选择器、顶分、行动轴共用一套几何和状态。
 * 静止：透明底 + 细边；悬停：边变粉、字变深；选中：淡粉底 + 粉边 + 深粉字。
 * .chip 是这一组不带页面前缀的通用名（2026-11-17），新写的胶囊用它，选中加 .is-on。 */
.chip, .gp-chip, .hr-cat, .axis-chip { padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--r-full); background: none; color: var(--muted); font: inherit; font-size: var(--fs-md); font-weight: 500; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.chip:hover, .gp-chip:hover, .hr-cat:hover, .axis-chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--text); }
.chip.is-on, .gp-chip.on, .hr-cat.is-active, .axis-chip.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.chip:focus-visible, .gp-chip:focus-visible, .hr-cat:focus-visible, .axis-chip:focus-visible { outline: none; box-shadow: var(--focus); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.gp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
/* 换分类（2026-11-16）：格子整体淡进来。按分类重新挂载（GridPickerBody 的 :key），打字搜索不重播。 */
.gp-grid { animation: gp-grid-in 160ms var(--ease-out) backwards; }
@keyframes gp-grid-in { from { opacity: 0; } }
.gp-item { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 8px 6px; border: 1px solid transparent; border-radius: var(--r-lg); background: none; color: var(--text); font: inherit; cursor: pointer; }
.gp-item:hover:not(:disabled) { background: var(--panel-2); }
.gp-item.current { border-color: var(--accent); background: var(--accent-soft); }
.gp-item.selected { background: var(--accent-soft); }
.gp-item.selected .gp-pic { box-shadow: 0 0 0 2px var(--accent); }
.gp-check { position: absolute; top: 5px; left: 5px; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: color-mix(in srgb, var(--panel) 82%, transparent); }
.gp-check.on { border-color: var(--accent-fill); background: var(--accent-fill); color: var(--on-accent-fill); }
.gp-check.on::after { content: "✓"; font-size: var(--fs-xs); font-weight: 700; line-height: 1; }
.ghost.gp-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 32%, var(--border)); }
.ghost.gp-danger:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.ghost.gp-danger:disabled { opacity: .45; cursor: default; }
.gp-item:disabled { opacity: 0.45; cursor: default; }
.gp-pic { position: relative; display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--r-lg); background: var(--panel-2); }
.gp-item.r5 .gp-pic { background: linear-gradient(160deg, #f7e2b3, #fbf1dc); }
.gp-item.r4 .gp-pic { background: linear-gradient(160deg, #e3d2f5, #f3ebfb); }
.gp-item.pinned .gp-pic { border: 1px dashed var(--border); background: none; }
/* 格子里的图是共享的 Avatar：铺满整格、透明底（稀有度底色在 .gp-pic 上），坏图显示首字。 */
.gp-pic .gp-avatar { --avatar-size: 100%; border-radius: inherit; background: none; font-size: var(--fs-3xl); font-weight: 400; }
.gp-noicon { color: var(--muted); font-size: var(--fs-3xl); }
.gp-badge { position: absolute; top: -6px; right: -8px; padding: 0 6px; border-radius: var(--r-sm); background: var(--panel); color: var(--muted); box-shadow: 0 0 0 1px var(--border); font-style: normal; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.gp-badge.hot { background: var(--accent-fill); color: var(--on-accent-fill); box-shadow: none; }
.gp-badge.warn { background: color-mix(in srgb, var(--warn) 12%, var(--panel)); color: var(--warn); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.gp-name { font-size: var(--fs-md); line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.gp-meta { color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; text-align: center; }
@media (max-width: 760px) {
  .gp-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .gp-pic { width: 60px; height: 60px; }
  /* 底部标签栏在弹窗上面，弹窗让出标签栏的高度，和「更多」面板一样 */
  .gp-modal { bottom: calc(68px + env(safe-area-inset-bottom)); padding: 0; align-items: end; }
  .gp-modal-box { max-height: calc(100% - 24px); border-radius: 14px 14px 0 0; }
}

/* 换一件遗器的弹窗（ui-shared/src/hsr/relics/RelicSwapDialog.vue）：外壳是上面的 .gp-modal，盒子加宽；
 * 遗器库撑满盒子，只让图标网格自己滚，底部工具条不再吸底（以前「角色」页和行动轴各写一份这几条）。 */
.rl-swap-box { display: flex; flex-direction: column; gap: 0; width: min(1080px, 100%); overflow: hidden; padding: 16px 20px 20px; }
.rl-swap-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.rl-swap-head h3 { margin: 0; font-size: var(--fs-lg); }
.rl-swap-box > p { margin: 0 0 var(--space-2); }
.rl-swap-box > .rl-library { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.rl-swap-box .rl-lib-main { flex: 1 1 auto; min-height: 0; align-items: stretch; }
.rl-swap-box .rl-lib-left { min-height: 0; overflow: clip; }
.rl-swap-box .rl-icon-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.rl-swap-box .rl-lib-tools { position: static; flex: none; }
@media (max-width: 760px) { .rl-swap-box { padding: 12px; } }

input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* 开关（ui-shared/src/components/ToggleSwitch.vue，配速查询的效果勾选也用 .switch）：原生 checkbox 画成开关，行动轴和配速查询共用。 */
.switch-field { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-md); color: var(--text); cursor: pointer; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 36px; height: 20px; margin: 0; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--muted) 38%, transparent) radial-gradient(circle at center, var(--on-accent-fill) 0 7px, transparent 7.5px) 0 0 / 20px 20px no-repeat; cursor: pointer; transition: background-color var(--t-fast), background-position var(--t-slow) cubic-bezier(.34, 1.56, .64, 1); }
input.switch:checked { background: var(--accent) radial-gradient(circle at center, var(--on-accent-fill) 0 7px, transparent 7.5px) 16px 0 / 20px 20px no-repeat; }
input.switch:focus-visible { outline: none; box-shadow: var(--focus); }
@media (prefers-reduced-motion: reduce) { input.switch { transition: none; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: var(--control-h);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--accent-fill);
  color: var(--on-accent-fill);
  font: inherit;
  font-weight: var(--fw-bold);
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), filter var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-fill) 28%, transparent); }
.btn:active:not(:disabled) { filter: brightness(.96); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-fill) 24%, transparent); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; filter: none; }
.btn.secondary { background: var(--accent-soft); color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); box-shadow: none; }
.btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); border-color: var(--accent); box-shadow: none; filter: none; }
.btn.secondary:active:not(:disabled) { background: color-mix(in srgb, var(--accent) 26%, var(--panel)); box-shadow: none; }
.btn.danger { background: var(--bad); color: var(--on-bad); box-shadow: 0 4px 12px color-mix(in srgb, var(--bad) 22%, transparent); }
.btn.danger:hover:not(:disabled) { box-shadow: 0 6px 18px color-mix(in srgb, var(--bad) 28%, transparent); }
.btn.secondary:focus-visible, .btn.danger:focus-visible { box-shadow: var(--focus); }
/* 小号：和 .ghost.small 一样高，放在同一行能对齐（2026-11-17 收掉行动轴、角色页各写的一份）。 */
.btn.small { height: var(--control-h-xs); padding: 0 var(--space-3); font-size: var(--fs-sm); white-space: nowrap; }
/* 胶囊（.capsule，不叫 .pill：外壳的 .pill 是静态小标签）：圆头、矮一点、字小一点，给工具条和卡片头上的动作用；再加 .small 是最矮的那档。 */
.btn.capsule { height: var(--control-h-sm); padding: 0 14px; border-radius: var(--r-full); font-size: var(--fs-sm); }
.btn.capsule.small { height: var(--control-h-xs); padding: 0 var(--space-3); }

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: var(--control-h-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--r-md);
  padding: 0 var(--space-3);
  cursor: pointer;
  text-align: center;
  font: inherit;
  font-size: var(--fs-md);
  line-height: 1.2;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ghost:active:not(:disabled) { background: var(--surface-hover); }
.ghost:focus-visible { outline: none; box-shadow: var(--focus); }
.ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost.small { height: var(--control-h-xs); padding: 0 10px; font-size: var(--fs-sm); }

/* 关闭「×」按钮（2026-11-17 把 7 套写法并成这一份）：圆形、透明底，悬停浅粉。
   大小用 --close-size 调（默认 28px），手机上用 --close-size-touch（默认 40px，手指点得准）；
   .lg 是大号的 ×，.framed 加一圈边框和卡片底，给叠在别的内容上的浮窗用。 */
.close-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--close-size, 28px);
  height: var(--close-size, 28px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.close-btn.lg { font-size: var(--fs-3xl); }
.close-btn.framed { border: 1px solid var(--border); background: var(--panel); }
.close-btn:hover, .close-btn:focus-visible { background: var(--accent-soft); color: var(--accent-strong); }
.close-btn.framed:hover, .close-btn.framed:focus-visible { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.close-btn:focus-visible { outline: none; box-shadow: var(--focus); }
@media (max-width: 760px) {
  .close-btn { width: var(--close-size-touch, 40px); height: var(--close-size-touch, 40px); }
}

/* 头像（ui-shared/src/components/Avatar.vue）：没图或坏图显示首字。大小用 --avatar-size，首字跟着大小缩放。 */
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--avatar-size, 32px); height: var(--avatar-size, 32px); overflow: hidden; border-radius: 26%; background: var(--panel-2); color: var(--muted); font-size: calc(var(--avatar-size, 32px) * .45); font-weight: 700; line-height: 1; }
.avatar.is-circle { border-radius: 50%; }
.avatar.is-square { border-radius: var(--r-md); }
.avatar-img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity var(--t-enter) ease; }
.avatar.is-contain .avatar-img { object-fit: contain; }
.avatar.is-crop .avatar-img { transform: scale(1.3); transform-origin: 0 0; }
.avatar-img:not(.is-loaded) { opacity: 0; }
.avatar:has(> .avatar-img:not(.is-loaded)) { background: linear-gradient(90deg, var(--panel-2), var(--surface-float), var(--panel-2)); background-size: 200% 100%; animation: gt-skeleton-shimmer 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .avatar { animation: none !important; } .avatar-img { transition: none; } }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--bad);
  color: var(--on-bad);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1;
  text-align: center;
}

.output {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin: 10px 0 0;
  overflow: auto;
  max-height: 340px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
}

.table-wrap { overflow-x: auto; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-md); line-height: var(--lh-dense); }
table.data th, table.data td { border-bottom: 1px solid var(--line-soft); padding: var(--space-2) var(--space-3); text-align: left; }
table.data th { color: var(--muted); font-weight: var(--fw-semibold); font-size: var(--fs-sm); white-space: nowrap; }
table.data tbody tr:hover { background: var(--surface-hover); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.highlight td { color: var(--accent-strong); font-weight: var(--fw-semibold); }

/* 统计格：设计稿里连成一条，用细线分隔，强调项只换底色 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.stat { background: transparent; border: 0; border-right: 1px solid var(--line-soft); border-radius: 0; padding: var(--space-4); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .k { color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.stat .v { font-size: var(--fs-4xl); font-weight: var(--fw-bold); line-height: var(--lh-number); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .v.small { font-size: var(--fs-2xl); }
.stat.accent { background: var(--surface-active); }
.stat.accent .v { color: var(--text); }

.tabs { display: flex; gap: var(--space-1); margin-bottom: var(--space-3); flex-wrap: wrap; border-bottom: 1px solid var(--line-soft); }
.tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: var(--space-2) var(--space-3);
  margin-bottom: -1px;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: var(--fw-semibold); }
/* 下划线是一块滑动的墨条（ui-shared 的 TabSwitch，2026-11-16）：切换时从左滑到右，不再瞬间跳 */
.tab-switch { position: relative; }
.tab-switch .tab.active { border-bottom-color: transparent; }
.tab-ink {
  position: absolute;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: left var(--t-base) var(--ease-out), width var(--t-base) var(--ease-out);
}
.tab-ink.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tab-ink { transition: none; } }

.pill { display: inline-block; padding: 1px var(--space-2); border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: var(--fs-xs); margin-right: 4px; white-space: nowrap; }
.hint { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--space-2); }
/* 小提示（ui-shared/src/components/InfoTip.vue）：「?」小圆钮，点一下在下面展开说明，不靠悬停 */
.info-tip { display: inline; }
.info-tip-btn { display: inline-grid; place-items: center; width: 18px; height: 18px; margin: 0 2px; padding: 0; vertical-align: 1px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 50%; background: var(--panel); color: var(--accent-strong); font: inherit; font-size: var(--fs-xs); font-weight: 700; line-height: 1; cursor: pointer; }
.info-tip-btn:hover, .info-tip.is-open .info-tip-btn { border-color: var(--accent); background: var(--accent-soft); }
.info-tip-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.info-tip-text { display: block; margin: 4px 0 2px; padding: 6px 8px; border-radius: var(--r-md); background: var(--panel-2); color: var(--text); font-size: var(--fs-sm); font-weight: 400; line-height: 1.5; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.formula { font-family: var(--mono); color: var(--accent); font-size: var(--fs-sm); overflow-wrap: anywhere; }

.loading { color: var(--muted); padding: var(--space-6); }
.error-text { color: var(--bad); }
.field-error { margin: var(--space-1) 0 0; color: var(--bad); font-size: var(--fs-sm); }
.input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 18%, transparent); }
.input[aria-invalid="true"]:focus { border-color: var(--bad); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--bad); }

code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
}


/* 首页常用功能（2026-11-16 第二轮）：四个入口排成卡片，图标 + 名字 + 一句做什么；
 * 上次打开的挂「上次」。颜色走主题变量，夜晚换成深色底也看得清。 */
.home-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); width: 100%; max-width: 640px; margin: 0 0 var(--space-5); }
.home-tools:empty { display: none; }
.home-tool {
  display: flex; align-items: center; gap: var(--space-3); min-width: 0; padding: var(--space-4);
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  background: var(--panel);
  color: var(--text); text-decoration: none;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.home-tool:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--panel); }
.home-tool:focus-visible { outline: none; box-shadow: var(--focus); }
.home-tool.is-primary { border-color: color-mix(in srgb, var(--accent) 28%, var(--line-soft)); background: var(--accent-soft); }
.home-tool.is-primary .home-tool-icon { width: 40px; height: 40px; background: var(--panel); }
.home-tool-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-strong); }
.home-tool-icon svg { width: 20px; height: 20px; }
.home-tool-icon img { width: 28px; height: 28px; border-radius: 50%; }
.home-tool-text { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.home-tool b { font-size: var(--fs-lg); font-weight: var(--fw-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-tool small { color: var(--muted); font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-tool-tail { display: flex; align-items: center; gap: var(--space-2); flex: none; margin-left: auto; }
.home-tool-go { width: 16px; height: 16px; flex: none; color: var(--muted); opacity: .42; transition: transform var(--t-fast) var(--ease-out), color var(--t-fast), opacity var(--t-fast); }
.home-tool:hover .home-tool-go { color: var(--accent-strong); opacity: 1; transform: translateX(2px); }
.home-tool.is-primary .home-tool-go { color: var(--accent-strong); opacity: .8; }
.home-tool em { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--accent-fill); color: var(--on-accent-fill); font-size: var(--fs-xs); font-style: normal; font-weight: var(--fw-semibold); }
/* 更新内容、放到桌面：两枚描边胶囊，和下面的链接区分开 */
.home-quick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-8); }
.home-quick-btn { display: inline-flex; align-items: center; gap: var(--space-1); height: var(--control-h-sm); padding: 0 var(--space-3); border: 1px solid var(--line-soft); border-radius: var(--r-full); background: var(--panel); color: var(--muted); font: inherit; font-size: var(--fs-md); font-weight: var(--fw-semibold); cursor: pointer; transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast); }
.home-quick-btn:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.home-quick-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.home-quick-btn svg { width: 14px; height: 14px; color: var(--accent); }
/* 页脚：左边一列小标签，右边是链接；不再重复「主页：」和单独一行代码贡献 */
.home-meta { display: grid; gap: var(--space-2); width: 100%; max-width: 640px; margin: 0; padding-top: var(--space-4); border-top: 1px solid var(--line-soft); }
.home-meta-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: var(--space-3); }
.home-meta dt { color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-normal); }
.home-meta dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-md); }
/* 链接做成胶囊（2026-11-18，参考莫娜欢迎页）：悬停时整枚填成主题色 */
.home-meta a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--space-3); border-radius: var(--r-full); background: color-mix(in srgb, var(--panel) 72%, transparent); box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--text); text-decoration: none; transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out); }
.home-meta a:hover { background: var(--accent-fill); box-shadow: none; color: var(--on-accent-fill); }
.home-meta a:hover svg { color: inherit; }
.home-meta a:active { transform: scale(.97); }
.home-meta a:focus-visible { outline: none; box-shadow: var(--focus); }
.home-meta svg { width: 14px; height: 14px; flex: none; color: var(--accent); transition: color var(--t-fast); }
.home-meta-sep { display: none; }
@media (max-width: 560px) {
  /* 手机：2×2 竖卡（图标在上、名字在下），说明收起来，给下面的链接留地方 */
  .home-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .home-tool { position: relative; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 96px; padding: 12px; }
  .home-tool small { display: none; }
  .home-tool-tail { position: absolute; top: 8px; right: 8px; margin: 0; }
  .home-tool-go { display: none; }
  .home-tool.is-primary .home-tool-icon { width: 36px; height: 36px; }
  .home-tool b { font-size: var(--fs-md); }
  .welcome h1 { font-size: clamp(32px, 10vw, 44px); }
}
@media (max-width: 760px) {
  .home-quick-btn { height: 44px; }
}
@media (max-width: 900px) {
  .welcome { padding: 32px 20px 96px; }
}

#local-save-status { position: fixed; right: 18px; bottom: 8px; z-index: 36; max-width: min(90vw, 520px); font-size: var(--fs-xs); color: var(--muted); background: var(--panel); border-radius: var(--r-sm); padding: 3px 8px; pointer-events: none; }
#local-save-status:empty { display: none; }
#local-save-status.is-error { color: var(--bad); border: 1px solid var(--bad); pointer-events: auto; }

/* 首页：添加到桌面引导（1.2） */
.home-install { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.home-install:empty { display: none; }
/* 展开的步骤卡占满一行，收起来时就是一个小按钮 */
.home-install:has(.home-install-card) { flex: 1 1 100%; }
.gt-whats-new { width: min(560px, calc(100vw - 32px)); }
.gt-whats-new h2 { margin: 0 0 2px; font-size: var(--fs-2xl); }
.gt-whats-new-body { max-height: min(60vh, 520px); overflow: auto; margin: 10px 0 4px; line-height: 1.75; }
.gt-whats-new-body ul { margin: 0; padding-left: 20px; }
.gt-whats-new-body li + li { margin-top: 6px; }
.home-install-card { flex: 1 1 320px; max-width: 520px; padding: var(--space-4); border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--panel); }
.home-install-head { display: flex; align-items: center; gap: var(--space-2); }
.home-install-switch { margin-left: auto; display: inline-flex; padding: 2px; border-radius: var(--r-full); background: var(--panel-2); border: 1px solid var(--line-soft); }
.home-install-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-sm); padding: 2px 10px; border-radius: var(--r-full); cursor: pointer; }
.home-install-switch button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-1); }
.home-install-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.home-install-head svg, .home-install svg { width: 18px; height: 18px; color: var(--accent); }
.home-install-card ol { margin: 8px 0 10px; padding-left: 20px; line-height: 1.7; font-size: var(--fs-base); }
.home-install-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 遗器库（ui-shared/src/hsr/relics：遗器系统页、角色与遗器的换一件共用）。类名统一以 rl- 开头。 */
.rl-root, .rl-library { --rl-gold: #e8b84b; --rl-gold-ink: color-mix(in srgb, var(--rl-gold) 35%, var(--text)); --rl-media-scrim: #000; --rl-media-ink: #fff; --rl-avatar-ink: #d8d4dc; --rl-level-bg: #3b393c; --rl-banner-bg: #cfa38f; --rl-card-w: 80px; }
.rl-root { display: grid; gap: 12px; min-width: 0; }

/* 遗器库：左边是背包式图标网格，右边是选中遗器的详情 */
.rl-library { display: grid; gap: 10px; min-width: 0; }
/* 详情打开后页面可能变高、出现竖向滚动条；先把滚动条的位置留出来，遗器库宽度不会因此少 10px，卡片不会缩。
 * 只限遗器页（.rl-root），角色页和行动轴的「换一件」弹窗里不要因为打开弹窗把整页挤一下。 */
.rl-lib-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 370px); gap: 10px; align-items: start; }
/* 换上/换下弹窗还没选中时让网格占满；选中后右栏出现。角色页的遗器库有占位卡，始终两栏。 */
.rl-lib-main:not(.has-detail) { grid-template-columns: minmax(0, 1fr); }
/* 详情栏的占位卡也占着右栏，这样没有选中时右栏不会突然消失、卡片也不会忽大忽小。 */
.rl-lib-main > .rl-detail { min-width: 0; }
.rl-lib-left { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 10px; min-width: 0; }
.rl-slot-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); flex: none; }
/* 部位标签和筛选/排序/新增合成一条工具栏（2026-11-16），窄屏自动折成两行 */
.rl-lib-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; border-bottom: 1px solid var(--border); }
.rl-lib-top .rl-slot-tabs { flex: 1 1 240px; border-bottom: 0; }
.rl-lib-top .rl-lib-tools { flex: 0 0 auto; position: static; margin-left: auto; padding: 0; border-top: 0; background: transparent; }
.rl-slot-tabs button { flex: 1 0 auto; padding: 7px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-size: var(--fs-md); white-space: nowrap; cursor: pointer; }
.rl-slot-tabs button.on { border-bottom-color: var(--accent); color: var(--accent-strong); font-weight: 700; }
.rl-tab-count { margin-left: 4px; color: var(--muted); font-size: var(--fs-2xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.rl-slot-tabs button.on .rl-tab-count { color: var(--accent-strong); }
/* 筛选条件摘要：可删的胶囊 + 结果数，条件多了自动换行 */
.rl-filter-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 1px 2px 0; }
.rl-filter-active-label { color: var(--muted); font-size: var(--fs-sm); }
.rl-filter-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-strong); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.rl-filter-chip:hover { border-color: var(--accent); }
.rl-filter-chip span { color: var(--muted); font-size: var(--fs-sm); }
.rl-filter-result { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rl-filter-clear { border: 0; background: none; color: var(--accent-strong); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.rl-filter-clear:hover { text-decoration: underline; text-underline-offset: 2px; }
.rl-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, var(--rl-card-w, 80px)); gap: 8px; align-content: start; justify-content: start; }
/* 卡片固定 80px 宽（2026-11-18）：页面宽窄、侧栏展开/收起、详情占位都只改每行放几件，不把卡片放大缩小。
 * 手机 601 以下只把间距收小，列数同样由 auto-fill 决定。 */
/* 详情打开、收起时卡片换行：行内由脚本做 320ms 的 FLIP 位移，这段时间别让人点到正在动的卡片。 */
.rl-icon-grid.is-reflowing { pointer-events: none; }
.rl-icon-grid.is-reflowing .rl-cell { will-change: transform; }
/* 标准遗器比例：约 3:4 的竖版卡片，上面是图标，下面是深色等级条 */
.rl-cell { position: relative; display: block; aspect-ratio: 168 / 219; padding: 0; border: 0; border-radius: var(--r-md); background: none; overflow: visible; cursor: pointer; }
.rl-cell-frame { display: flex; flex-direction: column; height: 100%; border-radius: var(--r-md); background: #9c675b; overflow: hidden; }
.rl-cell.r4 .rl-cell-frame { background: #6f5b7e; }
.rl-cell.r5 .rl-cell-lv { background: color-mix(in srgb, var(--rl-gold) 12%, var(--rl-level-bg)); }
.rl-cell.r4 .rl-cell-lv { background: color-mix(in srgb, var(--accent-2) 16%, var(--rl-level-bg)); }
.rl-cell:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.rl-cell.on { box-shadow: 0 0 0 2px var(--accent); }
.rl-cell.is-selected { box-shadow: 0 0 0 2px var(--accent); }
.rl-check { position: absolute; top: 5px; left: 5px; z-index: 3; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: color-mix(in srgb, var(--panel) 82%, transparent); }
.rl-check.on { border-color: var(--accent-fill); background: var(--accent-fill); color: var(--on-accent-fill); }
.rl-check.on::after { content: "✓"; font-size: var(--fs-sm); font-weight: 700; line-height: 1; }
/* 图标按素材原比例放在格子里，上下留一点同色底，不要铺满 */
.rl-cell-art { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
/* 星级：和游戏里一样，格子里压在等级条上方，详情里写在部位名下面 */
:root { --rl-star: #ffd86b; }
.rl-stars { color: var(--rl-star); letter-spacing: 1px; line-height: 1; text-shadow: 0 1px 2px color-mix(in srgb, var(--rl-media-scrim) 45%, transparent); }
.rl-cell-stars { position: absolute; left: 0; right: 0; bottom: 30px; z-index: 1; font-size: var(--fs-xs); text-align: center; pointer-events: none; }
.rl-dc-stars { font-size: var(--fs-base); }
.rl-cell-lv { flex: none; width: 100%; padding: 3px 0; background: var(--rl-level-bg); color: var(--rl-media-ink); font-size: var(--fs-base); font-weight: 700; line-height: 1.4; text-align: center; font-variant-numeric: tabular-nums; }
/* 右上角头像：约格子宽度的 29%，贴在右上角；用透明立绘放在黑底上，不加描边和投影 */
/* 换一件按速度排时（行动轴）：图标左上角写这件给多少速度 */
.rl-cell-spd { position: absolute; top: 4px; left: 4px; z-index: 2; padding: 0 5px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--panel); color: var(--accent-strong); font-size: var(--fs-xs); font-weight: 700; line-height: 1.6; font-variant-numeric: tabular-nums; }
.rl-cell-owner { position: absolute; top: 0; right: 0; z-index: 2; width: 29%; max-width: 48px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--rl-media-scrim); }
/* 头像用角色缩略图：左上角是属性和命途图标、底部是星级，脸在中上；按固定位置放大 1.8 倍取脸（和行动轴的头像一个思路）。 */
/* 游戏里的圆形小头像本身就是脸居中，不用再裁 */
.rl-cell-owner img.rl-avatar, .rl-dc-owner img.rl-avatar { transform: none; object-fit: cover; }
.rl-cell-owner img { width: 100%; height: 100%; object-fit: cover; transform-origin: 0 0; transform: translate(-50.8%, -22%) scale(1.8); }
.rl-lib-tools { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); background: var(--panel); flex: none; }
/* 单独一页的遗器库：网格自己滚，底部工具栏固定在卡片底部，遗器不会跑到按钮下面。 */
.rl-library:not(.is-pick) .rl-lib-left { max-height: calc(100dvh - 128px); overflow: clip; }
.rl-library:not(.is-pick) .rl-icon-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.rl-library:not(.is-pick) .rl-lib-tools { position: static; flex: none; }
@media (max-width: 900px) {
  .rl-library:not(.is-pick) .rl-lib-left { max-height: calc(100dvh - 210px); }
}
.rl-tool { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.rl-tools-main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--panel-2) 65%, var(--panel)); }
.rl-tool:hover { background: var(--panel); color: var(--text); }
.rl-tool.on { background: var(--accent-soft); color: var(--accent-strong); font-weight: var(--fw-semibold); }
.rl-tool.on .rl-dot { background: var(--accent-strong); }
.rl-tool-icon { font-size: var(--fs-sm); color: var(--muted); }
.rl-tool.on .rl-tool-icon { color: inherit; }
.rl-tool-svg { width: 14px; height: 14px; }
.rl-filter-count { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 4px; padding: 0 4px; border-radius: var(--r-full); background: var(--accent-fill); color: var(--on-accent-fill); font-size: var(--fs-2xs); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.rl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.rl-tool-add { width: 40px; height: 40px; flex: none; justify-content: center; padding: 0; border: 1px solid var(--accent-fill); border-radius: 50%; background: var(--accent-fill); color: var(--on-accent-fill); font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: 1; }
.rl-tool-add:hover { background: var(--accent-strong); }
.rl-tool-done { flex: none; border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 6px 14px; }
.rl-tool-done:hover { border-color: var(--accent); background: var(--accent-soft); }
.rl-manage-tools { flex-wrap: wrap; }
.rl-manage-count { padding: 0 6px; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.rl-tool.rl-tool-danger { color: var(--bad); }
.rl-tool.rl-tool-danger:hover:not(:disabled) { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.rl-tool.rl-tool-danger:disabled { opacity: .45; cursor: default; }

.rl-detail { position: sticky; top: 12px; display: grid; gap: 8px; align-content: start; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); animation: rl-detail-in 300ms cubic-bezier(.2, .8, .2, 1); }
@keyframes rl-detail-in { from { opacity: 0; transform: translateX(16px) scale(.995); } }
@keyframes rl-detail-sheet-in { from { opacity: 0; transform: translateY(24px); } }
.rl-detail-empty { min-height: 200px; align-content: center; justify-items: center; gap: 5px; border-style: dashed; background: color-mix(in srgb, var(--panel-2) 45%, var(--panel)); color: var(--muted); text-align: center; }
.rl-detail-empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 2px; border-radius: 50%; background: var(--panel-2); color: var(--accent-strong); }
.rl-detail-empty-icon svg { width: 23px; height: 23px; }
.rl-detail-empty p { margin: 0; color: var(--text); font-size: var(--fs-md); font-weight: 700; }
.rl-detail-empty small { max-width: 24em; font-size: var(--fs-sm); line-height: 1.6; }
.rl-detail-sheet-head { display: none; }
.rl-detail-close { display: none; }

/* 右侧遗器详情：名字、立绘横幅、词条、套装效果 */
.rl-dc { display: grid; gap: 12px; min-width: 0; }
.rl-dc-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, var(--rl-gold) 65%, transparent); }
.rl-dc-title { display: grid; gap: 2px; min-width: 0; }
.rl-dc-title h3 { margin: 0; font-size: var(--fs-2xl); font-weight: 800; color: var(--rl-gold-ink); line-height: 1.3; }
.rl-dc-title small { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-dc-owner { margin-left: auto; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--rl-media-scrim); color: var(--rl-avatar-ink); overflow: hidden; }
.rl-dc-owner img { width: 100%; height: 100%; object-fit: cover; transform-origin: 0 0; transform: translate(-50.8%, -22%) scale(1.8); }
.rl-dc-owner svg { width: 22px; height: 22px; opacity: 0.7; }

.rl-dc-banner { position: relative; display: flex; align-items: flex-end; min-height: 150px; border-radius: var(--r-md); background-color: var(--rl-banner-bg); background-image: url("../modules/honkai-star-rail/assets/relic-banner.svg"); background-size: cover; background-position: center; overflow: hidden; }
.rl-dc.r4 .rl-dc-banner { background-color: color-mix(in srgb, var(--accent-2) 28%, var(--panel-2)); }
.rl-dc-slot { position: relative; z-index: 1; display: grid; gap: 2px; padding: 0 0 12px 18px; color: var(--rl-media-ink); }
.rl-dc-slot span { font-size: var(--fs-xl); opacity: 0.92; }
.rl-dc-slot strong { font-size: var(--fs-4xl); font-weight: 800; line-height: 1.05; }
.rl-dc-art { position: absolute; right: 6%; top: 50%; height: 86%; width: auto; object-fit: contain; transform: translateY(-50%); }
.rl-dc-trash { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--rl-media-scrim) 40%, transparent); color: var(--rl-media-ink); cursor: pointer; }
.rl-dc-trash:hover { background: color-mix(in srgb, var(--rl-media-scrim) 60%, transparent); }
.rl-dc-trash svg { width: 20px; height: 20px; }

.rl-dc-stats { display: grid; }
.rl-dc-main { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--r-sm); background: linear-gradient(90deg, color-mix(in srgb, var(--rl-gold) 30%, transparent), transparent); color: var(--rl-gold-ink); font-weight: 700; }
.rl-dc-main img { width: 20px; height: 20px; object-fit: contain; }
.rl-dc-main span { flex: 1; font-size: var(--fs-lg); }
.rl-dc-main b { font-size: var(--fs-3xl); font-variant-numeric: tabular-nums; }
.rl-dc-sub { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); font-size: var(--fs-base); }
.rl-dc-sub img { width: 18px; height: 18px; object-fit: contain; }
.rl-dc-sub span { flex: 1; display: flex; align-items: center; gap: 5px; min-width: 0; }
.rl-dc-sub b { font-variant-numeric: tabular-nums; }
.rl-dc-roll { padding: 0 4px; border-radius: var(--r-full); background: color-mix(in srgb, var(--accent-2) 13%, var(--panel-2)); color: var(--accent-2); font-style: normal; font-size: var(--fs-2xs); font-weight: 700; line-height: 16px; }
.rl-dc-stats img { filter: brightness(0); opacity: 0.6; }

.rl-dc-set h4 { margin: 0 0 4px; font-size: var(--fs-lg); color: var(--rl-gold-ink); }
.rl-dc-set p { margin: 2px 0; font-size: var(--fs-md); line-height: 1.6; color: var(--text); }
.rl-dc-set em { font-style: normal; font-weight: 700; }

.rl-dc-actions { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.rl-dc-equip-label { flex: none; font-size: var(--fs-sm); color: var(--muted); }
.rl-dc-actions .rl-select { width: 150px; }
.rl-dc-actions .ghost { margin-left: auto; }
.rl-dc-pick { flex: 1; }
.rl-detail-back { display: none; }

/* 筛选：总览页每类一个「点击选择」，点开是可选列表（套装 / 主属性 / 副属性） */
.rl-filter { display: grid; gap: 12px; width: min(680px, 100%); }
.rl-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rl-filter-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.rl-filter-x { width: 28px; height: 28px; border: 0; border-radius: var(--r-md); background: none; color: var(--muted); font: inherit; font-size: var(--fs-3xl); line-height: 1; cursor: pointer; }
.rl-filter-x:hover { background: var(--panel-2); color: var(--text); }
.rl-fsec { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: color-mix(in srgb, var(--panel-2) 55%, var(--panel)); }
.rl-fsec h4 { margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); }
.rl-pick-bar { display: flex; align-items: stretch; justify-content: space-between; gap: 8px; width: 100%; height: 36px; padding: 0 0 0 12px; border: 1px dashed var(--control-border); border-radius: var(--r-md); background: var(--panel); color: var(--text); font: inherit; font-size: var(--fs-md); text-align: left; cursor: pointer; overflow: hidden; }
.rl-pick-bar:hover { border-color: var(--accent); color: var(--accent-strong); }
.rl-pick-bar > span:first-child { align-self: center; }
.rl-pick-plus { flex: none; display: grid; place-items: center; width: 38px; background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-xl); font-weight: 700; }
.rl-picked { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rl-picked li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 6px 5px 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); font-size: var(--fs-md); }
.rl-picked img { flex: none; width: 24px; height: 24px; border-radius: var(--r-sm); object-fit: contain; }
.rl-picked span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-unpick { flex: none; width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--bad); color: var(--on-bad); font: inherit; font-size: var(--fs-sm); line-height: 1; cursor: pointer; }
.rl-picked-say { margin: 0; font-size: var(--fs-sm); color: var(--rl-gold-ink); }
.rl-filter-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.rl-filter-tabs button { flex: 1; padding: 8px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-size: var(--fs-base); font-weight: 600; cursor: pointer; }
.rl-filter-tabs button.on { border-bottom-color: var(--accent); color: var(--accent-strong); }
.rl-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: min(46vh, 380px); overflow: auto; padding: 2px; }
.rl-option { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); font-size: var(--fs-md); cursor: pointer; }
.rl-option:hover { border-color: var(--accent); }
.rl-option img { flex: none; width: 24px; height: 24px; border-radius: var(--r-sm); object-fit: contain; }
.rl-option-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-option-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.rl-option input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.rl-submodes { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: var(--fs-md); }
.rl-submodes label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.rl-submodes input { margin: 0; accent-color: var(--accent); }
.rl-stepper { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.rl-stepper span { flex: 1; min-width: 0; }
.rl-stepper button { flex: none; width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 50%; background: var(--panel-2); color: var(--text); font: inherit; font-size: var(--fs-lg); line-height: 1; cursor: pointer; }
.rl-stepper b { min-width: 22px; text-align: center; color: var(--text); font-variant-numeric: tabular-nums; }

/* 新增/修改遗器 */
.rl-modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: var(--overlay); animation: gt-modal-fade 160ms var(--ease-out) backwards; }
.rl-modal-box { width: min(660px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-3); animation: gt-modal-pop 220ms var(--ease-spring) backwards; }
.rl-modal-box h3 { margin-top: 0; font-size: var(--fs-lg); font-weight: 700; }
.rl-modal-actions { position: sticky; bottom: -20px; display: flex; justify-content: flex-end; gap: 8px; margin: 16px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--panel); }
/* 新增/修改遗器：左侧主设置，右侧部位和副词条卡片 */
.rl-editor2 { display: block; width: min(1180px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; }
.rl-editor2-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--panel); }
.rl-editor-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rl-editor2-head h3 { margin: 0; font-size: var(--fs-2xl); }
.rl-editor-state { padding: 1px 8px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }
.rl-editor-state.is-saving { background: var(--panel-2); color: var(--muted); }
.rl-editor2-close { --close-size: 44px; background: var(--panel-2); }
.rl-editor2-body { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; padding: 16px 20px 20px; }
.rl-editor2-left { display: flex; flex-direction: column; gap: 10px; align-self: start; min-width: 0; }
/* 打开面板就能看到当前成品：件图、套装、部位/等级、主属性、词条总数。 */
.rl-editor-preview { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; grid-template-areas: "art text value" "art text count"; align-items: center; gap: 0 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: color-mix(in srgb, var(--panel-2) 55%, var(--panel)); }
.rl-editor-preview-art { grid-area: art; display: grid; place-items: center; width: 54px; height: 70px; border-radius: var(--r-md); background: var(--panel); color: var(--muted); overflow: hidden; }
.rl-editor-preview-art img { width: 100%; height: 100%; object-fit: contain; }
.rl-editor-preview-art svg { width: 24px; height: 24px; }
.rl-editor-preview-text { grid-area: text; display: grid; gap: 2px; min-width: 0; }
.rl-editor-preview-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: var(--fs-md); }
.rl-editor-preview-text small { color: var(--muted); font-size: var(--fs-xs); }
.rl-editor-preview-value { grid-area: value; display: grid; justify-items: end; gap: 1px; text-align: right; }
.rl-editor-preview-value em { color: var(--muted); font-style: normal; font-size: var(--fs-2xs); }
.rl-editor-preview-value b { color: var(--accent-strong); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.rl-editor-preview-count { grid-area: count; justify-self: end; color: var(--muted); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.rl-set-row.has-error .rl-label { color: var(--bad); }
.rl-set-row.has-error .rl-select-btn { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--panel)); }
.rl-range-ticks { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.rl-editor2-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rl-sec { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-lg); }
.rl-sec::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); }
.rl-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rl-set-row { display: grid; gap: 4px; }
.rl-label { font-size: var(--fs-sm); color: var(--muted); }

/* 带图标的下拉菜单 */
.rl-select { position: relative; min-width: 0; }
.rl-select-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); color: var(--text); font: inherit; font-size: var(--fs-md); text-align: left; cursor: pointer; }
.rl-select-btn:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.rl-select-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.rl-select.small .rl-select-btn { height: 30px; padding: 0 8px; font-size: var(--fs-sm); }
.rl-select-btn:disabled { opacity: 0.5; cursor: default; }
.rl-select-btn img { flex: none; width: 20px; height: 20px; border-radius: var(--r-sm); object-fit: contain; }
.rl-select img.mono { filter: brightness(0); opacity: 0.7; }
.rl-select-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-select-btn span.placeholder { color: var(--muted); }
.rl-select-arrow { flex: none; width: 14px; height: 14px; color: var(--muted); transition: transform var(--t-fast); }
.rl-select.open .rl-select-arrow { transform: rotate(180deg); }
.rl-select-menu { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 100%; max-width: min(340px, 80vw); max-height: 260px; margin: 0; padding: 4px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); box-shadow: 0 14px 34px #2a142233; list-style: none; transform-origin: top left; animation: gt-select-in 160ms var(--ease-out) backwards; }
.rl-select.up .rl-select-menu { top: auto; bottom: calc(100% + 4px); transform-origin: bottom left; }
.rl-select-menu.is-closing { animation: gt-select-out 120ms ease forwards; pointer-events: none; }
.rl-select-pill { position: absolute; z-index: 0; top: 0; left: 4px; right: 4px; height: 30px; border-radius: var(--r-sm); background: var(--surface-active); opacity: 0; pointer-events: none; transition: transform 220ms var(--ease-out), height 150ms ease, opacity 150ms ease; }
.rl-select-option { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); text-align: left; cursor: pointer; }
.rl-select-option:hover { background: transparent; }
.rl-select-option.on { color: var(--accent-strong); font-weight: 700; }
.rl-select-option:focus-visible { outline: none; box-shadow: var(--focus); }
.rl-select-option img { flex: none; width: 20px; height: 20px; border-radius: var(--r-sm); object-fit: contain; }
.rl-select-option span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-set-effects { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); }
.rl-set-effects b { color: var(--text); }
.rl-effect-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-md); color: var(--muted); }
.rl-effect-row b { font-size: var(--fs-xl); color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.rl-level-row { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-md); }
.rl-level-row b { color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.rl-range { width: 100%; accent-color: var(--accent); }
.rl-equip { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.rl-equip .rl-select { flex: 1; min-width: 0; }
.rl-editor2-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.rl-editor2-actions .btn { flex: 1 1 100px; }
.rl-danger { padding: 8px 12px; border: 1px solid var(--bad); border-radius: var(--r-md); background: none; color: var(--bad); font: inherit; font-size: var(--fs-md); cursor: pointer; }
.rl-danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }

.rl-slot-picks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.rl-slot-pick { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px 5px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); color: var(--muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.rl-slot-pick img { width: 36px; height: 36px; object-fit: contain; }
.rl-slot-pick-blank { display: grid; place-items: center; width: 36px; height: 36px; border: 1px dashed var(--border); border-radius: var(--r-md); color: var(--muted); }
.rl-slot-pick-blank svg { width: 22px; height: 22px; }
.rl-slot-pick em { position: absolute; top: 3px; right: 5px; font-style: normal; font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.rl-slot-pick.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.rl-roll-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-md); color: var(--muted); }
.rl-roll-head b { color: var(--accent-strong); font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.rl-roll-head > div { display: flex; gap: 6px; }
.rl-roll-progress { height: 4px; overflow: hidden; border-radius: var(--r-full); background: var(--panel-2); }
.rl-roll-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 180ms var(--ease-out); }
.rl-roll-progress.full > span { background: var(--good); }
.rl-editor-flash-note { color: var(--good); font-size: var(--fs-xs); }
.rl-sub-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rl-sub-card { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--panel); }
.rl-sub-card header { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rl-sub-card .rl-select { flex: 1; min-width: 0; }
.rl-sub-card .rl-select-btn { height: 32px; border-color: var(--line-soft); background: var(--panel-2); padding: 0 6px; }
.rl-sub-card .rl-select-btn:hover { border-color: var(--accent); background: var(--panel); }
.rl-sub-card.is-empty { border-style: dashed; background: color-mix(in srgb, var(--panel-2) 42%, var(--panel)); }
.rl-sub-card.is-flash { animation: rl-sub-flash 320ms var(--ease-out); }
@keyframes rl-sub-flash {
  from { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); }
}
.rl-sub-x { flex: none; width: 24px; height: 24px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font-size: var(--fs-xl); line-height: 1; cursor: pointer; }
.rl-sub-x:hover { background: var(--panel); color: var(--text); }
.rl-sub-value { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rl-sub-value b { font-size: var(--fs-xl); color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.rl-sub-value span { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.rl-sub-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; align-items: start; }
.rl-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-width: 240px; }
.rl-chips > span { grid-column: 1 / -1; font-size: var(--fs-xs); white-space: nowrap; }
.rl-chips.up > span { color: var(--good); }
.rl-chips.down > span { color: var(--bad); }
.rl-chips button { padding: 3px 2px; border: 1px solid transparent; border-radius: var(--r-sm); font: inherit; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; cursor: pointer; }
.rl-chips.up button { background: var(--good-soft); color: var(--good); }
.rl-chips.down button { background: var(--bad-soft); color: var(--bad); }
.rl-chips button:disabled { opacity: 0.35; cursor: default; }

@media (max-width: 900px) {
  .rl-lib-main { grid-template-columns: minmax(0, 1fr); }
  .rl-editor2 { width: 100%; max-height: calc(100% - 12px); }
  .rl-editor2-body { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .rl-slot-picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rl-sub-cards { grid-template-columns: minmax(0, 1fr); }
  .rl-detail-empty { display: none; }
  .rl-detail { position: fixed; top: auto; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 950; max-height: 72vh; overflow: auto; padding: 0 12px 12px; border: 1px solid var(--border); border-radius: 16px 16px 0 0; background: var(--panel); box-shadow: 0 -10px 30px #00000055; animation-name: rl-detail-sheet-in; }
  .rl-detail-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 2; margin: 0 -12px 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
  .rl-detail-sheet-head > span { color: var(--text); font-size: var(--fs-md); font-weight: 700; }
  .rl-detail-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--panel-2); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
  .rl-detail-close:hover { border-color: var(--accent); background: var(--accent-soft); }
  .rl-detail-back { display: block; position: fixed; inset: 0; z-index: 940; background: var(--overlay); }
}
@media (prefers-reduced-motion: reduce) {
  .rl-detail { animation: none; }
  .rl-modal, .rl-modal-box { animation: none; }
  .rl-select-menu, .rl-select-menu.is-closing { animation: none; }
  .rl-select-pill { transition: none; }
  .rl-roll-progress > span { transition: none; }
  .rl-sub-card.is-flash { animation: none; }
}
@media (max-width: 600px) {
  .rl-slot-tabs button { padding: 6px 9px; font-size: var(--fs-sm); }
  .rl-icon-grid { gap: 6px; }
  .rl-cell-lv { padding: 2px 0; font-size: var(--fs-sm); }
  .rl-tool { padding: 5px 12px; font-size: var(--fs-sm); }
  .rl-tool-add { width: 36px; height: 36px; font-size: var(--fs-3xl); }
  .rl-modal { bottom: calc(68px + env(safe-area-inset-bottom)); padding: 0; align-items: end; }
  .rl-modal-box { max-height: calc(100% - 24px); border-radius: 14px 14px 0 0; }
  .rl-sub-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .rl-sub-row b { grid-column: 2 / -1; justify-self: end; }
}
/* ---------------- 角色面板（ui-shared/src/hsr/character-panel/CharacterPanel.vue） ----------------
   「编队」的角色详情和行动轴队员卡点开的面板共用（2026-11-13 从编队的 style.css 搬来，样子不变）。外面的浮窗由各页面自己写。 */
.cpanel-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
@keyframes cpanel-in {
  from { opacity: 0; transform: translateY(6px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.cpanel-switch {
  display: none;
  gap: 4px;
  padding: 4px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel-2);
}
.cpanel-tab {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.cpanel-tab.on { border-color: transparent; background: var(--accent-fill); color: var(--on-accent-fill); font-weight: var(--fw-bold); }
.cpanel-blocks { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 12px; align-items: start; }
.cpanel-block { min-width: 0; }
.cpanel-top { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.cpanel-profile { position: relative; height: 235px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel-2); }
.cpanel-profile > img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: top center; }
.cpanel-profile-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, var(--panel) 100%); }
.cpanel-profile-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.cpanel-profile-name { position: absolute; left: 10px; right: 10px; bottom: 8px; color: var(--text); font-size: 16px; font-weight: 800; line-height: 1.2; }
.cpanel-profile-name small { margin-left: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.cpanel-eido-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cpanel-eido-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 4px; }
.cpanel-eido-card {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
  opacity: .55;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease, opacity var(--t-fast) ease;
}
.cpanel-eido-card.on { opacity: 1; border-color: color-mix(in srgb, var(--warn) 38%, var(--border)); }
.cpanel-eido-card.active { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); opacity: 1; }
.cpanel-eido-card:focus-visible { outline: 2px solid color-mix(in srgb, var(--warn) 60%, transparent); outline-offset: 1px; }
.cpanel-eido-pic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; }
.cpanel-eido-pic img { width: 100%; height: 100%; display: block; object-fit: contain; }
html:not(.night) .cpanel-eido-pic img { filter: brightness(.32); }
.cpanel-eido-n { flex: none; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--muted); font-size: 8px; font-weight: 800; }
.cpanel-eido-card.on .cpanel-eido-n { background: color-mix(in srgb, var(--warn) 28%, var(--panel-2)); color: var(--text); }
.cpanel-eido-card.active .cpanel-eido-n { background: var(--warn); color: #fff; }
.cpanel-eido-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cpanel-eido-text b { font-size: 10.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cpanel-info { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.cpanel-info-section { min-width: 0; padding: 7px 9px; }
.cpanel-info-section + .cpanel-info-section { border-top: 1px solid var(--border); }
.cpanel-info-title { display: flex; align-items: center; gap: 5px; margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.cpanel-info-title > span { color: var(--accent); }
/* 面板里改星魂和光锥（2026-11-15）：小按钮，白天也要看得清，所以用淡底 + accent-strong 文字 */
.cpanel-build-btn {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent-strong);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
}
.cpanel-build-btn:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--panel)); }
.cpanel-build-btn:disabled { opacity: .5; cursor: default; }
.cpanel-eido-step { margin-left: auto; display: inline-flex; gap: 3px; }
.cpanel-eido-step button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border));
  border-radius: 50%;
  background: color-mix(in srgb, var(--warn) 14%, var(--panel));
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.cpanel-eido-step button:hover:not(:disabled) { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 26%, var(--panel)); }
.cpanel-eido-step button:disabled { opacity: .4; cursor: default; }
.cpanel-cone { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cpanel-cone img { width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); object-fit: cover; }
.cpanel-cone div { min-width: 0; }
.cpanel-cone b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpanel-cone small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 星魂信息：桌面端悬停气泡，手机端点击浮窗。 */
.cpanel-eido-pop {
  position: fixed;
  z-index: 96;
  width: min(260px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--warn) 46%, var(--border));
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 14px 40px color-mix(in srgb, #2a1420 32%, transparent);
  pointer-events: none;
  animation: cpanel-in var(--t-fast) ease-out;
}
.cpanel-eido-pop b { display: block; margin-bottom: 0; color: var(--warn); font-size: 11px; line-height: 1.4; }
.cpanel-eido-pop-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.cpanel-eido-pop-head img { flex: none; width: 22px; height: 22px; object-fit: contain; }
html:not(.night) .cpanel-eido-pop-head img, html:not(.night) .cpanel-eido-window-icon { filter: brightness(.32); }
.cpanel-eido-pop p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.cpanel-eido-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: color-mix(in srgb, #1a0f1e 52%, transparent);
  animation: cpanel-fade var(--t-fast) ease-out;
}
@keyframes cpanel-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.cpanel-eido-window {
  width: min(340px, 100%);
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 70px color-mix(in srgb, #2a1420 36%, transparent);
  animation: cpanel-in var(--t-fast) ease-out;
}
.cpanel-eido-window-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.cpanel-eido-window-head b { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; }
.cpanel-eido-window-icon { flex: none; width: 28px; height: 28px; object-fit: contain; }
.cpanel-eido-window-body { padding: 10px 12px 13px; overflow-y: auto; }
.cpanel-eido-window-state {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
}
.cpanel-eido-window-state.on { border-color: color-mix(in srgb, var(--warn) 46%, var(--border)); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); color: var(--warn); }
.cpanel-eido-window-body p { margin: 0; color: var(--text); font-size: 11.5px; line-height: 1.6; }
.cpanel-section { margin-top: 10px; }
.cpanel-section:first-child { margin-top: 0; }
.cpanel-section-title { margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; }

.cpanel-attrs { margin-top: 10px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.cpanel-attr-head { display: flex; align-items: center; gap: 6px; padding: 6px 9px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, var(--panel-2)), var(--panel-2)); color: var(--text); font-size: 11px; font-weight: 800; }
.cpanel-attr-head > span { color: var(--accent); font-size: 10px; }
.cpanel-attr-cols { display: grid; grid-template-columns: 1fr 1fr; }
.cpanel-attr-col { min-width: 0; }
.cpanel-attr-col + .cpanel-attr-col { border-left: 1px solid var(--border); }
.cpanel-attr-row { display: flex; align-items: center; gap: 5px; min-height: 26px; padding: 3px 9px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); font-size: 11px; }
.cpanel-attr-row:last-child { border-bottom: 0; }
.cpanel-attr-icon { flex: none; width: 14px; height: 14px; display: grid; place-items: center; color: var(--warn); text-align: center; font-size: 12px; }
.cpanel-attr-icon img, .cpanel-relic-stat-icon img { width: 100%; height: 100%; display: block; object-fit: contain; }
html:not(.night) .cpanel-attr-icon img, html:not(.night) .cpanel-relic-stat-icon img { filter: brightness(.32); }
.cpanel-attr-label { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpanel-attr-base { flex: none; display: flex; flex-direction: column; align-items: flex-end; color: var(--muted); font-size: 8px; line-height: 1.2; }
.cpanel-attr-base em { color: var(--good); font-style: normal; }
.cpanel-attr-total { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }

.cpanel-relics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cpanel-relic { position: relative; min-width: 0; overflow: visible; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.cpanel-relic.empty { opacity: .5; }
.cpanel-relic-head { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 30px; padding: 3px 8px; padding-right: 44px; border-left: 3px solid var(--border); border-radius: 7px 7px 0 0; }
.cpanel-relic.warm .cpanel-relic-head,
.cpanel-relic.cool .cpanel-relic-head {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, var(--panel)), color-mix(in srgb, var(--accent) 12%, var(--panel)));
}
.cpanel-relic.empty .cpanel-relic-head { border-left-color: var(--border); }
.cpanel-relic-slot { flex: none; color: var(--muted); font-size: 9px; }
.cpanel-relic-head b { flex: 1; min-width: 0; color: var(--text); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpanel-relic-level { flex: none; color: var(--warn); font-size: 10px; font-style: normal; font-weight: 700; line-height: 1.5; }
.cpanel-relic-piece-icon { position: absolute; right: 6px; top: -8px; width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 1px 2px #0002); }
.cpanel-relic-body { overflow: hidden; border-radius: 0 0 7px 7px; }
.cpanel-relic-main { display: flex; align-items: center; gap: 4px; padding: 3px 8px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.cpanel-relic-main .cpanel-relic-stat-icon { width: 15px; height: 15px; font-size: 13px; }
.cpanel-relic-main .cpanel-relic-stat-name { font-size: 10.5px; font-weight: 700; }
.cpanel-relic-main b { margin-left: auto; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cpanel-relic-stat-icon { flex: none; width: 13px; height: 13px; display: grid; place-items: center; color: var(--text); text-align: center; font-size: 11px; }
.cpanel-relic-stat-name { flex: 1; min-width: 0; color: var(--text); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpanel-relic-subs { background: none; }
.cpanel-relic-sub { display: flex; align-items: center; gap: 3px; padding: 2px 8px; border: 0; font-size: 9.5px; line-height: 1.45; }
.cpanel-relic-sub .cpanel-relic-stat-name { flex: 0 1 auto; max-width: 58%; color: var(--text); }
.cpanel-relic-sub b { flex: none; width: 38px; margin-left: auto; color: var(--text); font-size: 10px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cpanel-relic-sub em { flex: none; margin-left: 4px; padding: 0 4px; border-radius: var(--r-sm); background: color-mix(in srgb, #1a0f1e 74%, transparent); color: var(--warn); font-size: 8px; font-style: normal; font-weight: 700; line-height: 1.5; }
html:not(.night) .cpanel-relic-sub em {
  border: 1px solid color-mix(in srgb, var(--warn) 34%, var(--border));
  background: color-mix(in srgb, var(--warn) 15%, var(--panel));
  color: color-mix(in srgb, var(--warn) 90%, var(--text));
}
.cpanel-relic-main.highlight .cpanel-relic-stat-icon,
.cpanel-relic-sub.highlight .cpanel-relic-stat-icon { color: var(--warn); }
@media (max-width: 760px) {
  .cpanel-badge { padding: 1px 6px; font-size: 9px; }
  .cpanel-switch { display: flex; }
  .cpanel-blocks { display: block; }
  .cpanel-block { display: none; }
  .cpanel-blocks[data-view="main"] .cpanel-block-main,
  .cpanel-blocks[data-view="relics"] .cpanel-block-relics { display: block; }
  .cpanel-top { grid-template-columns: 118px minmax(0, 1fr); gap: 8px; }
  .cpanel-profile { height: 170px; }
  .cpanel-profile-name { bottom: 8px; font-size: 13px; }
  .cpanel-profile-top .cpanel-badge { padding: 1px 4px; font-size: 8px; }
  .cpanel-eido-grid { gap: 3px; }
  .cpanel-eido-card { gap: 4px; padding: 4px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .cpanel-eido-pic { width: 24px; height: 24px; }
  .cpanel-eido-n { width: 15px; height: 15px; font-size: 7px; }
  .cpanel-eido-text b { font-size: 9.5px; }
  .cpanel-info-section { padding: 6px 7px; }
  .cpanel-info-title { margin-bottom: 3px; font-size: 9px; }
  .cpanel-cone img { width: 28px; height: 28px; }
  .cpanel-cone b { font-size: 10px; }
  .cpanel-cone small { font-size: 8px; }
  /* 手机上这两个按钮要手指点得着（2026-11-15） */
  .cpanel-build-btn { padding: 2px 9px; font-size: 10.5px; }
  .cpanel-eido-step { gap: 4px; }
  .cpanel-eido-step button { width: 22px; height: 22px; font-size: 12px; }
  .cpanel-eido-window { width: min(320px, 100%); }
  .cpanel-section { margin-top: 7px; }
  .cpanel-section-title { margin-bottom: 4px; font-size: 9px; }
  .cpanel-attrs { margin-top: 7px; }
  .cpanel-attr-head { padding: 4px 7px; font-size: 9px; }
  .cpanel-attr-head > span { font-size: 9px; }
  .cpanel-attr-row { min-height: 22px; padding: 2px 6px; gap: 3px; font-size: 9px; }
  .cpanel-attr-icon { width: 12px; height: 12px; font-size: 10px; }
  .cpanel-attr-base { font-size: 7px; }
  .cpanel-attr-total { font-size: 10.5px; }
  .cpanel-relics { gap: 8px; }
  .cpanel-relic { padding: 0; }
  .cpanel-relic-head { min-height: 28px; padding: 3px 6px; padding-right: 36px; border-left-width: 2px; }
  .cpanel-relic.warm .cpanel-relic-head, .cpanel-relic.cool .cpanel-relic-head { padding: 3px 6px; padding-right: 36px; }
  .cpanel-relic-piece-icon { right: 4px; top: -6px; width: 30px; height: 30px; }
  .cpanel-relic-head b { font-size: 10px; }
  .cpanel-relic-level { font-size: 9px; }
  .cpanel-relic-main { gap: 3px; padding: 3px 6px; }
  .cpanel-relic-main .cpanel-relic-stat-icon { width: 13px; height: 13px; font-size: 11px; }
  .cpanel-relic-main .cpanel-relic-stat-name { font-size: 9px; }
  .cpanel-relic-main b { font-size: 11px; }
  .cpanel-relic-stat-icon { width: 11px; height: 11px; font-size: 9px; }
  .cpanel-relic-stat-name { font-size: 8px; }
  .cpanel-relic-sub { gap: 3px; padding: 2px 6px; font-size: 8px; }
  .cpanel-relic-sub em { padding: 0 3px; font-size: 7px; }
  .cpanel-relic-sub b { font-size: 9px; }
}
/* 角色面板能改遗器时（行动轴）：遗器位整张能点，下面一排「改 / 换一件 / 卸下」；属性和套装标出和打开面板时比的变化。 */
.cpanel-relic-face { display: block; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 8px 8px 0 0; background: none; color: inherit; font: inherit; text-align: left; }
button.cpanel-relic-face { cursor: pointer; }
button.cpanel-relic-face:hover .cpanel-relic-head b { color: var(--accent-strong); }
button.cpanel-relic-face:focus-visible { outline: none; box-shadow: var(--focus); }
.cpanel-relic.editable.empty { opacity: 1; border-style: dashed; }
.cpanel-relic.editable.empty .cpanel-relic-head { opacity: .6; }
.cpanel-relic-blank { padding: 6px 8px 8px; color: var(--accent-strong); font-size: 11px; font-weight: 700; }
.cpanel-relic-actions { display: flex; gap: 4px; padding: 4px 6px 6px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.cpanel-relic-actions button {
  flex: 1 1 0; min-width: 0; padding: 3px 4px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--panel-2); color: var(--text); font: inherit; font-size: 11px; cursor: pointer;
}
.cpanel-relic-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-strong); }
.cpanel-relic-actions button:disabled { cursor: default; opacity: .5; }
/* 能改遗器时醒目的词条（行动轴是速度）：整行加底色、数值加粗，一眼找到 */
.cpanel-relic.editable .cpanel-relic-sub.highlight, .cpanel-relic.editable .cpanel-relic-main.highlight { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.cpanel-relic.editable .cpanel-relic-sub.highlight .cpanel-relic-stat-name, .cpanel-relic.editable .cpanel-relic-sub.highlight b { color: var(--accent-strong); font-weight: 800; }
.cpanel-section-hint { margin-left: 6px; color: var(--muted); font-size: 10px; font-weight: 400; }
.cpanel-attr-note { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.cpanel-attr-row.changed { flex-wrap: wrap; row-gap: 0; background: color-mix(in srgb, var(--accent) 7%, transparent); }
/* 变了的行：名字不省略，对比放不下时换到下一行靠右 */
.cpanel-attr-row.changed .cpanel-attr-label { flex: 1 0 auto; }
.cpanel-attr-row.changed .cpanel-attr-change { margin-left: auto; }
.cpanel-attr-change { flex: none; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cpanel-attr-change b { color: var(--text); font-size: 12px; }
.cpanel-attr-change em { font-style: normal; font-weight: 700; }
.cpanel-attr-row.up .cpanel-attr-change em { color: var(--good); }
.cpanel-attr-row.down .cpanel-attr-change em { color: var(--bad); }
.cpanel-attr-row.speed.changed .cpanel-attr-change b { color: var(--accent-strong); font-size: 13px; }
.cpanel-sets { margin-top: 10px; }
.cpanel-set-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cpanel-set-list li { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); font-size: 11px; }
.cpanel-set-list img { width: 20px; height: 20px; flex: none; object-fit: contain; }
.cpanel-set-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpanel-set-list b { flex: none; font-variant-numeric: tabular-nums; }
.cpanel-set-list em { flex: none; padding: 0 6px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 700; }
.cpanel-set-list .new em, .cpanel-set-list .changed em { background: color-mix(in srgb, var(--good) 16%, var(--panel)); color: var(--good); }
.cpanel-set-list .lost { opacity: .7; text-decoration: line-through; }
.cpanel-set-list .lost em { background: color-mix(in srgb, var(--bad) 14%, var(--panel)); color: var(--bad); text-decoration: none; }
@media (max-width: 760px) {
  .cpanel-relic-actions button { padding: 5px 4px; font-size: 12px; }
  .cpanel-attr-change { font-size: 9.5px; }
  .cpanel-attr-change b { font-size: 10.5px; }
}

/* 【阿哈时刻】的徽记（欢愉命途小图标，内联后桌面版和单文件版都不用联网）：行动轴的 .axis-face-aha 和成品轴的【阿哈时刻】行共用。 */
:root { --aha-glyph: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAHk0lEQVR4nNVba4hXRRQ/5+5GJb5WDcnKzFZLsKerFElBGRiCQZlQX4pe+qHsm2Xgx1LBTwVphB8KKnzkJzOLtScVrW72RHLNLCjzsSppL2rvL47O/Hc8O3funXvv/lt/MPjfuTPnnDn3nDPnzB2ZcgCA6SwGMyP0vDWC1nAAy5k5pSEMACeY+dmi41sjaJ8kouuJ6DYa2ngpZnASM5iZ19EQBzO/GjWeIgBgJBEdJKLzaGhiPxFNzvP7KhbwGxG9T0MX22IWHxsDLN4korme/k0AupkHd9MAIC9C4tCcDNlosBWwLUOw7iRJVg72tpkkCQDM8Dz6K0u2WhXAzHsB7CWidtV/dZqmLczcR4MIACLzxZ5HHxNRNO+kpBxfePouoeZhqqdvZxlCSZlJALZ7ui+l5mGMp6+zadzTNO2AH2ViShQAtGfwbisTf1pjJxg/97mAYKzJEwojT2jPtnaBZ5jEpOPURBdARhy4jAYfvgD4ZVliSQVBPvf0SaY42LiwrgAoqOKzde4EDxDRnWb+MCI6QUSfEtF6IvpEjb0owwWaCwBzPYFoufh0RJsCYDfCWKvmrFPP+0xgPPW8mS6wN2d7WqSTJQVJZ7uI6MocPkKnw/l7nGfM99RsF+DTGWHIP68lojVGUdtNpSYYbRbvLioGE+pavKDqvq1TYtcC7LbUnmMJRXA8YAFWsaWQ6A7tp7Y/TdPRaZouBrDSebbPYwGJaT9SfTji/B6vnv1g/pXgKfFiIYAWp3nXExUD0jRdwMw7mPkhInrGefRLIEmpZJoZFiDuc756ZhX9BxGtICI5D/yu6NFdkvN8BICNzLxRTA/AveZs0EJnfePqMs2MYOsLgL1KGfcR0eVE9LZRxvCyCphIRJ8R0QL5A8AjSZLoyK8toMW8pTotwPV/S9uFdrVuInra/F5KRFtDSkgy+saYyG23qBeZ+Q3xIcnNbSOiAxmpamqaVlAZ7MtJgo64Msl5BDOvMKdD/xLRbKOEFtMGLNaH9caM7BtY5h1F9Kunb1TNbvB1TiF0KGPeE85vUcIrvkGJp2+pCiDLApWWzwImOb+/per4JrADIKv6ZGZxwRecLolfdwUVAGCCUYDFcWMNFGEBI2u0gD510KEt4CAz/x2Y/5z6ezUA2S4bSNQeuUQFmg3MfEz5fQPMfNKjhGnO73eoGmT+7xm0BbtDk40VbHG6pNh6MOQCi9TfmwsIuUv9PUNF5NKlqkmls2i7SVAIHwZiA7mZ3xxPJeYLOnr+w2rOP/Z4KkC3CLbKEZuiI5Wfi/kF5LvBQ7s/NUc/A0lxXRwDcE4BBhcD+FMp4G6VgmraeThg6LoK2KAUIGNyaxkA4z30H/MpoEsx6ClSX5u5koNb9BlauvbXC8jCYQC3eM4NNJ6KkM9Fn5HldNxzmPQqAXdEMGgzFmMZSFvgUcKTzjgfhOdkz7xONa6n6CmwmX8s6wWRw6SvggKkLVYK6FWxwLY28/Y6zUJ2GAuak3Fq5HOfxtiSCtijFdDmUUBnpAKsK1g6VtM+JRRtq7NMv6ICen0K0CikAMVM6m/5SuxiJ4CpWfW5p8mYsdbs0zOht8UiMrV63O6YzwU0CrlAgaBoGa4yCwstvt2MawhsV1406BVUwKkADynuHKJHVRYope/U2AsHDj1JqlZ4StjtJjna7xRPk0ySM8OTnksmutDMy7315VOAOSxxt3ThP6shsGmiFY22GGaKnt2+tEtouDFDb5ObdAwpIc/0LPcGwK62fWd4s7WZ5jFUtXkPEd1DRLfbN+hB4ja7cCKaKXNDtUjGgrW88zzD+g92EN5utsQqIEegmQBeD1jD88Zq6uIn7SsPn8U+C9jpoTev4Sv1YFTO94Ab1YFKVYj8V3n6pUg7DZWg+NBd0xuRKJ4LE/EX18BvFICfPSwaWyDUNijtg4Lf52ITEWnXmQQkD/sAFL5t4pGp1bTNGfRfDilgUUCwlRUVYJUQqgVkJ4q6apOhgKzFC24NKWCEKTOzsMmYVlkF2EDoU0JPmqbRn9AU7dEA3g3Iv2vAC8RAAR/P8VEx0dkVFOCr7gTy8SUaDs37ARwMyQ7gjlwLxukHkgbnQcxset6CM567CrAJ0IYIBbrtJgDvFZB3U6Ggiv4MLuSrLt6SyxL/gwIWZFiSD4XPD6jCWV6PSWTmDJIC2gzttREvB2ZsI7mKUQAbhicjFWGZdpqd49yyCjBBbYVzXFfkSM3FIRN0S+cxBKAjTdM9TlkaYxEzM2j6YsxrvkNO8xJi3riFKHlK9IJDmVyapkcLMm9UcZqeXLTIWNBPGQqwMalIYIahXTqTzHMJWdQyuS0eECB4ZJWmaSglnp/DP3S8LjItiS2fOW+Ah4gtoGaYj6iyFV5h/lfZo8z80RkMnBIWwDRz78/3nZ/MZ7ZrmPlQgL984FxFRIfNHYQucxnC3kc448p87AFKZQS2rSkZhy4aO9y3SGcbUG3xA5RAZxvgT1jKRPHMXWRIA/0LH2YSo6qw932GNjAwgYox+RDsB5aOIesS6F/4xAKnwGUUYNsaAL7/LlMaXJWAeis3q/P32sDMp67KAJjFzF210aUa0EzTrHtf/w8SV6+F94YIMgAAAABJRU5ErkJggg=="); }

/* ---------------- 选队伍（ui-shared/src/hsr/TeamPicker.vue，类名 team-pick-） ----------------
 * 列出「编队」里的队伍，点一支选上。队伍多（最多 20 支）时列表自己滚动，不把页面撑长；360 宽一列，宽了自动排成多列。
 * 颜色全走主题变量，夜晚模式不用另写覆盖。 */
.team-pick { display: grid; gap: var(--space-2); min-width: 0; }
.team-pick-note { margin: 0; font-size: var(--fs-md); }
.team-pick-error { color: var(--bad); }
.team-pick-empty { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-4); border: 1px dashed var(--border); border-radius: var(--radius); background: var(--panel-2); }
.team-pick-empty .team-pick-note { flex: 1 1 200px; }
.team-pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: var(--space-2);
  max-height: min(60vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
}
.team-pick-team {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: var(--space-2) 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.team-pick-team:hover:not(:disabled) { border-color: var(--field-hover); }
.team-pick-team:focus-visible { box-shadow: var(--focus); }
.team-pick-team.is-on { border-color: var(--accent); background: var(--accent-soft); }
.team-pick-team:disabled { opacity: .5; cursor: default; }
.team-pick-head { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
.team-pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-semibold); }
.team-pick-team.is-on .team-pick-name { color: var(--accent-strong); }
.team-pick-count { flex: none; margin-left: auto; color: var(--muted); font-size: var(--fs-sm); }
.team-pick-slots { display: flex; gap: 6px; }
/* 头像是共享的 Avatar（.avatar，圆形）：没导入的位置写「?」，空位不写字。 */
.team-pick-slot { --avatar-size: 40px; border: 1px solid var(--border); font-size: var(--fs-md); font-weight: 400; }
.team-pick-slot.is-empty { border-style: dashed; background: none; }
.team-pick-slot.is-unknown { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); color: var(--warn); font-weight: 700; }
/* 编队里选了配置的位置（不是当前装备）：一行小字「名字·配置名」，放不下截断，鼠标停上去看全 */
.team-pick-builds { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.team-pick-team.is-on .team-pick-builds { color: var(--accent-strong); }
@media (max-width: 380px) {
  .team-pick-slot { --avatar-size: 36px; }
}

/* ---------------- 选关卡（ui-shared/src/hsr/StagePicker.vue，类名 stage-pick-） ----------------
 * 模式用外壳的 .tabs / .tab（TabSwitch），半场用 .gp-chips / .gp-chip，下拉框是原生 select（外壳换成统一菜单），这里只管排版。
 * 期和层用下拉框，期、层再多也只占一行；窄屏（两格放不下 160px）自动排成一列。 */
.stage-pick { display: grid; gap: var(--space-2); min-width: 0; }
.stage-pick .tab-switch { margin-bottom: 0; }
.stage-pick-note { margin: 0; font-size: var(--fs-md); }
.stage-pick-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: var(--space-2); }
.stage-pick-fields .input { width: 100%; min-width: 0; }
.stage-pick-label { font-size: var(--fs-sm); color: var(--muted); }

/* ---------------- 成品轴（ui-shared/src/hsr/AxisStrip.vue，类名 astrip-；行动轴已经在用 .axis-strip，别混） ----------------
 * 照着打的步骤列表：我方一行一步，终结技单独一行（左边一条强调色竖线，看得出是插进来的），敌人和【阿哈时刻】矮、淡，
 * 每轮之间一条分隔，当前步高亮。只用主题变量，夜晚模式不用另写覆盖。
 * 外面给了高度时列表在里面滚动；不给时跟着内容长。360 到 1000 宽都排得开：名字和目标过长时省略，不撑宽。 */
.astrip { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; min-height: 0; border-radius: var(--radius); outline: none; }
.astrip:focus-visible { box-shadow: var(--focus); }
.astrip-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.astrip-nav { height: 36px; padding: 0 var(--space-4); }
.astrip-count { color: var(--muted); font-size: var(--fs-md); font-variant-numeric: tabular-nums; white-space: nowrap; }
.astrip-list { display: flex; flex-direction: column; gap: 4px; min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; }

/* position: relative：行里只给读屏听的字（.astrip-hidden）是绝对定位的，要有这一层把它留在列表里。
   没有的话它按更外层定位，滚动列表剪不到它，会把整页撑出一段能滚的空白（2026-11-15 实测，占满窗口的布局里才看得出）。 */
.astrip-row { position: relative; display: flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: 44px; padding: 4px var(--space-2); border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.astrip-row.is-stop { cursor: pointer; }
.astrip-row.is-stop:hover { border-color: var(--field-hover); }
.astrip-row.is-current { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
/* 终结技：缩进一点、左边一条竖线，看得出是插在上一步后面的。 */
.astrip-row.is-ultimate { margin-left: var(--space-4); border-left: 3px solid var(--accent-2); }
.astrip-row.is-ultimate .astrip-move { background: color-mix(in srgb, var(--accent-2) 16%, var(--panel)); color: var(--accent-2); }
.astrip-row.is-assist .astrip-move { background: var(--panel-2); color: var(--muted); }
/* 助战什么时候按（「能量满了就放」「拖到真珠第 3 动之后放」）：靠右，拖过的用强调色。 */
.astrip-when { flex: 0 1 auto; min-width: 0; margin-left: auto; overflow: hidden; color: var(--muted); font-size: var(--fs-md); text-overflow: ellipsis; white-space: nowrap; }
.astrip-when.is-set { color: var(--accent-strong); }
/* 首领机制里要选的：玩家要操作的一步（能停），左边一条提醒色竖线、底色淡淡的提醒色，和我方出招分开，又比敌人行动醒目。
   选什么、按哪个算都要看全，字多时换行，不截断。 */
.astrip-row.is-choice { flex-wrap: wrap; row-gap: 2px; border-left: 3px solid var(--warn); }
.astrip-row.is-choice:not(.is-current) { background: color-mix(in srgb, var(--warn) 8%, var(--panel)); }
.astrip-row.is-choice .astrip-move { background: color-mix(in srgb, var(--warn) 18%, var(--panel)); color: var(--text); }
.astrip-question { flex: 0 1 auto; min-width: 0; color: var(--muted); font-size: var(--fs-md); overflow-wrap: anywhere; }
.astrip-pick { display: inline-flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; margin-left: auto; }
.astrip-pick-name { overflow-wrap: anywhere; }
.astrip-source { flex: none; padding: 0 6px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.astrip-source.is-set { color: var(--accent-strong); }
/* 敌人行动、【阿哈时刻】：不是玩家的操作，矮、淡，翻步时跳过。 */
.astrip-row.is-enemy, .astrip-row.is-aha, .astrip-row.is-memo { min-height: 28px; padding: 2px var(--space-2); border-style: dashed; background: transparent; color: var(--muted); font-size: var(--fs-sm); opacity: .72; }
.astrip-row.is-enemy .astrip-face, .astrip-row.is-aha .astrip-face, .astrip-row.is-memo .astrip-face { --avatar-size: 22px; }
/* 连着的几次敌人行动并成一行：一次一个头像，按先后排，一行放不下就换行（不横着滚）。名字在头像的提示和读屏文字里。 */
.astrip-faces { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
/* 【阿哈时刻】没有头像：用和行动轴同一个徽记，盖住组件给的首字。 */
.astrip-row.is-aha .astrip-face { background: var(--accent) var(--aha-glyph) center / 82% no-repeat; color: var(--accent-strong); }
.astrip-row.is-aha .astrip-face > span { visibility: hidden; }

/* 头像是共享的 Avatar（.avatar），这里只定大小和字号。 */
.astrip-face { --avatar-size: 32px; font-size: var(--fs-md); }
.astrip-face.is-small { --avatar-size: 24px; font-size: var(--fs-xs); }
.astrip-name { flex: 0 1 auto; min-width: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.astrip-move { flex: none; padding: 1px var(--space-2); border-radius: 999px; background: var(--panel-2); color: var(--accent-strong); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
/* 招式后面的按键（普攻 Q、战技 E）：小键帽。 */
.astrip-key { display: inline-block; margin-left: var(--space-1); min-width: 16px; padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--text) 82%, var(--panel)); color: var(--panel); font: inherit; font-size: var(--fs-2xs); line-height: 16px; text-align: center; vertical-align: 1px; }
.astrip-target { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 4px; min-width: 0; margin-left: auto; color: var(--muted); font-size: var(--fs-md); }
.astrip-target.is-ally .astrip-target-name { color: var(--good); }
.astrip-arrow { flex: none; }
.astrip-target-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.astrip-marked { flex: none; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--warn); }
.astrip-target + .astrip-marked { margin-left: 0; }
.astrip-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.astrip-round { display: flex; align-items: center; gap: var(--space-2); margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.astrip-round::before, .astrip-round::after { content: ""; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 760px) {
  .astrip-row { gap: 6px; }
  .astrip-row.is-ultimate { margin-left: var(--space-2); }
  .astrip-face { --avatar-size: 28px; }
  /* 窄屏上目标名字收短，名字放进头像的提示里。 */
  .astrip-target-name { max-width: 6em; }
  /* 助战的时机在窄屏上换到下一行写全，不截断（照着打要看的就是它）。 */
  .astrip-row.is-assist { flex-wrap: wrap; row-gap: 2px; }
  .astrip-when { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 400px) {
  .astrip-target-name { display: none; }
}

/* ---------------- 行动条（ui-shared/src/hsr/AxisQueue.vue，类名 aqueue-；翻步那一条借用成品轴的 astrip-bar） ----------------
 * 成品轴的另一种画法（2026-11-18 用户定样子）：像游戏左边那条行动顺序，一列贴着左边，一行一个回合；左边深色小块是还差多少行动值，
 * 横条头像只露脸（我方高清立绘按脸取景，位置由组件算；敌人整张放进去）；同一回合插进来的终结技、要选的是右边的小头像。
 * 颜色只分敌我：我方粉色、敌人红色，【阿哈时刻】按我方。右边只写现在要按什么和下一次轮到你按的。
 * 外面给了高度时列表在里面滚动（显示到底），滚动条是全站的浮动滑块。 */
.aqueue { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; min-height: 0; border-radius: var(--radius); outline: none; }
.aqueue:focus-visible { box-shadow: var(--focus); }
.aqueue-body { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, auto); align-items: start; flex: 0 1 auto; min-height: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.aqueue-list { display: flex; flex-direction: column; gap: var(--space-2); min-height: 0; margin: 0; padding: var(--space-3) var(--space-3) var(--space-3) 0; list-style: none; overflow: hidden; }
.aqueue-list.is-all { overflow-y: auto; overscroll-behavior: contain; }
.aqueue-row { position: relative; flex: none; display: flex; align-items: center; gap: var(--space-1); height: 48px; --side: var(--accent); }
.aqueue-row.is-enemy { --side: var(--bad); }
.aqueue-row.is-stop { cursor: pointer; }
.aqueue-row.is-now { height: 64px; }
/* 「现在」上面补画的、这一步之前不用按的几行（敌人出手、忆灵自己的回合）：淡一点，左边写「先」。 */
.aqueue-row.is-before { opacity: .62; }
.aqueue-av { flex: none; align-self: stretch; width: 40px; display: grid; place-items: center; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: color-mix(in srgb, var(--text) 86%, var(--panel)); color: var(--panel); font-size: var(--fs-sm); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.aqueue-row.is-enemy .aqueue-av { background: color-mix(in srgb, var(--bad) 80%, var(--text)); }
.aqueue-row.is-now .aqueue-av { background: var(--accent-fill); color: var(--on-accent-fill); font-size: var(--fs-xs); }
.aqueue-pic { position: relative; flex: none; align-self: stretch; width: 104px; display: grid; place-items: center; overflow: hidden; border-left: 4px solid var(--side); border-radius: var(--r-sm); background: var(--panel-2); color: var(--muted); font-size: var(--fs-md); font-weight: var(--fw-bold); }
.aqueue-row.is-now .aqueue-pic { width: 128px; box-shadow: 0 4px 14px color-mix(in srgb, var(--side) 35%, transparent); }
.aqueue-row.is-stop:hover .aqueue-pic { box-shadow: 0 0 0 1px var(--field-hover); }
.aqueue-art { position: absolute; max-width: none; height: auto; pointer-events: none; }
/* 没有高清立绘的（敌人、合金保姆这类）：小头像整张放进格子。贴着格子定位，不然百分比高度按原图 128px 算，只露出中间一段
   （2026-11-18 用户：列车长只看到一顶帽子）。 */
.aqueue-icon { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; }
.aqueue-row.is-enemy .aqueue-pic { background: color-mix(in srgb, var(--bad) 10%, var(--panel-2)); }
.aqueue-aha { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--accent) var(--aha-glyph) center / 82% no-repeat; }
.aqueue-ult { position: absolute; top: var(--space-1); right: var(--space-1); z-index: 1; min-width: 20px; height: 20px; padding: 0 var(--space-1); border-radius: var(--r-full); background: var(--accent-fill); color: var(--on-accent-fill); font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 20px; text-align: center; }
/* 这一动按哪个键（普攻 Q、战技 E）：和「大」同一个位置，深色键帽，和强调色的「大」分开。 */
.aqueue-key { background: color-mix(in srgb, var(--text) 82%, var(--panel)); color: var(--panel); }
/* 同一个单位同一时刻连着几步（首领一回合动两下、连放几次助战）并成一行：右下角标「×N」。 */
.aqueue-times { position: absolute; right: var(--space-1); bottom: var(--space-1); z-index: 1; min-width: 20px; height: 20px; padding: 0 var(--space-1); border-radius: var(--r-full); background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--border); font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
/* 同一回合里插进来的终结技、要选的：右边一串小头像，叠一点省地方。 */
.aqueue-extras { display: flex; align-items: center; padding-left: var(--space-1); }
.aqueue-extra { position: relative; flex: none; width: 32px; height: 32px; min-width: 0; padding: 0; border: 0; border-radius: var(--r-sm); background: none; box-shadow: 0 0 0 2px var(--panel); cursor: pointer; }
.aqueue-extra + .aqueue-extra { margin-left: -8px; }
.aqueue-extra:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 2; }
.aqueue-extra-face { --avatar-size: 32px; font-size: var(--fs-xs); }
.aqueue-extra-tag { position: absolute; right: -4px; bottom: -4px; min-width: 16px; height: 16px; padding: 0 2px; border-radius: var(--r-full); background: var(--accent-fill); color: var(--on-accent-fill); font-size: var(--fs-2xs); font-weight: var(--fw-bold); line-height: 16px; text-align: center; }
.aqueue-extra.is-choice .aqueue-extra-tag { background: var(--warn); }
.aqueue-extra-more { flex: none; display: grid; place-items: center; min-width: 32px; height: 32px; margin-left: -8px; padding: 0 var(--space-1); border-radius: var(--r-sm); background: var(--panel-2); box-shadow: 0 0 0 2px var(--panel); color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
/* 现在这一步落在这一行的哪一个上：那一个描一圈强调色。 */
.aqueue-pic.is-current, .aqueue-extra.is-current { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); z-index: 1; }
.aqueue-initial { font-size: var(--fs-lg); }
.aqueue-round { flex: none; display: flex; align-items: center; gap: var(--space-2); padding-left: var(--space-2); color: var(--muted); font-size: var(--fs-2xs); }
.aqueue-round::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.aqueue-side { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; padding: var(--space-3) var(--space-3) var(--space-3) var(--space-2); }
.aqueue-who { color: var(--muted); font-size: var(--fs-md); overflow-wrap: anywhere; }
.aqueue-move { margin-top: var(--space-1); color: var(--accent-strong); font-size: var(--fs-4xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.aqueue-target { display: flex; align-items: center; gap: var(--space-2); min-width: 0; margin-top: var(--space-2); font-size: var(--fs-md); }
.aqueue-target.is-ally .aqueue-target-name { color: var(--good); }
.aqueue-target-face { --avatar-size: 28px; font-size: var(--fs-xs); }
.aqueue-target-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aqueue-when { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--fs-md); }
.aqueue-next { padding-top: var(--space-3); border-top: 1px solid var(--line-soft); }
.aqueue-next-label { color: var(--muted); font-size: var(--fs-xs); }
.aqueue-next-line { margin-top: var(--space-1); font-size: var(--fs-base); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }

/* 窄窗口（exe 专注显示能拖到 300 宽、手机）：右边的大字收小，行动条不变。 */
@media (max-width: 420px) {
  .aqueue-move { font-size: var(--fs-3xl); }
  .aqueue-side { gap: var(--space-4); }
}

/* ---------------- 快捷键设置（ui-shared/src/components/HotkeySettings.vue，类名 hkset-） ----------------
 * 一个动作一行：名字 + 键的按钮（点了以后等着按新键，显示成「Ctrl + →」）；底下一行是提示和「恢复默认」「完成」。
 * 专注显示的窄窗口里用，行都不换行、尽量矮；只用主题变量，夜晚模式不用另写覆盖。 */
.hkset { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.hkset-head { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; margin: 0; font-size: var(--fs-md); }
.hkset-hint { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.hkset-row { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.hkset-name { flex: none; width: 4.5em; color: var(--muted); font-size: var(--fs-sm); }
.hkset-key { flex: 1 1 auto; min-width: 0; height: 26px; padding: 0 var(--space-2); overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); color: var(--text); font: inherit; font-size: var(--fs-md); font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.hkset-key:hover { border-color: var(--accent); }
.hkset-key:focus-visible { outline: none; box-shadow: var(--focus); }
.hkset-key.is-listening { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.hkset-foot { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; }
.hkset-line { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.hkset-line.is-warn { color: var(--warn); font-weight: 600; }
.hkset-foot .ghost, .hkset-foot .btn { flex: none; height: 26px; padding: 0 10px; font-size: var(--fs-sm); }

/* 手机上的几条通用规则（2026-11-16） */
@media (max-width: 760px) {
  /* iOS 和内嵌网页：点进 16px 以下的输入框会自动放大整页，输入类控件统一 16px。 */
  input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="email"], input[type="password"], input:not([type]), textarea, select { font-size: var(--fs-xl) !important; }
  /* 独立图标按钮补到 40–44，手指点得准；表格/时间轴里的密集小图标不硬放大。 */
  .rl-dc-trash { width: 44px; height: 44px; }
  .rl-filter-x { width: 40px; height: 40px; }
  /* 顶栏的小圆按钮补到 44px，手指点得准。 */
  #theme-toggle, #pin-toggle { width: 44px; height: 44px; }
}

/* 选择控件 / 小按钮统一过渡（2026-11-17）：按下和悬停都不硬切。 */
.sv-seg-item, .sv-mode, .sv-team-chip, .tb-mini, .tb-pick, .rl-tool, .bt-pick, .hr-tab,
.axis-save-btn, .axis-import-btn, .axis-expand-toggle, .axis-collapse-toggle, .axis-config-btn, .axis-add, .gp-item, .gt-dialog-actions button {
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.sv-seg-item, .sv-mode, .sv-team-chip, .tb-pick, .hr-tab, .bt-pick, .gp-item { cursor: pointer; }
.sv-seg-item:disabled, .sv-mode:disabled, .sv-team-chip:disabled, .tb-mini:disabled, .tb-pick:disabled,
.rl-tool:disabled, .bt-pick:disabled, .axis-save-btn:disabled, .axis-import-btn:disabled, .axis-expand-toggle:disabled, .axis-collapse-toggle:disabled, .axis-config-btn:disabled, .axis-add:disabled, .gp-item:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* 按下反馈（2026-11-16）：以前只有悬停，按下去没反应。统一缩一点点，别只换颜色。 */
.btn:active:not(:disabled),
.ghost:active:not(:disabled),
.tab:active:not(:disabled),
.nav-feature:active,
.nav-page:active,
.rs-chip:active,
.chip:active:not(:disabled),
.close-btn:active:not(:disabled),
.gp-chip:active:not(:disabled),
.hr-cat:active:not(:disabled),
.axis-chip:active:not(:disabled),
.sv-seg-item:active:not(:disabled),
.sv-mode:active:not(:disabled),
.sv-team-chip:active:not(:disabled),
.tb-mini:active:not(:disabled),
.tb-pick:active:not(:disabled),
.rl-tool:active:not(:disabled),
.bt-pick:active:not(:disabled),
.hr-tab:active:not(:disabled),
.axis-save-btn:active:not(:disabled),
.axis-import-btn:active:not(:disabled),
.axis-expand-toggle:active:not(:disabled),
.axis-collapse-toggle:active:not(:disabled),
.axis-config-btn:active:not(:disabled),
.axis-add:active:not(:disabled),
.gp-item:active:not(:disabled),
.gt-dialog-actions button:active:not(:disabled) {
  transform: scale(.98);
}

/* 键盘焦点（2026-11-16）：这几类可点区域原来没有自己的焦点样式，靠浏览器默认太不显眼。 */
.nav-feature:focus-visible,
.nav-page:focus-visible,
.nav-more:focus-visible,
.rs-chip:focus-visible,
.tab:focus-visible,
[role="option"]:focus-visible,
[role="tab"]:focus-visible,
.sidebar-backup button:focus-visible,
.sidebar-about summary:focus-visible,
.sidebar-links a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}
/* 兜底：没有单独写焦点样式的按钮，用统一的两层焦点环。 */
button:focus-visible, [role="button"]:focus-visible, [role="radio"]:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
/* 品牌是整行按钮，焦点圈画在行里面，免得被侧栏边缘裁掉 */
.brand:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -3px; }

@media (prefers-reduced-motion: reduce) {
  button, [role="button"], [role="radio"], [role="tab"], .btn, .ghost { transition: none; }
  button:active:not(:disabled), [role="button"]:active:not(:disabled), .btn:active:not(:disabled), .ghost:active:not(:disabled) { transform: none; }
}

/* ---- 换页（2026-11-16）：顶栏标题和内容同一拍 ----
 * 进功能：标题从下往上、内容跟着淡入；回首页：标题从上往下。
 * 内容只用 opacity：页面里带 transform 会让里面的 position: fixed 弹窗改按这一层定位（弹窗会跑到屏幕外）。
 * 都用 backwards，播完交还正常样式，不在元素上留 transform。 */
#crumb .crumb-icon,
#crumb .crumb-title,
#crumb .sub { animation: gt-crumb-in var(--t-base) var(--ease-out) backwards; }
#crumb .sub { animation-delay: 30ms; }
#crumb[data-enter="back"] .crumb-icon,
#crumb[data-enter="back"] .crumb-title,
#crumb[data-enter="back"] .sub { animation-name: gt-crumb-back; }
@keyframes gt-crumb-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes gt-crumb-back { from { opacity: 0; transform: translateY(-5px); } }

@keyframes gt-enter-forward { from { opacity: 0; } }
/* 页根一般只有一个 wrapper（.rs-page / .axis-page…），只动它的话等于整页一淡；
 * 2026-11-16 第四轮：连它的直接子块一起错开 30ms，进出才有「一块块落位」的节奏。 */
#view[data-enter="forward"] .gt-feature-root > * { animation: gt-enter-forward 180ms var(--ease-out) backwards; }
#view[data-enter="forward"] .gt-feature-root > * > * { animation: gt-enter-forward 260ms var(--ease-out) backwards; }
#view[data-enter="forward"] .gt-feature-root > * > *:nth-child(2) { animation-delay: 30ms; }
#view[data-enter="forward"] .gt-feature-root > * > *:nth-child(3) { animation-delay: 60ms; }
#view[data-enter="forward"] .gt-feature-root > * > *:nth-child(n + 4) { animation-delay: 90ms; }

/* 首页（2026-11-16 第二轮，2026-11-17 收成一次编排，2026-11-18 加面具）：胶囊 → 品牌字 → 狐狸面具挂上来 → 横线 → 小标题 → 四张卡 → 小按钮 → 链接。 */
#view[data-enter="back"] .welcome .home-status { animation: gt-home-rise 260ms var(--ease-out) backwards; }
#view[data-enter="back"] .welcome h1 { animation: gt-home-rise 420ms var(--ease-out) 30ms backwards; }
#view[data-enter="back"] .home-mask { animation: gt-home-mask 420ms var(--ease-spring) 300ms backwards; }
#view[data-enter="back"] .home-blade { animation: gt-home-rise 320ms var(--ease-out) 140ms backwards; }
#view[data-enter="back"] .home-ask { animation: gt-home-rise 300ms var(--ease-out) 160ms backwards; }
/* 樱花枝从自己那个角轻轻探进来（只动 opacity 和 translate；左下那枝转了 180°，同一个位移方向正好反过来） */
#view[data-enter="back"] .home-sky { animation: gt-home-sky 700ms var(--ease-out) backwards; }
@keyframes gt-home-sky { from { opacity: 0; } }
@keyframes gt-home-mask { from { opacity: 0; transform: rotate(-24deg) translateY(-.1em); } }
#view[data-enter="back"] .home-tool { animation: gt-home-rise 300ms var(--ease-out) backwards; }
#view[data-enter="back"] .home-tool:nth-child(1) { animation-delay: 180ms; }
#view[data-enter="back"] .home-tool:nth-child(2) { animation-delay: 230ms; }
#view[data-enter="back"] .home-tool:nth-child(3) { animation-delay: 280ms; }
#view[data-enter="back"] .home-tool:nth-child(4) { animation-delay: 330ms; }
#view[data-enter="back"] .home-quick { animation: gt-home-rise 320ms var(--ease-out) 380ms backwards; }
#view[data-enter="back"] .home-meta { animation: gt-home-rise 320ms var(--ease-out) 430ms backwards; }
@keyframes gt-home-rise { from { opacity: 0; transform: translateY(12px); } }

/* 本地加载通常一帧就好了，骨架屏只闪一下更难看：先不显示，150ms 还没好再淡进来 */
#view > .gt-skeleton { animation: gt-skeleton-late 140ms linear 150ms backwards; }
@keyframes gt-skeleton-late { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #crumb .crumb-icon,
  #crumb .crumb-title,
  #crumb .sub,
  #view[data-enter="forward"] .gt-feature-root > *,
  #view[data-enter="forward"] .gt-feature-root > * > *,
  #view[data-enter="back"] .welcome .home-status,
  #view[data-enter="back"] .welcome h1,
  #view[data-enter="back"] .home-mask,
  #view[data-enter="back"] .home-blade,
  #view[data-enter="back"] .home-ask,
  #view[data-enter="back"] .home-sky,
  #view[data-enter="back"] .home-tool,
  #view[data-enter="back"] .home-quick,
  #view[data-enter="back"] .home-meta { animation: none; }
}

/* ---- 删除前的收起（2026-11-17）：先淡出/缩小 160ms，再让数据更新移除 ----
 * 这里的 forwards 是故意的：收起后要保持隐藏到数据移除，不要闪回原样。 */
.gt-leaving { pointer-events: none; animation: gt-leave 160ms var(--ease-out) forwards; }
.gt-fade-out { pointer-events: none; animation: gt-fade-out 160ms var(--ease-out) forwards; }
@keyframes gt-leave { to { opacity: 0; transform: scale(.97); } }
@keyframes gt-fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .gt-leaving, .gt-fade-out { animation: none; opacity: 0; }
}

/* ---- 悬停抬升（2026-11-16）：可点的卡片浮起来 2px，告诉用户「这个能点」---- */
.rs-chip, .rl-cell {
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), border-color var(--t-fast);
}
.rs-chip:hover, .rl-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.rs-chip:active, .rl-cell:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .rs-chip:hover, .rl-cell:hover, .rs-chip:active, .rl-cell:active { transform: none; }
}

/* ---- 空状态（2026-11-16）：图标 + 一句为什么空 + 一个下一步 ---- */
.gt-empty { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-10) var(--space-5); text-align: center; flex: none; }
.gt-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: var(--space-1); border-radius: var(--r-full); background: var(--panel-2); color: var(--accent); }
.gt-empty-icon svg { width: 24px; height: 24px; }
.gt-empty-title { margin: 0; color: var(--text); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.gt-empty-hint { margin: 0; max-width: 32em; color: var(--muted); font-size: var(--fs-md); line-height: var(--lh-body); }
.gt-empty-action { margin-top: var(--space-3); }

/* ---- 轻提示 toast（2026-11-16）：保存、删除、导出这类结果不再弹模态 ---- */
.gt-toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  display: grid;
  gap: 8px;
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}
.gt-toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: min(88vw, 460px);
  padding: 10px var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-md);
  pointer-events: auto;
  cursor: pointer;
  animation: gt-toast-in var(--t-base) cubic-bezier(.2, .9, .3, 1);
}
.gt-toast::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gt-toast.is-success { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); color: var(--good); }
.gt-toast.is-error { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); color: var(--bad); }
.gt-toast.is-info { border-color: color-mix(in srgb, var(--info) 45%, var(--border)); color: var(--info); }
.gt-toast.is-leaving { animation: gt-toast-out var(--t-fast) ease forwards; }
@keyframes gt-toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes gt-toast-out { to { opacity: 0; transform: translateY(6px); } }
/* 手机底部有标签栏，提示往上挪一点，别挡住 */
@media (max-width: 760px) { .gt-toasts { bottom: calc(72px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .gt-toast, .gt-toast.is-leaving { animation: none; } }

/* ---- 按钮忙的时候（2026-11-16）：字隐掉，中间转一圈，别让用户以为没点动 ---- */
.btn.is-loading, .ghost.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after, .ghost.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 14px;
  height: 14px;
  margin: auto;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: gt-spin .7s linear infinite;
}
@keyframes gt-spin { to { transform: rotate(360deg); } }
/* 不在按钮里的转圈（「正在加载」那一行）：和按钮里的同一个动画；外面写 role="status" 和文字，转圈本身 aria-hidden。 */
.spinner {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -3px;
  animation: gt-spin .8s linear infinite;
}
/* 减少动态效果：转慢，不停（停了就看不出还在加载）。 */
@media (prefers-reduced-motion: reduce) { .btn.is-loading::after, .ghost.is-loading::after, .spinner { animation-duration: 2s; } }

