/* ==========================================================================
   ShareHub · 全站样式（手写，无框架依赖）
   设计语言：暖中性纸感 + 陶土色强调 + 衬线标题，细描边、低饱和、克制动效。
   结构：tokens → base → layout → components → pages → responsive
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */

:root {
  /* 层级：bg < bg-soft < card < card-2 < card-3（暖灰，带一点纸黄） */
  --bg: #1a1918;
  --bg-soft: #201f1e;
  --card: #242322;
  --card-2: #2b2a28;
  --card-3: #343330;

  --border: #3a3936;
  --border-soft: #2e2d2a;
  --border-strong: #4b4945;

  --text: #f5f4ee;
  --text-dim: #c4c0b5;
  --muted: #948f85;

  --acc: #bd5f40;
  --acc-hi: #cd7253;
  --acc-text: #dd8f75;
  --acc-soft: rgba(189, 95, 64, .15);
  --acc-line: rgba(189, 95, 64, .46);

  --ok: #7fa87f;
  --warn: #d9a441;
  --danger: #df6a5e;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --radius: 14px;
  --radius-sm: 9px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .4);
  --shadow: 0 12px 32px -16px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .26);
  --shadow-lg: 0 28px 64px -28px rgba(0, 0, 0, .8);
  --ring: 0 0 0 3px rgba(217, 119, 87, .24);

  /* 只有两种字体：Newsreader（标题/编辑感）+ Switzer（正文/UI）。不掺第三款。
     后面的中文字体只是兜底 —— 用户内容（昵称、文件名、公告）里仍有中文，
     指定明确的字族比让浏览器随机挑一个要稳。 */
  --serif: "Newsreader", Georgia, "Times New Roman", "Songti SC", "Source Han Serif SC",
    "Noto Serif SC", SimSun, serif;
  --sans: "Switzer", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "Switzer", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 54px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="light"] {
  --bg: #f7f5ef;
  --bg-soft: #f0eee6;
  --card: #fffefa;
  --card-2: #f5f3eb;
  --card-3: #eae6db;

  --border: #e2ded1;
  --border-soft: #eeebe1;
  --border-strong: #d1cbbb;

  --text: #1f1e1d;
  --text-dim: #524f48;
  --muted: #6f6a62;

  --acc: #b8563a;
  --acc-hi: #a34a2f;
  --acc-text: #a8492c;
  --acc-soft: rgba(184, 86, 58, .10);
  --acc-line: rgba(184, 86, 58, .34);

  --ok: #4a7c59;
  --warn: #96702a;
  --danger: #b8493c;

  --shadow-xs: 0 1px 2px rgba(60, 50, 40, .06);
  --shadow-sm: 0 2px 6px -1px rgba(60, 50, 40, .08);
  --shadow: 0 12px 28px -18px rgba(60, 50, 40, .28), 0 1px 3px rgba(60, 50, 40, .05);
  --shadow-lg: 0 28px 60px -30px rgba(60, 50, 40, .32);
  --ring: 0 0 0 3px rgba(201, 100, 66, .18);
}

/* ---------------------------------------------------------------- base */

* { box-sizing: border-box; }
[v-cloak] { display: none !important; }

html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1000px 520px at 50% -14%, rgba(217, 119, 87, .08), transparent 72%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="light"] body {
  background:
    radial-gradient(1000px 520px at 50% -14%, rgba(201, 100, 66, .07), transparent 72%),
    var(--bg);
}

::selection { background: var(--acc); color: #fff; }

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: 4px;
}

a { color: var(--acc-text); text-decoration: none; transition: color .16s; }
a:hover { color: var(--acc-hi); }

/* 大标题用衬线（Claude 那种编辑感），小标题与正文回到无衬线，避免小字号宋体发糊 */
h1, h2 {
  margin: 0 0 .5em;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -.015em;
  color: var(--text);
}
h1 { font-size: clamp(1.62rem, 2.4vw, 2.02rem); letter-spacing: -.022em; }
h2 { font-size: 1.1rem; }

h3, h4 {
  margin: 0 0 .5em;
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: -.008em;
  color: var(--text);
}
h3 { font-size: .95rem; }
h4 { font-size: .85rem; color: var(--text-dim); }

p { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }

hr {
  border: 0; height: 1px; background: var(--border-soft); margin: 20px 0;
}

code, pre, kbd { font-family: var(--mono); font-size: .86em; }

code {
  background: var(--card-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xs);
  padding: .1em .38em;
  color: var(--text-dim);
  word-break: break-all;
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
  overflow: auto;
  margin: 0;
  max-height: 440px;
  line-height: 1.7;
  color: var(--text-dim);
}
pre code { background: none; border: 0; padding: 0; color: inherit; }

kbd {
  background: var(--card-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: var(--r-xs);
  padding: .08em .38em; color: var(--text-dim);
}

details > summary { cursor: pointer; color: var(--text-dim); font-size: .84rem; }
details > summary:hover { color: var(--text); }
details[open] > summary { margin-bottom: 10px; }

/* --------------------------------------------------------- 符号（箭头） */
/* Switzer / Newsreader 只覆盖拉丁字符，U+2190–2193 这类箭头会掉到系统字体上，
   字形粗细和基线都对不上。这里统一用矢量遮罩画，颜色跟随文字、大小跟随字号。 */

.ar {
  --ar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15'/%3E%3Cpath d='M13 6l6 6-6 6'/%3E%3C/svg%3E");
  display: inline-block;
  width: .68em; height: .68em;
  vertical-align: -.05em;
  background: currentColor;
  -webkit-mask: var(--ar-icon) center / contain no-repeat;
  mask: var(--ar-icon) center / contain no-repeat;
  flex: none;
}
.ar-l { transform: rotate(180deg); }
.ar-ur { transform: rotate(-45deg); }
.ar-lr {
  --ar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M8 7l-5 5 5 5'/%3E%3Cpath d='M16 7l5 5-5 5'/%3E%3C/svg%3E");
}
.ar-dr {
  --ar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4v8a4 4 0 0 0 4 4h10'/%3E%3Cpath d='M14 12l4 4-4 4'/%3E%3C/svg%3E");
}
/* 章节序号：字体里没有 ①②③④，改成描边数字 */
.step-n {
  display: inline-grid; place-items: center;
  width: 1.55em; height: 1.55em;
  margin-right: .5em;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--acc-text);
  font-family: var(--sans);
  font-size: .68em; font-weight: 600;
  font-variant-numeric: tabular-nums;
  vertical-align: .08em;
}

/* ---------------------------------------------------------------- layout */

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 860px; }

#app { display: flex; flex-direction: column; min-height: 100vh; }

.page { flex: 1 0 auto; padding: 34px 0 76px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .inner {
  display: flex; align-items: center; gap: 20px;
  max-width: 1160px; margin: 0 auto;
  height: var(--header-h); padding: 0 24px;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-size: .93rem; font-weight: 600; letter-spacing: -.015em;
  color: var(--text); white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand .logo {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--acc); color: #fff;
  font-family: var(--serif);
  font-size: .82rem; font-weight: 600; letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .35s var(--ease), background-color .2s;
}
.brand:hover .logo { transform: rotate(-6deg) scale(1.04); }
/* 导航栏只留图标，站名通过 title / aria-label 挂在链接上（见 core.js 的 site-nav） */

/* 导航分两块：左边一组页签（.nav），右边固定工具（.nav-actions）。
 * 宽屏整条铺开；放不下时 .nav 自己收缩、内部横向滚动（不做折叠菜单，见 core.js 注释），
 * 工具按钮始终留在条上，手机上切主题/搜索不用先展开菜单。 */
.nav {
  display: flex; align-items: center; gap: 2px;
  margin-left: auto;
  /* flex:0 1 auto + min-width:0：放得下时按自然宽度靠右对齐，放不下时收缩到可用宽度。
     min-width 必须显式写 0 —— flex 项默认 min-width:auto 会撑到内容宽度，那样永远滚不起来。 */
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* 页签不压缩：宁可横向滚动，也不要把 "Speed test" 挤成 "Speed te…" */
.nav > * { flex: none; }
/* 边缘渐隐：只在那一侧还有没露出来的页签时出现（class 由 core.js 的 paintEdges 维护），
   否则窄屏看上去就像「菜单被截断了」，用户不会想到去划。 */
.nav.can-right {
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 22px);
  mask-image: linear-gradient(to left, transparent 0, #000 22px);
}
.nav.can-left {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22px);
  mask-image: linear-gradient(to right, transparent 0, #000 22px);
}
.nav.can-left.can-right {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22px,
                                      #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 22px,
                              #000 calc(100% - 22px), transparent 100%);
}
.nav a {
  padding: 6px 11px; border-radius: var(--r-sm);
  font-size: .84rem; font-weight: 500; color: var(--text-dim);
  white-space: nowrap; transition: background-color .16s, color .16s;
}
.nav a:hover { background: var(--card-2); color: var(--text); }
.nav a.active {
  background: var(--card-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-actions { display: flex; align-items: center; flex: none; }

.theme-btn {
  display: grid; place-items: center;
  width: 30px; height: 30px; margin-left: 6px; padding: 0;
  border-radius: var(--r-sm);
  background: transparent; border: 1px solid transparent;
  color: var(--muted); cursor: pointer;
  transition: .16s;
}
.theme-btn:hover { background: var(--card-2); border-color: var(--border); color: var(--text); }
.theme-btn svg { width: 15px; height: 15px; display: block; }

.token-chip {
  margin-left: 6px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: var(--r-xs);
  background: var(--bg-soft);
  font-family: var(--mono); font-size: .7rem; color: var(--muted);
  cursor: pointer; white-space: nowrap;
  transition: .16s;
}
.token-chip:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------------------------------------------------- 窄屏：页签横向滚动 */

/* 早期版本在这里做过「折叠成汉堡 + 绝对定位下拉面板」，因为 pointerdown 判定
 * 会把面板先藏起来、click 再也不触发（手机端点菜单项不跳转），已整体撤掉。
 * 现在窄屏就是一条可以划的页签带，规则见上面的 .nav。 */

/* ---------------------------------------------------------------- 通用排布 */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(252px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin: 0 0 26px;
}
.page-head h1 { margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--muted); font-size: .88rem; }

.card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .sub { color: var(--muted); font-size: .8rem; }

/* ---------------------------------------------------------------- 卡片 */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}
.card.tight { padding: 16px 18px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 150% at 0% 0%, var(--acc-soft), transparent 58%),
    var(--card);
  box-shadow: var(--shadow-sm);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(120% 90% at 100% 0%, #000, transparent 62%);
  mask-image: radial-gradient(120% 90% at 100% 0%, #000, transparent 62%);
  opacity: .5;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.hero p { color: var(--text-dim); max-width: 68ch; }

.feature {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  color: inherit;
  transition: border-color .18s, background-color .18s, transform .18s var(--ease);
}
.feature:hover {
  color: inherit;
  border-color: var(--border-strong);
  background: var(--card-2);
  transform: translateY(-2px);
}
.feature h3 { margin: 0; font-size: .93rem; }
.feature p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.feature .tag { align-self: flex-start; margin-top: auto !important; }

/* ---------------------------------------------------------------- 表单 */

label.field { display: block; margin-bottom: 16px; }
label.field > span {
  display: block; margin-bottom: 6px;
  font-size: .82rem; font-weight: 500; color: var(--text-dim);
}
label.field .hint { display: block; margin-top: 6px; font-size: .76rem; color: var(--muted); font-weight: 400; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"],
input[type="search"], input[type="email"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit; font-size: .88rem;
  transition: border-color .16s, box-shadow .16s, background-color .16s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: var(--ring);
  background: var(--card);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input[readonly] { color: var(--text-dim); font-family: var(--mono); font-size: .8rem; }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

input[type="range"] { width: 100%; accent-color: var(--acc); }
input[type="checkbox"], input[type="radio"] {
  width: 15px; height: 15px; accent-color: var(--acc);
  vertical-align: -2px; cursor: pointer;
}

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--text);
  font: inherit; font-size: .84rem; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  transition: background-color .16s, border-color .16s, color .16s, transform .1s;
  -webkit-user-select: none; user-select: none;
}
.btn:hover {
  background: var(--card-3);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: var(--card-2); border-color: var(--border); }

.btn-primary {
  background: var(--acc); border-color: transparent; color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn-primary:hover { background: var(--acc-hi); border-color: transparent; color: #fff; }

.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); background: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); color: var(--danger); }

.btn-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, var(--border)); background: transparent; }
.btn-ok:hover { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); color: var(--ok); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--card-2); border-color: transparent; color: var(--text); }

.btn-sm { height: 28px; padding: 0 10px; font-size: .76rem; border-radius: var(--r-xs); }
.btn-lg { height: 40px; padding: 0 20px; font-size: .9rem; border-radius: var(--r-md); }
.btn-block { display: flex; width: 100%; }

/* 分段控件：用 .tabs 承载，视觉上是现代 segmented control */
.tabs {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  padding: 3px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.tabs button {
  height: 28px; padding: 0 12px;
  border: 0; border-radius: var(--r-xs);
  background: transparent;
  color: var(--muted);
  font: inherit; font-size: .8rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background-color .16s, color .16s, box-shadow .16s;
}
.tabs button:hover { color: var(--text); }
.tabs button.on {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--border);
}

/* ---------------------------------------------------------------- 标签 / 提示 */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--text-dim);
  font-size: .72rem; font-weight: 500; line-height: 1.7;
  white-space: nowrap;
}
.tag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.tag.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.tag.brand { color: var(--acc-text); border-color: var(--acc-line); background: var(--acc-soft); }

.alert {
  display: block;
  margin-bottom: 14px; padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card-2);
  color: var(--text-dim);
  font-size: .84rem; line-height: 1.75;
}
.alert:last-child { margin-bottom: 0; }
.alert.ok { border-color: color-mix(in srgb, var(--ok) 34%, transparent); background: color-mix(in srgb, var(--ok) 10%, var(--card)); color: var(--text); }
.alert.warn { border-color: color-mix(in srgb, var(--warn) 34%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--card)); color: var(--text); }
.alert.danger { border-color: color-mix(in srgb, var(--danger) 34%, transparent); background: color-mix(in srgb, var(--danger) 10%, var(--card)); color: var(--text); }
.alert.info { border-color: var(--acc-line); background: var(--acc-soft); color: var(--text); }
.alert code { background: color-mix(in srgb, var(--bg) 55%, transparent); }

/* 工具类 */
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.small { font-size: .8rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- 表格 */

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
}
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
th {
  position: sticky; top: 0;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: .74rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: var(--card-2); }
td.mono, th.mono { font-family: var(--mono); font-size: .78rem; }

/* ---------------------------------------------------------------- 文件卡片 */

.file-card {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s;
}
.file-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.file-thumb {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(120% 120% at 50% 0%, var(--card-3), var(--bg-soft) 78%);
}
.file-thumb img, .file-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.file-thumb video { background: var(--bg-soft); }

/* 类型标识：列表缩略图与详情页共用 */
.kind-ico {
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.2;
}
.file-thumb .kind-ico {
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
.file-thumb .badge {
  position: absolute; top: 9px; left: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(10, 11, 13, .62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff; font-size: .68rem; font-weight: 500;
}
.file-thumb .thumb-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.file-thumb .thumb-play::before {
  content: "";
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(10, 11, 13, .55)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 7.5v9l7.5-4.5z'/%3E%3C/svg%3E")
    center / 22px no-repeat;
  border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.file-body {
  display: flex; flex-direction: column; gap: 7px;
  flex: 1; padding: 14px 15px;
}
.file-body h3 {
  margin: 0;
  font-size: .88rem; font-weight: 550; line-height: 1.45;
  letter-spacing: -.005em;
  word-break: break-word;
}
.file-body .desc {
  margin: 0;
  color: var(--muted); font-size: .79rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.file-meta {
  display: flex; gap: 7px; flex-wrap: wrap;
  margin-top: auto;
  color: var(--muted); font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.file-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 15px 15px;
}

/* ---------------------------------------------------------------- 预览 */

.preview-stage {
  display: grid; place-items: center;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: #07080a;
}
.preview-stage img, .preview-stage video { max-width: 100%; max-height: 74vh; display: block; }
.preview-stage audio { width: min(620px, 92%); margin: 34px 0; }
.preview-stage iframe { width: 100%; height: 74vh; border: 0; background: #fff; }
.preview-stage pre { width: 100%; max-height: 74vh; border: 0; border-radius: 0; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- 聊天 */
/* 整页锁死：body 不滚动，全站唯一可滚动的容器是 .chat-log */

body.chat-body { height: 100dvh; overflow: hidden; }
body.chat-body #app { height: 100%; min-height: 0; }

.chat-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: 12px 24px;
}
.chat-shell {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-soft);
  min-height: 44px;
}
.chat-dot {
  width: 7px; height: 7px; flex: none;
  border-radius: 50%;
  background: var(--muted);
}
.chat-dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.chat-title {
  font-family: var(--serif);
  font-size: .95rem; font-weight: 600; letter-spacing: -.01em;
  color: var(--text);
}
.chat-meta { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.chat-sep { color: var(--border-strong); font-size: .78rem; }
.chat-head .chat-nick {
  width: 108px; flex: none;
  height: 28px; padding: 0 9px;
  border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  background: var(--card); color: var(--text-dim);
  font-family: inherit; font-size: .8rem;
  transition: .16s;
}
.chat-head .chat-nick:hover { border-color: var(--border); }
.chat-head .chat-nick:focus { border-color: var(--border-strong); background: var(--card); color: var(--text); outline: none; }

.icon-btn {
  display: grid; place-items: center;
  width: 28px; height: 28px; flex: none;
  padding: 0;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--muted);
  cursor: pointer; transition: .16s;
}
.icon-btn:hover { background: var(--card-2); border-color: var(--border); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.icon-btn svg { width: 15px; height: 15px; display: block; }
.icon-btn:disabled { opacity: .5; cursor: default; }

.chat-log {
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;   /* 滚到边界不再把整页带着滚 */
  padding: 12px 16px 16px;
  scrollbar-gutter: stable;
}
.chat-more { display: flex; justify-content: center; flex: none; padding: 2px 0 10px; }
.chat-empty {
  margin: auto; padding: 24px;
  color: var(--muted); font-size: .86rem; text-align: center;
}
.chat-msg {
  display: flex; gap: 9px; align-items: flex-start;
  flex: none;            /* 消息区是纵向 flex，消息不能被压缩 */
  min-width: 0;
  padding: 3px 0;
}
.chat-avatar {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  color: #fff;
  font-size: .68rem; font-weight: 600;
  -webkit-user-select: none; user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.chat-bubble {
  max-width: min(720px, 78%);
  min-width: 0;
  padding: 7px 12px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 3px 12px 12px 12px;
  background: var(--card-2);
  font-size: .875rem;
  line-height: 1.58;
  word-break: break-word;
}
.chat-msg.self { flex-direction: row-reverse; }
.chat-msg.self .chat-bubble {
  border-radius: 12px 3px 12px 12px;
  background: color-mix(in srgb, var(--acc) 13%, var(--card-2));
  border-color: var(--acc-line);
}
.chat-bubble.deleted { opacity: .6; }
.chat-who {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 2px;
  color: var(--muted); font-size: .72rem;
}
.chat-who strong { color: var(--text-dim); font-weight: 600; }
.chat-del {
  margin-left: 2px; padding: 0 3px;
  border: 0; border-radius: 4px;
  background: transparent; color: var(--muted);
  font-size: .86rem; line-height: 1.2; cursor: pointer;
}
.chat-del:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.chat-bubble img, .chat-bubble video {
  display: block;
  max-width: 100%; max-height: 300px; width: auto;
  margin-top: 4px;
  border-radius: var(--r-sm);
  background: var(--bg-soft);
}
.chat-bubble audio { width: 100%; margin-top: 6px; }
.chat-bubble a.media-link { display: block; margin-top: 4px; font-size: .82rem; }
.chat-bubble .txt { white-space: pre-wrap; }
.chat-typing { padding: 2px 0 0 35px; color: var(--muted); font-size: .74rem; }

.chat-compose {
  padding: 10px 12px 9px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
}
.chat-attach {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.chat-attach img, .chat-attach video {
  height: 46px; border-radius: var(--r-sm); display: block;
}
.chat-input {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 5px 5px 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  transition: border-color .16s, box-shadow .16s;
}
.chat-input:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--ring);
}
.chat-input textarea {
  flex: 1; min-width: 0;
  min-height: 30px; max-height: 132px;
  padding: 5px 0;
  border: 0; background: transparent; color: var(--text);
  font-family: inherit; font-size: .875rem; line-height: 1.5;
  resize: none; outline: none;
}
.chat-input textarea::placeholder { color: var(--muted); }
.chat-send {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  padding: 0;
  border: 0; border-radius: var(--r-sm);
  background: var(--acc); color: #fff;
  cursor: pointer;
  transition: background-color .16s, opacity .16s;
}
.chat-send:hover:not(:disabled) { background: var(--acc-hi); }
.chat-send:disabled { opacity: .4; cursor: default; }
.chat-send svg { width: 16px; height: 16px; }
.chat-foot {
  display: flex; justify-content: space-between;
  margin-top: 5px;
  color: var(--muted); font-size: .7rem;
  font-variant-numeric: tabular-nums;
}
.chat-daysep {
  flex: none;
  margin: 12px 0 4px;
  color: var(--muted); font-size: .7rem; text-align: center;
  letter-spacing: .04em;
}
.chat-daysep::before, .chat-daysep::after {
  content: ""; display: inline-block;
  width: 22px; height: 1px; background: var(--border);
  vertical-align: middle; margin: 0 8px;
}

/* ---------------------------------------------------------------- 数据 / 进度 */

.bar {
  height: 5px; overflow: hidden;
  border-radius: 999px;
  background: var(--card-3);
}
.bar > i {
  display: block; height: 100%;
  background: var(--acc);
  border-radius: 999px;
  transition: width .2s var(--ease);
}

.kv { display: grid; grid-template-columns: minmax(78px, auto) 1fr; gap: 8px 16px; font-size: .84rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-dim); word-break: break-all; min-width: 0; }

.stat {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card-2);
}
.stat .n {
  font-size: 1.32rem; font-weight: 640;
  letter-spacing: -.025em; line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat .l { margin-top: 2px; font-size: .74rem; color: var(--muted); }

.drop {
  padding: 32px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-soft);
  color: var(--muted);
  text-align: center; cursor: pointer;
  transition: border-color .18s, background-color .18s, color .18s;
}
.drop:hover, .drop.over {
  border-color: var(--acc);
  background: var(--acc-soft);
  color: var(--text);
}

/* ---------------------------------------------------------------- 浮层 */

.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(380px, 90vw);
}
.toast {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--acc);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: .84rem;
  animation: toast-in .22s var(--ease);
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.modal-mask {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(6, 7, 9, .68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal {
  width: min(620px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.spin {
  display: inline-block; vertical-align: -2px;
  width: 14px; height: 14px;
  border: 1.6px solid color-mix(in srgb, var(--text) 22%, transparent);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--card-2), var(--card-3), var(--card-2));
  background-size: 200% 100%;
  animation: sk 1.4s ease-in-out infinite;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.qr-box {
  display: inline-block;
  padding: 12px;
  border-radius: var(--r-md);
  background: #fff;
  line-height: 0;
}
.qr-box img { display: block; width: 196px; height: 196px; }

.steps { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; }
.steps .dot {
  flex: none; width: 7px; height: 7px; margin-top: 8px;
  border-radius: 50%; background: var(--muted);
}
.steps .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.steps .dot.bad { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }

.log-line {
  display: flex; gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono); font-size: .76rem;
  min-width: 0;
}
.log-line .s2 { color: var(--ok); }
.log-line .s3 { color: var(--warn); }
.log-line .s4, .log-line .s5 { color: var(--danger); }

/* ---------------------------------------------------------------- 代理引导 */

.proxy-empty {
  position: relative;
  overflow: hidden;
  margin-top: 26px;
  padding: clamp(32px, 4.6vw, 52px) clamp(24px, 4vw, 46px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background:
    radial-gradient(110% 80% at 0% 0%, var(--acc-soft), transparent 62%),
    var(--card);
}
.proxy-empty__mark {
  margin-bottom: .55em;
  font-size: 1.05rem; font-weight: 600; letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
}
.proxy-empty__lead {
  max-width: 48em;
  margin: 0 0 1.6em;
  color: var(--text-dim); font-size: .89rem; line-height: 1.85;
}
.proxy-empty__steps {
  display: grid; gap: 12px;
  margin: 0 0 1.8em; padding: 0;
  max-width: 48em; list-style: none;
}
.proxy-empty__steps li {
  display: flex; align-items: flex-start; gap: 12px;
  color: var(--text-dim); font-size: .85rem;
}
.proxy-empty__steps span {
  flex: none;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card-2);
  color: var(--muted);
  font-family: var(--mono); font-size: .68rem; line-height: 1;
}
.proxy-empty__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 登录卡 */

.admin-login { max-width: 420px; margin: 48px auto 0; }
.admin-login .card { padding: 32px 30px 28px; }
.admin-login h1 { font-size: 1.42rem; letter-spacing: -.03em; margin-bottom: .35em; }
.admin-login .btn-block { margin-top: 6px; }

/* ---------------------------------------------------------------- 页脚 */

.footer {
  flex: none;
  margin-top: 44px;
  padding: 18px 0;
  border-top: 1px solid var(--border-soft);
  color: var(--muted); font-size: .78rem;
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 760px) {
  body { font-size: 14px; }
  .wrap { padding: 0 16px; }
  /* 窄屏不再折叠：页签带在条中间横向滚动（判定全在 .nav 里，这里只管留白） */
  .site-header .inner { height: auto; min-height: var(--header-h); padding: 8px 16px; gap: 10px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 9px; }
  .page { padding: 22px 0 56px; }
  .page-head { margin-bottom: 20px; }
  .card { padding: 16px; border-radius: var(--r-md); }
  .hero { padding: 24px; border-radius: var(--r-lg); }
  .chat-main { padding: 0; }
  .chat-shell { border-radius: 0; border-left: 0; border-right: 0; }
  .chat-bubble { max-width: 88%; }
  .chat-head .chat-nick { width: 84px; }
  .detail-layout { grid-template-columns: 1fr; }
  .tabs { width: 100%; }
  .tabs button { flex: 1 1 auto; }
}

/* 尊重系统减弱动效偏好：截图与低性能设备都能拿到确定态 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- 全局搜索 */

.search-mask {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-start; justify-content: center;
  padding: min(12vh, 108px) 16px 24px;
  background: rgba(8, 8, 7, .52);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: searchFade .16s ease;
}
@keyframes searchFade { from { opacity: 0; } to { opacity: 1; } }

.search-box {
  display: flex; flex-direction: column;
  width: min(640px, 100%);
  max-height: min(70vh, 620px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.search-inbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}
.search-inbar svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.search-inbar input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; color: var(--text);
  font-family: inherit; font-size: .95rem;
  outline: none;
}
.search-inbar input::placeholder { color: var(--muted); }

.search-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 8px; }
.search-tip {
  margin: 0; padding: 20px 16px;
  color: var(--muted); font-size: .84rem; line-height: 1.6;
}
.search-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 4px;
  color: var(--muted);
  font-size: .67rem; letter-spacing: .09em; text-transform: uppercase;
}
.search-hit {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border-left: 2px solid transparent;
  color: inherit;
}
.search-hit.on { background: var(--card-2); border-left-color: var(--acc); }
.search-hit:hover { color: inherit; }
.search-kind {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: none;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--card-2);
  color: var(--muted);
  font-family: var(--mono); font-size: .62rem; font-weight: 600;
}
.search-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.search-main strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-size: .86rem; font-weight: 600;
}
.search-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.search-foot {
  display: flex; align-items: center; gap: 5px; flex: none;
  padding: 8px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  color: var(--muted); font-size: .72rem;
}
.search-kbd {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-2);
  color: var(--text-dim);
  font-family: var(--mono); font-size: .68rem; line-height: 1.5;
}
.search-sep { color: var(--border-strong); }

/* ---------------------------------------------------------------- 聊天：引用与右键菜单 */

.chat-quote {
  display: block; width: 100%;
  /* 短消息（"好的"）气泡本来只有几个字宽，引用条会被压到看不清；
     给一个下限让它始终能露出半行原文，气泡自己会跟着变宽 */
  min-width: 168px; max-width: 100%;
  margin: 2px 0 5px;
  padding: 4px 8px;
  border: 0; border-left: 2px solid var(--acc-line);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: color-mix(in srgb, var(--acc) 8%, transparent);
  color: inherit; font: inherit; font-size: .76rem; line-height: 1.4;
  text-align: left; cursor: pointer;
  transition: border-color .14s, background-color .14s;
}
.chat-quote strong {
  display: block; margin-bottom: 1px;
  color: var(--acc-text); font-size: .72rem; font-weight: 600;
}
.chat-quote span {
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted);
}
.chat-quote:hover { border-left-color: var(--acc); background: color-mix(in srgb, var(--acc) 13%, transparent); }
.chat-quote.gone span { font-style: italic; }

.chat-reply-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  padding: 5px 8px;
  border-left: 2px solid var(--acc);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--card-2);
  color: var(--muted); font-size: .76rem;
}
.chat-reply-bar .rp-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-bar strong { color: var(--text-dim); }

.chat-more-btn {
  margin-left: auto;
  padding: 0 4px;
  border: 0; border-radius: 4px;
  background: transparent; color: var(--muted);
  font-size: .82rem; line-height: 1.2;
  cursor: pointer; opacity: 0;
  transition: opacity .14s, background-color .14s, color .14s;
}
.chat-msg:hover .chat-more-btn,
.chat-more-btn:focus-visible { opacity: 1; }
.chat-more-btn:hover { background: var(--card-3); color: var(--text); }

.ctx-menu {
  position: fixed; z-index: 120;
  min-width: 172px; padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: ctxIn .12s ease;
}
@keyframes ctxIn {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.ctx-menu button {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 7px 9px;
  border: 0; border-radius: var(--r-xs);
  background: transparent; color: var(--text-dim);
  font: inherit; font-size: .82rem; text-align: left; cursor: pointer;
}
.ctx-menu button:hover { background: var(--card-2); color: var(--text); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ctx-menu button:disabled { opacity: .4; cursor: default; }
.ctx-menu svg { width: 15px; height: 15px; flex: none; opacity: .78; }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--border-soft); }

/* 从搜索结果跳到某条消息时，闪一下边框，让人知道落到了哪里 */
.chat-msg.flash .chat-bubble { animation: flashBubble 1.8s ease; }
@keyframes flashBubble {
  0%, 35% { box-shadow: 0 0 0 2px var(--acc-line); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 760px) {
  .search-mask { padding: 7vh 10px 10px; }
  .search-box { max-height: 76vh; }
  .search-foot { display: none; }
  .chat-more-btn { opacity: 1; }
}
