/*
 * theme.css —— OneCloud 自研前端的**唯一主题真相源**（2026-10-06 建立）
 *
 * 背景：门户先做了 macOS 27 那套玻璃风，DDNS 页 / WordBook / authgate 登录页 /
 * wolbridge 唤醒页各自还留着当初烟囱式长出来的配色。四处都改一遍等于四份真相，
 * 改一处漏三处是迟早的事。所以把「变量 + 背景层 + 通用控件」抽到这里，四处只准 link。
 *
 * ── 谁能用 ───────────────────────────────────────────────────────────
 *   本文件挂在 nginx 的静态根（/var/www/hello），对外就是 https://<host>/theme.css。
 *   ⚠️ hello.conf 里给它配了 `location = /theme.css { auth_request off; }` ——
 *      不 off 的话，**登录页自己**加载它会撞 401 → @auth_login → 拿到一份 HTML，
 *      页面就成了裸 HTML。改那一行的注释也写了这件事。
 *
 *   四处页面虽然在 nginx 上分属四条 route（静态根 / /words/ / /auth/ / /wake/），
 *   但都在**同一个 origin**，所以一律用绝对路径 `/theme.css` 引同一份，不必各存一份。
 *
 * ── 类名为什么是 gl- 前缀 ─────────────────────────────────────────────
 *   `.card` `.chip` `.badge` `.row` 这种通用名在各子页里早有自己的含义
 *   （WordBook 的 .card 是单词卡、.chip 是计数格），这里再定义同名的会互相覆盖。
 *   所以本文件对外只提供 gl- 前缀的那一组，剩下的留给各页自己。
 *
 * ── 引用方式 ─────────────────────────────────────────────────────────
 *   <link rel="stylesheet" href="/theme.css">
 *   <script src="/theme.js"></script>          <!-- 星辰层由它生成，见文件头注释 -->
 */

/* ══════════════════════════════════════════════════════════════ 变量 */
:root {
  color-scheme: dark;

  /* 底色：整块画布是**不透明**的深色。星空层是 z-index:-2 的普通子元素，
     按 CSS 绘制次序它压在 body 自己的背景**之上**、正常内容之下 ⇒ 底色实心也没关系，
     星空照样透出来，办成「半透明 body」反而会让个别浏览器整页发灰。 */
  --bg-deep: #07060c;

  /* 玻璃面：数值越低越透。太透会看不出「折射」，太实就退化成普通卡片 */
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.13);
  --glass-solid: rgba(26, 28, 42, 0.72);      /* 模态框用：要压住背后的东西 */

  /* 描边 */
  --stroke: rgba(255, 255, 255, 0.16);
  --stroke-hi: rgba(255, 255, 255, 0.34);
  --hair: rgba(255, 255, 255, 0.08);          /* 列表分隔线 */

  /* 文字三级 */
  --text: rgba(255, 255, 255, 0.94);
  --text-dim: rgba(255, 255, 255, 0.62);
  --text-faint: rgba(255, 255, 255, 0.42);

  /* 语义色 */
  --accent: #7aa2ff;
  --ok: #54e0a8;
  --warn: #ffd166;
  --bad: #ff7a7a;

  /* 圆角 / 投影 / 模糊 */
  --radius-l: 28px;
  --radius-m: 22px;
  --radius-s: 16px;
  --radius-xs: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.42), 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.55);
  --blur: blur(24px) saturate(165%);
  --blur-strong: blur(32px) saturate(175%);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ══════════════════════════════════════════════════════════════ 基础 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

/* `scrollbar-gutter: stable` 只在**真有持久滚动条**的环境才有意义（防内容随滚动条
   出现/消失横向跳一格）。⚠️ 移动端是 overlay 滚动条、不占布局，但 Chrome/Safari
   仍会按这句话预留一条槽 —— 于是右侧永久空出 10px 而左侧为 0，看起来就是
   「左右边距不一致」。
   ⇒ 用指针类型做门禁：精细指针（桌面）才预留；触屏（手机/平板）不预留。
   实测（390px 视口）：去掉后 wrap 左右边距 0/0 对称；留着时是 0/10。 */
@media (hover: hover) and (pointer: fine) {
  html { scrollbar-gutter: stable; }
}

/* 兜底：UA 的 [hidden]{display:none} 是**作者样式可覆盖**的 —— 任何一条设了 display
   的类规则（哪怕同优先级）都会盖掉它，且 element.hidden 读起来仍为 true。
   页面里的模态框 / 抽屉全靠 hidden 开合，这条必须留着。 */
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

/* ═══════════════════════════════════════════════════════ 背景：星辰 + 色晕 */
/* 两层都由 theme.js 在启动时插进 <body> 的最前面，页面本身不必写这些 div。
   z-index 取负数让它们沉到内容之下、-2/-1 两档固定了「星在下、色晕在上」的叠放次序。

   ⚠️ 星辰层是**静态**的（2026-10-07 改）—— 这里刻意没有 @keyframes / animation。
   原因是它上面盖着好几处 `backdrop-filter` 磨砂玻璃：背景只要逐帧变化，浏览器就得
   逐帧重新采样 + 重新模糊整块背景，70 颗闪动的星星等于让全页玻璃每帧重算一次。
   背景静止后玻璃模糊退化成「只算一次」，持续开销≈0。别再给它加回动画。 */
.gl-stars { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.gl-stars i { position: absolute; border-radius: 50%; }

/* 四角径向渐变：毛玻璃需要底下有东西可折射，纯黑底上 blur 是看不出效果的 */
.gl-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 46% at 12% 18%, rgba(122, 162, 255, 0.20), transparent 62%),
    radial-gradient(38% 42% at 88% 12%, rgba(168, 123, 255, 0.16), transparent 62%),
    radial-gradient(44% 48% at 78% 88%, rgba(45, 212, 191, 0.14), transparent 64%),
    radial-gradient(40% 44% at 18% 82%, rgba(91, 140, 255, 0.16), transparent 62%);
}

/* ══════════════════════════════════════════════════════ 图标（线性 sprite）
   形状定义在 theme.js 注入的那套 <symbol> 里，这里只管「长什么样」：
   一律 1em 见方、随字色、细描边 —— 与玻璃风的 1px 描边语言对齐。
   尺寸由**父级字号**决定，所以要放大就调父级的 font-size，别改这里的宽高。

   ⚠️ 页面里不要再写 emoji：彩色 emoji 自带配色和高光，压在半透明玻璃上
      会脏；而且各平台字形不一致（同一个 🔊 在 iOS / Windows / Android
      上三个样），「图标风格统一」这件事从写下 emoji 那一刻就做不到了。 */
.ico {
  width: 1em; height: 1em;
  flex: none;
  display: inline-block;
  vertical-align: -0.14em;          /* 基线校正：与汉字/拉丁字母齐平，不飘 */
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;             /* 图标不该吃掉按钮的点击命中区 */
}
/* ⚠️ 这条不能省：stroke-width 是 **viewBox 单位**，会跟着图标一起缩放 ——
   同一个 1.8 在 12px 小图标上是 0.9px（几乎断线），在 40px 空状态图标上
   却变成 3px（蠢粗）。non-scaling-stroke 让描边恒按 CSS 像素画，
   于是「一套图标、任意尺寸、同一根线」。 */
.ico path,
.ico circle,
.ico rect,
.ico line { vector-effect: non-scaling-stroke; }

/* ══════════════════════════════════════════════════════ 通用容器 / 控件 */
.gl-wrap {
  width: 100%; max-width: 1040px; margin: 0 auto;
  padding: 28px 24px 56px;
}

/* 玻璃卡片。注意 backdrop-filter 必须带 -webkit- 前缀 —— iOS Safari 至今只认旧的写法，
   缺了它在 iPhone 上就是一层半透明灰，完全不是玻璃。 */
.gl-card {
  padding: 18px;
  border-radius: var(--radius-m);
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  margin-bottom: 16px;
}
.gl-card > :last-child { margin-bottom: 0; }

.gl-card-title {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  font-size: 15px; font-weight: 640; letter-spacing: -0.2px;
  margin-bottom: 14px;
}

/* 键值行。下面那条发丝线刻意用 --hair（8%）而不是 --stroke —— 16% 在密集列表里太抢 */
.gl-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--hair);
}
.gl-row:last-child { border-bottom: none; }
.gl-k { font-size: 13px; color: var(--text-dim); flex: none; }
.gl-v {
  font-size: 13px; font-weight: 600; text-align: right;
  min-width: 0; word-break: break-all;
  display: flex; align-items: center; gap: 9px; justify-content: flex-end;
}

/* 按钮：主次两级。主按钮沿用了门户唤醒键那套斜向渐变。 */
.gl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-xs);
  border: 1px solid rgba(122, 162, 255, 0.42);
  background: linear-gradient(135deg, rgba(122, 162, 255, 0.32), rgba(122, 162, 255, 0.14));
  color: #eaf1ff; font: inherit; font-size: 13.5px; font-weight: 620;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1), filter 0.2s, border-color 0.2s;
}
.gl-btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.gl-btn:active { transform: translateY(0); }
.gl-btn:disabled { opacity: 0.55; cursor: default; }
.gl-btn:disabled:hover { transform: none; filter: none; }

.gl-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--stroke);
  color: var(--text-dim);
}
.gl-btn-ghost:hover { color: var(--text); border-color: var(--stroke-hi); filter: none; }

/* 语义按钮：主按钮（蓝）用于「打开 / 主行动」，绿色用于「保存 / 应用」，
   红色用于「重启 / 删除」这类有破坏性或会短暂中断的动作。 */
.gl-btn-ok {
  border-color: rgba(84, 224, 168, 0.42);
  background: linear-gradient(135deg, rgba(84, 224, 168, 0.28), rgba(84, 224, 168, 0.10));
  color: #eafff6;
}
.gl-btn-ok:hover { border-color: rgba(84, 224, 168, 0.62); }
.gl-btn-danger {
  border-color: rgba(255, 122, 122, 0.40);
  background: linear-gradient(135deg, rgba(255, 122, 122, 0.22), rgba(255, 122, 122, 0.08));
  color: #ffecec;
}
.gl-btn-danger:hover { border-color: rgba(255, 122, 122, 0.62); filter: brightness(1.08); }

/* 开关（代理总开关）。原生的 checkbox 藏在 label 里，由 .track 画轨道。 */
.gl-switch {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.gl-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.gl-switch .track {
  position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.10); border: 1px solid var(--stroke);
  transition: background 0.18s, border-color 0.18s;
}
.gl-switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.72);
  transition: transform 0.18s, background 0.18s;
}
.gl-switch input:checked + .track {
  background: rgba(84, 224, 168, 0.30); border-color: rgba(84, 224, 168, 0.55);
}
.gl-switch input:checked + .track::after { transform: translateX(18px); background: var(--ok); }
.gl-switch input:focus-visible + .track { outline: 1px solid var(--stroke-hi); outline-offset: 3px; }
.gl-switch input:disabled + .track { opacity: 0.45; cursor: default; }
.gl-switch .sw-label { font-size: 12px; color: var(--text-faint); min-width: 3em; }
.gl-switch .sw-label.on { color: var(--ok); }

.gl-input,
.gl-select {
  width: 100%; padding: 11px 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xs);
  color: var(--text); font: inherit; font-size: 15px;
  outline: none; transition: border-color 0.15s, background 0.15s;
}
.gl-select { padding: 8px 10px; font-size: 13px; color-scheme: dark; }
/* 原生下拉的**弹层**是 UA 画的：页面这边给它设了 `color`，弹层默认却是白底，
   于是变成「白底白字」。显式给 option 上深底浅字，Chrome / Firefox 都认。 */
.gl-select option { background-color: #1a1c2a; color: var(--text); }

/* 下拉箭头自绘。
   原生箭头的位置由 UA 决定（Safari / Chrome / Windows 三者都不一样），
   我们只能给 padding，管不到箭头 —— 实测编辑弹窗里箭头离右边框只有 4px，
   跟左侧 13px 的文字内边距完全不对称。改成 appearance:none + 自己画一个，
   `right 13px` 与左内边距对齐，`padding-right:34px` 保证长选项文字不压箭头。
   ⚠️ 本块必须写在 .gl-input 的 `background:` 简写**之后**，否则会被那个简写清掉。 */
select.gl-select,
select.gl-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='rgba(255,255,255,0.55)' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 11px 7px;
}
select.gl-select::-ms-expand { display: none; }
.gl-input::placeholder { color: var(--text-faint); }
/* 焦点态用 background-color 而不是 background 简写：简写会把上面那条
   background-image（箭头）一起重置掉，一聚焦箭头就消失。 */
.gl-input:focus,
.gl-select:focus { border-color: var(--stroke-hi); background-color: rgba(255, 255, 255, 0.09); }

/* 徽章 / 状态点 / 标签 */
.gl-badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: var(--text-dim);
  border: 1px solid var(--stroke); white-space: nowrap;
}
.gl-badge.ok   { background: rgba(84, 224, 168, 0.16); color: var(--ok);   border-color: rgba(84, 224, 168, 0.35); }
.gl-badge.bad  { background: rgba(255, 122, 122, 0.16); color: var(--bad); border-color: rgba(255, 122, 122, 0.35); }
.gl-badge.warn { background: rgba(255, 209, 102, 0.14); color: var(--warn); border-color: rgba(255, 209, 102, 0.30); }

.gl-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-faint); }
.gl-dot.ok  { background: var(--ok);  box-shadow: 0 0 8px var(--ok); }
.gl-dot.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

.gl-tag {
  display: inline-block; font-size: 11px; line-height: 1.6;
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.08); color: var(--text-dim);
}
.gl-tag.use  { background: rgba(122, 162, 255, 0.20); color: #a8c4ff; }
.gl-tag.dead { background: rgba(255, 122, 122, 0.18); color: #ffa3a3; }
.gl-tag.warn { background: rgba(255, 209, 102, 0.18); color: #ffdd8a; }

/* 等宽片段（地址、端口、域名） */
.gl-mono {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 9px; border-radius: 8px;
  font-size: 12.5px; word-break: break-all;
}
a.gl-mono { color: var(--text); text-decoration: none; }
a.gl-mono:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

/* 长文本日志块。滚动条按 2026-10-05 的需求隐藏：日志一直在追加，右侧那根条跟着不停变化，
   抢注意力。滚动能力保留（滚轮 / 触摸 / 键盘都在），只是不画那根条。 */
.gl-log {
  padding: 12px; border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px; line-height: 1.55;
  max-height: 320px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* 旧 Edge / IE */
}
.gl-log::-webkit-scrollbar { display: none; }   /* Chrome / Safari / 新 Edge */

/* 表格（DDNS 页的地址全貌用）
   ── 2026-10-07 第二轮：可断行 → 单行省略号 ──────────────────────────
   ① 地址列**不换行**：换行会把行高撑成 2~3 倍（375px 实测 3 行），窄屏下整张表
      读起来像「一坨地址」而不是表格。
   ② 但「不换行」必须配宽度上限，否则 39 字符的 IPv6（等宽约 290px）会按
      「内容最小宽度」把整张表顶出卡片 —— 上一版就栽在这（状态标签被裁到卡片外）。
   ⇒ 所以 `table-layout: fixed` + 显式列宽是**必须**的、不是装饰：
      宽度由列宽说了算、内容不再参与分配，`nowrap + ellipsis` 才能安全截断。
   列宽取值依据：2/3 列是寿命（最长 `0（已耗尽）`）、4 列是状态标签
   （最长 `实测不可达 已废弃`），都给「刚好放得下」的定值，剩余全归地址列。 */
.gl-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.gl-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-dim);
  padding: 7px 8px; border-bottom: 1px solid var(--stroke);
}
.gl-table th:nth-child(2), .gl-table td:nth-child(2),
.gl-table th:nth-child(3), .gl-table td:nth-child(3) { width: 96px; }
.gl-table th:nth-child(4), .gl-table td:nth-child(4) { width: 168px; }

/* 单行省略号。⚠️ 状态列（第 4 列）是例外：它是若干 `white-space:nowrap` 的短标签
   并排，放不下时**整枚折到下一行**比「裁掉半枚标签」可读 —— 标签内部依然不拆。
   （这不是给超长文本留的退路，地址那种才是；短标签折行不撑高多少。） */
.gl-table th, .gl-table td {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gl-table td:nth-child(4) { white-space: normal; overflow: visible; text-overflow: clip; }

.gl-table td {
  padding: 8px; border-bottom: 1px solid var(--hair); vertical-align: top;
}
.gl-table tr.use  td { background: rgba(122, 162, 255, 0.07); }
.gl-table tr.dead td { background: rgba(255, 122, 122, 0.06); }

/* 窄屏：4 列并排读不了（地址占满一行后，valid/preferred/状态 只能各剩几十 px）。
   改成「一条地址一块」—— 地址独占一行，寿命两项并排、列名用 ::before 就近标注，
   状态另起一行。判据：≤560px 时卡片内宽已不足 4 列的最小宽度之和。 */
@media (max-width: 560px) {
  .gl-table { display: block; }
  .gl-table thead { display: none; }              /* 列名改由下面那对 ::before 提供 */
  .gl-table tbody, .gl-table tr, .gl-table td { display: block; }
  .gl-table tr { border-bottom: 1px solid var(--hair); }
  .gl-table tr:last-child { border-bottom: none; }
  .gl-table td { border-bottom: none; padding: 3px 8px; }
  /* ⚠️ 这条不能省、也不能简写成 `.gl-table td { width: auto }`：上面给 2/3/4 列定的
     96/168px 是**表格布局**用的，到了 `display:block` 这里会变成「真实块宽」，
     每格缩成一条窄柱。而 `.gl-table td`（0,1,1）打不过 `.gl-table td:nth-child(2)`
     （0,2,1）—— 必须写到同级特异性才复位得掉。 */
  .gl-table th:nth-child(2), .gl-table td:nth-child(2),
  .gl-table th:nth-child(3), .gl-table td:nth-child(3),
  .gl-table th:nth-child(4), .gl-table td:nth-child(4) { width: auto; }
  .gl-table td:first-child { padding-top: 10px; }
  .gl-table td:last-child  { padding-bottom: 10px; }
  .gl-table td:nth-child(2),
  .gl-table td:nth-child(3) { display: inline-block; padding-top: 0; padding-bottom: 0; }
  .gl-table td:nth-child(2)::before { content: 'valid '; }
  .gl-table td:nth-child(3)::before { content: 'preferred '; }
  .gl-table td:nth-child(2)::before,
  .gl-table td:nth-child(3)::before { font-size: 11px; color: var(--text-faint); }
}

/* 模态层。没有关闭按钮是刻意的 —— 点框外空白 / 按 Esc 关闭。 */
.gl-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 6, 14, 0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.gl-modal {
  width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 18px;
  border-radius: var(--radius-m);
  background: var(--glass-solid);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-pop);
  backdrop-filter: var(--blur-strong); -webkit-backdrop-filter: var(--blur-strong);
  cursor: default; color: var(--text);
  overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.gl-backdrop { overscroll-behavior: contain; }

/* 模态打开时由 JS 给 <html> 加这个类：锁住背后页面，滚轮不会在模态滚到尽头后
   继续滚父页面（overscroll-behavior 再兜一层）。 */
html.gl-modal-open,
html.gl-modal-open body { overflow: hidden; }

/* 深色细滚动条：Windows 默认的亮灰宽条在玻璃卡片上很突兀。 */
html { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
html::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16); border: 2px solid transparent;
  border-radius: 999px; background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28); border: 2px solid transparent;
  background-clip: padding-box;
}
.gl-modal::-webkit-scrollbar { width: 9px; height: 9px; }
.gl-modal::-webkit-scrollbar-track { background: transparent; }
.gl-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16); border: 2px solid transparent;
  border-radius: 999px; background-clip: padding-box;
}
.gl-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28); border: 2px solid transparent;
  background-clip: padding-box;
}

/* 原生 file input 的「选择文件」按钮也换成站内 ghost 按钮风格。 */
input[type="file"] { color: var(--text-dim); font-size: 12px; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 12px; font-weight: 600; height: 36px;
  margin-right: 10px; padding: 0 12px;
  border: 1px solid var(--stroke); border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06); color: var(--text-dim);
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
}
input[type="file"]::file-selector-button:hover {
  color: var(--text); border-color: var(--stroke-hi);
  background: rgba(255, 255, 255, 0.10);
}

/* 文字色调快捷 */
.gl-dim   { color: var(--text-dim); }
.gl-faint { color: var(--text-faint); }
.gl-ok    { color: var(--ok); }
.gl-warn  { color: var(--warn); }
.gl-bad   { color: var(--bad); }
.gl-info  { color: #9dc4ff; }
