@charset "UTF-8";
/* System UI fonts render immediately; MiSans WOFF2 subsets replace them as they arrive. */
/* QueryHub 网页版主题
   默认浅色（内容区背景 #fafbf8，暖白）；深色主题通过 <html data-theme="dark"> 启用。
   logo 使用项目原素材：ICON-透明.png → logo*.png（彩色字标已应要求全站移除）。 */

:root {
  /* —— 浅色（默认）——
     视觉材质仿照 D:/MOMIKA.WEB：暖色背景 + 白玻璃面板 + 内高光/内凹边 + 暖阴影。
     G2 连续曲率圆角沿用自己的实现：corner-shape: superellipse(4)。 */
  --bg: #fafbf8;
  --bg-sidebar: #ffffff;
  --bg-panel: #ffffff;
  --bg-hover: rgba(36, 120, 245, 0.06);
  --bg-active: rgba(10, 132, 255, 0.10);
  --bg-code: #f6f5f2;
  --border: rgba(20, 24, 32, 0.08);
  --border-strong: rgba(20, 24, 32, 0.14);
  --text: #111113;
  --text-2: #6e6e73;
  --text-3: #9a9aa0;
  --brand: #0a84ff;
  --brand-weak: rgba(10, 132, 255, 0.10);
  --green: #1a8f4a;
  --red: #e5484d;
  --orange: #d9822b;
  --yellow: #b08900;
  --danger: #e5484d;
  --overlay: rgba(24, 22, 20, 0.28);
  --scroll-thumb: rgba(20, 24, 32, 0.16);
  --scroll-thumb-hover: rgba(20, 24, 32, 0.26);

  /* MOMIKA 材质：玻璃控制件 / 内高光 / 内凹边 / 暖阴影 */
  --glass-control:
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.98) 0%, rgba(253, 252, 250, 0.98) 58%, #ffffff 100%),
    linear-gradient(180deg, #ffffff 0%, #fbfaf8 52%, #ffffff 100%);
  --glass-highlight:
    inset 0 8px 18px rgba(219, 219, 219, 0.22),
    inset 0 -10px 18px rgba(255, 255, 255, 0.96),
    inset 10px 0 18px rgba(255, 255, 255, 0.72),
    inset -10px 0 18px rgba(255, 255, 255, 0.72);
  --recessed-edge:
    inset 0 0 0 2px rgba(224, 224, 224, 0.48),
    inset 0 2px 4px rgba(238, 238, 238, 0.78);
  --warm-shadow: var(--top-highlight), 0 18px 42px rgba(232, 221, 211, 0.42);
  --warm-shadow-strong: var(--top-highlight), 0 22px 52px rgba(232, 221, 211, 0.46);
  --surface-shadow: var(--glass-highlight), var(--recessed-edge), var(--warm-shadow);
  --surface-shadow-strong: var(--glass-highlight), var(--recessed-edge), var(--warm-shadow-strong);
  --hairline: rgba(20, 24, 32, 0.08);
  --glass-border: rgba(255, 255, 255, 0.86);
  --top-highlight: 0 1px 0 rgba(255, 255, 255, 0.9);
  --input-bg: #ffffff;

  --radius: 24px;
  --radius-sm: 18px;
  --radius-lg: 36px;
  --radius-surface: 48px;
  /* G2 连续曲率圆角：superellipse(1.5)。
     实测（Edge / 半径 40px 的 100px 盒子）：参数越大转角越"方"——
     1≈纯圆(36px)、1.5≈30px、2≈22px、3≈12px、4 只有 5px（近方角，曾误用导致整站圆角看起来很小）。
     用户要求贴近参考图的大圆角观感，取 1.5（转角扫过≈纯圆的 75%，保留连续曲率的柔和过渡）。 */
  --corner: superellipse(1.5);
  --sidebar-w: 216px;
  --topbar-h: 56px;
  --statusbar-h: 30px;
}

/* —— 深色（可选）—— */
[data-theme='dark'] {
  /* 玻璃材质（深色）——此前缺失导致深色主题面板仍为浅色 */
  --glass-control: linear-gradient(180deg, #2a2a2a 0%, #232323 52%, #2a2a2a 100%);
  --glass-highlight: inset 0 8px 18px rgba(0, 0, 0, 0.28), inset 0 -10px 18px rgba(255, 255, 255, 0.05);
  --recessed-edge: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
  --warm-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 42px rgba(0, 0, 0, 0.45);
  --warm-shadow-strong: 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 52px rgba(0, 0, 0, 0.5);
  --hairline: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.09);
  --top-highlight: 0 1px 0 rgba(255, 255, 255, 0.05);
  --input-bg: #1f1f1f;
  --bg: #191919;
  --bg-sidebar: #1e1e1e;
  --bg-panel: #242424;
  --bg-hover: #2c2c2c;
  --bg-active: #313131;
  --bg-code: #141414;
  --border: #333333;
  --border-strong: #404040;
  --text: #e6e6e6;
  --text-2: #9a9a9a;
  --text-3: #6e6e6e;
  --green: #07c160;
  --red: #ff3b30;
  --orange: #ff8a1f;
  --yellow: #ffbe0b;
  --danger: #fa5151;
  --overlay: rgba(0, 0, 0, 0.55);
  --scroll-thumb: #3a3a3a;
  --scroll-thumb-hover: #4a4a4a;
}

* { box-sizing: border-box; }

/* ---------- G2 连续曲率圆角 ----------
   corner-shape: superellipse(1.5) —— 超椭圆，曲率从直边到转角连续过渡，比"四分之一圆"更柔和。
   参数语义（实测）：1=纯圆；数值越大越方（4 时转角只剩 5px，接近方角——曾误用）。
   半径仍由 border-radius 控制，形状由 --corner 统一控制。
   真正的"圆形"元素（头像、状态灯、点、时间线节点）显式保持 round。 */
*,
*::before,
*::after { corner-shape: var(--corner); }

.avatar,
.conn .led,
.statusbar .led,
.dot,
.tdot,
.unread-dot,
.n-badge,
.spinner { corner-shape: round; }

html, body, #app { height: 100%; }

body {
  margin: 0;
  font: 14px/1.6 "MiSans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 应用外壳 ---------- */
.shell {
  display: flex; flex-direction: column; height: 100%;
  padding: 14px; gap: 12px;
  background: var(--bg);
}
.shell-body { flex: 1 1 auto; display: flex; min-height: 0; gap: 12px; }

/* ---------- 侧栏 ---------- */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  background: var(--glass-control);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-surface);
  box-shadow: var(--surface-shadow);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
}
.brand { padding: 4px 10px 14px; }
.brand .logo { display: flex; align-items: center; gap: 8px; }
.brand .logo .mark { width: 26px; height: 26px; flex: 0 0 auto; }
.brand .slogan { margin-top: 8px; font-size: 11px; line-height: 1.5; color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-size: 14px;
  border: 0; background: none; cursor: pointer; text-align: left; width: 100%;
  font-family: inherit;
  transition: background-color 120ms ease, color 120ms ease;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--bg-active); color: var(--text); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; opacity: 0.9; }
.nav-item .n-badge {
  margin-left: auto; min-width: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 17px; text-align: center;
}

.sidebar-foot { margin-top: auto; padding: 10px 12px; color: var(--text-3); font-size: 11px; line-height: 1.6; }

/* ---------- 顶栏 ---------- */
.topbar {
  flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: transparent;
  border-bottom: 1px solid var(--hairline);
}
.topbar .title { font-size: 15px; font-weight: 600; }
.topbar .grow { flex: 1 1 auto; }
.conn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  background: var(--bg);
}
.conn .led { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.conn.on .led { background: #12b76a; box-shadow: 0 0 6px rgba(18, 183, 106, 0.6); }
.conn.on { color: #0f9d58; border-color: rgba(18, 183, 106, 0.35); }

/* ---------- 动效令牌（依据 .agents 动效规范） ----------
   原则：只在低频、有语义的位置做动效；高频交互保持近瞬时；
   只用 transform / opacity；入场/出场用强 ease-out；UI 动效 ≤ 300ms。 */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);   /* 强 ease-out（入场/出场） */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* 强 ease-in-out（屏上移动） */
  --motion-press: 160ms;   /* 按压反馈 */
  --motion-pop: 180ms;     /* 下拉、小弹层 */
  --motion-modal: 240ms;   /* 模态框、全屏浮层 */
  --motion-view: 170ms;    /* 视图切换 */
}

/* ---------- 按钮 / 输入 ---------- */
button { font-family: inherit; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-control);
  box-shadow: inset 0 0 0 1px var(--hairline), var(--top-highlight), 0 8px 20px rgba(232, 221, 211, 0.30);
  color: var(--text); font-size: 13px; cursor: pointer;
  transition: transform var(--motion-press) var(--ease-out), box-shadow 160ms ease, background-color 160ms ease;
}
.btn:hover { box-shadow: inset 0 0 0 1px var(--hairline), var(--warm-shadow); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #3d99ff 0%, var(--brand) 55%, #0a7aeb 100%);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 24px rgba(10, 132, 255, 0.28);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.danger { color: var(--danger); border-color: rgba(217, 48, 37, 0.4); }

input[type='text'], input[type='password'], input[type='search'], input[type='number'],
input[type='url'], input[type='date'], select, textarea {
  width: 100%; padding: 9px 11px;
  background: var(--input-bg);
  border: 1px solid transparent;
  box-shadow: var(--recessed-edge);
  border-radius: var(--radius-sm); color: var(--text); font: inherit;
  outline: none; transition: box-shadow 180ms ease;
}
input:focus, select:focus, textarea:focus {
  /* 焦点光晕：弱环 + 漫射光（泛光质感、无硬边） */
  box-shadow: var(--recessed-edge), 0 0 0 3px rgba(10, 132, 255, 0.14), 0 0 18px 3px rgba(10, 132, 255, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 120px; font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif; font-size: 13px; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }

.seg { display: inline-flex; background: var(--glass-control); border: 1px solid var(--glass-border); box-shadow: inset 0 0 0 1px var(--hairline); border-radius: var(--radius-sm); padding: 2px; }
.seg button {
  border: 0; background: none; color: var(--text-2); padding: 5px 14px;
  border-radius: 14px; cursor: pointer; font-size: 13px;
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: linear-gradient(180deg, #3d99ff 0%, var(--brand) 55%, #0a7aeb 100%);
  color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 14px rgba(10, 132, 255, 0.24);
}

/* ---------- 内容区 ---------- */
.main-panel {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--glass-control);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-surface);
  box-shadow: var(--surface-shadow);
  overflow: hidden;
}
.content { flex: 1 1 auto; overflow-y: auto; padding: 20px 24px 30px; }
.content-narrow { max-width: 760px; margin: 0 auto; }

.filterbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filterbar .grow { flex: 1 1 auto; }
.sort-select { width: auto; }

/* ---------- 下拉框（自定义 select：连弹层一起风格化） ----------
   Chromium base-select：触发按钮沿用输入框玻璃材质，弹层是完全可控的玻璃卡片。
   不支持的浏览器自动忽略 @supports 块，退化为原生外观。 */
@supports (appearance: base-select) {
  select,
  select::picker(select) { appearance: base-select; }

  /* 触发按钮 */
  select {
    display: inline-flex; align-items: center; gap: 10px;
    padding-right: 13px;
  }
  /* 箭头：细 chevron（替换原生小三角），展开时翻转 */
  select::picker-icon {
    content: '';
    width: 6px; height: 6px;
    border-right: 1.5px solid var(--text-2);
    border-bottom: 1.5px solid var(--text-2);
    rotate: 45deg;
    translate: 0 -2px;
    transition: rotate 0.18s ease, translate 0.18s ease;
  }
  select:open::picker-icon { rotate: 225deg; translate: 0 -4px; }

  /* 弹层：玻璃卡片 + 大圆角 + 暖阴影（与全站材质一致） */
  ::picker(select) {
    margin-top: 6px;
    padding: 6px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    corner-shape: superellipse(1.5);
    background: var(--glass-control);
    box-shadow: inset 0 0 0 1px var(--hairline), var(--top-highlight), var(--warm-shadow-strong);
    max-height: 330px;
    transform-origin: top;            /* 从触发按钮方向展开 */
    opacity: 1; transform: scale(1) translateY(0);
    transition: opacity var(--motion-pop) var(--ease-out), transform var(--motion-pop) var(--ease-out);
  }
  @starting-style {
    ::picker(select) { opacity: 0; transform: scale(0.95) translateY(-4px); }
  }

  /* 选项 */
  option {
    padding: 8px 12px;
    border-radius: 12px;
    corner-shape: superellipse(1.5);
    font-size: 13px;
    color: var(--text);
  }
  option:hover { background: var(--bg-hover); }
  option:checked { background: var(--brand-weak); font-weight: 600; }
  option::checkmark { color: var(--brand); }
}

/* 问题卡片 */
.qcard {
  background: var(--glass-control);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--hairline), var(--top-highlight), 0 12px 28px rgba(232, 221, 211, 0.30);
  padding: 14px 18px; margin-bottom: 12px;
  cursor: pointer; transition: transform 0.12s, box-shadow 0.16s; position: relative;
}
.qcard:hover { box-shadow: inset 0 0 0 1px var(--hairline), var(--warm-shadow); transform: translateY(-1px); }
.qcard .head { display: flex; align-items: center; gap: 9px; }
.qcard .title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcard .preview { color: var(--text-2); font-size: 13px; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qcard .meta { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.qcard .author { display: inline-flex; align-items: center; gap: 6px; }
.qcard .stats { margin-left: auto; display: flex; gap: 14px; color: var(--text-3); font-size: 12px; }
.qcard .stats b { color: var(--text-2); font-weight: 600; margin-left: 3px; }

.avatar {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--brand);
}
.answered-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--green);
  background: rgba(6, 122, 62, 0.10); border-radius: 999px; padding: 2px 8px;
}

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dot-red { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-yellow { background: var(--yellow); }

/* 空态 / 加载 / 错误 */
.empty { text-align: center; color: var(--text-3); padding: 48px 0; }
.empty .big { font-size: 30px; margin-bottom: 10px; }
.loading { text-align: center; color: var(--text-3); padding: 18px 0; font-size: 13px; }
.notice {
  border: 1px solid var(--border-strong); background: var(--bg-panel);
  border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 12px; font-size: 13px;
}
.notice.error { border-color: rgba(217, 48, 37, 0.45); color: var(--danger); }
.notice.ok { border-color: rgba(6, 122, 62, 0.45); color: var(--green); }

/* ---------- 详情 ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--glass-control);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--hairline), var(--top-highlight), 0 14px 34px rgba(232, 221, 211, 0.34);
  padding: 18px;
}
.panel h3 { margin: 0 0 10px; font-size: 15px; }

.q-title { font-size: 20px; font-weight: 700; line-height: 1.35; margin: 0; }
.q-byline { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; margin-top: 8px; flex-wrap: wrap; }

.md-body { margin-top: 12px; font-size: 14px; color: var(--text); overflow-wrap: break-word; }
.md-body p { margin: 0 0 10px; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 14px 0 8px; }
.md-body pre { background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; }
.md-body code { font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif; font-size: 12.5px; background: var(--bg-code); border-radius: 4px; padding: 1px 5px; }
.md-body pre code { background: none; padding: 0; }
.md-body blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.md-body a { color: var(--brand); }
.md-body img { max-width: 100%; border-radius: var(--radius-sm); }
.md-body ul, .md-body ol { margin: 0 0 10px; padding-left: 22px; }
.md-body hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

.attachments { margin-top: 12px; }
.attachments .att-title { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.att-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.att-item {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 7px 11px; font-size: 12.5px; color: var(--text);
  text-decoration: none; background: var(--bg); cursor: pointer; font-family: inherit;
}
.att-item:hover { border-color: var(--brand); color: var(--text); }
.att-item .size { color: var(--text-3); font-size: 11px; }
.attachments ul { list-style: none; margin: 8px 0 0; padding: 0; }
.attachments li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; border-bottom: 1px dashed var(--border); }
.attachments li:last-child { border-bottom: 0; }
.attachments li .grow { flex: 1 1 auto; }
.attachments .muted { color: var(--text-3); font-size: 11.5px; }

/* 附件拖放区 */
.dropzone {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; color: var(--text-3); font-size: 13px;
  cursor: pointer; transition: 0.15s; background: var(--bg);
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); color: var(--brand); background: var(--brand-weak); }

/* 编辑器工具栏 */
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }

/* 信息栏 */
.info-list { font-size: 13px; }
.info-list .row2 { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.info-list .row2:last-child { border-bottom: 0; }
.info-list .k { color: var(--text-3); }
.info-list .v { color: var(--text); text-align: right; overflow-wrap: anywhere; }

/* 时间线 */
.timeline-title { font-size: 14px; font-weight: 600; margin: 18px 0 10px; color: var(--text); }
.entry {
  position: relative; padding: 0 0 16px 22px;
  border-left: 2px solid var(--border);
  margin-left: 5px;
}
.entry:last-child { border-left-color: transparent; }
.entry .tdot {
  position: absolute; left: -6px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--text-3);
}
.entry.answer .tdot { background: var(--brand); }
.entry.followUp .tdot { background: var(--yellow); }
.entry.supplementaryAnswer .tdot { background: var(--green); }
.entry .e-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.entry .e-author { color: var(--text); font-weight: 600; font-size: 13px; }
.entry .e-type { font-size: 10.5px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; }
.entry .e-body { margin-top: 6px; font-size: 13.5px; }
.entry .e-body p { margin: 0 0 8px; }
.entry.followUp { margin-left: 24px; }

/* 未读标记 */
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.qcard.unread { border-left: 3px solid var(--brand); }

/* ---------- 表单面板 ---------- */
.form-panel { max-width: 460px; margin: 6vh auto 0; }
.form-panel h2 { margin: 0 0 4px; font-size: 18px; }
.form-panel .sub { color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.recovery-box {
  background: var(--bg); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px; margin-top: 14px;
  font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif; word-break: break-all;
}

/* ---------- 状态栏 ---------- */
.statusbar {
  flex: 0 0 var(--statusbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; font-size: 12px; color: var(--text-3);
  background: transparent; border-top: 1px solid var(--hairline);
}
.statusbar .led { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.statusbar .led.on { background: #12b76a; }
.statusbar .led.connecting { background: var(--yellow); }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-box {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; max-width: 360px; width: calc(100% - 40px);
}
.modal-box h3 { margin: 0 0 8px; font-size: 15px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.row-center { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--text-3); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .sidebar { flex-basis: 62px; padding: 10px 6px; }
  .sidebar .brand .slogan, .sidebar .nav-item .lbl, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .content { padding: 14px; }
}

/* ---------- 连接页（整屏极简：左泛光 logo，右输入 + 连接） ---------- */
.hero {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 420px);
  align-items: center;
  gap: 40px;
  padding: 0 8vw;
  background: var(--bg);
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 48px 24px; align-content: center; }
}

.hero-left {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 320px;
}
/* 泛光：品牌色径向光晕 + logo 自身柔光 */
.hero-left .halo {
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 120, 245, 0.20) 0%, rgba(36, 120, 245, 0.08) 42%, rgba(36, 120, 245, 0) 70%);
  filter: blur(6px);
  animation: halo 6s ease-in-out infinite;
}
[data-theme='dark'] .hero-left .halo {
  background: radial-gradient(circle, rgba(36, 120, 245, 0.34) 0%, rgba(36, 120, 245, 0.12) 42%, rgba(36, 120, 245, 0) 70%);
}
@keyframes halo { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.85; } }

.hero-logo {
  position: relative; width: 116px; height: 116px;
  filter: drop-shadow(0 6px 18px rgba(36, 120, 245, 0.35)) drop-shadow(0 0 34px rgba(36, 120, 245, 0.22));
}

.hero-right { display: flex; flex-direction: column; gap: 12px; }
.hero-field { display: block; }
.hero-field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.hero-field input { padding: 11px 12px; font-size: 14px; }
.hero-btn { justify-content: center; padding: 11px 16px; font-size: 14px; width: 100%; }
.hero-link {
  border: 0; background: none; color: var(--text-3); font-size: 12.5px;
  cursor: pointer; padding: 2px 0; text-align: center; font-family: inherit;
}
.hero-link:hover { color: var(--brand); }
.hero-note { margin: 0 0 2px; font-size: 12.5px; color: var(--text-3); }
.hero-error {
  margin: 2px 0 0; font-size: 12.5px; color: var(--danger);
  border: 1px solid rgba(217, 48, 37, 0.35); background: var(--bg-panel);
  border-radius: var(--radius-sm); padding: 8px 10px;
}

/* ---------- 附件预览（移植 MOMIKA file-preview 结构 + 本项目材质） ---------- */
.preview-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(24, 22, 20, 0.28);
  backdrop-filter: blur(6px) saturate(120%);
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
}
.preview-shell {
  width: 100%; height: 100%; max-width: 1440px;
  display: flex; flex-direction: column;
  background: var(--glass-control);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-surface);
  box-shadow: var(--surface-shadow-strong);
  overflow: hidden;
}
.preview-header {
  flex: 0 0 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--hairline);
}
.file-heading { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.file-heading strong { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-heading span { font-size: 11.5px; color: var(--text-3); }
.preview-tools { display: inline-flex; align-items: center; gap: 8px; }
.preview-tools button {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-control);
  box-shadow: inset 0 0 0 1px var(--hairline), 0 6px 16px rgba(232, 221, 211, 0.30);
  color: var(--text); font-size: 15px; line-height: 1; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.16s;
}
.preview-tools button:hover { box-shadow: inset 0 0 0 1px var(--hairline), var(--warm-shadow); }
.preview-tools button:active { transform: scale(0.95); }
.preview-tools output, .preview-tools .tool-note {
  font-size: 12px; color: var(--text-2); min-width: 44px; text-align: center;
}
.tool-download, .tool-close {
  height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-control);
  box-shadow: inset 0 0 0 1px var(--hairline), 0 6px 16px rgba(232, 221, 211, 0.30);
  color: var(--text); font-size: 12.5px; cursor: pointer;
}
.tool-close { width: 34px; padding: 0; justify-content: center; font-size: 14px; }
.tool-download:hover, .tool-close:hover { box-shadow: inset 0 0 0 1px var(--hairline), var(--warm-shadow); }
.preview-stage { flex: 1 1 auto; min-height: 0; position: relative; background: #fdfcfa; }
.preview-status {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: var(--text-2); font-size: 13px;
}
.preview-status.is-error { color: var(--danger); }
.image-viewport {
  position: absolute; inset: 0; overflow: hidden; cursor: grab;
  background: #fdfcfa;
}
.image-viewport.is-dragging { cursor: grabbing; }
.image-viewport.is-checkerboard {
  background-image:
    linear-gradient(45deg, #ececea 25%, transparent 25%, transparent 75%, #ececea 75%),
    linear-gradient(45deg, #ececea 25%, transparent 25%, transparent 75%, #ececea 75%);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
  background-color: #fff;
}
.image-viewport img {
  position: absolute; left: 50%; top: 50%;
  transform-origin: center center; transform: translate(-50%, -50%);
  max-width: none; user-select: none; -webkit-user-drag: none;
}
.pdf-host { position: absolute; inset: 0; overflow: auto; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pdf-host .pdf-page { box-shadow: 0 12px 28px rgba(232, 221, 211, 0.42); border-radius: 10px; background: #fff; max-width: 100%; height: auto; }
.office-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.text-host { position: absolute; inset: 0; overflow: auto; padding: 20px 24px; background: #fff; }
.text-host pre { margin: 0; font-family: 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.av-host { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 86%; max-height: 86%; }


/* ==========================================================================
   多端适配（PC 布局不变，全部写在媒体查询内）
   覆盖：手机竖/横屏、平板竖/横屏、手表/超小屏、折叠屏（横向/纵向分段）
   ========================================================================== */

/* 触摸设备：加大点击区、去掉悬停位移效果 */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn.sm { min-height: 32px; }
  .nav-item { min-height: 44px; }
  .qcard:hover { transform: none; }
  input[type='text'], input[type='password'], input[type='search'], input[type='number'],
  input[type='url'], input[type='date'], select, textarea { font-size: 16px; } /* 防 iOS 自动放大 */
}

/* 小笔记本 / 平板横屏（1024–1439）：留白略收，结构不变 */
@media (max-width: 1439px) and (min-width: 1024px) {
  .shell { padding: 12px; gap: 10px; }
  .shell-body { gap: 10px; }
  .sidebar { flex-basis: 200px; }
  .content { padding: 18px 20px 26px; }
}

/* 平板竖屏（768–1023）：侧栏收窄、卡片与留白收紧，详情单列 */
@media (max-width: 1023px) and (min-width: 768px) {
  .shell { padding: 12px; gap: 10px; }
  .shell-body { gap: 10px; }
  .sidebar {
    flex-basis: 188px; padding: 14px 10px 10px;
    border-radius: var(--radius-lg);
  }
  .main-panel { border-radius: var(--radius-lg); }
  .brand .logo .mark { width: 22px; height: 22px; }
  .content { padding: 16px 18px 24px; }
  .detail-grid { grid-template-columns: 1fr; }
  .preview-mask { padding: 14px; }
  .preview-shell { border-radius: var(--radius-lg); }
}

/* 手机（≤767）：侧栏变底部导航，内容通栏，隐藏状态栏 */
@media (max-width: 767px) {
  .shell { padding: 0; gap: 0; }
  .shell-body { gap: 0; padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    flex: none; flex-direction: row; align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-radius: 0; border: 0; border-top: 1px solid var(--hairline);
    box-shadow: 0 -8px 24px rgba(232, 221, 211, 0.42);
  }
  .sidebar .brand, .sidebar .sidebar-foot { display: none; }
  .sidebar .nav { flex-direction: row; gap: 2px; margin: 0; flex: 1 1 auto; }
  .nav-item { flex: 1 1 0; flex-direction: column; gap: 2px; padding: 4px 0; font-size: 11px; min-width: 0; }
  .nav-item .ico { width: auto; font-size: 16px; }
  .nav-item .n-badge { margin-left: 0; position: absolute; top: 2px; right: 22%; }
  .nav-item { position: relative; }

  .main-panel { border-radius: 0; border: 0; box-shadow: none; }
  .topbar { flex-basis: 52px; padding: 0 12px; gap: 8px; }
  .topbar .title { font-size: 14px; }
  .statusbar { display: none; }
  .content { padding: 14px 14px 20px; }

  .qcard { padding: 12px 14px; border-radius: var(--radius); }
  .panel { padding: 14px; border-radius: var(--radius); }

  /* 预览全屏化 */
  .preview-mask { padding: 0; }
  .preview-header { gap: 8px; }
  .tool-download { width: 34px; padding: 0; justify-content: center; }
  .dl-text { display: none; }
  .dl-icon { font-size: 15px; }
  .preview-tools { gap: 5px; }
  .preview-shell { border-radius: 0; border: 0; max-width: none; }
  .preview-header { flex-basis: 52px; padding: 0 12px; gap: 8px; }
  .file-heading strong { font-size: 13px; }
  .preview-tools .tool-note, .preview-tools output { min-width: 38px; }

  /* 连接页：单列堆叠 */
  .hero { grid-template-columns: 1fr; gap: 18px; padding: 32px 20px; align-content: center; }
  .hero-left { min-height: 0; gap: 10px; }
  .hero-logo { width: 84px; height: 84px; }
  .hero-left .halo { width: 260px; height: 260px; }
}

/* 手表 / 超小屏（≤360 宽 或 ≤320 高）：极简，只留内容与返回 */
@media (max-width: 360px), (max-height: 320px) {
  .shell-body { padding-bottom: 0; }
  .sidebar { display: none; }
  .topbar { flex-basis: 44px; padding: 0 10px; }
  .topbar .conn { display: none; }
  .content { padding: 10px 10px 14px; }
  .qcard { padding: 10px 12px; margin-bottom: 8px; box-shadow: none; }
  .qcard .preview, .qcard .stats { display: none; }
  .qcard .title { font-size: 13.5px; }
  .panel { padding: 12px; box-shadow: none; }
  .btn { padding: 6px 10px; }
  .seg button { padding: 5px 9px; font-size: 12px; }
  .filterbar { gap: 8px; }
  .search-hide-on-watch { display: none; }
}

/* 手机横屏（矮屏）：压缩纵向装饰 */
@media (max-height: 520px) and (pointer: coarse) {
  .topbar { flex-basis: 44px; }
  .sidebar { flex-direction: row; }
  .sidebar .brand .slogan { display: none; }
  .hero { min-height: auto; }
  .hero-left { min-height: 0; }
  .hero-logo { width: 76px; height: 76px; }
}

/* 折叠屏：横向两屏 → 侧栏占第一屏，内容占第二屏（避开铰链） */
@media (horizontal-viewport-segments: 2) {
  .shell { padding: 0; gap: 0; }
  .shell-body { gap: 0; }
  .sidebar {
    flex: 0 0 env(viewport-segment-width 0 0, var(--sidebar-w));
    border-radius: 0; border: 0; box-shadow: none;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }
  .main-panel { border-radius: 0; border: 0; box-shadow: none; }
  .content { padding-left: calc(20px + env(safe-area-inset-left)); }
}

/* 折叠屏：纵向两屏 → 按手机规则处理，内容占上屏 */
@media (vertical-viewport-segments: 2) {
  .shell { padding: 0; gap: 0; }
  .sidebar { display: none; }
  .main-panel { border-radius: 0; border: 0; box-shadow: none; }
  .shell-body { padding-bottom: 0; }
}

/* ---------- 动效：视图切换 / 模态 / 预览浮层 ---------- */

/* 视图切换：新内容快速淡入 + 轻微上移；旧内容立即移除（不拖慢导航） */
.view-enter-active { transition: opacity var(--motion-view) var(--ease-out), transform var(--motion-view) var(--ease-out); }
.view-enter-from { opacity: 0; transform: translateY(6px); }

/* 模态框：遮罩淡入 + 面板从 0.96 缩放展开；关闭更快（150ms） */
.modal-enter-active { transition: opacity var(--motion-modal) var(--ease-out); }
.modal-enter-active .modal-box { transition: opacity var(--motion-modal) var(--ease-out), transform var(--motion-modal) var(--ease-out); }
.modal-leave-active { transition: opacity 150ms var(--ease-out); }
.modal-leave-active .modal-box { transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out); }
.modal-enter-from, .modal-leave-to { opacity: 0; }
.modal-enter-from .modal-box { opacity: 0; transform: scale(0.96); }
.modal-leave-to .modal-box { opacity: 1; transform: scale(0.98); }

/* 附件预览浮层：遮罩淡入 + 面板轻微放大上浮（spatial continuity） */
.overlay-enter-active { transition: opacity var(--motion-modal) var(--ease-out); }
.overlay-enter-active .preview-shell { transition: opacity var(--motion-modal) var(--ease-out), transform var(--motion-modal) var(--ease-out); }
.overlay-leave-active { transition: opacity 160ms var(--ease-out); }
.overlay-leave-active .preview-shell { transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }
.overlay-enter-from, .overlay-leave-to { opacity: 0; }
.overlay-enter-from .preview-shell { opacity: 0; transform: scale(0.985) translateY(8px); }
.overlay-leave-to .preview-shell { opacity: 0; transform: scale(0.99); }

/* 主题切换：短暂的颜色过渡，防止整页突变（reduced-motion 下保持瞬时） */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease !important;
}

/* 尊重系统"减少动态效果" */
@media (prefers-reduced-motion: reduce) {
  .hero-left .halo { animation: none; }
  * { transition-duration: 0.01ms !important; }
  .theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after { transition-duration: 0.01ms !important; }
}


/* ---------- 小屏顶栏收缩与矮屏/手表适配 ---------- */
.top-logout-icon { display: none; }

/* 手机：顶栏只留标题 + 主题图标 + 头像 + 退出图标 */
@media (max-width: 767px) {
  .topbar { gap: 6px; }
  .top-conn, .top-username { display: none; }
  .top-theme-text { display: none; }
  .top-theme { padding: 6px 9px; }
  .top-logout-icon { display: inline; }
  .top-logout-text { display: none; }
  .top-logout { padding: 6px 9px; }
  .top-avatar { width: 24px; height: 24px; font-size: 12px; }
}

/* 矮屏（横屏手机/小窗）：侧栏可滚动，隐藏页脚，品牌压缩 */
@media (max-height: 560px) {
  .sidebar { overflow-y: auto; }
  .sidebar-foot { display: none; }
  .brand { padding: 2px 10px 10px; }
  .brand .slogan { display: none; }
  .nav-item { padding: 7px 12px; }
}

/* 手表 / 超小屏：保留底部图标导航，顶栏一行放下 */
@media (max-width: 360px), (max-height: 320px) {
  .shell-body { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .sidebar {
    display: flex; flex-direction: row; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    border-radius: 0; border: 0; border-top: 1px solid var(--hairline);
    box-shadow: none;
  }
  .sidebar .brand, .sidebar .sidebar-foot { display: none; }
  .sidebar .nav { flex-direction: row; gap: 0; margin: 0; flex: 1 1 auto; }
  .nav-item { flex: 1 1 0; flex-direction: column; padding: 3px 0; font-size: 0; min-height: 0; }
  .nav-item .ico { font-size: 15px; width: auto; }
  .nav-item .lbl { display: none; }

  .topbar { flex-basis: 42px; padding: 0 8px; gap: 4px; }
  .topbar .title { font-size: 13px; }
  .top-theme { min-height: 28px; padding: 4px 7px; }
  .top-avatar { width: 22px; height: 22px; font-size: 11px; }
  .top-logout { min-height: 28px; padding: 4px 7px; }

  /* 控件回到小尺寸（覆盖触摸设备的放大规则） */
  .btn { min-height: 28px; padding: 5px 9px; font-size: 12px; }
  .btn.sm { min-height: 26px; padding: 4px 8px; font-size: 11.5px; }
  input[type='text'], input[type='password'], input[type='search'], input[type='number'],
  input[type='url'], input[type='date'], select, textarea { font-size: 13px; padding: 6px 8px; }
  .seg button { padding: 4px 8px; font-size: 11.5px; }
  .filterbar { gap: 6px; margin-bottom: 10px; }
  .filterbar > * { max-width: 100%; }
  .sort-select { max-width: 46%; }
  .statusbar { display: none; }
  .content { padding: 8px 8px 12px; }
  .qcard { padding: 9px 10px; margin-bottom: 7px; }
  .qcard .title { font-size: 13px; }
  .panel { padding: 10px; }
  .preview-header { flex-basis: 44px; }
  .preview-tools button, .tool-close, .tool-download { height: 28px; min-width: 28px; }
  .preview-tools .tool-note, .preview-tools output { min-width: 30px; font-size: 11px; }
}
