/* DSH Remote · 移动优先 · 五皮肤(默认深空/深色落日/亮色易北爱乐厅/中性草原孤塔/黑曜白)
 * 规则样式表; 变量定义已抽取到 theme-vars.css(桌面端共享), 保持单一来源。 */

@import 'theme-vars.css';

/* 思考流与兼容档位提示 */
.effort-hint { flex-basis: 100%; color: var(--dsr-muted); font-size: 11px; line-height: 1.45; }
.msg.reasoning-live { border-color: var(--dsr-accent-line); box-shadow: 0 0 0 1px var(--dsr-accent-soft) inset; }
.msg.reasoning-live summary::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--dsr-accent); animation: reasoning-pulse 1.2s ease-in-out infinite; }
@keyframes reasoning-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }


/* ============ 基础 ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

input::placeholder, textarea::placeholder { color: var(--dsr-text-disabled); opacity: 1; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--dsr-bg);
  color: var(--dsr-text);
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}

body { padding-bottom: calc(92px + var(--dsr-safe-b)); }

.hidden { display: none !important; }
.muted { color: var(--dsr-muted); font-size: 12px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--dsr-safe-top) + 10px) 14px 10px;
  /* 实色背景: 小米/MIUI WebView 后台恢复时 backdrop-filter 图层会丢, 顶栏整块消失 */
  background: var(--dsr-bg);
  border-bottom: 1px solid var(--dsr-line);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; letter-spacing: .5px; }
.brand-trigger { padding: 4px 5px 4px 2px; border-radius: 11px; text-align: left; color: var(--dsr-text); }
.brand-trigger:active { background: var(--dsr-accent-soft); }
.brand-trigger:focus-visible { outline: 2px solid var(--dsr-accent); outline-offset: 2px; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.14; }
.brand-name { white-space: nowrap; }
.brand-group-name { max-width: 16ch; overflow: hidden; color: var(--dsr-muted); font-size: 10.5px; font-weight: 600; letter-spacing: .15px; text-overflow: ellipsis; white-space: nowrap; }
.brand-caret { width: 14px; height: 14px; flex: none; color: var(--dsr-muted); transition: transform .18s ease, color .18s ease; }
.brand-trigger[aria-expanded="true"] .brand-caret { color: var(--dsr-accent-strong); transform: rotate(180deg); }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--dsr-brand-a), var(--dsr-brand-b));
  box-shadow: 0 0 12px var(--dsr-glow);
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.conn-badge {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--dsr-line); color: var(--dsr-muted);
}
.conn-badge.on { color: var(--dsr-success); border-color: var(--dsr-success-line); background: var(--dsr-success-soft); }
.conn-badge.off { color: var(--dsr-warning); border-color: var(--dsr-warning-line); background: var(--dsr-warning-soft); }

/* ---------- 按钮 ---------- */
button {
  font: inherit; color: inherit; background: none; border: none; cursor: pointer;
  touch-action: manipulation;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-accent-strong);
  font-size: 17px; display: grid; place-items: center;
}
.icon-btn svg { width: 19px; height: 19px; display: block; }
.icon-btn:active { background: var(--dsr-panel-2); }
/* 顶栏按钮统一: 反馈/刷新/连接徽章同高同基线 */
.topbar-btn {
  height: 44px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  line-height: 1; vertical-align: middle; flex-shrink: 0;
}
.topbar-right .topbar-btn.icon-btn { width: 44px; padding: 0; font-size: 19px; border-radius: 12px; }
.topbar-right #btn-donate { color: var(--dsr-accent-2); }
.topbar-right #btn-feedback { color: var(--dsr-info); }
.topbar-right #btn-refresh { color: var(--dsr-success); }
.topbar-right .topbar-btn.conn-badge { padding: 0 14px; border-radius: 999px; font-size: 12.5px; }

/* ---------- 顶栏组切换抽屉 ---------- */
.group-drawer-backdrop { position: fixed; inset: 0; z-index: 70; border: 0; background: var(--dsr-overlay); }
.group-drawer { position: fixed; inset: 0 auto 0 0; z-index: 71; display: flex; flex-direction: column; width: min(360px, calc(100vw - 18px)); background: var(--dsr-panel); border-right: 1px solid var(--dsr-line); box-shadow: 18px 0 48px var(--dsr-shadow); animation: group-drawer-in .22s cubic-bezier(.2,.8,.2,1); }
.group-drawer.hidden, .group-drawer-backdrop.hidden { display: none; }
@keyframes group-drawer-in { from { opacity: .01; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
body.group-drawer-open { overflow: hidden; }
.group-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: calc(var(--dsr-safe-top) + 18px) 18px 15px; border-bottom: 1px solid var(--dsr-line); }
.group-drawer-eyebrow { margin-bottom: 3px; color: var(--dsr-accent-strong); font-size: 10px; font-weight: 750; letter-spacing: 1.5px; }
.group-drawer-head h2 { margin: 0; color: var(--dsr-text); font-size: 20px; line-height: 1.2; }
.group-drawer-close { width: 38px; height: 38px; display: grid; flex: none; place-items: center; border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-bg-2); color: var(--dsr-muted); font-size: 24px; line-height: 1; }
.group-drawer-close:active { background: var(--dsr-accent-soft); color: var(--dsr-accent-strong); }
.group-drawer-current { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 14px 8px; padding: 11px 12px; border: 1px solid var(--dsr-accent-line); border-radius: 12px; background: var(--dsr-accent-soft); color: var(--dsr-muted); font-size: 12px; }
.group-drawer-current strong { min-width: 0; overflow: hidden; color: var(--dsr-accent-strong); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.group-drawer-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 14px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--dsr-line) transparent; }
.group-drawer-option { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid transparent; border-radius: 13px; color: var(--dsr-text); text-align: left; }
.group-drawer-option:active { background: var(--dsr-bg-2); }
.group-drawer-option.current { border-color: var(--dsr-accent-line); background: linear-gradient(100deg, var(--dsr-accent-soft), transparent); }
.group-drawer-option-mark { width: 10px; height: 10px; flex: none; border: 2px solid var(--dsr-line); border-radius: 50%; }
.group-drawer-option.current .group-drawer-option-mark { border-color: var(--dsr-accent); background: var(--dsr-accent); box-shadow: 0 0 0 4px var(--dsr-accent-soft); }
.group-drawer-option-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.group-drawer-option-name { overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.group-drawer-option-meta { overflow: hidden; color: var(--dsr-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.group-drawer-option-check { flex: none; color: var(--dsr-accent-strong); font-size: 18px; font-weight: 750; }
.group-drawer-foot { flex: none; padding: 12px 14px calc(12px + var(--dsr-safe-b)); border-top: 1px solid var(--dsr-line); background: var(--dsr-bg-2); }
.group-drawer-manage { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border: 1px solid var(--dsr-line); border-radius: 11px; background: var(--dsr-panel); color: var(--dsr-accent-strong); font-weight: 700; text-align: left; }
.group-drawer-manage:active { background: var(--dsr-accent-soft); }
.group-drawer-foot p { margin: 7px 2px 0; color: var(--dsr-muted); font-size: 11px; }
.mini-btn {
  padding: 5px 11px; border-radius: 9px; font-size: 13px;
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-accent-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  flex-shrink: 0;
}
.mini-btn:active { background: var(--dsr-panel-2); }
a.mini-btn { text-decoration: none; display: inline-flex; align-items: center; }
.feedback-links { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 14px; }
.feedback-card { background: var(--dsr-accent-soft); border-color: var(--dsr-accent-line); }
.feedback-btn {
  flex: 1 1 0; min-width: 92px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-accent-strong);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.feedback-btn svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.feedback-btn.primary { background: var(--dsr-accent-strong); border-color: var(--dsr-accent-strong); color: var(--dsr-on-accent); }
.feedback-btn:active { filter: brightness(.94); }
.btn {
  flex: 1; padding: 11px 14px; border-radius: 12px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--dsr-line);
}
.btn.primary { background: var(--dsr-accent); border-color: var(--dsr-accent); color: var(--dsr-on-accent); }
.btn.subtle { background: var(--dsr-panel); color: var(--dsr-muted); }
.danger-btn {
  padding: 7px 13px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: var(--dsr-error-soft); color: var(--dsr-error);
  border: 1px solid var(--dsr-error-line);
}
.danger-btn:active { background: var(--dsr-error-line); }

/* ---------- 主体 ---------- */
.main { padding: 12px 12px 20px; max-width: 720px; margin: 0 auto; }

.stat-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px;
}
.stat {
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: var(--dsr-radius);
  padding: 10px 12px;
}
.stat .v { font-size: 21px; font-weight: 700; }
.stat .k { font-size: 11px; color: var(--dsr-muted); }
.stat.running .v { color: var(--dsr-warning); }
.stat.pending .v { color: var(--dsr-accent-2); }
.stat.ctx .v { color: var(--dsr-info); }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; min-width: 0; margin: 14px 2px 8px; font-size: 13px; font-weight: 700; color: var(--dsr-muted);
  letter-spacing: 1px;
}
.section-head > span:first-child { min-width: 0; }
.section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; flex-wrap: wrap; }
.session-sort {
  min-width: 0; max-width: 112px; height: 30px; padding: 0 7px;
  color: var(--dsr-muted); background: var(--dsr-panel); border: 1px solid var(--dsr-line);
  border-radius: 8px; font: inherit; font-size: 11px; outline: none;
}
.session-sort:focus { border-color: var(--dsr-accent-line); color: var(--dsr-text); }
.section-head.small { margin-top: 6px; }
.workspace-nav, .fs-workspace-nav {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
  margin: 10px 0; padding: 10px; background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: var(--dsr-radius);
}
.workspace-nav > label, .fs-workspace-nav > label, .field-label { color: var(--dsr-muted); font-size: 12px; font-weight: 600; }
.workspace-select {
  min-width: 0; width: 100%; height: 34px; padding: 0 9px; border-radius: 9px;
  color: var(--dsr-text); background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); font: inherit; font-size: 12.5px; outline: none;
}
.workspace-select:focus { border-color: var(--dsr-accent-line); }
.workspace-select.full { margin: 7px 0 10px; }
.workspace-path-scroll {
  display: block; min-width: 0; overflow-x: auto; overflow-y: hidden; white-space: nowrap;
  scrollbar-width: thin; touch-action: pan-x; overscroll-behavior-inline: contain;
  color: var(--dsr-text); background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); border-radius: 9px;
  padding: 7px 9px; font-size: 11.5px; user-select: text;
}
.workspace-nav > .workspace-path-scroll { grid-column: 1 / -1; }
.workspace-name-block { display: grid; gap: 6px; margin: 2px 0 10px; color: var(--dsr-muted); font-size: 12px; }
.workspace-name-block strong {
  min-width: 0; padding: 8px 10px; color: var(--dsr-text); background: var(--dsr-panel); border: 1px solid var(--dsr-line);
  border-radius: 9px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; user-select: text;
}
.workspace-path-block { display: grid; gap: 6px; margin-top: 2px; color: var(--dsr-muted); font-size: 12px; }

/* ---------- Token 统计(移动端) ---------- */
.stats-view { padding-bottom: 16px; }
.stats-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 2px 17px; }
.stats-page-copy { min-width: 0; }
.stats-eyebrow, .stats-panel-kicker { color: var(--dsr-accent-strong); font-size: 10px; font-weight: 800; letter-spacing: .14em; line-height: 1.2; }
.stats-page-head h1 { margin: 4px 0 4px; font-size: 26px; line-height: 1.15; letter-spacing: -.04em; text-wrap: balance; }
.stats-page-subtitle { margin: 0; color: var(--dsr-muted); font-size: 12px; line-height: 1.5; }
.stats-date-wrap { display: grid; gap: 2px; flex: 0 0 auto; justify-items: end; padding: 7px 10px; background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 12px; }
.stats-date-label { color: var(--dsr-muted); font-size: 10px; white-space: nowrap; }
.stats-date { color: var(--dsr-text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 12px; }
.stats-toolbar-label { color: var(--dsr-muted); font-size: 11px; font-weight: 650; }
.stats-mode-picker { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 11px; }
.stats-mode-btn { min-height: 30px; padding: 5px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--dsr-muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.stats-mode-btn.active { color: var(--dsr-text); background: var(--dsr-accent-soft); border-color: var(--dsr-accent-line); box-shadow: 0 2px 8px var(--dsr-shadow); }
.stats-mode-btn:active { background: var(--dsr-panel-2); }
.stats-mode-btn:focus-visible { position: relative; z-index: 1; }
.stats-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scard { position: relative; min-width: 0; overflow: hidden; padding: 14px; background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 18px; box-shadow: 0 8px 24px var(--dsr-shadow); }
.scard::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--dsr-line); }
.scard-primary { grid-column: 1 / -1; background: linear-gradient(140deg, var(--dsr-panel), var(--dsr-accent-soft)); }
.scard-primary::before { background: linear-gradient(90deg, var(--dsr-accent), var(--dsr-accent-2)); }
.scard-cost::before { background: var(--dsr-accent-2); }
.scard-share::before { background: var(--dsr-info); }
.scard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.scard-label { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--dsr-muted); font-size: 11px; font-weight: 700; }
.scard-label > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 7px; color: var(--dsr-accent-strong); background: var(--dsr-accent-soft); font-size: 14px; font-weight: 800; }
.scard-icon.cost { color: var(--dsr-accent-2); background: var(--dsr-accent-2-soft); font-size: 12px; }
.scard-icon.share { color: var(--dsr-info); background: var(--dsr-info-soft); font-size: 12px; }
.scard-badge { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsr-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.scard-value { margin-top: 11px; color: var(--dsr-text); font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard-primary .scard-value { font-size: clamp(32px, 9vw, 42px); }
.scard-unit { margin-left: 6px; color: var(--dsr-muted); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.scard-helper { margin-top: 7px; color: var(--dsr-muted); font-size: 10px; line-height: 1.4; }
.bucket-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--dsr-line); }
.bucket-grid .b { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 5px; min-width: 0; }
.bucket-dot { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: var(--dsr-accent); }
.bucket-dot.input { background: var(--dsr-accent-strong); }
.bucket-dot.cache-read { background: var(--dsr-info); }
.bucket-dot.cache-write { background: var(--dsr-accent-2); }
.bucket-dot.output { background: var(--dsr-warning); }
.bucket-grid .n { min-width: 0; overflow: hidden; color: var(--dsr-muted); font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.bucket-grid .t { grid-column: 2; min-width: 0; overflow: hidden; color: var(--dsr-text); font-size: 12px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.stats-split { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; }
.stats-split-item { display: grid; gap: 5px; min-width: 0; padding: 8px; background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); border-radius: 10px; }
.stats-split-item span { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--dsr-muted); font-size: 10px; white-space: nowrap; }
.stats-split-item strong { overflow: hidden; color: var(--dsr-text); font-size: 12px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.split-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--dsr-accent-strong); }
.split-dot.off { background: var(--dsr-accent-2); }
.share-layout { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.share-ring { position: relative; display: grid; place-items: center; width: 68px; height: 68px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--dsr-info) var(--share), var(--dsr-bg-2) 0); }
.share-ring::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--dsr-panel); }
.share-ring span { position: relative; z-index: 1; color: var(--dsr-text); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.share-copy { display: grid; gap: 2px; min-width: 0; }
.share-copy strong { font-size: 13px; }
.share-copy span, .share-copy small { color: var(--dsr-muted); font-size: 10px; line-height: 1.35; }
.share-copy small { font-variant-numeric: tabular-nums; }
.stats-panel { margin-top: 14px; padding: 14px; background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 18px; box-shadow: 0 8px 24px var(--dsr-shadow); }
.stats-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; margin-bottom: 12px; }
.stats-panel-title { margin: 3px 0 0; font-size: 16px; line-height: 1.2; letter-spacing: -.02em; }
.stats-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; min-width: 0; margin-top: 1px; color: var(--dsr-muted); font-size: 10px; }
.stats-legend .lg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.stats-legend .sw { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.stats-legend .sw.peak { background: var(--dsr-accent-strong); }
.stats-legend .sw.off { background: var(--dsr-accent-2); }
.stats-legend .sw.token { background: var(--dsr-accent); }
.stats-chart { display: flex; align-items: flex-end; gap: 7px; height: 190px; padding: 21px 2px 20px; overflow-x: auto; overflow-y: hidden; background-image: linear-gradient(to top, var(--dsr-line) 1px, transparent 1px); background-size: 100% 25%; border-radius: 10px; }
.stats-bar { display: flex; flex: 1 0 30px; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 30px; }
.stats-bar .bars { display: flex; width: 100%; max-width: 40px; height: 100%; flex-direction: column; justify-content: flex-end; overflow: hidden; border-radius: 7px 7px 3px 3px; background: var(--dsr-accent-soft); box-shadow: 0 4px 12px var(--dsr-shadow); }
.stats-bar .seg { width: 100%; }
.stats-bar .seg.peak { background: var(--dsr-accent-strong); }
.stats-bar .seg.off { background: var(--dsr-accent-2); }
.stats-bar .bars.token { background: linear-gradient(180deg, var(--dsr-accent-strong), var(--dsr-accent)); }
.stats-bar .lbl { color: var(--dsr-muted); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-bar .val { min-height: 12px; color: var(--dsr-text); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-empty { display: grid; flex: 1; place-items: center; min-height: 145px; color: var(--dsr-muted); text-align: center; font-size: 12px; }
.stats-note { margin: 14px 2px 0; padding: 10px 12px; color: var(--dsr-muted); background: var(--dsr-info-soft); border-left: 3px solid var(--dsr-info); border-radius: 0 10px 10px 0; font-size: 11px; line-height: 1.6; }

@media (max-width: 380px) {
  .stats-page-head { gap: 8px; }
  .stats-page-head h1 { font-size: 23px; }
  .stats-date-wrap { padding: 6px 8px; }
  .stats-toolbar { align-items: flex-start; flex-direction: column; gap: 6px; }
  .stats-mode-picker { width: 100%; }
  .stats-mode-btn { width: 100%; }
  .scard { padding: 12px; }
  .bucket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-panel { padding: 12px; }
  .stats-panel-head { display: block; }
  .stats-legend { justify-content: flex-start; margin-top: 8px; }
}

/* ---------- 会话列表 ---------- */
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-card {
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: var(--dsr-radius);
  flex: 0 0 auto; padding: 12px 13px; position: relative; overflow: hidden;
}
.session-card:active { background: var(--dsr-panel-2); }
.session-card.current { border-color: var(--dsr-accent-line); box-shadow: 0 0 0 1px var(--dsr-accent-soft); }
.sc-title {
  font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; padding-right: 44px;
}
.sc-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--dsr-muted); flex-wrap: wrap; }
.sc-workspace {
  min-width: 0; margin-top: 5px; padding-right: 28px; color: var(--dsr-muted); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-group-label {
  display: flex; align-items: center; gap: 6px; flex: 0 0 auto; min-width: 0; min-height: 28px;
  box-sizing: border-box; margin: 8px 2px 0; padding: 6px 8px 4px; border-bottom: 1px solid var(--dsr-line);
  color: var(--dsr-accent-strong); font-size: 11px; font-weight: 700;
}
.session-workspace-group { flex: 0 0 auto; display: flex; flex-direction: column; gap: 0; }
.session-group-label { touch-action: pan-y; user-select: none; }
.session-group-drag-handle { flex: 0 0 auto; color: var(--dsr-muted); opacity: .52; font-size: 14px; line-height: 1; letter-spacing: -3px; }
.session-workspace-group.reorder-pressing { outline: 1px solid var(--dsr-accent-line); border-radius: var(--dsr-radius); }
.session-workspace-group.reorder-dragging { position: relative; z-index: 5; opacity: .76; outline: 1px solid var(--dsr-accent-strong); box-shadow: 0 10px 24px var(--dsr-shadow); touch-action: none; }
.session-workspace-group .session-card { touch-action: pan-y; }
.session-group-icon { flex: 0 0 auto; color: var(--dsr-accent-2); font-size: 12px; }
.session-group-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-list.workspace-sorted .sc-workspace { display: none; }
.session-list.workspace-sorted .session-card { padding-top: 11px; padding-bottom: 11px; }
}
.sc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dsr-line); display: inline-block; }
.sc-dot.running { background: var(--dsr-warning); box-shadow: 0 0 8px var(--dsr-warning-line); animation: pulse 1.6s infinite; }
.sc-dot.pending { background: var(--dsr-accent-2); box-shadow: 0 0 8px var(--dsr-accent-2-line); }
@keyframes pulse { 50% { opacity: .45; } }
.sc-badge {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--dsr-accent-2-soft); color: var(--dsr-accent-2); border: 1px solid var(--dsr-accent-2-line);
}
.sc-badge.goal-active { background: var(--dsr-info-soft); color: var(--dsr-info); border-color: var(--dsr-info-line); }
.sc-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--dsr-muted); }
.session-swipe { position: relative; overflow: hidden; border-radius: var(--dsr-radius); background: var(--dsr-error); touch-action: pan-y; }
.session-swipe .session-card { position: relative; z-index: 1; transform: translateX(var(--swipe-x, 0)); transition: transform .18s ease; }
.session-swipe.revealed .session-card { transform: translateX(-92px); }
.session-swipe .wb-session { position: relative; z-index: 1; transform: translateX(var(--swipe-x, 0)); transition: transform .18s ease; }
.session-swipe.revealed .wb-session { transform: translateX(-92px); }
.wb-sessions .session-swipe { border-radius: 8px; }
.sc-archive-btn { position: absolute; inset: 0 0 0 auto; z-index: 0; width: 92px; display: grid; place-items: center; padding: 0; background: var(--dsr-error); color: #fff; font-size: 13px; font-weight: 700; }
.sc-archive-btn:active { filter: brightness(.9); }
.empty { text-align: center; color: var(--dsr-muted); padding: 34px 0; }

/* ---------- 工作台与归档会话 ---------- */
.workbench-bar { margin: 0 0 2px; border-radius: var(--dsr-radius); overflow: hidden; }
.workbench-bar .wb-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 13px;
  font: inherit; text-align: left; border: 1px solid var(--dsr-line);
  background: var(--dsr-panel); color: var(--dsr-text);
}
.workbench-bar.unbound .wb-toggle { color: var(--dsr-muted); cursor: default; }
.workbench-bar.unbound .wb-chevron { visibility: hidden; }
.workbench-bar.bound .wb-toggle { background: var(--dsr-accent-soft); border-color: var(--dsr-accent-line); color: var(--dsr-accent-strong); font-weight: 600; }
.wb-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-chevron { flex-shrink: 0; font-size: 11px; color: var(--dsr-muted); transition: transform .15s ease; }
.workbench-bar.bound .wb-toggle[aria-expanded="true"] .wb-chevron { transform: rotate(180deg); }
.wb-panel { background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); border-top: none; border-radius: 0 0 var(--dsr-radius) var(--dsr-radius); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.wb-project { background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 10px; overflow: hidden; }
.wb-project-head { display: flex; align-items: center; gap: 7px; padding: 9px 10px; cursor: pointer; touch-action: pan-y; user-select: none; }
.wb-drag-handle, .wb-session-drag-handle { flex: none; color: var(--dsr-muted); opacity: .52; font-size: 14px; line-height: 1; letter-spacing: -3px; }
.wb-project.reorder-pressing, .wb-session.reorder-pressing { outline: 1px solid var(--dsr-accent-line); }
.wb-project.reorder-dragging, .wb-session.reorder-dragging { position: relative; z-index: 5; opacity: .76; outline: 1px solid var(--dsr-accent-strong); box-shadow: 0 10px 24px var(--dsr-shadow); touch-action: none; }
.wb-panel.reorder-active { user-select: none; }
.reorder-placeholder { flex: 0 0 auto; box-sizing: border-box; border: 1px dashed var(--dsr-accent-line); border-radius: 8px; background: var(--dsr-accent-soft); opacity: .72; }
html.reorder-scroll-lock { overscroll-behavior: none; }
html.reorder-scroll-lock body { overscroll-behavior: none; }
.wb-project-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-new { padding: 3px 9px; font-size: 12px; }
.wb-sessions { display: flex; flex-direction: column; gap: 4px; padding: 0 6px 6px; }
.wb-session { width: 100%; display: flex; align-items: center; gap: 8px; background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); border-radius: 8px; padding: 7px 9px; text-align: left; color: var(--dsr-text); font: inherit; touch-action: pan-y; user-select: none; }
.wb-session-title { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-session-meta { flex-shrink: 0; font-size: 11px; color: var(--dsr-muted); }
.wb-empty { font-size: 12px; color: var(--dsr-muted); text-align: center; padding: 10px 0; }
.archived-toggle { width: 100%; display: block; text-align: center; padding: 9px 0; margin-top: 2px; border-radius: 9px; background: var(--dsr-panel); border: 1px dashed var(--dsr-line); color: var(--dsr-muted); font-size: 12px; }

/* ---------- 会话详情 ---------- */
body.in-session { overflow: hidden; height: 100vh; height: 100dvh; }
body.in-session .topbar { display: none; }
body.in-session .main {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 12px 0;
}
body.in-session .bottom-nav { display: none; }
body.in-session .view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.session-head {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  padding: calc(var(--dsr-safe-top) + 8px) 12px 8px;
  margin: -12px -12px 6px;
  background: var(--dsr-head-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dsr-line);
}
/* 会话运行状态可视化:
   运行中 = 流动渐变; 出错/中断 = 暖色; 空闲 = 原始样式 */
.session-head.running {
  background: var(--dsr-head-running-bg);
  background-size: 200% 100%;
  animation: session-running-flow 2.6s ease-in-out infinite alternate;
  border-bottom-color: var(--dsr-head-running-line);
}
.session-head.interrupted {
  background: var(--dsr-head-interrupted-bg);
  background-size: 200% 100%;
  animation: session-running-flow 1.8s ease-in-out infinite alternate;
  border-bottom-color: var(--dsr-head-interrupted-line);
}
@keyframes session-running-flow {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
.session-head .session-title { flex-shrink: 1; }
.session-head-meta { flex: 1; min-width: 0; }
.session-send-btn { flex: 0 0 auto; min-height: 38px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--dsr-accent-line); background: var(--dsr-accent-soft); color: var(--dsr-accent-strong); font: inherit; font-size: 13px; font-weight: 700; }
.session-send-btn:active { filter: brightness(.92); }
.session-title {
  font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-sub { font-size: 12px; color: var(--dsr-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-head .mini-btn { flex: none; padding: 7px 9px; }
.text-input { width: 100%; box-sizing: border-box; min-height: 42px; padding: 10px 12px; border: 1px solid var(--dsr-line); border-radius: 10px; background: var(--dsr-bg-2); color: var(--dsr-text); font: inherit; outline: none; }
.text-input:focus { border-color: var(--dsr-accent-line); }
.cards {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
  flex-shrink: 0; max-height: 42vh; overflow-y: auto;
}
.card {
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: var(--dsr-radius);
  padding: 11px 13px;
}
.card-title { font-size: 12px; color: var(--dsr-muted); font-weight: 700; letter-spacing: .6px; margin-bottom: 6px; }
.card-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; }
.card-row .k { color: var(--dsr-muted); }
.card-row .v { text-align: right; word-break: break-all; }
.subagent-card { padding: 0; overflow: hidden; }
.subagent-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.subagent-toggle .card-title { margin: 0; }
.subagent-toggle-icon { color: var(--dsr-muted); font-size: 16px; line-height: 1; }
.subagent-toggle-icon morph-icon,
.subagent-toggle-icon morph-icon svg { width: 16px; height: 16px; display: block; }
.subagent-list { padding: 0 12px 10px; border-top: 1px solid var(--dsr-line); }
.queue-dock { margin: 0 0 10px; border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-surface); overflow: hidden; }
.queue-dock-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--dsr-muted); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--dsr-line); }
.queue-dock-list { max-height: 220px; overflow-y: auto; }
.queue-dock-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--dsr-line); }
.queue-dock-item:last-child { border-bottom: 0; }
.queue-dock-preview { flex: 1; min-width: 0; color: var(--dsr-text); font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-dock-action { flex: 0 0 auto; }
.session-pending { flex:0 0 auto; margin:0 0 10px; padding:10px; border:1px solid var(--dsr-warning-line); border-radius:13px; background:var(--dsr-warning-soft); }
.session-pending-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; color:var(--dsr-text); font-size:12px; font-weight:750; }
.session-pending-list { display:flex; flex-direction:column; gap:8px; }
.session-pending .pending-card { min-width:0; background:var(--dsr-panel); }
.session-pending .pc-title { line-height:1.45; overflow-wrap:anywhere; word-break:break-word; }
.session-pending .pc-desc { line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.session-pending .goal-actions { justify-content:flex-end; }
.md-table-wrap { max-width: 100%; overflow-x: auto; margin: 8px 0; }
.md-table-wrap table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: .94em; }
.md-table-wrap th, .md-table-wrap td { padding: 6px 9px; border: 1px solid var(--dsr-line); text-align: left; white-space: nowrap; }
.md-table-wrap th { background: var(--dsr-bg-2); font-weight: 700; }
.md-table-wrap tbody tr:nth-child(even) { background: color-mix(in srgb, var(--dsr-bg-2) 45%, transparent); }
.goal-disclosure { width: 100%; min-width: 0; display: flex; justify-content: flex-end; }
.goal-disclosure .goal-card { width: 100%; min-width: 0; }
.goal-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.goal-card-head .card-title { min-width: 0; margin-bottom: 0; }
.goal-collapse-btn,
.goal-side-tab {
  touch-action: manipulation; border: 1px solid var(--dsr-line); background: var(--dsr-bg-2); color: var(--dsr-muted);
  font: inherit; cursor: pointer;
}
.goal-collapse-btn { min-height: 34px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 9px; font-size: 12px; }
.goal-collapse-btn > span { color: var(--dsr-accent-strong); font-size: 18px; line-height: 1; }
.goal-side-tab {
  min-height: 46px; max-width: min(100%, 210px); display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 10px;
  border-right: 0; border-radius: 12px 0 0 12px; box-shadow: -5px 6px 18px var(--dsr-shadow); color: var(--dsr-text); font-size: 13px; font-weight: 700;
}
.goal-side-tab > span:first-child { color: var(--dsr-accent-strong); font-size: 20px; line-height: 1; }
.goal-side-tab small { min-width: 0; color: var(--dsr-muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.goal-collapse-btn:hover,
.goal-side-tab:hover { background: var(--dsr-panel-2); color: var(--dsr-text); }
.goal-collapse-btn:active,
.goal-side-tab:active { transform: translateY(1px); }
.goal-collapse-btn:focus-visible,
.goal-side-tab:focus-visible { outline: 2px solid var(--dsr-accent-strong); outline-offset: 2px; }
.goal-obj { font-size: 13px; line-height: 1.55; color: var(--dsr-text); overflow-wrap: anywhere; }
.goal-phase { font-size: 12px; color: var(--dsr-info); margin-top: 3px; }
.goal-actions { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.goal-actions .mini-btn { flex: 1; text-align: center; min-width: 64px; }
.pill {
  display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: var(--dsr-accent-soft); color: var(--dsr-accent-strong); border: 1px solid var(--dsr-accent-line);
  margin: 1px 3px 1px 0;
}
.pill.done { background: var(--dsr-success-soft); color: var(--dsr-success); border-color: var(--dsr-success-line); }
.pill.active { background: var(--dsr-warning-soft); color: var(--dsr-warning); border-color: var(--dsr-warning-line); }

/* ---------- 历史 ---------- */
.history-wrap {
  flex: 1; min-height: 0;
  position: relative;
  display: flex;
}
.history {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 8px;
  padding-right: 16px;
  scrollbar-width: none;
}
body.in-session .history { padding-bottom: calc(76px + var(--dsr-safe-b)); }
body.in-session.has-composer-images .history { padding-bottom: calc(146px + var(--dsr-safe-b)); }
.history::-webkit-scrollbar { display: none; }
.history-more { text-align: center; margin: 4px 0; }

/* 右侧导航条: 拇指 + 用户发言节点 */
.history-rail {
  position: absolute; right: 0; top: 0; bottom: 0; width: 18px;
  z-index: 5; touch-action: none;
}
.rail-track {
  position: absolute; right: 8px; top: 4px; bottom: 4px; width: 4px;
  border-radius: 2px; background: var(--dsr-line);
}
.rail-thumb {
  position: absolute; right: 6px; width: 8px; min-height: 32px;
  border-radius: 4px; background: var(--dsr-accent); opacity: .85;
}
.rail-nodes { position: absolute; inset: 0; }
.rail-node {
  position: absolute; right: 7px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--dsr-warning); transform: translateY(-3px);
  box-shadow: 0 0 4px var(--dsr-warning-line);
}
.rail-node.active { background: var(--dsr-text); width: 8px; height: 8px; right: 6px; }
.msg { max-width: 94%; border-radius: var(--dsr-radius); padding: 10px 12px; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--dsr-accent); color: var(--dsr-on-accent); }
.msg.assistant { align-self: flex-start; background: var(--dsr-panel); border: 1px solid var(--dsr-line); }
.msg .role { font-size: 11px; opacity: .65; margin-bottom: 3px; }
.msg pre {
  background: var(--dsr-code-bg); border-radius: 8px; padding: 8px 10px; overflow-x: auto;
  font-size: 12px; max-height: 220px; overflow-y: auto;
}
.msg img { max-width: 100%; border-radius: 8px; }
.msg p { margin: 4px 0; }
.msg p:first-child { margin-top: 0; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0; padding-left: 20px; }
.msg code { font-family: ui-monospace, monospace; font-size: .9em; background: var(--dsr-accent-soft); padding: 0 4px; border-radius: 4px; }
.msg h1, .msg h2, .msg h3 { margin: 8px 0 4px; line-height: 1.3; font-weight: 700; }
.msg h1 { font-size: 1.3em; } .msg h2 { font-size: 1.18em; } .msg h3 { font-size: 1.05em; }
.msg blockquote { margin: 6px 0; padding: 2px 10px; border-left: 3px solid var(--dsr-accent-2); color: var(--dsr-muted); }
.msg a { color: var(--dsr-accent-strong); text-decoration: underline; word-break: break-all; }
.msg.user a { color: var(--dsr-on-accent); }
.msg li { margin: 2px 0; }

.event {
  align-self: center; font-size: 11px; color: var(--dsr-muted);
  background: var(--dsr-panel); border: 1px dashed var(--dsr-divider);
  padding: 5px 12px; border-radius: 999px; max-width: 92%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event.event-detail {
  align-self: stretch; max-width: 96%; white-space: normal; overflow: visible;
  border-radius: 12px; padding: 8px 10px; line-height: 1.45;
}
.event.event-detail summary { white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.event.event-detail pre {
  margin: 8px 0 0; max-height: 280px; overflow: auto; white-space: pre-wrap;
  overflow-wrap: anywhere; word-break: break-word; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--dsr-code-bg); border-radius: 8px; padding: 9px 10px;
}
.tool {
  align-self: flex-start; max-width: 96%; background: var(--dsr-panel);
  border: 1px solid var(--dsr-line); border-left: 3px solid var(--dsr-accent-2);
  border-radius: 10px; padding: 8px 11px; font-size: 13px;
}
.tool summary { cursor: pointer; color: var(--dsr-accent-2); font-weight: 600; }
.tool-meta-inline { font-size: 11px; color: var(--dsr-muted); font-weight: 400; margin-left: 6px; }
.tool pre { margin: 6px 0 0; font-size: 11.5px; background: var(--dsr-code-bg); border-radius: 8px; padding: 8px; overflow-x: auto; max-height: 180px; overflow-y: auto; }
.tool .tool-meta { font-size: 11px; color: var(--dsr-muted); margin-top: 4px; }
.tool-text {
  white-space: pre-wrap; word-break: break-word;
  font-size: 12.5px; line-height: 1.6;
  background: var(--dsr-code-bg); border-radius: 8px;
  padding: 8px 10px; margin-top: 6px;
  max-height: 320px; overflow-y: auto;
}
.tool.result { border-left-color: var(--dsr-info); }
.tool.result summary { color: var(--dsr-info); }
.tool.error { border-left-color: var(--dsr-error); }
.tool.error summary { color: var(--dsr-error); }

/* ---------- composer ---------- */
.composer-wrap {
  position: fixed; left: 0; right: 0; bottom: calc(58px + var(--dsr-safe-b)); z-index: 20;
  max-width: 720px; margin: 0 auto;
  background: var(--dsr-composer-bg); backdrop-filter: blur(10px);
  border-top: 1px solid var(--dsr-line);
}
.composer-attachments {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px 0;
  scrollbar-width: none;
}
.composer-attachments::-webkit-scrollbar { display: none; }
.composer-attachment { position: relative; flex: 0 0 58px; width: 58px; height: 58px; border-radius: 11px; overflow: hidden; border: 1px solid var(--dsr-line); background: var(--dsr-panel); }
.composer-attachment img { width: 100%; height: 100%; object-fit: cover; display: block; }
.composer-attachment-remove { position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); background: rgba(0,0,0,.62); color: #fff; font-size: 14px; line-height: 16px; padding: 0; }
.composer-image-btn { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--dsr-info); background: var(--dsr-panel); border: 1px solid var(--dsr-line); }
.composer-image-btn svg { width: 20px; height: 20px; }
.composer-image-btn:active, .composer-image-btn.active { color: var(--dsr-accent-strong); background: var(--dsr-accent-soft); border-color: var(--dsr-accent-line); }
.composer-image-menu { position: absolute; right: 12px; bottom: 58px; z-index: 4; display: flex; gap: 7px; padding: 7px; border: 1px solid var(--dsr-line); border-radius: 14px; background: var(--dsr-bg-2); box-shadow: 0 12px 30px var(--dsr-shadow); }
.composer-image-option { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--dsr-line); border-radius: 10px; background: var(--dsr-panel); color: var(--dsr-text); font: inherit; font-size: 12px; }
.composer-image-option svg { width: 16px; height: 16px; color: var(--dsr-info); }
.composer {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 8px 12px calc(8px + var(--dsr-safe-b));
}
.composer-input-wrap { flex: 1; min-width: 0; position: relative; display: flex; align-items: flex-end; }
.composer-input-wrap textarea { width: 100%; min-width: 0; }
.composer textarea {
  flex: 1; resize: none; background: var(--dsr-panel); color: var(--dsr-text);
  border: 1px solid var(--dsr-line); border-radius: 16px;
  padding: 10px 14px; font: inherit; font-size: 15px; line-height: 1.4;
  max-height: 120px; outline: none;
}
.composer textarea:focus { border-color: var(--dsr-accent-line); }
.composer-fs-btn { position: absolute; top: 5px; right: 6px; z-index: 2; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); color: var(--dsr-muted); }
.composer-fs-btn:active { color: var(--dsr-accent-strong); border-color: var(--dsr-accent-line); }
.composer-fs-btn svg { width: 15px; height: 15px; }
.composer-input-wrap.has-fs-btn textarea { padding-right: 38px; }
.composer-fs-handle { display: none; }
.composer-wrap.fs { position: fixed; top: calc(54px + var(--dsr-safe-top)); left: 0; right: 0; bottom: 0; max-width: none; height: auto; z-index: 35; display: flex; flex-direction: column; background: var(--dsr-composer-bg); }
.composer-wrap.fs .composer-menu { display: none; }
.composer-wrap.fs .composer-fs-handle { display: flex; align-items: center; justify-content: center; flex: none; height: 28px; touch-action: pan-y; }
.composer-fs-handle span { width: 38px; height: 4px; border-radius: 999px; background: var(--dsr-line); }
.composer-wrap.fs .composer { flex: 1; align-items: stretch; padding-bottom: calc(8px + var(--dsr-safe-b)); }
.composer-wrap.fs .composer-input-wrap { align-items: stretch; }
.composer-wrap.fs .composer-input-wrap textarea { height: 100%; max-height: none; resize: none; }
.composer-wrap.fs .composer-fs-btn { top: 7px; right: 7px; width: 30px; height: 30px; }
.composer-wrap.fs .plus-btn { display: none; }
.composer-wrap.fs .composer-image-btn, .composer-wrap.fs .composer-image-menu, .composer-wrap.fs .send-btn { display: none; }
.composer-wrap.fs .composer-image-menu { bottom: 58px; }
body.composer-fullscreen { overflow: hidden; }
.plus-btn {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 14px;
  background: var(--dsr-panel); color: var(--dsr-info); border: 1px solid var(--dsr-line);
  font-size: 22px; font-weight: 700; line-height: 1;
}
.plus-btn.active { background: var(--dsr-info-soft); border-color: var(--dsr-info-line); }
.send-btn {
  flex-shrink: 0; width: 46px; height: 42px; border-radius: 14px;
  background: var(--dsr-accent); color: var(--dsr-on-accent); font-weight: 700; font-size: 14px;
}
.send-btn:disabled { opacity: .45; }
.composer-status { display: flex; align-items: center; gap: 7px; padding: 0 3px; color: var(--dsr-accent-strong); font-size: 12px; font-weight: 700; }
.composer-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: dsr-running-pulse 1.3s ease-out infinite; }
@keyframes dsr-running-pulse { 0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; } 70% { box-shadow: 0 0 0 6px transparent; opacity: .65; } 100% { box-shadow: 0 0 0 0 transparent; opacity: 1; } }
.scan-live-card { width: min(92vw, 420px); }
.scan-live-preview { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 14px; background: #05070d; }
.scan-live-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scan-live-frame { position: absolute; inset: 18%; border: 2px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.scan-live-frame::after { content: ''; position: absolute; left: 8%; right: 8%; top: 8%; height: 2px; background: var(--dsr-accent-strong); box-shadow: 0 0 12px var(--dsr-accent-strong); animation: scan-live-line 1.8s ease-in-out infinite; }
@keyframes scan-live-line { 0%, 100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(220px); opacity: 1; } }
.scan-live-status { padding: 10px 2px 0; color: var(--dsr-muted); font-size: 13px; text-align: center; }
.composer-menu {
  max-height: min(46vh, 340px); overflow-y: auto;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 12px;
  border-bottom: 1px solid var(--dsr-line);
}
.menu-title {
  font-size: 12px; color: var(--dsr-muted); font-weight: 700; letter-spacing: .5px;
  margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between;
}
.menu-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.menu-chip {
  background: var(--dsr-panel); color: var(--dsr-text); border: 1px solid var(--dsr-line);
  border-radius: 999px; padding: 6px 11px; font-size: 12.5px; cursor: pointer;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.menu-chip:active { background: var(--dsr-accent-soft); border-color: var(--dsr-accent-line); }
.menu-chip.current { color: var(--dsr-info); border-color: var(--dsr-info-line); background: var(--dsr-info-soft); }
.menu-chip.danger { color: var(--dsr-warning); border-color: var(--dsr-warning-line); }
.menu-models { display: flex; flex-wrap: wrap; gap: 7px; }
.model-chip {
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-text);
  border-radius: 999px; padding: 6px 11px; font-size: 12.5px; cursor: pointer;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.model-chip.current { color: var(--dsr-info); border-color: var(--dsr-info-line); background: var(--dsr-info-soft); }
.model-provider { font-size: 11px; color: var(--dsr-muted); margin: 7px 0 5px; }
body.in-session .main { padding-bottom: 0; }

/* ---------- 系统总览 · A 方案 ---------- */
.overview-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin:2px 0 16px; }
.overview-eyebrow { color:var(--dsr-accent-strong); font-size:10px; font-weight:800; letter-spacing:1.7px; line-height:1.3; }
.overview-title { margin:3px 0 2px; font-size:25px; line-height:1.18; letter-spacing:-.4px; }
.overview-subtitle { margin:0; color:var(--dsr-muted); font-size:12px; }
.overview-refresh { width:34px; height:34px; padding:0; display:grid; place-items:center; border-radius:11px; font-size:18px; line-height:1; }
.overview-refresh { color: var(--dsr-accent-strong); }
.overview-refresh svg { width:17px; height:17px; display:block; }
.overview-board { margin-bottom:14px; padding:14px; border:1px solid var(--dsr-accent-line); border-radius:16px; background:linear-gradient(145deg,var(--dsr-accent-soft),var(--dsr-panel) 55%,var(--dsr-bg-2)); box-shadow:0 8px 22px var(--dsr-shadow); }
.overview-board-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:11px; }
.overview-board-head h2 { margin:3px 0 0; color:var(--dsr-text); font-size:18px; line-height:1.25; letter-spacing:-.2px; }
.overview-announcement-list { display:grid; gap:8px; }
.overview-announcement-card { width:100%; min-width:0; display:block; padding:12px; border:1px solid var(--dsr-line); border-radius:13px; background:var(--dsr-bg-2); color:var(--dsr-text); text-align:left; cursor:pointer; }
.overview-announcement-card.poll { border-color:var(--dsr-accent-line); }
.overview-announcement-card:active { background:var(--dsr-panel-2); }
.overview-announcement-meta { display:flex; align-items:center; gap:7px; min-width:0; margin-bottom:7px; color:var(--dsr-muted); font-size:10.5px; }
.overview-announcement-badge { flex:0 0 auto; padding:2px 7px; border-radius:999px; background:var(--dsr-panel); border:1px solid var(--dsr-line); color:var(--dsr-muted); font-size:10px; font-weight:750; }
.overview-announcement-card.poll .overview-announcement-badge { background:var(--dsr-accent-soft); border-color:var(--dsr-accent-line); color:var(--dsr-accent-strong); }
.overview-announcement-new { flex:0 0 auto; padding:1px 6px; border-radius:999px; background:var(--dsr-error-soft); color:var(--dsr-error); font-size:9.5px; font-weight:800; }
.overview-announcement-date { min-width:0; margin-left:auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.overview-announcement-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13.5px; font-weight:750; }
.overview-announcement-copy { display:-webkit-box; margin-top:4px; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; color:var(--dsr-muted); font-size:11.5px; line-height:1.55; }
.overview-announcement-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; padding-top:8px; border-top:1px solid var(--dsr-line); color:var(--dsr-accent-strong); font-size:11px; font-weight:700; }
.overview-announcement-footer span:last-child { flex:0 0 auto; font-size:16px; font-weight:500; }
.overview-pulse-card { position:relative; overflow:hidden; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; align-items:center; padding:14px; margin-bottom:14px; border:1px solid var(--dsr-accent-line); border-radius:16px; background:linear-gradient(135deg,var(--dsr-panel),var(--dsr-bg-2)); box-shadow:0 10px 26px var(--dsr-shadow); }
.overview-pulse-card::after { content:""; position:absolute; width:110px; height:110px; right:-45px; top:-55px; border-radius:50%; background:var(--dsr-accent-soft); filter:blur(3px); pointer-events:none; }
.overview-pulse-copy { min-width:0; align-self:start; }
.overview-status { margin-top:6px; font-size:20px; font-weight:780; letter-spacing:-.3px; }
.overview-status-desc { margin-top:4px; color:var(--dsr-muted); font-size:11px; }
.overview-primary-action { display:inline-flex; align-items:center; justify-content:center; min-height:34px; margin-top:13px; padding:7px 13px; border:1px solid var(--dsr-accent-strong); border-radius:10px; background:var(--dsr-accent-strong); color:var(--dsr-on-accent); font:inherit; font-size:12px; font-weight:750; cursor:pointer; transition:transform .18s ease, filter .18s ease; }
.overview-primary-action:hover, .overview-primary-action:focus-visible { filter:brightness(1.08); transform:translateY(-1px); }
.overview-primary-action:disabled { opacity:.65; cursor:wait; transform:none; }
.overview-pulse-card.status-degraded { border-color:var(--dsr-warning-line); }
.overview-pulse-card.status-degraded .overview-primary-action { border-color:var(--dsr-warning); background:var(--dsr-warning); color:var(--dsr-on-warning); }
.overview-pulse-card.status-offline { border-color:var(--dsr-error-line); }
.overview-pulse-card.status-offline .overview-primary-action { border-color:var(--dsr-error); background:var(--dsr-error); color:var(--dsr-neutral-9); }
.system-pulse-ring { --pulse-pct:0%; position:relative; z-index:1; width:92px; height:92px; padding:7px; border-radius:50%; background:conic-gradient(var(--dsr-accent) 0 var(--pulse-pct),var(--dsr-line) var(--pulse-pct) 100%); box-shadow:0 0 20px var(--dsr-glow); }
.system-pulse-ring::before { content:""; position:absolute; inset:6px; border-radius:50%; border:1px solid var(--dsr-accent-line); opacity:.7; }
.system-pulse-core { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; width:100%; height:100%; border-radius:50%; background:var(--dsr-bg-2); color:var(--dsr-muted); }
.system-pulse-core strong { max-width:100%; color:var(--dsr-text); font-size:14px; line-height:1.05; letter-spacing:.2px; text-align:center; white-space:nowrap; }
.system-pulse-core span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:4px; font-size:8px; text-align:center; }
.overview-links { grid-column:1 / -1; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; padding-top:8px; border-top:1px solid var(--dsr-line); }
.overview-link { min-width:0; display:grid; grid-template-columns:auto 1fr; align-items:center; gap:4px 6px; padding-top:9px; color:var(--dsr-muted); font-size:10px; }
.overview-link i { width:6px; height:6px; border-radius:50%; background:var(--dsr-muted); box-shadow:0 0 0 3px var(--dsr-line); }
.overview-link b { grid-column:2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsr-text); font-size:10px; font-weight:650; }
.overview-link.ok i { background:var(--dsr-success); box-shadow:0 0 0 3px var(--dsr-success-soft); }
.overview-link.warn i { background:var(--dsr-warning); box-shadow:0 0 0 3px var(--dsr-warning-soft); }
.overview-link.off i { background:var(--dsr-error); box-shadow:0 0 0 3px var(--dsr-error-soft); }
.overview-section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:17px 1px 8px; font-size:12px; font-weight:750; letter-spacing:.3px; }
.overview-section-meta { color:var(--dsr-muted); font-size:11px; font-weight:500; }
.overview-attention-list, .overview-session-list { display:flex; flex-direction:column; gap:7px; }
.overview-attention-item, .overview-session-item { width:100%; display:flex; align-items:center; gap:10px; min-width:0; padding:11px 12px; border:1px solid var(--dsr-line); border-radius:13px; background:var(--dsr-panel); color:var(--dsr-text); text-align:left; }
.overview-attention-item { align-items:flex-start; }
button.overview-attention-item, button.overview-session-item { cursor:pointer; }
.overview-attention-item { border-left:3px solid var(--dsr-warning); }
.overview-attention-item.question { border-left-color:var(--dsr-accent-2); }
.overview-item-mark { flex:0 0 auto; width:25px; height:25px; display:grid; place-items:center; border-radius:8px; background:var(--dsr-warning-soft); color:var(--dsr-warning); font-size:12px; }
.overview-attention-item.question .overview-item-mark { background:var(--dsr-accent-2-soft); color:var(--dsr-accent-2); }
.overview-item-copy { min-width:0; flex:1; }
.overview-item-title { font-size:12.5px; font-weight:650; line-height:1.45; overflow-wrap:anywhere; word-break:break-word; }
.overview-item-desc { margin-top:3px; color:var(--dsr-muted); font-size:11px; line-height:1.45; white-space:normal; overflow-wrap:anywhere; }
.overview-item-arrow { color:var(--dsr-muted); font-size:18px; }
.overview-item-actions { flex:0 0 auto; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; }
.overview-item-actions .mini-btn { padding:4px 7px; font-size:10px; }
.overview-metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.overview-metric { min-width:0; padding:11px 12px; border:1px solid var(--dsr-line); border-radius:13px; background:var(--dsr-panel); }
.overview-metric span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsr-muted); font-size:10.5px; }
.overview-metric strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:5px; color:var(--dsr-text); font-size:15px; font-weight:700; }
.overview-session-item { cursor:pointer; }
.overview-session-item .overview-item-mark { background:var(--dsr-info-soft); color:var(--dsr-info); }
.overview-session-item.running .overview-item-mark { background:var(--dsr-success-soft); color:var(--dsr-success); }
.overview-session-item .overview-item-desc { font-variant-numeric:tabular-nums; }
.overview-empty { padding:10px 12px; border:1px dashed var(--dsr-line); border-radius:13px; color:var(--dsr-muted); font-size:12px; text-align:center; }
.overview-legacy { display:none; }

/* ---------- 待办 ---------- */
.pending-list, .jobs-list { display: flex; flex-direction: column; gap: 8px; }
.pending-card, .job-card {
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: var(--dsr-radius);
  padding: 11px 13px;
}
.pending-card.approval { border-left: 3px solid var(--dsr-warning); }
.pending-card.question { border-left: 3px solid var(--dsr-accent-2); }
.pc-title { font-weight: 600; font-size: 14px; }
.pc-desc { font-size: 12.5px; color: var(--dsr-muted); margin-top: 3px; overflow-wrap: anywhere; }
.pc-session { font-size: 11px; color: var(--dsr-accent-strong); margin-top: 5px; }
.job-card .job-name { font-weight: 600; font-size: 14px; }
.job-state { font-size: 12px; color: var(--dsr-muted); margin-top: 3px; }

/* ---------- 文件传输 ---------- */
.fs-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fs-workspace-nav { grid-template-columns: auto minmax(0, 1fr); margin-top: 0; }
.fs-path {
  flex: 1 1 150px; min-width: 0; font-size: 12.5px; color: var(--dsr-muted);
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 10px;
  padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fs-progress {
  display: flex; align-items: center; gap: 10px;
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 10px;
  padding: 9px 11px; margin-bottom: 10px;
}
.fs-progress-track {
  flex: 1; height: 7px; border-radius: 999px; background: var(--dsr-panel-2); overflow: hidden;
}
.fs-progress-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--dsr-accent), var(--dsr-info));
  transition: width .15s ease;
}
.fs-progress-text { flex-shrink: 0; min-width: 112px; text-align: right; }
.fs-progress-actions { flex-shrink: 0; display: flex; gap: 6px; }
.fs-progress-actions .mini-btn { padding: 4px 10px; font-size: 12px; }
.fs-pull {
  height: 0; overflow: hidden; text-align: center; font-size: 12px; color: var(--dsr-info);
  transition: height .12s ease; line-height: 26px;
}
.fs-list { display: flex; flex-direction: column; gap: 8px; }
.fs-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: var(--dsr-radius);
  padding: 11px 13px; min-width: 0;
}
.fs-row:active { background: var(--dsr-panel-2); }
.fs-ico { flex-shrink: 0; width: 22px; height: 22px; display:grid; place-items:center; color:var(--dsr-info); }
.fs-ico svg { width:20px; height:20px; display:block; }
.fs-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fs-name {
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.fs-sub { font-size: 12px; color: var(--dsr-muted); margin-top: 1px; }
.fs-arrow { flex-shrink: 0; color: var(--dsr-muted); font-size: 18px; }
.file-preview-card { max-width: 760px; height: min(82vh, 760px); display: flex; flex-direction: column; overflow: hidden; }
.file-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.file-preview-head .modal-title { margin-bottom: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-path { margin: 10px 0; flex-shrink: 0; }
.file-preview-tabs { display: flex; gap: 7px; margin-bottom: 8px; flex-shrink: 0; }
.file-preview-tabs .current { border-color: var(--dsr-accent-line); color: var(--dsr-accent-strong); background: var(--dsr-accent-soft); }
.file-preview-source, .file-preview-rendered {
  flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 12px; border-radius: 10px;
  color: var(--dsr-text); background: var(--dsr-panel); border: 1px solid var(--dsr-line); font-size: 12.5px; line-height: 1.55;
}
.file-preview-source { white-space: pre; tab-size: 2; }
.file-preview-rendered { overflow-wrap: anywhere; }
.file-preview-card > .modal-actions { flex-shrink: 0; }

/* ---------- 设置 ---------- */
.settings-group {
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: var(--dsr-radius);
  margin-bottom: 10px; overflow: hidden;
}
.model-settings-shell { padding: 14px; }
.model-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--dsr-line); }
.model-settings-head .setting-actions { flex-wrap: nowrap; }
.model-settings-status { padding: 12px 0 2px; font-size: 12px; }
.model-settings-status.error { color: var(--dsr-error); white-space: pre-wrap; overflow-wrap: anywhere; }
.model-settings-list { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.model-provider-card { border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-bg-2); overflow: hidden; }
.model-provider-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; }
.model-provider-identity { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; }
.model-provider-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.model-provider-route { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsr-muted); font-size: 11px; }
.model-provider-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--dsr-muted); }
.model-provider-dot.configured { background: var(--dsr-success); box-shadow: 0 0 8px var(--dsr-success); }
.model-provider-dot.unknown { background: var(--dsr-info); }
.model-editor { display: flex; flex-direction: column; gap: 12px; padding: 13px 14px 14px; background: var(--dsr-panel); border-top: 1px solid var(--dsr-line); }
.model-editor-title { display: flex; align-items: baseline; gap: 8px; }
.model-editor-title strong { font-size: 14px; }
.model-editor-title code { color: var(--dsr-muted); font-size: 11px; overflow-wrap: anywhere; }
.model-field { display: flex; flex-direction: column; gap: 5px; }
.model-field > label, .model-field-label { color: var(--dsr-muted); font-size: 12px; }
.model-input { box-sizing: border-box; width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--dsr-line); border-radius: 9px; background: var(--dsr-bg-2); color: var(--dsr-text); font: inherit; font-size: 13px; outline: none; }
.model-input:focus { border-color: var(--dsr-accent-line); box-shadow: 0 0 0 2px var(--dsr-accent-soft); }
.model-input::placeholder { color: var(--dsr-muted); opacity: .85; }
.model-input[type=password] { letter-spacing: .04em; }
.model-inline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
.model-catalog { display: flex; flex-direction: column; gap: 8px; padding-top: 3px; border-top: 1px solid var(--dsr-line); }
.model-catalog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.model-catalog-title { font-size: 12px; color: var(--dsr-muted); }
.model-catalog-hint { margin-top: 2px; font-size: 11px; color: var(--dsr-muted); line-height: 1.45; }
.model-catalog-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.model-list { display: flex; flex-direction: column; gap: 6px; }
.model-entry-card { display: flex; flex-direction: column; gap: 8px; padding: 9px; border: 1px solid var(--dsr-line); border-radius: 9px; background: var(--dsr-bg-2); }
.model-entry { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.model-entry .model-input { min-width: 0; min-height: 32px; padding: 6px 8px; font-size: 12px; }
.model-entry-remove { width: 30px; height: 30px; padding: 0; border: 1px solid var(--dsr-line); border-radius: 8px; background: transparent; color: var(--dsr-muted); cursor: pointer; }
.model-entry-remove:active { color: var(--dsr-error); border-color: var(--dsr-error); }
.model-empty { padding: 10px; border: 1px dashed var(--dsr-line); border-radius: 9px; color: var(--dsr-muted); font-size: 12px; text-align: center; }
.model-reasoning { display: flex; flex-direction: column; gap: 7px; padding-top: 8px; border-top: 1px solid var(--dsr-line); }
.model-reasoning-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.model-reasoning-list { display: flex; flex-direction: column; gap: 6px; }
.model-reasoning-entry { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; align-items: center; }
.model-reasoning-entry .model-input { min-width: 0; min-height: 32px; padding: 6px 8px; font-size: 12px; }
.model-reasoning-default { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; color: var(--dsr-muted); font-size: 12px; }
.model-reasoning-default .model-input { min-height: 32px; padding: 6px 8px; font-size: 12px; }
.model-discovery { display: flex; flex-direction: column; gap: 7px; padding: 9px; border: 1px solid var(--dsr-info-line); border-radius: 9px; background: var(--dsr-info-soft); }
.model-discovery-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--dsr-info); font-size: 12px; }
.model-discovery-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.model-discovery-row { display: flex; align-items: center; gap: 7px; min-height: 30px; font-size: 12px; }
.model-discovery-row input { flex: 0 0 auto; }
.model-discovery-row code { min-width: 0; overflow-wrap: anywhere; color: var(--dsr-text); }
.model-editor-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.model-editor-error { margin: 0; color: var(--dsr-error); font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.model-readonly { color: var(--dsr-warning); font-size: 12px; }
@media (max-width: 520px) {
  .model-settings-head { flex-direction: column; }
  .model-settings-head .setting-actions { width: 100%; justify-content: flex-start; }
  .model-inline { grid-template-columns: 1fr; }
  .model-entry { grid-template-columns: minmax(0, 1fr) auto; }
  .model-entry .model-name-input { grid-column: 1 / -1; grid-row: 2; }
  .model-reasoning-entry { grid-template-columns: minmax(0, 1fr) auto; }
  .model-reasoning-entry .model-input:nth-child(2), .model-reasoning-entry .model-input:nth-child(3) { grid-column: 1 / -1; }
  .model-reasoning-entry .model-entry-remove { grid-column: 2; grid-row: 1; }
  .model-reasoning-default { grid-template-columns: 1fr; gap: 4px; }
}
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px;
}
.setting-row > div:first-child { flex: 1; min-width: 0; }
.setting-row + .setting-row { border-top: 1px solid var(--dsr-line); }
.setting-link {
  width: 100%; color: var(--dsr-text); text-align: left;
  transition: background-color .18s ease, color .18s ease;
}
.setting-link::after {
  content: '›'; flex: 0 0 auto; color: var(--dsr-muted); font-size: 20px; font-weight: 400;
  transform: translateX(0); transition: transform .18s ease, color .18s ease;
}
.setting-link:hover, .setting-link:focus-visible { background: var(--dsr-bg-2); }
.setting-link:hover::after, .setting-link:focus-visible::after { color: var(--dsr-accent-strong); transform: translateX(2px); }
.setting-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-experimental-badge { display: inline-block; margin-left: 6px; padding: 2px 6px; border: 1px solid var(--dsr-warning-line); border-radius: 999px; color: var(--dsr-warning); background: var(--dsr-warning-soft); font-size: 10px; font-weight: 700; vertical-align: 2px; }
.setting-desc { font-size: 12px; color: var(--dsr-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setting-desc.expanded { white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; }
.setting-select { min-width: 112px; max-width: 145px; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--dsr-line); background: var(--dsr-bg-2); color: var(--dsr-text); font: inherit; font-size: 12px; }
.setting-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dsh-control-steps { display:flex; flex-direction:column; gap:5px; margin-top:8px; padding:8px 9px; border:1px solid var(--dsr-line); border-radius:10px; background:var(--dsr-bg-2); }
.dsh-control-step { display:grid; grid-template-columns:16px minmax(0,1fr); gap:6px; align-items:start; color:var(--dsr-muted); font-size:11px; line-height:1.45; }
.dsh-control-step.current { color:var(--dsr-accent-strong); }
.dsh-control-step.success { color:var(--dsr-success); }
.dsh-control-step.failed { color:var(--dsr-error); }
.dsh-control-step-mark { text-align:center; font-weight:800; }
.dsh-control-step-detail { grid-column:2; color:var(--dsr-muted); white-space:pre-wrap; overflow-wrap:anywhere; }
.about { text-align: center; color: var(--dsr-muted); font-size: 12px; margin-top: 16px; line-height: 1.8; }

/* 多服务器列表(分组) */
.group-bar { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; }
.group-bar-label { font-size: 12px; color: var(--dsr-muted); white-space: nowrap; }
.group-select { flex: 1; min-width: 0; position: relative; }
.group-select-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--dsr-bg-2); color: var(--dsr-text); border: 1px solid var(--dsr-line); border-radius: 10px; padding: 7px 9px; font: inherit; font-size: 13px; outline: none; cursor: pointer; }
.group-select-btn .caret { color: var(--dsr-muted); font-size: 10px; transition: transform .15s ease; }
.group-select-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 220px; overflow-y: auto; background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.28); padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.group-option { width: 100%; text-align: left; background: none; border: none; color: var(--dsr-text); font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; }
.group-option.current { background: var(--dsr-accent-soft); color: var(--dsr-accent-strong); font-weight: 600; }
.group-option:active { background: var(--dsr-panel-2); }
.server-list { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.server-empty { font-size: 12px; color: var(--dsr-muted); }
.srv-group { border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-panel); overflow: hidden; }
.srv-group-head { display: flex; align-items: center; gap: 6px; padding: 7px 9px; }
.srv-group-name { flex: 1; min-width: 0; text-align: left; background: none; border: none; color: var(--dsr-text); font: inherit; font-size: 13px; font-weight: 600; padding: 2px 0; display: flex; align-items: center; gap: 6px; }
.srv-group-count { font-size: 10.5px; color: var(--dsr-muted); background: var(--dsr-bg-2); border-radius: 999px; padding: 0 7px; line-height: 16px; }
.srv-group-speed { flex-shrink: 0; padding: 3px 8px; font-size: 12px; }
.srv-group-del { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-muted); font-size: 11px; }
.srv-group-del:active { color: var(--dsr-error); }
.srv-group-body { display: flex; flex-direction: column; gap: 6px; padding: 0 9px 9px; }
.switch.small { width: 36px; height: 21px; }
.switch.small .slider::before { width: 15px; height: 15px; left: 2px; top: 2px; }
.switch.small input:checked + .slider::before { transform: translateX(15px); }
.server-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); border-radius: 10px;
  padding: 8px 10px;
}
.server-row.active { border-color: var(--dsr-info-line); background: var(--dsr-info-soft); }
.server-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.server-note { font-size: 13px; word-break: break-all; }
.server-url { flex: 1; min-width: 0; font-size: 11.5px; color: var(--dsr-muted); word-break: break-all; }
.server-token-badge { color: var(--dsr-muted); font-size: 10px; }
.server-badge {
  flex-shrink: 0; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--dsr-accent-soft); color: var(--dsr-accent-strong);
  border: 1px solid var(--dsr-accent-line); white-space: nowrap;
}
.server-badge.good { background: var(--dsr-success-soft); color: var(--dsr-success); border-color: var(--dsr-success-line); }
.server-badge.bad { background: var(--dsr-warning-soft); color: var(--dsr-warning); border-color: var(--dsr-warning-line); }
.server-edit, .server-del {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-muted); font-size: 12px;
}
.server-edit:active { color: var(--dsr-accent-strong); }
.server-del:active { color: var(--dsr-error); }
.server-add { display: flex; gap: 8px; padding: 0 14px 13px; }
.server-add input {
  flex: 1; min-width: 0; background: var(--dsr-bg-2); color: var(--dsr-text);
  border: 1px solid var(--dsr-line); border-radius: 10px; padding: 8px 10px;
  font: inherit; font-size: 13px; outline: none;
}
.server-add input:focus { border-color: var(--dsr-accent-line); }

/* 开关 */
.switch { position: relative; display: inline-block; width: 46px; height: 27px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; border-radius: 999px; background: var(--dsr-panel-2);
  border: 1px solid var(--dsr-line); transition: background-color .2s ease, border-color .2s ease;
}
.slider::before {
  content: ''; position: absolute; width: 19px; height: 19px; border-radius: 50%;
  left: 3px; top: 3px; background: var(--dsr-muted); transition: transform .2s ease, background-color .2s ease;
}
.switch input:checked + .slider { background: var(--dsr-accent-soft); border-color: var(--dsr-accent); }
.switch input:checked + .slider::before { transform: translateX(19px); background: var(--dsr-accent); }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: flex-end; min-height: 88px; gap: 3px; isolation: isolate;
  padding: 0 8px var(--dsr-safe-b); background: transparent; border-top: none;
}
.nav-wave { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; filter: drop-shadow(0 -8px 20px var(--dsr-shadow)); }
.nav-wave svg { width: 100%; height: 100%; display: block; overflow: visible; }
.nav-wave-fill { fill: var(--dsr-nav-bg); }
.nav-wave-line { fill: none; stroke: var(--dsr-accent-line); stroke-width: .55; vector-effect: non-scaling-stroke; }
.nav-wave::after { content: ''; position: absolute; left: 10%; right: 10%; top: 28%; height: 1px; background: linear-gradient(90deg, transparent, var(--dsr-accent-2-line), var(--dsr-accent-line), transparent); opacity: .45;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  min-width: 0; min-height: 69px; padding: 7px 2px 5px; color: var(--dsr-nav-muted); font-size: 11px; position: relative;
  border-radius: 14px 14px 0 0; touch-action: manipulation;
}
.nav-btn .nav-ico { width: 22px; height: 22px; display: grid; place-items: center; line-height: 1; transition: transform .18s ease, color .18s ease; }
.nav-btn .nav-ico svg { width: 21px; height: 21px; display: block; }
.nav-btn:not(.nav-home) .nav-ico { color: var(--dsr-nav-muted); opacity: .84; }
.nav-btn:not(.nav-home) > span:last-of-type { color: var(--dsr-nav-muted); }
.nav-btn.active:not(.nav-home) { color: var(--dsr-nav-active); }
.nav-btn.active:not(.nav-home) .nav-ico { color: var(--dsr-nav-active); transform: translateY(-1px); opacity: 1; }
.nav-btn.active:not(.nav-home)::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--dsr-nav-active); box-shadow: 0 0 10px var(--dsr-glow); }
.nav-home { z-index: 2; transform: translateY(-13px); color: var(--dsr-nav-muted); }
.nav-home-orb { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--dsr-bg-2); border: 1px solid var(--dsr-accent-line); box-shadow: 0 5px 18px var(--dsr-shadow); transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.nav-home .nav-ico { width: 30px; height: 30px; color: var(--dsr-accent-strong); }
.nav-home .nav-ico svg { width: 29px; height: 29px; }
.nav-home.active { color: var(--dsr-nav-active); }
.nav-home.active .nav-home-orb { background: linear-gradient(145deg, var(--dsr-accent-2), var(--dsr-accent) 64%); border-color: var(--dsr-accent); color: var(--dsr-on-accent); box-shadow: 0 7px 24px var(--dsr-glow), inset 0 0 0 1px rgba(255,255,255,.28); }
.nav-home.active .nav-ico { color: var(--dsr-on-accent); transform: none; }
.nav-home:active .nav-home-orb { transform: scale(.96); }
.nav-badge {
  position: absolute; top: 1px; left: calc(50% + 19px); z-index: 3;
  background: var(--dsr-nav-badge-bg); color: var(--dsr-nav-badge-text); border-radius: 999px;
  font-size: 10px; font-weight: 800; padding: 0 6px; line-height: 16px;
}

/* ---------- 反馈底部菜单 ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 45;
  background: var(--dsr-overlay);
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
  max-height: 72vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--dsr-bg-2); border-top: 1px solid var(--dsr-line); border-radius: 20px 20px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 34px var(--dsr-shadow);
}
.sheet-handle { width: 38px; height: 4px; border-radius: 999px; background: var(--dsr-line); margin: 2px auto 10px; }
.sheet-title { font-size: 14px; font-weight: 700; padding: 0 6px 8px; }
.sheet-item {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 13px; border: none; background: transparent; color: var(--dsr-text);
  font: inherit; text-align: left; cursor: pointer; text-decoration: none;
}
.sheet-item:hover, .sheet-item:focus-visible { background: var(--dsr-bg); }
.sheet-item.primary { background: var(--dsr-accent-soft); border: 1px solid var(--dsr-accent-line); }
.sheet-item.primary:hover { background: var(--dsr-accent-soft); filter: brightness(1.03); }
.sheet-ico {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-accent-strong);
}
.sheet-item.primary .sheet-ico { background: var(--dsr-accent-strong); border-color: var(--dsr-accent-strong); color: var(--dsr-on-accent); }
.sheet-ico svg { width: 18px; height: 18px; fill: currentColor; }
.sheet-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sheet-item-name { font-size: 14px; font-weight: 600; }
.sheet-item-desc { font-size: 12px; color: var(--dsr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 应用内选择抽屉 ---------- */
.custom-select-native {
  position: fixed !important; left: -10000px !important; width: 1px !important; height: 1px !important;
  opacity: 0 !important; pointer-events: none !important;
}
.custom-select-trigger {
  min-width: 0; height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 10px; border: 1px solid var(--dsr-line); border-radius: 9px;
  color: var(--dsr-text); background: var(--dsr-bg-2); font: inherit; font-size: 12.5px;
  text-align: left; cursor: pointer; outline: none;
}
.custom-select-trigger::after { content: '⌄'; flex: 0 0 auto; color: var(--dsr-muted); font-size: 14px; transform: translateY(-1px); }
.custom-select-trigger:focus-visible { border-color: var(--dsr-accent-line); box-shadow: 0 0 0 2px var(--dsr-accent-soft); }
.custom-select-trigger:disabled { opacity: .48; cursor: default; }
.custom-select-trigger-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-select-trigger { width: 100%; }
.workspace-select-trigger.full { margin: 7px 0 10px; }
.session-sort-trigger { height: 30px; max-width: 112px; color: var(--dsr-muted); background: var(--dsr-panel); font-size: 11px; }
.setting-select-trigger { min-width: 112px; max-width: 145px; }
.custom-select-backdrop { z-index: 79; }
.custom-select-sheet { z-index: 80; max-height: min(72vh, 620px); overflow: hidden; display: flex; flex-direction: column; }
.custom-select-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.custom-select-head .sheet-title { min-width: 0; margin: 0; padding-bottom: 8px; }
.custom-select-head .icon-btn { width: 34px; height: 34px; flex: 0 0 auto; }
.custom-select-options { min-height: 48px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 5px; padding: 2px 0 8px; }
.custom-select-option {
  width: 100%; min-height: 52px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 11px; border: 1px solid transparent; border-radius: 13px;
  color: var(--dsr-text); background: transparent; font: inherit; text-align: left; cursor: pointer;
}
.custom-select-option:focus-visible, .custom-select-option:active { background: var(--dsr-panel); border-color: var(--dsr-line); outline: none; }
.custom-select-option.current { background: var(--dsr-accent-soft); border-color: var(--dsr-accent-line); }
.custom-select-option:disabled { opacity: .45; cursor: default; }
.custom-select-option-copy { min-width: 0; display: grid; gap: 3px; }
.custom-select-option-name { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.custom-select-option-path { color: var(--dsr-muted); font-size: 11.5px; line-height: 1.45; overflow-wrap: anywhere; }
.custom-select-option-check { width: 24px; color: var(--dsr-accent-strong); font-size: 18px; font-weight: 800; text-align: center; }
.custom-select-cancel { flex: 0 0 auto; width: 100%; margin-top: 2px; }

/* 写反馈弹层 */
.fb-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fb-chip {
  min-height: 36px; padding: 7px 14px; border-radius: 999px; font-size: 13px;
  background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-text); cursor: pointer;
}
.fb-chip.current { background: var(--dsr-accent-soft); border-color: var(--dsr-accent-line); color: var(--dsr-accent-strong); font-weight: 600; }
.fb-textarea, .fb-input {
  width: 100%; box-sizing: border-box; margin-bottom: 10px;
  background: var(--dsr-panel); color: var(--dsr-text); border: 1px solid var(--dsr-line); border-radius: 12px;
  padding: 10px 12px; font: inherit; font-size: 14px; outline: none; resize: vertical;
}
.fb-textarea:focus, .fb-input:focus { border-color: var(--dsr-accent-line); }
.fb-input { min-height: 42px; }
.fb-diagnostics { display:grid; grid-template-columns:auto minmax(0,1fr); gap:5px 8px; align-items:start; margin:-1px 1px 4px; color:var(--dsr-text); font-size:13px; line-height:1.45; cursor:pointer; }
.fb-diagnostics input { width:17px; height:17px; margin:1px 0 0; accent-color:var(--dsr-accent); }
.fb-diagnostics small { grid-column:2; color:var(--dsr-muted); font-size:11px; line-height:1.45; }
.feedback-success-card { max-width: 360px; text-align: center; padding: 22px 20px 18px; }
.feedback-success-icon {
  width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%;
  color: var(--dsr-success); background: var(--dsr-success-soft); border: 1px solid var(--dsr-success-line);
}
.feedback-success-icon svg { width: 28px; height: 28px; }
.feedback-success-title { margin-bottom: 8px; font-size: 18px; }
.feedback-success-body { color: var(--dsr-muted); line-height: 1.65; }
.feedback-success-card .modal-actions { justify-content: stretch; }
.feedback-success-card .modal-actions .btn { flex: 1; min-height: 42px; }

.app-version-warning-card { max-width: 390px; text-align: center; padding: 22px 20px 18px; border-top: 3px solid var(--dsr-accent); }
.app-version-warning-icon {
  width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 15px;
  color: var(--dsr-accent-strong); background: var(--dsr-accent-soft); border: 1px solid var(--dsr-accent-line);
  font-size: 28px; font-weight: 800; line-height: 1;
}
.app-version-warning-title { margin-bottom: 7px; font-size: 18px; }
.app-version-warning-body, .app-version-warning-hint { color: var(--dsr-muted); line-height: 1.6; }
.app-version-comparison { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 16px 0 12px; }
.app-version-comparison > div { display: grid; gap: 5px; min-width: 0; padding: 11px 8px; border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-panel); }
.app-version-comparison span { color: var(--dsr-muted); font-size: 11px; }
.app-version-comparison strong { overflow-wrap: anywhere; color: var(--dsr-text); font-size: 14px; }
.app-version-comparison > i { color: var(--dsr-accent-strong); font-style: normal; font-weight: 800; }
.app-version-warning-hint { font-size: 12px; }
.app-version-warning-card .modal-actions { justify-content: stretch; }
.app-version-warning-card .modal-actions .btn { flex: 1; min-height: 42px; }

/* ---------- 模态 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: var(--dsr-overlay); backdrop-filter: blur(3px); padding: 18px;
}
.modal-card {
  width: 100%; max-width: 460px; max-height: 82vh; overflow-y: auto;
  background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); border-radius: 18px;
  padding: 16px; box-shadow: 0 22px 60px var(--dsr-shadow); overscroll-behavior: contain;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.modal-body { font-size: 14px; }
.workspace-create-desc { margin: 0 0 12px; color: var(--dsr-muted); line-height: 1.55; }
.workspace-create-location { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 10px; color: var(--dsr-muted); font-size: 12px; }
.workspace-create-location code { min-width: 0; flex: 1; padding: 7px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsr-text); background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 9px; }
.modal-body .q-item { background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 12px; padding: 11px 12px; margin-bottom: 10px; }
.modal-body .q-text { font-weight: 600; margin-bottom: 8px; }
.modal-body .q-option {
  display: flex; gap: 8px; align-items: flex-start; padding: 7px 6px; border-radius: 8px;
}
.modal-body input[type='radio'], .modal-body input[type='checkbox'] { accent-color: var(--dsr-accent); margin-top: 3px; }
.modal-body textarea {
  width: 100%; margin-top: 8px; background: var(--dsr-panel); color: var(--dsr-text);
  border: 1px solid var(--dsr-line); border-radius: 10px; padding: 9px 11px; font: inherit; outline: none;
}
.modal-actions { display: flex; gap: 9px; margin-top: 14px; }
.archive-modal-desc { margin: 0 0 12px; color: var(--dsr-muted); line-height: 1.55; }
.archive-summary { border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-panel); padding: 10px 12px; }
.archive-summary-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; font-size: 13px; }
.archive-summary-row + .archive-summary-row { border-top: 1px solid var(--dsr-line); }
.archive-summary-row > span { color: var(--dsr-muted); }
.archive-summary-row strong, .archive-summary-row code { min-width: 0; color: var(--dsr-text); overflow-wrap: anywhere; word-break: break-word; }
.archive-confirm-btn { flex: 1; padding: 11px 14px; border-radius: 12px; font-size: 15px; font-weight: 700; border: 1px solid var(--dsr-error); background: var(--dsr-error); color: #fff; }
.archive-confirm-btn:active { filter: brightness(.9); }
.announcement-card { border-top: 3px solid var(--dsr-accent); }
.announcement-kicker { color: var(--dsr-accent-strong); font-size: 12px; font-weight: 700; letter-spacing: .04em; margin-bottom: 6px; }
.announcement-pagination { display:flex; align-items:center; justify-content:flex-end; gap:8px; margin:-2px 0 8px; color:var(--dsr-muted); font-size:12px; font-weight:650; }
.announcement-pagination .mini-btn { min-width:34px; min-height:30px; padding:2px 9px; font-size:19px; line-height:1; }
.announcement-pagination .mini-btn:disabled { opacity:.38; cursor:default; }
.announcement-content { line-height: 1.7; overflow-wrap: anywhere; word-break: break-word; }
.announcement-poll { display: grid; gap: 10px; margin-top: 14px; padding: 12px; border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-panel); }
.announcement-poll-question { font-size: 14px; font-weight: 700; line-height: 1.5; }
.announcement-poll-options { display: grid; gap: 7px; }
.announcement-poll-option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: start; padding: 10px; border: 1px solid var(--dsr-line); border-radius: 10px; background: var(--dsr-bg-2); cursor: pointer; }
.announcement-poll-option:has(input:checked) { border-color: var(--dsr-accent-line); background: var(--dsr-accent-soft); }
.announcement-poll-option input { margin-top: 3px; accent-color: var(--dsr-accent); }
.announcement-poll-option strong { display: block; font-size: 13px; line-height: 1.45; }
.announcement-poll-option small { display: block; margin-top: 2px; color: var(--dsr-muted); font-size: 11.5px; line-height: 1.45; }
.announcement-poll-status { color: var(--dsr-accent-strong); font-size: 12.5px; font-weight: 650; }
.announcement-poll > .btn { justify-self: stretch; }
.announcement-action { display: inline-block; margin-top: 12px; color: var(--dsr-accent-strong); font-size: 13px; font-weight: 600; text-decoration: none; }
.announcement-action:hover { text-decoration: underline; }
.announcement-history-card { max-width: 520px; }
.announcement-history-list { display: flex; flex-direction: column; gap: 8px; }
.announcement-history-item { border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-panel); padding: 10px 12px; }
.announcement-history-item summary { cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 700; overflow-wrap: anywhere; }
.announcement-history-item summary small { flex: 0 0 auto; color: var(--dsr-muted); font-size: 11px; font-weight: 400; }
.announcement-history-item .announcement-history-content { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--dsr-line); line-height: 1.65; overflow-wrap: anywhere; word-break: break-word; }
.announcement-history-item .announcement-action { margin-top: 8px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.kv .k { color: var(--dsr-muted); } .kv .v { word-break: break-all; text-align: right; }

/* ---------- 皮肤选择面板 ---------- */
.theme-swatch-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  margin-right: 5px; vertical-align: -1px; background: var(--dsr-bg);
  border: 1px solid rgba(127, 127, 127, .35); flex-shrink: 0;
}
@media (max-width: 720px) {
  #btn-theme .t-label { display: none; }
  #btn-theme .theme-swatch-dot { margin-right: 0; }
  .section-actions { gap: 4px; }
  .section-actions .session-sort { max-width: 98px; }
  .section-actions .mini-btn { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { padding-left: 10px; padding-right: 10px; }
  .brand { gap: 6px; }
  .brand-group-name { max-width: 10ch; }
  .topbar-right { gap: 4px; min-width: 0; }
  .topbar-right .topbar-btn.icon-btn { width: 38px; height: 38px; }
  .topbar-right .topbar-btn.conn-badge { max-width: 72px; padding-left: 8px; padding-right: 8px; overflow: hidden; text-overflow: ellipsis; }
  .setting-row { align-items: flex-start; flex-wrap: wrap; }
  .setting-row > .setting-actions { width: 100%; justify-content: flex-end; }
  .workspace-nav { grid-template-columns: minmax(0, 1fr) auto; }
  .workspace-nav > label { grid-column: 1 / -1; }
  .workspace-nav > .workspace-path-scroll { grid-column: 1 / -1; }
  .fs-workspace-nav { grid-template-columns: 1fr; }
  .file-preview-card { height: 88vh; padding: 13px; }
}
.theme-panel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.theme-option {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 9px; min-width: 0; width: 100%;
  min-height: 86px; padding: 10px; border-radius: 13px; text-align: left;
  background: var(--dsr-panel); border: 1px solid var(--dsr-line);
  white-space: nowrap; overflow: hidden;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.theme-option:hover, .theme-option:focus-visible { background: var(--dsr-panel-2); border-color: var(--dsr-accent-line); transform: translateY(-1px); }
.theme-option:active { background: var(--dsr-panel-2); transform: scale(.985); }
.theme-option.current { border-color: var(--dsr-accent-line); box-shadow: 0 0 0 1px var(--dsr-accent-soft); }
.theme-swatches {
  display: grid; grid-template-columns: 1.35fr 1fr .72fr; height: 30px; flex-shrink: 0;
  overflow: hidden; border: 1px solid rgba(127, 127, 127, .28); border-radius: 8px;
}
.theme-swatches i {
  width: auto; height: 100%; display: block;
}
.theme-option .theme-name {
  min-width: 0; padding-right: 22px; font-size: 13px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.theme-option .theme-check { position: absolute; right: 11px; bottom: 9px; color: var(--dsr-accent-strong); font-size: 14px; font-weight: 700; }
@media (max-width: 350px) { .theme-panel-list { grid-template-columns: 1fr; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; top: calc(58px + var(--dsr-safe-top)); left: 50%; transform: translateX(-50%);
  z-index: 60; background: var(--dsr-panel-2); border: 1px solid var(--dsr-line);
  color: var(--dsr-text); padding: 9px 16px; border-radius: 999px; font-size: 13px;
  max-width: 88vw; box-shadow: 0 6px 24px var(--dsr-shadow);
}
.toast.err { border-color: var(--dsr-error-line); color: var(--dsr-error); }
.toast.ok { border-color: var(--dsr-success-line); color: var(--dsr-success); }

/* 键盘焦点：保证深浅皮肤和移动端外接键盘都有清晰反馈 */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--dsr-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 560px) {
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
  .msg { max-width: 78%; }
  .overview-pulse-card { grid-template-columns:1fr auto; }
  .overview-metric-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

.update-download-progress { margin-top: 12px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.update-download-progress progress { display: block; width: 100%; height: 10px; margin: 7px 0; accent-color: var(--dsr-accent, #2563eb); }
#update-download-detail { color: var(--dsr-text-muted); font-variant-numeric: tabular-nums; }
/* Sending intent remains visible while waiting for a steering acknowledgement. */
.composer-send-status { padding: 6px 12px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.composer-send-status[data-phase="pending"], .composer-send-status[data-phase="unknown"], .composer-send-status[data-phase="error"] { color: var(--dsr-accent-strong); font-weight: 600; }
#btn-send, #btn-fs-send { touch-action: none; user-select: none; -webkit-touch-callout: none; }
#btn-send.steer-mode, #btn-fs-send.steer-mode { outline: 2px solid currentColor; outline-offset: 2px; }
.send-hold-ready { box-shadow: 0 0 0 3px var(--dsr-accent-strong); }
