:root {
  --bg: #080a0e;
  --rail: #0c0f14;
  --panel: #11151c;
  --panel-2: #151a22;
  --panel-3: #1a202a;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #edf0f5;
  --muted: #8a93a6;
  --faint: #5c6577;
  --accent: #e8b86d;
  --accent-soft: rgba(232, 184, 109, 0.12);
  --accent-line: rgba(232, 184, 109, 0.34);
  --teal: #6ed3b6;
  --blue: #8fa8ff;
  --danger: #ff7a7a;
  /* v0.9.26：表面/控件主题 token（弹窗、输入区、附件条不再写死深色）
     v0.9.30 #2：原值是 --soft: var(--soft) 这类自引用，CSS 会判为循环无效值，
     导致默认深色主题下所有 var(--soft) 全部失效。这里补成真实色值。 */
  --soft: rgba(255, 255, 255, 0.035);
  --hover-bg: rgba(255, 255, 255, 0.055);
  --active-bg: rgba(255, 255, 255, 0.09);
  /* v0.9.30 #2：深度思考等组件引用的 token 此前从未定义，主题绑定形同虚设 */
  --border: var(--line);
  --border-strong: var(--line-2);
  --text-2: #c9d3e3;
  --modal-bg: linear-gradient(180deg, #151a22, #10141b);
  --composer-bg: rgba(8, 10, 14, 0.78);
  --field-bg: rgba(21, 26, 34, 0.92);
  --field-bg-focus: rgba(24, 29, 38, 0.96);
  --radius: 14px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.app {
  display: flex;
  height: 100vh;
  min-width: 760px;
  background:
    radial-gradient(900px 540px at 74% -12%, rgba(232, 184, 109, 0.06), transparent 62%),
    radial-gradient(760px 520px at 6% 112%, rgba(110, 211, 182, 0.05), transparent 60%),
    var(--bg);
}

/* ------------------------------- rail ------------------------------- */

.rail {
  width: 74px;
  flex: 0 0 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18px 0 16px;
  background: linear-gradient(180deg, #0d1016, #0a0d12);
  border-right: 1px solid var(--line);
}

/* v0.9.52：品牌色卡 —— 与 Q 图标同源的「色卡 + 大 Q」。
   底色/字色/投影都走主题变量：深色默认暖金、冰川冷蓝、宣纸琥珀，
   切换主题时自动换装，不再是一张固定图片。 */
:root {
  --brand-grad: linear-gradient(145deg, #f0c987 0%, #cf9a45 55%, #b07c2f 100%);
  --brand-ink: #1a1206;
  --brand-glow: rgba(232, 184, 109, 0.24);
  --brand-ring: rgba(255, 255, 255, 0.42);
}

[data-theme='glacier'] {
  --brand-grad: linear-gradient(145deg, #9cc4ff 0%, #5b91e8 55%, #3669b8 100%);
  --brand-ink: #06101f;
  --brand-glow: rgba(127, 178, 255, 0.26);
  --brand-ring: rgba(255, 255, 255, 0.38);
}

[data-theme='paper'] {
  --brand-grad: linear-gradient(145deg, #f4cd92 0%, #e0a556 55%, #c47f2c 100%);
  --brand-ink: #241703;
  --brand-glow: rgba(196, 127, 44, 0.22);
  --brand-ring: rgba(255, 255, 255, 0.55);
}

.rail-brand {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--brand-grad);
  color: var(--brand-ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  /* Q 字形的尾巴本身就是这个字符自带的，不需要额外描边；
     这里只补一点下沉阴影 + 顶部高光，和 App 图标同一套观感。 */
  text-shadow: 0 1px 0 var(--brand-ring);
  box-shadow: 0 8px 22px var(--brand-glow), inset 0 1px 0 var(--brand-ring);
}

.rail-nav,
.rail-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.rail-foot {
  margin-top: auto;
}

.rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 58px;
  padding: 8px 0 7px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  transition: background 160ms ease, color 160ms ease;
}

.rail-item:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.rail-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.rail-item.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.me-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a3140, #171c25);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* ------------------------------- shell ------------------------------- */

.shell {
  flex: 1;
  min-width: 0;
  display: grid;
  /* v0.9.30 #3：右栏从固定 296px 放宽为弹性区间，让协作看板文字能横向铺开 */
  grid-template-columns: 296px minmax(460px, 1fr) minmax(340px, 400px);
  height: 100vh;
}

/* --------------------------- conversations --------------------------- */

.conv-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, rgba(17, 21, 28, 0.92), rgba(13, 16, 22, 0.96));
  border-right: 1px solid var(--line);
}

.conv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 18px 14px;
}

.conv-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.conv-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.icon-btn:hover {
  background: var(--hover-bg);
  border-color: var(--line);
  color: var(--text);
}

.search-box,
.market-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  margin: 0 18px 12px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--faint);
  transition: border-color 150ms ease, background 150ms ease;
}

.search-box:focus-within,
.market-search:focus-within {
  border-color: var(--accent-line);
  background: rgba(232, 184, 109, 0.05);
}

.search-box input,
.market-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
}

.search-box input::placeholder,
.market-search input::placeholder {
  color: var(--faint);
}

.conv-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2px 0 12px;
}

.conv-section {
  margin-top: 10px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 6px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-head .count {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  letter-spacing: 0;
}

.conv-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: calc(100% - 16px);
  margin: 0 8px 2px;
  padding: 10px 10px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.conv-delete {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}

.conv-row:hover .conv-delete {
  opacity: 1;
}

.conv-delete:hover {
  background: rgba(255, 80, 80, 0.2);
  color: #ff6b6b;
}

.conv-delete .icon {
  width: 14px;
  height: 14px;
}

/* v0.9.25：分组头折叠开关 + 列表折叠态 */
.section-head {
  cursor: pointer;
  user-select: none;
}

.section-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-chev {
  display: inline-block;
  color: var(--faint);
  font-size: 11px;
  transition: transform 160ms ease;
}

.section-head.collapsed .section-chev {
  transform: rotate(-90deg);
}

#groupList.hidden,
#privateList.hidden {
  display: none;
}

.conv-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.conv-row.active {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(232, 184, 109, 0.11), rgba(232, 184, 109, 0.02));
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  color: #12151b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.avatar.group {
  position: relative;
  overflow: hidden;
  color: #10131a;
  background:
    radial-gradient(circle at 28% 24%, rgba(232, 184, 109, 0.95), transparent 48%),
    radial-gradient(circle at 72% 34%, rgba(110, 211, 182, 0.9), transparent 50%),
    radial-gradient(circle at 50% 78%, rgba(143, 168, 255, 0.9), transparent 52%),
    #202633;
}

/* v0.9.52：群头像宫格（成员头像拼图）。
   与单人头像共用 .avatar 的尺寸档（40 / sm 32 / lg 64），
   内部按 --ga-cols 自动排布，3 人时第一格 span 2 行做出「左大右二」的微信式布局。 */
.avatar.group.grid-avatar {
  padding: 0;
  border-radius: 13px;
  background: var(--panel-3);
  color: var(--muted);
}

.ga-grid {
  display: grid;
  grid-template-columns: repeat(var(--ga-cols, 3), 1fr);
  grid-auto-rows: 1fr;
  gap: 1px;
  padding: 1px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.ga-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 3px;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.ga-cell.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ga-cell.ga-more {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 8px;
  text-shadow: none;
}

.avatar.sm .ga-cell { font-size: 7px; }
.avatar.lg .ga-cell { font-size: 12px; border-radius: 5px; }

.avatar.sm {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 10px;
  font-size: 11px;
}

.avatar.lg {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  border-radius: 20px;
  font-size: 20px;
}

.conv-copy {
  flex: 1;
  min-width: 0;
}

.conv-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.conv-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-row.active .conv-name {
  color: var(--accent);
}

.conv-time {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.conv-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-preview .who {
  color: var(--faint);
}

.unread {
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1206;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

/* 正在协作的会话：绿色徽标，切走也能一眼看到哪条在跑。
   v0.9.15：去掉 runPulse 呼吸动画——renderConvList 每个事件都重建 DOM，
   动画反复重启视觉上「一直在闪」。改静态徽标，状态一眼可辨不晃眼。 */
.unread.run {
  background: #3fb950;
  color: #06210f;
}

@keyframes runPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* 执行中发送键变停止入口 */
.send-btn.stop-mode {
  background: var(--danger);
  color: #1a1206;
}

/* v0.9.19：聊天内思考强度快捷档位 */
/* v0.9.20②：每成员独立的思考强度档位条。横向排布、可折行，放输入框上方显眼处。 */
.member-effort-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 24px 2px;
  flex: 0 0 auto;
}
.meb-label {
  flex: 0 0 auto;
  margin-top: 6px;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.03em;
}
.meb-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
}
.meb-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meb-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.meb-name {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
.effort-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  background: rgba(20, 24, 30, 0.6);
}
.effort-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.effort-switch button:hover { color: var(--text-2); }
.effort-switch button.active {
  background: var(--accent, #b8935a);
  color: #1a1206;
  font-weight: 600;
}

/* v0.9.23：档位折叠卡（从主区输入框上方沉入右侧「协作方式」面板） */
.effort-collapse {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft);
  overflow: hidden;
}
.effort-collapse > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.effort-collapse > summary::-webkit-details-marker { display: none; }
.effort-collapse > summary::after {
  content: '▾';
  color: var(--faint);
  font-size: 10px;
  transition: transform 0.16s ease;
}
.effort-collapse:not([open]) > summary::after { transform: rotate(-90deg); }
.effort-collapse[open] > summary { border-bottom: 1px solid var(--border); }
.meb-inline { padding: 10px 12px; }
.meb-empty { font-size: 11.5px; color: var(--faint); }

/* v0.9.19：右上角三点菜单 */
.chat-panel { position: relative; }
.chat-menu {
  position: absolute;
  top: 58px;
  right: 18px;
  z-index: 40;
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #1c1f26;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.chat-menu[hidden] { display: none; }
.chat-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.chat-menu-item:hover { background: var(--hover-bg); }
.chat-menu-item .icon { width: 15px; height: 15px; }
.chat-menu-item.danger { color: #e88; }
.chat-menu-item.danger:hover { background: rgba(232, 100, 100, 0.12); }

/* v0.9.10：折叠的「协作过程」中间步骤 */
.proc-fold {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 320px;
  margin: 6px auto 6px 44px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #211e18;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}

.proc-fold:hover {
  color: var(--text-2);
  border-color: var(--border-strong);
}

.proc-fold-chev {
  display: inline-flex;
  transition: transform 0.18s ease;
}

.proc-fold.open .proc-fold-chev {
  transform: rotate(90deg);
}

.conv-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10.5px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.dot.online {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(110, 211, 182, 0.12);
}

/* ------------------------------- chat ------------------------------- */

.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  background:
    radial-gradient(720px 420px at 78% -8%, rgba(232, 184, 109, 0.045), transparent 62%),
    linear-gradient(180deg, rgba(10, 13, 18, 0.98), rgba(8, 10, 14, 0.99));
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(14px);
}

.chat-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-avatars {
  display: flex;
  align-items: center;
}

.header-avatars .avatar {
  margin-left: -9px;
  border: 2px solid var(--bg);
}

.header-avatars .avatar:first-child {
  margin-left: 0;
}

.chat-title {
  min-width: 0;
}

.chat-title h2 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.chat-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10.5px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-pill .dot {
  background: var(--teal);
}

.model-pill.warn .dot {
  background: var(--accent);
}

.model-pill.err .dot {
  background: var(--danger);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 10px;
  scroll-behavior: smooth;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  /* v0.9.20①：过去固定 900px 宽又水平居中，宽屏下左侧凭空多出 200+px 空白，
     且与贴边的 header/composer 不对齐。改为左对齐铺满、统一内距，收窄左侧留白；
     用户消息本身靠 justify-content:flex-end 仍贴右。 */
  max-width: 1180px;
  margin: 0 0 18px;
  padding: 0 24px;
  animation: rise 220ms ease both;
}

.msg-row.user {
  justify-content: flex-end;
}

.msg-row.user .msg-main {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.msg-row.user .msg-meta {
  justify-content: flex-end;
}

.system-row span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.msg-main {
  min-width: 0;
  max-width: 680px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 1px 0 5px;
}

.msg-name {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 680;
}

.role-chip {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.msg-time {
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* v0.9.54：排队中的消息 —— 让「已经收下、还没轮到发」这件事在时间线里可见 */
.role-chip.queue-chip {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.queue-hint {
  margin-top: 5px;
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.bubble {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  /* v0.9.27：不再写死深色内衬，跟随主题 surface，宣纸主题下不再发黑 */
  background: var(--panel-2);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-row.user .bubble {
  border-color: var(--accent-line);
  border-radius: 14px 4px 14px 14px;
  /* v0.9.28：跟随主题强调色（此前写死金棕色，冰川等主题下与整体风格冲突） */
  background: var(--accent-soft);
  color: var(--text);
}

/* v0.9.27：宣纸（浅色）下用户消息 —— 修正对比度（旧版金字配浅底几乎看不见） */
[data-theme='paper'] .msg-row.user .bubble {
  border-color: rgba(181, 101, 29, 0.35);
  background: linear-gradient(145deg, rgba(181, 101, 29, 0.16), rgba(181, 101, 29, 0.07));
  color: #4a3517;
}

.system-row {
  display: flex;
  align-items: center;
  gap: 10px;
  /* v0.9.20①：与 .msg-row 一起左对齐，避免居中留白 */
  max-width: 1180px;
  margin: 4px 0 18px;
  padding: 0 24px;
  color: var(--faint);
  font-size: 10.5px;
}

.system-row::before,
.system-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.artifact-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  /* v0.9.27：修 bug —— 默认底色原先写死深色（rgba(10,13,18,.7)），
     宣纸主题下不 hover 就发黑；改为跟随主题 surface。 */
  background: var(--panel-2);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.artifact-card:hover {
  border-color: var(--accent-line);
  background: rgba(232, 184, 109, 0.06);
  transform: translateY(-1px);
}

.artifact-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: rgba(143, 168, 255, 0.12);
  color: var(--blue);
}

.artifact-copy {
  flex: 1;
  min-width: 0;
}

.artifact-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.artifact-open {
  color: var(--faint);
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

/* v0.9.30 #7：给三点一个固定占位盒，尺寸恒定，不随内容/成员切换抖动 */
.typing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: none;
  width: 21px;
  height: 6px;
}

.typing i {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
  /* v0.9.30 #7：只做透明度呼吸，不再位移/缩放（点上下跳正是「乱跳」的观感来源）；
     配合 renderLive 的稳定节点，动画不会被重建打断。三点错相位 0 / 0.2s / 0.4s。 */
  animation: typing 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.2s;
}

.typing i:nth-child(3) {
  animation-delay: 0.4s;
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  /* v0.9.59：去掉胶囊外圈（边框/圆角/底色/内边距），只留绿点 + 文字 + 停止按钮；
     整体右移一点点，仍跟随消息流。 */
  align-self: flex-start;
  width: fit-content;
  max-width: calc(100% - 88px);
  margin: 0 0 8px 60px;
  color: var(--muted);
  font-size: 11px;
}

.status-strip .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(110, 211, 182, 0.45);
}

.status-strip strong {
  color: var(--text);
  font-weight: 650;
}

/* ------------------------------ composer ------------------------------ */

.composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  /* v0.9.43：输入容器整体加宽（收窄两侧留白） */
  padding: 12px 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--composer-bg);
  backdrop-filter: blur(14px);
}

/* 0.9.25：待发送附件行——选完文件、上传中就出现，发送后清空 */
.attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px 8px;
  margin-top: 8px;
}
.attach-row[hidden] { display: none; }

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--text);
  font-size: 12px;
}
.attach-chip .icon { width: 13px; height: 13px; color: var(--sub); flex: none; }
.attach-chip .attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip.uploading { opacity: 0.7; }
.attach-chip .attach-state { color: var(--sub); font-size: 11px; }
.attach-remove {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
}
.attach-remove .icon { width: 12px; height: 12px; }
.attach-remove:hover { color: var(--danger, #ff6b6b); }

/* 已发出消息里的附件按钮（点开在工作区预览） */
.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.msg-attach {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--hover-bg);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.msg-attach .icon { width: 13px; height: 13px; color: var(--sub); }
.msg-attach:hover { border-color: var(--accent-line); }
/* v0.9.32：图片附件在气泡里显示缩略图，直观确认「这轮带了哪张图给模型」 */
.msg-attach-thumb {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 5px;
  flex: none;
  background: var(--hover-bg);
}

.composer textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 56px;
  max-height: 200px;
  padding: 14px 16px 10px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  resize: none;
  transition: background 150ms ease;
}

.composer textarea:focus {
  border-color: var(--accent-line);
  background: var(--field-bg-focus);
}

.composer textarea::placeholder {
  color: var(--faint);
}

.send-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #f1c67f, #d9a04f);
  color: #211506;
  box-shadow: 0 8px 22px rgba(232, 184, 109, 0.18);
  transition: transform 150ms ease, filter 150ms ease;
}

.send-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.send-btn:active {
  transform: translateY(0);
}

/* ------------------------------ context ------------------------------ */

.context-panel {
  min-width: 0;
  /* v0.9.30 #3：收紧左右留白，把宽度让给看板文字 */
  padding: 18px 16px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(17, 21, 28, 0.72), rgba(13, 16, 22, 0.9));
  border-left: 1px solid var(--line);
}

.context-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.context-title .icon {
  width: 14px;
  height: 14px;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 7px;
  border-radius: 10px;
}

.member-row:hover {
  background: var(--soft);
}

.member-copy {
  flex: 1;
  min-width: 0;
}

.member-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-copy small {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(110, 211, 182, 0.1);
}

.member-status.away {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.1);
}

.context-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* 0.9.25 协作看板：四栏实时派生
   v0.9.30 #3：内部现在只有一张 .board-cards（需求/方案两卡），原来的两列 grid
   会把它挤进左半列（约 130px），文字被迫竖排。改成块级流式，横向铺满右栏。 */
.collab-board {
  display: block;
  margin: 10px 0 4px;
}
.board-col {
  display: flex;
  flex-direction: column;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}
.board-col-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.board-col-head .board-ic .icon { width: 13px; height: 13px; color: var(--sub); }
.board-col-head .board-title { font-size: 12px; font-weight: 600; color: var(--text); }
.board-col-head .board-count {
  margin-left: auto;
  min-width: 18px;
  padding: 0 6px;
  text-align: center;
  border-radius: 9px;
  background: var(--active-bg);
  color: var(--muted);
  font-size: 11px;
}
.board-col-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  max-height: 168px;
  overflow-y: auto;
}
.board-empty {
  padding: 8px 4px;
  color: var(--sub);
  font-size: 11px;
}
.board-item {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--hover-bg);
  color: var(--text);
  font-size: 11.5px;
  cursor: pointer;
}
.board-item .icon { width: 12px; height: 12px; color: var(--sub); flex: none; }
.board-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-item:hover { border-color: var(--accent-line); }

/* 看板跳转到消息时的高亮 */
.msg-row.msg-flash {
  animation: msgFlash 1.3s ease;
}
@keyframes msgFlash {
  0%, 100% { background: transparent; }
  20%, 60% { background: rgba(99, 179, 237, 0.16); }
}

/* 0.9.25 真实协作看板（CollabBoard） */
.rb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
  flex-wrap: wrap;
}
.rb-phase {
  padding: 3px 9px;
  border-radius: 9px;
  background: rgba(99, 179, 237, 0.14);
  color: var(--accent, #63b3ed);
  font-size: 11.5px;
  font-weight: 600;
}
.rb-progress { color: var(--muted); font-size: 11.5px; }
.rb-bar {
  height: 4px;
  border-radius: 3px;
  background: var(--active-bg);
  overflow: hidden;
  margin-bottom: 10px;
}
.rb-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4fd1a5, #63b3ed);
  transition: width 0.5s ease;
}
.rb-section {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px 10px;
  margin-bottom: 8px;
}
.rb-sec-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.rb-sec-head .icon { width: 13px; height: 13px; color: var(--sub); }
.rb-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  max-height: 180px;
  overflow-y: auto;
}
.rb-task {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
  padding: 7px 9px;
  margin-bottom: 6px;
}
.rb-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.rb-task-head strong { font-size: 12px; color: var(--text); }
.rb-worker {
  flex: none;
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--active-bg);
  color: var(--muted);
  font-size: 10.5px;
}
.rb-sub {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
  font-size: 11.5px;
  color: var(--muted);
}
.rb-sub .rb-mark { flex: none; }
.rb-sub.done .rb-sub-title { color: var(--sub); text-decoration: line-through; }
.rb-sub.blocked .rb-sub-title { color: #f28b82; }
.rb-gate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 11.5px;
}
.rb-gate-name { flex: none; color: var(--text); font-weight: 600; }
.rb-gate-reason {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--sub);
}
.rb-gate-mark { flex: none; }
.rb-gate.ok .rb-gate-mark { color: #4fd1a5; }
.rb-gate.no .rb-gate-mark { color: var(--sub); }
.rb-disc {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  font-size: 11.5px;
  color: var(--muted);
}
.rb-disc-who { flex: none; color: var(--sub); font-weight: 600; }
.rb-disc span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


.info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 11px;
}

.info-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.notice-box {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px 18px;
  text-align: center;
}

.profile-card .avatar {
  margin-bottom: 10px;
}

.profile-card h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.profile-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.chip:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ------------------------------- market ------------------------------- */

.market-view {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 44px 54px 56px;
}

.market-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  max-width: 1220px;
  margin: 0 auto;
}

.market-head h1 {
  margin: 8px 0 8px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 760;
}

.market-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.market-search {
  width: 300px;
  height: 42px;
  margin: 0;
  flex: 0 0 auto;
}

.market-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 1220px;
  margin: 30px auto 18px;
}

.market-cat {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  transition: all 150ms ease;
}

.market-cat:hover,
.market-cat.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  max-width: 1220px;
  margin: 0 auto;
}

.market-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 172px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    var(--panel);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.market-card:hover {
  border-color: var(--line-2);
  background:
    linear-gradient(150deg, rgba(232, 184, 109, 0.07), rgba(255, 255, 255, 0.012)),
    var(--panel);
  transform: translateY(-2px);
}

.market-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--accent);
}

.market-card h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 680;
}

.market-card p {
  flex: 1;
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.market-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.market-tag {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.market-state {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
}

.market-state.ready {
  border-color: rgba(110, 211, 182, 0.24);
  background: rgba(110, 211, 182, 0.08);
  color: var(--teal);
}

.market-state.soon {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

/* v0.9.20④：市场底部「这一版先做入口和骨架」占位块已删除（DOM 与样式一并移除）。 */

/* ------------------------------- modal ------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(9px);
  animation: fade 160ms ease both;
}

.modal {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  animation: modalIn 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* v0.9.52：意见反馈浮层 */
.feedback-card {
  width: min(520px, 94vw);
  padding: 22px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  animation: modalIn 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.feedback-head h3 {
  margin: 6px 0 6px;
  font-size: 18px;
}

.feedback-head .muted {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.6;
}

.feedback-input {
  width: 100%;
  min-height: 132px;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
}

.feedback-input:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--field-bg-focus);
}

.feedback-meta {
  margin-top: 8px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.6;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* v0.9.63：检查更新浮层 */
.update-body {
  margin: 4px 0 2px;
}

.update-version {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.update-notes {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--field-bg);
}

/* v0.9.53 #5：为爱发电浮层 —— 一级还原爱发电平台视觉，二级是作者本人的赞赏码 */
.sponsor-card {
  width: min(392px, 92vw);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  animation: modalIn 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* 一级：紫色主视觉（爱发电的品牌色） */
.sp-cover {
  position: relative;
  padding: 26px 24px 20px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, 0.22), transparent 62%),
    linear-gradient(135deg, #a173f3 0%, #7d51da 58%, #6b3fc7 100%);
}

.sp-close {
  position: absolute;
  top: 10px;
  right: 12px;
  color: rgba(255, 255, 255, 0.9) !important;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  z-index: 2;
}

.sp-close:hover { background: rgba(255, 255, 255, 0.22); }

.sp-avatar {
  width: 68px;
  height: 68px;
  margin: 4px auto 10px;
  border-radius: 50%;
  padding: 3px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(45, 20, 90, 0.28);
}

.sp-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.sp-name {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.sp-bio {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.sp-body {
  padding: 18px 22px 16px;
}

.sp-desc {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.72;
  text-align: center;
}

.sp-qr-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(147, 51, 234, 0.28);
  border-radius: 11px;
  background: rgba(147, 51, 234, 0.09);
  color: #7c3aed;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.sp-qr-link:hover {
  background: rgba(147, 51, 234, 0.15);
  border-color: rgba(147, 51, 234, 0.42);
}

.sp-qr-link .icon { width: 15px; height: 15px; }

.sp-pay {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.04em;
}

.sp-platform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.sp-platform-name {
  font-size: 12.5px;
  font-weight: 750;
  color: #8a5ce0;
  letter-spacing: 0.04em;
}

.sp-platform-desc {
  font-size: 10.5px;
  color: var(--faint);
}

/* 二级：赞赏码 */
.sp-qr-view { text-align: center; }

.sp-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.sp-back .icon { width: 14px; height: 14px; transform: rotate(180deg); }
.sp-back:hover { color: var(--text); }

.sp-qr-box {
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #0e0f13;
  border: 1px solid var(--line);
}

.sp-qr-box img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 8px;
}

.sp-qr-tip {
  margin: 12px 0 4px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.sp-qr-thanks {
  margin: 0;
  font-size: 11px;
  color: var(--faint);
}

/* v0.9.52：群聊改名浮层 —— 与 .modal 同一套表面材质，但更窄更轻。 */
.rename-card {
  width: min(420px, 92vw);
  padding: 22px 22px 18px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  animation: modalIn 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.rename-head h3 {
  margin: 6px 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.rename-head .muted {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.6;
}

.rename-input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.rename-input:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--field-bg-focus);
}

.rename-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 21px 15px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 5px 0 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin: 5px 0 0;
  font-size: 11.5px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 18px 21px;
  overflow-y: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.field input {
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--field-bg);
  color: var(--text);
  font-size: 12.5px;
}

.field input:focus {
  border-color: var(--accent-line);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 21px 18px;
  border-top: 1px solid var(--line);
}

.ghost,
.primary,
.danger {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 650;
  transition: filter 150ms ease, background 150ms ease, border-color 150ms ease;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.ghost:hover {
  border-color: var(--line-2);
  background: var(--hover-bg);
  color: var(--text);
}

.primary {
  border: 0;
  background: linear-gradient(145deg, #f1c67f, #d9a04f);
  color: #211506;
}

.primary:hover {
  filter: brightness(1.04);
}

.danger {
  border: 1px solid rgba(255, 122, 122, 0.28);
  background: rgba(255, 122, 122, 0.1);
  color: var(--danger);
}

.error-box {
  padding: 9px 11px;
  border: 1px solid rgba(255, 122, 122, 0.24);
  border-radius: 9px;
  background: rgba(255, 122, 122, 0.08);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
}

.cfg-path {
  font-size: 10px;
  word-break: break-all;
}

.artifact-modal {
  width: min(780px, 100%);
}

.artifact-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 21px 0;
}

.artifact-body {
  max-height: 62vh;
  margin-top: 12px;
  padding: 0 21px 21px;
  overflow: auto;
}

.artifact-body .preview-frame,
.artifact-body .preview-code {
  margin: 0;
  width: 100%;
}

/* v0.9.24：弹窗内文本回退保持旧的可读配色 */
.artifact-body .preview-code {
  background: #0a0d12;
  color: #c9d3e3;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.new-group-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
}

.new-group-btn:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.new-group-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.new-group-btn > span:nth-child(2) {
  flex: 1;
}

.new-group-btn strong {
  display: block;
  font-size: 12.5px;
}

.new-group-btn small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.modal-sub {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.private-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.private-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.private-pick:hover {
  background: var(--hover-bg);
}

.private-pick strong {
  display: block;
  font-size: 12px;
}

.private-pick small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
}

/* ------------------------------- toast ------------------------------- */

/* v0.9.33 设置页：安全策略分区 */
.policy-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.policy-mode {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 14px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel-2); color: var(--text); cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.policy-mode strong { font-size: 12.5px; }
.policy-mode small { font-size: 10.5px; line-height: 1.6; color: var(--sub); }
.policy-mode:hover { border-color: var(--accent-line); }
.policy-mode.active { border-color: var(--accent); background: var(--accent-soft); }
.policy-mode.active strong { color: var(--accent); }
.policy-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.settings-card textarea[data-field="policy-hosts"] {
  width: 100%; margin-top: 10px; padding: 10px 12px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2);
  color: var(--text); font-size: 11.5px; line-height: 1.6; resize: vertical;
}

/* v0.9.33 策略沙箱：高危工具执行确认浮层 */
.approval-overlay { z-index: 120; }
.approval-card {
  width: min(460px, calc(100vw - 40px));
  padding: 22px 22px 18px;
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
.approval-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.approval-head h3 { margin: 3px 0 0; font-size: 16px; font-weight: 700; }
.approval-shield {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent);
}
.approval-shield .icon { width: 20px; height: 20px; }
.approval-card > .muted { font-size: 12px; line-height: 1.7; margin: 0 0 12px; }
.approval-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.approval-chip {
  font-size: 10.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--sub); background: var(--panel-2);
}
.approval-args {
  max-height: 130px; overflow: auto; margin: 0 0 16px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2);
  font-size: 10.5px; line-height: 1.6; color: var(--sub);
  white-space: pre-wrap; word-break: break-all;
}
.approval-actions { display: flex; gap: 8px; justify-content: flex-end; }
.approval-foot { font-size: 10px; margin: 12px 0 0; text-align: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  max-width: min(520px, calc(100vw - 48px));
  padding: 10px 15px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  /* v0.9.29：跟随主题（旧版写死深色，宣纸浅色下成黑块） */
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 11.5px;
  transform: translateX(-50%);
  animation: toastIn 200ms ease both;
}

/* ----------------------------- animations ----------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* v0.9.25：三点 loading 改为平滑「呼吸」而非生硬闪烁——透明度与位移用缓动连续过渡，
   不再在 0%/60% 硬切，避免消息发送中一直突兀地闪。三点错相位形成连贯的波浪。 */
/* v0.9.30 #7：纯淡入淡出，去掉 translateY/scale，三点不再上下跳 */
@keyframes typing {
  0%,
  100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(110, 211, 182, 0.4);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(110, 211, 182, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(110, 211, 182, 0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ----------------------------- scrollbars ----------------------------- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* ----------------------------- responsive ----------------------------- */

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 280px minmax(420px, 1fr);
  }

  .context-panel {
    display: none;
  }

  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-view {
    padding: 36px 36px 48px;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .conv-panel {
    display: none;
  }

  .rail {
    width: 64px;
    flex-basis: 64px;
  }

  .rail-item {
    width: 52px;
  }

  .market-view {
    padding: 28px 24px 40px;
  }

  .market-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .market-search {
    width: 100%;
  }

  .market-grid {
    grid-template-columns: 1fr;
  }

  .msg-row {
    padding: 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------- settings center (0.9.9) --------------------------- */

.settings-overlay {
  padding: 34px;
}

.settings-center {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  width: min(1080px, 100%);
  height: min(82vh, 800px);
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  animation: modalIn 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 46%);
}

.settings-brand {
  padding: 4px 10px 18px;
}

.settings-brand h2 {
  margin: 5px 0 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.settings-tab {
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  text-align: left;
  transition: background 140ms ease, color 140ms ease;
}

.settings-tab:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.settings-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

.settings-nav-foot {
  margin-top: auto;
  padding: 14px 8px 2px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.settings-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.settings-head h2 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.settings-head p {
  margin: 5px 0 0;
  font-size: 11.5px;
}

.settings-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 22px;
  padding: 20px 24px 30px;
  overflow-y: auto;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.settings-badge {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.settings-badge.ok {
  border-color: rgba(110, 211, 182, 0.3);
  background: rgba(110, 211, 182, 0.07);
  color: var(--teal);
}

.settings-badge.warn {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.field select,
.field textarea {
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--field-bg);
  color: var(--text);
  font-size: 12.5px;
}

.field select {
  height: 42px;
}

.field textarea {
  padding: 9px 10px;
  line-height: 1.5;
  resize: vertical;
}

.field select:focus,
.field textarea:focus {
  border-color: var(--accent-line);
}

.default-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}

.default-row .primary {
  height: 42px;
  white-space: nowrap;
}

.provider-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provider-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.provider-card:hover {
  border-color: var(--line-2);
}

.provider-card.new-provider {
  border-style: dashed;
  border-color: var(--accent-line);
  background: rgba(232, 184, 109, 0.035);
}

.provider-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.provider-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.provider-title strong {
  font-size: 13px;
}

.provider-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.provider-note {
  max-width: 520px;
  overflow: hidden;
  color: var(--faint);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-state {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.provider-state.ok {
  border-color: rgba(110, 211, 182, 0.28);
  background: rgba(110, 211, 182, 0.06);
  color: var(--teal);
}

.provider-state.warn {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.provider-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 10px 12px;
}

.provider-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.provider-actions button {
  height: 34px;
  padding: 0 14px;
  font-size: 11.5px;
}

.provider-result {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  word-break: break-all;
}

.provider-result.ok {
  background: rgba(110, 211, 182, 0.06);
  color: var(--teal);
}

.provider-result.err {
  background: rgba(255, 122, 122, 0.06);
  color: var(--danger);
}

/* ── v0.9.21 一键开通引导 ────────────────────────────────────────────── */
.ob-section .section-head p {
  max-width: 720px;
}

.ob-hint {
  padding: 10px 13px;
  margin-bottom: 14px;
  border: 1px solid rgba(110, 211, 182, 0.22);
  border-radius: 10px;
  background: rgba(110, 211, 182, 0.055);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.ob-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.ob-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.ob-card:hover {
  border-color: var(--line-2);
}

.ob-card.ob-configured {
  border-color: rgba(110, 211, 182, 0.3);
}

.ob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ob-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ob-title strong {
  font-size: 13px;
}

.ob-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.ob-badge-free {
  border: 1px solid rgba(110, 211, 182, 0.28);
  background: rgba(110, 211, 182, 0.08);
  color: var(--teal);
}

.ob-badge-paid {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
}

.ob-check {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(110, 211, 182, 0.14);
  color: var(--teal);
  font-size: 10px;
  font-weight: 650;
}

.ob-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  min-height: 34px;
}

.ob-actions,
.ob-keyrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ob-actions button,
.ob-keyrow button {
  height: 32px;
  padding: 0 12px;
  font-size: 11.5px;
}

.ob-keyrow input {
  flex: 1 1 150px;
  min-width: 130px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 11.5px;
}

.ob-subhead {
  margin: 20px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.ob-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.ob-advanced-toggle:hover {
  border-color: var(--line-2);
  color: var(--text);
}

.ob-chevron {
  color: var(--faint);
  font-size: 11px;
}

.ob-advanced-hint {
  margin: 12px 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.6;
}

.ob-advanced-actions {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .ob-group {
    grid-template-columns: 1fr;
  }
}

.agent-model-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-model-row {
  /* 0.9.14：统一 grid 布局——头像在左，编辑区在右，按钮贴底。
     不再嵌套 agent-profile / agent-model-line / details.agent-extra，
     所有字段直接在 agent-edit-grid 里。
     v0.9.40：展开态改为单列卡片流（摘要行 → 编辑区 → 操作排），
     去掉独立 avatar 列后不再出现第二个头像位。 */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "summary";
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.agent-model-row.open {
  grid-template-areas:
    "summary"
    "edit"
    "actions";
  gap: 12px 0;
}

.agent-model-row > .agent-summary { grid-area: summary; }

/* .agent-model-id：旧新成员临时块用，保留不动 */
.agent-model-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-bottom: 3px;
}

.agent-model-id > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.agent-model-id strong {
  font-size: 12.5px;
}

.agent-model-id small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.settings-row strong {
  font-size: 12.5px;
}

.settings-row small {
  color: var(--muted);
  font-size: 10.5px;
}

.settings-row.danger-row {
  background: rgba(255, 122, 122, 0.03);
}

.path-text {
  max-width: 54%;
  overflow-wrap: anywhere;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
}

@media (max-width: 900px) {
  .settings-overlay {
    padding: 16px;
  }

  .settings-center {
    grid-template-columns: 1fr;
    height: min(88vh, 860px);
  }

  .settings-nav {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-brand,
  .settings-nav-foot {
    display: none;
  }

  .settings-tab {
    padding: 8px 12px;
    white-space: nowrap;
  }

  .settings-head,
  .settings-body {
    padding-right: 18px;
    padding-left: 18px;
  }

  .default-row,
  .provider-grid,
  .agent-model-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .provider-note {
    display: none;
  }

  .settings-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .path-text {
    max-width: 100%;
    text-align: left;
  }
}

.status-strip .stop-chip {
  margin-left: 2px;
  font-size: 10.5px;
}

/* ---------------------- right details panel (0.9.9) ---------------------- */

.shell.details-closed {
  grid-template-columns: 296px minmax(460px, 1fr) 0;
}

.shell.details-closed .context-panel {
  display: none;
}

.context-tabs {
  display: flex;
  gap: 2px;
  margin: -6px -3px 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.context-tab {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
}

.context-tab span {
  color: var(--faint);
  font-size: 9.5px;
}

.context-tab:hover {
  color: var(--text);
}

.context-tab.active {
  background: rgba(232, 184, 109, 0.12);
  color: var(--accent);
  font-weight: 650;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  align-items: stretch;
}

/* v0.9.36：紧凑卡片布局，铺满面板宽度，消除右侧大片留白 */
.file-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.file-row:hover {
  background: var(--hover-bg);
  border-color: var(--line-2);
}

.file-row:disabled {
  cursor: default;
  opacity: 0.78;
}

.fr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.fr-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  line-height: 1.3;
}

.fr-meta {
  color: var(--faint);
  font-size: 9.5px;
}

/* v0.9.40：无包围框、坐标固定（span/button 两种形态统一，避免 UA 默认按钮边框造成"框住"） */
.file-menu-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  border: none;
  appearance: none;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.file-menu-btn:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.file-menu-btn .icon { width: 15px; height: 15px; }

.file-ext {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border-radius: 5px;
  background: var(--hover-bg);
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.file-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy small {
  color: var(--faint);
  font-size: 9.5px;
}

.context-empty {
  padding: 14px 8px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.6;
}

.preview-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.preview-title {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.preview-title strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-title small {
  flex: none;
  color: var(--faint);
  font-size: 9.5px;
}

.preview-code {
  max-height: calc(100vh - 230px);
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  /* v0.9.53 #6：原来写死深色底 + var(--muted)，宣纸主题下变成浅底浅字/深底深字，
     现在底和字都跟着主题走，保证任何主题下都够对比。 */
  background: var(--soft);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-frame {
  width: 100%;
  height: calc(100vh - 230px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.preview-img {
  max-width: 100%;
  max-height: calc(100vh - 230px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    repeating-conic-gradient(#1a1d24 0% 25%, #14161c 0% 50%) 50% / 18px 18px;
  object-fit: contain;
}

.preview-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.preview-actions .ghost.sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 7px;
  text-decoration: none;
  line-height: 1.4;
}

.preview-actions .ghost.sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* v0.9.41：安全策略快捷入口 —— WorkBuddy 同款：composer 底部左侧胶囊 + 上弹菜单 */
/* v0.9.42：输入框容器——文本区 + 底部内嵌「安全策略」三档分段控件（横向，输入框内部底部，不遮挡文字与发送） */
.input-box {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--field-bg);
  overflow: hidden;
  transition: border-color 150ms ease, background 150ms ease;
}
.input-box:focus-within { border-color: var(--accent-line); }
/* v0.9.44：WorkBuddy 同款——输入框内部左下角胶囊显示当前档位，点击上弹菜单选三档 */
.input-box .input-foot {
  display: flex;
  align-items: center;
  padding: 2px 10px 8px;
}
.input-box .sec-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}
.input-box .sec-pill .icon { width: 12px; height: 12px; }
.input-box .sec-pill .sp-chev { transition: transform 160ms ease; }
.input-box .sec-pill:hover { border-color: var(--line-2); color: var(--text); }
.input-box .sec-pill.open { border-color: var(--accent-line); color: var(--accent); }
.input-box .sec-pill.open .sp-chev { transform: rotate(180deg); }

.sec-pop {
  z-index: 70;
  min-width: 236px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.22);
}
.sec-pop .sp-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 130ms ease;
}
.sec-pop .sp-item:hover { background: var(--hover-bg); }
.sec-pop .sp-item.active { background: var(--accent-soft); }
.sec-pop .sp-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
}
.sec-pop .sp-dot.on { border-color: var(--accent); background: var(--accent); }
.sec-pop .sp-text { display: flex; flex-direction: column; gap: 1px; }
.sec-pop .sp-text strong { font-size: 12px; font-weight: 650; }
.sec-pop .sp-text small { color: var(--faint); font-size: 10.5px; }

/* v0.9.44：发送按钮 + 推理强度胶囊右侧簇，同一行、垂直居中 */
.send-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  flex: none;
}
.composer .effort-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field-bg);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

/* ── 0.9.14：新的统一 grid 内部样式 ── */

.agent-model-row > .agent-edit-grid {
  grid-area: edit;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  min-width: 0;
  padding-top: 2px;
}

/* 头像色只占第一列 → 和"一句话说明"同左对齐 */
.agent-model-row > .agent-edit-grid .color-field {
  grid-column: 1;
}

/* 人设 / 长期记忆全宽展开在最后两行 */
.agent-model-row > .agent-edit-grid .persona-field {
  grid-column: 1 / -1;
}

.agent-model-row > .agent-edit-grid .persona-field textarea {
  min-height: 72px;
}

.agent-model-row > .agent-actions {
  grid-area: actions;
  display: flex;
  gap: 6px;
  justify-self: end;
  align-self: end;
}

.agent-model-row > .agent-actions button {
  height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.agent-model-row.new-agent {
  grid-area: auto; /* 新成员临时块 */
  border-style: dashed;
  border-color: var(--accent-line);
  background: rgba(232, 184, 109, 0.035);
  grid-template-columns: minmax(170px, 1.1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
  grid-template-areas: none;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.swatch {
  width: 21px;
  height: 21px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.swatch.active {
  border-color: rgba(255, 255, 255, 0.9);
  transform: scale(1.08);
}

@media (max-width: 900px) {
  .agent-model-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "edit"
      "actions";
  }

  .agent-model-row > .agent-edit-grid {
    grid-template-columns: 1fr;
  }

  .agent-model-row > .agent-edit-grid .color-field {
    grid-column: 1;
  }

  .agent-model-row > .agent-actions {
    justify-self: end;
  }

  .agent-model-row.new-agent {
    grid-template-columns: 1fr;
  }
}

/* 旧样式彻底废弃：.agent-profile / .agent-model-line / .agent-extra / 旧 .agent-edit-grid
   全部被上面的统一 grid 取代 */

/* ======================= 0.9.11：头像 / 插话 / 思考进度卡 ======================= */

/* 图片头像（成员头像可上传 png / jpg / webp / gif） */
.avatar.has-img {
  overflow: hidden;
  padding: 0;
}

.avatar.has-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.md {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 16px;
  font-size: 16px;
}

/* 插话小标（协作进行中用户发的消息） */
.interject-chip {
  border-color: rgba(232, 184, 109, 0.45);
  color: var(--accent-line, #e8b86d);
}

/* 右栏成员行：hover 出「编辑」提示，点一下进设置改名字 / 头像 / 角色 */
.member-edit-hint {
  color: var(--faint);
  font-size: 10px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.member-row:hover .member-edit-hint {
  opacity: 1;
}

/* 状态条：阶段文案截断；停止键固定右端 */
.status-strip > span:not(.pulse) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip .stop-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  /* v0.9.59：停止按钮一并去掉胶囊外圈，只留红色文字 + 图标 */
  color: #f07575;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  height: auto;
}

.status-strip .stop-chip .icon {
  width: 12px;
  height: 12px;
}

.status-strip .stop-chip:hover {
  color: #f07575;
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
}

/* 层1思考进度卡：消息列表和状态条之间的稳定节点，不随消息列表重建 */
.think-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  /* v0.9.52：思考卡此前是「900px + 居中 + 28px 内距」，
     和 .msg-row（1180px + 左对齐 + 24px 内距）完全错位：
     头像和正文都比消息往右缩了一截。这里直接对齐消息行的几何参数。 */
  max-width: 1180px;
  margin: 0 0 10px;
  padding: 0 24px;
}

.think-card[hidden] {
  display: none;
}

.think-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.think-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 11.5px;
  flex-wrap: wrap;
}

.think-meta .think-text {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.think-bubble {
  width: fit-content;
  padding: 2px 4px;
  background: var(--hover-bg);
}

.think-card .typing {
  padding: 6px 8px;
}

/* ======================= 0.9.13：设置页可滚动 / 不再截断底部 ======================= */

.settings-center {
  max-height: calc(100vh - 68px);
}

.settings-nav {
  min-height: 0;
  overflow-y: auto;
}

.settings-main {
  min-height: 0;
  height: 100%;
}

.settings-body {
  min-height: 0;
  overscroll-behavior: contain;
}

@media (max-width: 900px) {
  .settings-center {
    grid-template-rows: auto minmax(0, 1fr);
    max-height: calc(100vh - 32px);
  }
}



/* 0.9.13：直播块就是一条普通消息行（头像 / 名字 / 正文列同宽），不是贴底悬浮条 */
.think-card {
  margin-bottom: 10px;
}

.think-main {
  flex: 1;
  min-width: 0;
  max-width: 680px;
}

.think-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.think-head .think-title {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 680;
}

.think-elapsed {
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.think-chev {
  display: inline-flex;
  color: var(--faint);
  transform: rotate(90deg);
}

.think-box {
  display: block;
  width: 100%;
  max-width: 680px;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  /* v0.9.29：跟随主题（旧版写死深色，宣纸浅色下背景发黑） */
  background: var(--soft);
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.68;
  text-align: left;
  cursor: pointer;
}

.think-box:hover {
  border-color: var(--border-strong);
}

.think-body-text {
  display: block;
  max-height: 132px;
  /* v0.9.19：改成可滚动 + JS 跟随增量滚到底，思考变长时不再"钉在顶部、底部被裁" */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 未贴底时才用渐隐提示"下面还有"，贴底后去掉，避免遮住最新一行 */
.think-box:not(.at-bottom) .think-body-text {
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
}

.think-body-text[hidden],
.think-empty[hidden] {
  display: none;
}

.think-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

/* v0.9.58：本轮工具调用灰色小记录行（只在直播块内存里，结束即清） */
.tool-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tool-lines[hidden] {
  display: none;
}

.tool-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.tool-line .tool-name {
  font-family: var(--mono);
  color: var(--text-2);
}

.tool-line .tool-verb {
  color: var(--faint);
}

.tool-line.running .tool-verb {
  color: var(--accent);
}

.tool-line.ok .tool-verb {
  color: var(--teal);
}

.tool-line.fail,
.tool-line.fail .tool-verb {
  color: var(--danger);
}

.think-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  min-height: 14px;
  color: var(--faint);
  font-size: 10.5px;
}

.think-chars {
  color: var(--accent-line, #e8b86d);
}

.think-hint {
  opacity: 0.85;
}

/* 历史消息下的「深度思考」小条 */
.think-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 4px 10px;
  /* v0.9.30 #2：整组绑定主题色，移除硬写死的 rgba(21,26,34,.6) 黑底。
     宣纸主题下会切成浅米灰底 + 深棕字 + 极淡描边（见下方 paper 覆盖）。 */
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
}

.think-chip:hover {
  color: var(--text);
  border-color: var(--accent-line);
}

[data-theme='paper'] .think-chip,
[data-theme='paper'] .think-box {
  background: rgba(120, 100, 70, 0.075);
  border-color: rgba(120, 100, 70, 0.17);
  color: #544b3d;
}

[data-theme='paper'] .think-chip small {
  color: #5d5341;
}

.think-chip small {
  color: var(--faint);
  font-size: 10px;
}

.think-chip .icon {
  width: 12px;
  height: 12px;
}

/* 直播中的正文气泡：和正式消息同款气泡，只是时间位显示「正在输入」 */
.live-reply {
  flex: 0 0 auto;
}

.live-reply .msg-row {
  margin-bottom: 6px;
}

.live-bubble {
  white-space: pre-wrap;
  word-break: break-word;
}

/* 完整思考弹层 */
.thinking-modal {
  width: min(720px, 92vw);
  max-height: 82vh;
}

.thinking-content {
  max-height: 62vh;
  overflow-y: auto;
  padding: 18px 22px 22px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
}

/* 输入区：元素统一垂直居中、间距一致，输入框内不再挤出一条滚动条 */
.composer {
  align-items: center;
  gap: 10px;
  padding: 12px 24px 16px;
}

.composer textarea {
  min-width: 0;
  min-height: 46px;
  padding: 12px 14px;
  scrollbar-width: none;
}

.composer textarea::-webkit-scrollbar {
  display: none;
}

.composer .icon-btn {
  flex: 0 0 auto;
}

/* =========================================================================
   v0.9.24 · 个性化：主题变量覆盖
   v0.9.26：只保留 宣纸（默认，浅色）/ 冰川（深色）两套；旧主题块已删除，
   旧 id 由前端迁移逻辑回落宣纸。组件一律吃变量，不写死色值。
   ========================================================================= */

[data-theme='glacier'] {
  --bg: #070a12;
  --rail: #0a0e18;
  --panel: #0e1320;
  --panel-2: #131a2b;
  --panel-3: #182032;
  --line: rgba(140, 170, 255, 0.08);
  --line-2: rgba(140, 170, 255, 0.15);
  --text: #eaf0fb;
  --muted: #8294b4;
  --faint: #56688a;
  --accent: #7fb2ff;
  --accent-soft: rgba(127, 178, 255, 0.12);
  --accent-line: rgba(127, 178, 255, 0.34);
  --teal: #5fd6c0;
  --blue: #7fb2ff;
  --danger: #ff8a9a;
}

/* 浅色主题：覆盖主要容器背景，组件内部仍尽量复用变量；
   个别硬编码深色内衬（气泡等）此处一并反向，保证浅色可读。 */
[data-theme='paper'] {
  --bg: #f4f1ea;
  --rail: #eceae2;
  --panel: #ffffff;
  --panel-2: #f3f0e9;
  --panel-3: #ece8df;
  --line: rgba(40, 30, 15, 0.1);
  --line-2: rgba(40, 30, 15, 0.16);
  /* v0.9.40：文字全面改深炭黑，拉开与宣纸底的对比（背景纹理不动） */
  --text: #1a1712;
  --muted: #464032;
  --faint: #6b6353;
  --accent: #b5651d;
  --accent-soft: rgba(181, 101, 29, 0.1);
  --accent-line: rgba(181, 101, 29, 0.3);
  --teal: #2f8f6e;
  --blue: #3a6ad4;
  --danger: #c23b3b;

  /* v0.9.26：宣纸（浅色）下的表面/控件 token —— 弹窗、输入区、附件随主题走 */
  --soft: rgba(40, 30, 15, 0.035);
  --hover-bg: rgba(40, 30, 15, 0.055);
  --active-bg: rgba(40, 30, 15, 0.09);
  /* v0.9.30 #2：宣纸下的次级文字/描边 —— v0.9.40 次级文字同步加深 */
  --text-2: #332e24;
  --border: rgba(40, 30, 15, 0.12);
  --border-strong: rgba(40, 30, 15, 0.2);
  --modal-bg: linear-gradient(180deg, #ffffff, #faf7f0);
  --composer-bg: rgba(244, 241, 234, 0.82);
  --field-bg: rgba(255, 255, 255, 0.92);
  --field-bg-focus: rgba(255, 255, 255, 1);

  --shadow: 0 22px 60px rgba(60, 50, 30, 0.18);
}

[data-theme='paper'] .app {
  background:
    radial-gradient(900px 540px at 74% -12%, rgba(181, 101, 29, 0.05), transparent 62%),
    radial-gradient(760px 520px at 6% 112%, rgba(47, 143, 110, 0.05), transparent 60%),
    var(--bg);
}

[data-theme='paper'] .rail {
  background: linear-gradient(180deg, #f1efe8, #e7e4db);
}

[data-theme='paper'] .conv-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 241, 234, 0.96));
}

[data-theme='paper'] .chat-panel {
  background:
    radial-gradient(720px 420px at 78% -8%, rgba(181, 101, 29, 0.04), transparent 62%),
    linear-gradient(180deg, rgba(248, 246, 240, 0.98), rgba(244, 241, 234, 0.99));
}

[data-theme='paper'] .context-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 241, 234, 0.9));
}

[data-theme='paper'] .chat-header {
  background: rgba(248, 246, 240, 0.72);
}

[data-theme='paper'] .composer,
[data-theme='paper'] .conv-foot {
  background: rgba(244, 241, 234, 0.78);
}

[data-theme='paper'] .bubble {
  background: rgba(241, 238, 230, 0.92);
  color: #232019;
  border-color: var(--line);
}

/* v0.9.40：Token 用量 —— me 菜单摘要栏 + 二级详情 */
.me-usage { justify-content: flex-start; }
.me-usage-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.me-usage-text small {
  color: var(--faint);
  font-size: 9.5px;
}
.me-usage-total {
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.me-usage-detail { display: block; }
.me-usage-back { margin-bottom: 10px; }

/* v0.9.41：设置面板内的 Token 用量分区（与设置/个性化同款面板） */
.usage-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.usage-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.usage-card small { color: var(--faint); font-size: 10px; letter-spacing: 0.04em; }
.usage-card strong {
  font-size: 24px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.usage-card .usage-sub { color: var(--muted); font-size: 10px; }
.usage-model-row { border-bottom: none; }
.usage-model-bar {
  height: 4px;
  margin: -2px 0 10px;
  border-radius: 999px;
  background: var(--hover-bg);
  overflow: hidden;
}
.usage-model-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4d93f8, #9333ea);
}

/* ── 个性化视图 ── */

.pz-view {
  display: block;
  overflow-y: auto;
}

.pz-head {
  max-width: 1220px;
  margin: 0 auto 8px;
}

.pz-head h1 {
  margin: 8px 0 8px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 760;
}

.pz-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.pz-block {
  max-width: 1220px;
  margin: 34px auto 0;
}

.pz-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.pz-block-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.pz-hint {
  color: var(--faint);
  font-size: 11.5px;
}

.pz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 13px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.theme-card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}

.theme-card.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-line) inset;
}

/* ---- v0.9.26：主题预览 = 主界面迷你缩影（非纯色块） ----
   直观呈现：背景色 + 侧栏/控件底色 + 文字对比度 + 强调色。
   圆角 + 轻阴影，标题与描述放在缩略图下方。 */
.theme-thumb {
  display: block;
  border-radius: 12px;
}

.tt-window {
  display: flex;
  flex-direction: column;
  height: 118px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.tt-topbar {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 14px;
  flex: none;
  padding: 0 7px;
}

.tt-topbar i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.tt-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.tt-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 22px;
  flex: none;
  padding-top: 8px;
}

.tt-rail i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.tt-rail .tt-rail-dot {
  border-radius: 50%;
}

.tt-chat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
}

.tt-bubble {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 78%;
  border-radius: 8px;
  padding: 6px 8px;
}

.tt-bubble.tt-in {
  align-self: flex-start;
}

.tt-bubble.tt-out {
  align-self: flex-end;
  width: 34%;
  height: 14px;
  border-radius: 8px;
  padding: 0;
}

.tt-line {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 2px;
}

.tt-line.short {
  width: 62%;
}

.tt-input {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 16px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 5px;
}

.tt-input i {
  width: 34%;
  height: 4px;
  border-radius: 2px;
}

.tt-input b {
  width: 12px;
  height: 10px;
  border-radius: 4px;
}

.theme-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.theme-meta strong {
  font-size: 13.5px;
  font-weight: 680;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.theme-meta strong small {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.theme-desc {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* 开屏动画卡片 */
.splash-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  transition: border-color 180ms ease, background 180ms ease;
}

.splash-card:hover {
  border-color: var(--line-2);
}

.splash-thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 11px;
  background: radial-gradient(circle at 50% 38%, #14181f, #0a0c11);
  border: 1px solid var(--line);
}

.splash-meta {
  flex: 1;
  min-width: 0;
}

.splash-meta strong {
  display: block;
  font-size: 13.5px;
  font-weight: 680;
}

.splash-meta small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.splash-play {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.splash-play:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

/* --------------------------- 开屏动画（Metal Reveal） --------------------------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.96);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.42s ease;
}

.splash.splash-active {
  opacity: 1;
}

.splash-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.splash-mark {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: linear-gradient(145deg, #cfd6e0, #7f8a9c);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  opacity: 0;
  animation: splashMarkIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.splash-diamond {
  width: 38px;
  height: 38px;
  transform: rotate(45deg);
  border-radius: 7px;
  background: linear-gradient(135deg, #ffffff, #9fb4cf 55%, #6f86a8);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.splash-word {
  position: relative;
  overflow: hidden;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #eef2f8;
  opacity: 0;
  animation: splashWordIn 0.5s ease 0.6s forwards;
}

/* 18° 斜向流光，每 3.2s 一道，峰值不透明度 0.18 级别（白色微光） */
.splash-word::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: splashShimmer 3.2s ease-in-out 1.1s infinite;
}

@keyframes splashMarkIn {
  from {
    opacity: 0;
    transform: scale(0.86) translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes splashWordIn {
  to {
    opacity: 1;
  }
}

@keyframes splashShimmer {
  0% {
    left: -60%;
  }
  55%,
  100% {
    left: 120%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-mark,
  .splash-word,
  .splash-word::after {
    animation: none !important;
    opacity: 1;
  }
}

/* ───── v0.9.36：web 预览三档独立舞台（与桌面开屏三范式对应） ───── */
.splash-stage > * { opacity: 0; animation: wsFade .7s ease forwards; }
@keyframes wsFade { to { opacity: 1; } }

/* 星云：粒子轨道 */
.ws-orbital { position: relative; width: 230px; height: 230px; display: grid; place-items: center; }
.ws-o { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.07); }
.ws-o1 { width: 230px; height: 230px; animation: wsSpin 13s linear infinite; }
.ws-o2 { width: 162px; height: 162px; top: 34px; left: 34px; animation: wsSpin 8.5s linear infinite reverse; }
.ws-o3 { width: 104px; height: 104px; top: 63px; left: 63px; animation: wsSpin 5.5s linear infinite; }
.ws-o i { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent, #c7ccd4)); box-shadow: 0 0 10px var(--accent, #c7ccd4); }
.ws-core { width: 46px; height: 46px; transform: rotate(45deg); border-radius: 11px;
  background: linear-gradient(135deg, var(--accent, #c7ccd4), #6f86a8 60%, #3a4a66);
  box-shadow: inset 0 1px 3px rgba(255,255,255,.6), 0 8px 24px rgba(0,0,0,.55); animation-delay: .3s; }
.ws-brand { margin-top: 26px; font: 700 22px/1 -apple-system,sans-serif; letter-spacing: .42em; text-indent: .42em; color: #eef2f8; animation-delay: .8s; }
@keyframes wsSpin { to { transform: rotate(360deg); } }

/* 极光：终端开机 */
.ws-term { width: min(520px, 86vw); padding: 20px 24px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(20,28,48,.55), rgba(8,12,22,.62));
  border: 1px solid rgba(120,150,255,.16); backdrop-filter: blur(3px);
  font: 13px/1.95 ui-monospace, Menlo, Consolas, monospace; color: #cdd6e6; text-align: left; }
.ws-term .ws-row { opacity: 0; white-space: pre; animation: wsShow .4s ease forwards; }
.ws-term .ws-r1 { animation-delay: .3s; } .ws-term .ws-r2 { animation-delay: .8s; }
.ws-term .ws-r3 { animation-delay: 1.4s; } .ws-term .ws-r4 { animation-delay: 2.0s; } .ws-term .ws-r5 { animation-delay: 2.6s; }
.ws-term .p { color: var(--accent, #c7ccd4); } .ws-term .ok { color: #6ed3b6; }
.ws-cur { display: inline-block; width: 8px; height: 15px; background: var(--accent, #c7ccd4); vertical-align: -2px; animation: wsBlink 1s steps(1) infinite; }
@keyframes wsShow { to { opacity: 1; } } @keyframes wsBlink { 50% { opacity: 0; } }

/* 金属：铬质故障 */
.ws-glitch { position: relative; display: grid; place-items: center; }
.ws-cglyph { width: 78px; height: 78px; transform: rotate(45deg) scale(.3); border-radius: 16px; opacity: 0;
  background: linear-gradient(135deg, #f4f7fb, #9aa6b6 46%, #4a566b 70%, #cdd6e2);
  box-shadow: inset 0 2px 4px rgba(255,255,255,.8), inset 0 -3px 6px rgba(0,0,0,.4), 0 10px 40px rgba(0,0,0,.6);
  animation: wsPop .8s cubic-bezier(.2,.8,.2,1) .3s forwards, wsGlitch 2.6s steps(2,end) 1.4s infinite; }
@keyframes wsPop { to { opacity: 1; transform: rotate(45deg) scale(1); } }
@keyframes wsGlitch { 0%,90% { filter: none; } 92% { filter: drop-shadow(3px 0 #ff3b6b) drop-shadow(-3px 0 #37e0ff); transform: rotate(45deg) scale(1) translate(2px,-1px); }
  95% { filter: drop-shadow(-3px 0 #ff3b6b) drop-shadow(3px 0 #37e0ff); transform: rotate(45deg) scale(1) translate(-3px,2px); }
  98% { filter: drop-shadow(2px 0 #ff3b6b) drop-shadow(-2px 0 #37e0ff); transform: rotate(45deg) scale(1) translate(1px,1px); } 100% { filter: none; } }
.ws-word { position: relative; margin-top: 34px; font: 800 32px/1 -apple-system,sans-serif; letter-spacing: .4em; text-indent: .4em; color: #eef2f8; }
.ws-word::before, .ws-word::after { content: attr(data-t); position: absolute; left: 0; top: 0; }
.ws-word::before { color: #ff3b6b; mix-blend-mode: screen; animation: wsGlx 2.6s steps(2,end) 1.4s infinite; }
.ws-word::after { color: #37e0ff; mix-blend-mode: screen; animation: wsGlx 2.6s steps(2,end) 1.4s infinite reverse; }
@keyframes wsGlx { 0%,88% { transform: translate(0,0); } 91% { transform: translate(-3px,1px); } 95% { transform: translate(3px,-1px); } 100% { transform: translate(0,0); } }
.ws-tag { margin-top: 12px; font: 500 12px/1.4 -apple-system,"PingFang SC",sans-serif; letter-spacing: .1em; color: rgba(230,236,246,.6); }

/* ───────────────── v0.9.25：左下角「我」面板 ───────────────── */
.me-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: #7C8CF8;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.me-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 140, 248, 0.3);
}

.me-overlay {
  align-items: flex-start;
  justify-content: flex-start;
  background: transparent;
}

.me-panel {
  position: absolute;
  left: 76px;
  bottom: 18px;
  width: 264px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  animation: modalIn 160ms ease;
}

.me-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.me-avatar-lg {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  padding: 0; /* v0.9.26：必须归零 —— 默认 padding 会让预览图四周露出底色块 */
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #7C8CF8;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  transition: filter 150ms ease;
}

.me-avatar-lg:hover {
  filter: brightness(1.06);
}

.me-avatar-img {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.me-profile-edit {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.me-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.me-field span {
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.me-field input {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  outline: 0;
  transition: border-color 150ms ease;
}

.me-field input:focus {
  border-color: var(--accent-line);
}

.me-avatar-editor {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.me-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.me-swatches .swatch {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}

.me-swatches .swatch:hover {
  transform: scale(1.12);
}

.me-swatches .swatch.active {
  border-color: #fff;
}

.me-menu {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.me-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.me-menu-item:hover {
  background: var(--hover-bg);
}

.me-menu-item .icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.me-menu-item .me-soon {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* ======================= v0.9.26：输入区 / 强度控件 / 我菜单 ======================= */

/* 消息框整体做大：composer 允许换行，强度 pill 独占一行居中（Codex 风格） */
.composer-wrap {
  position: relative;
}

.composer {
  flex-wrap: wrap;
  row-gap: 8px;
}

/* v0.9.42：推理强度触发器移到发送按钮右侧、同一行 */
.composer .effort-pill .icon { width: 13px; height: 13px; }
.composer .effort-pill .effort-pill-chev { transition: transform 160ms ease; }
.composer .effort-pill:hover { border-color: var(--line-2); color: var(--text); }
.composer .effort-pill.open { border-color: var(--accent-line); color: var(--accent); }
.composer .effort-pill.open .effort-pill-chev { transform: rotate(180deg); }

/* 思考强度浮层：成员下拉 + 渐变滑块（星点标档位，圆点为当前值） */
.effort-panel {
  position: fixed;
  z-index: 60;
  width: min(330px, 92%);
  padding: 13px 14px 12px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.14);
  animation: efIn 170ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* v0.9.36：底部小箭头，指向触发按钮中心（--ef-arrow-x 由 JS 按按钮实时注入） */
.effort-panel::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--ef-arrow-x, 50%);
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--panel);
  filter: drop-shadow(0 1px 0 var(--line-2));
}

@keyframes efIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ef-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ef-bolt {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.ef-bolt .icon { width: 14px; height: 14px; }

.ef-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.ef-title strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.ef-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-size: 11px;
  margin-top: 1px;
}

.ef-refresh {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.ef-refresh .icon { width: 14px; height: 14px; }
.ef-refresh:hover { color: var(--accent); background: var(--hover-bg); }

.ef-members {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 11px 0 13px;
  flex-wrap: wrap;
}

.ef-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.ef-member .ef-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ef-member:hover { border-color: var(--line-2); color: var(--text); }
.ef-member.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}


/* 左下角「我」昵称常显 —— v0.9.27：换衬线字体，加字重与字间距提升辨识度 */
.me-name {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-family: 'Georgia', 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-align: center;
}

/* 个性化弹窗（复用 settings-center 骨架，左栏窄一点） */
.pz-center {
  grid-template-columns: 180px minmax(0, 1fr);
  height: min(72vh, 660px);
}

.pz-nav-note {
  padding: 4px 10px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.7;
}

/* =========================================================================
   v0.9.27 批次样式
   ========================================================================= */

/* --- #4 会话条目：hover 时时间 → 三点更多（同位不重叠），删除收进菜单 --- */
.conv-more {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}
.conv-more .icon { width: 15px; height: 15px; }
.conv-more:hover { background: var(--hover-bg); color: var(--text); }
.conv-row:hover .conv-time,
.conv-row.active .conv-time { display: none; }
.conv-row:hover .conv-more,
.conv-row.active .conv-more { opacity: 1; }
[data-theme='paper'] .conv-row:hover { background: rgba(40, 30, 15, 0.045); }
[data-theme='paper'] .conv-row.active {
  background: linear-gradient(90deg, rgba(181, 101, 29, 0.1), rgba(181, 101, 29, 0.02));
}

/* --- 通用轻量上下文菜单（会话三点 / 气泡右键复制共用） --- */
.ctx-menu {
  position: fixed;
  z-index: 999;
  min-width: 132px;
  padding: 5px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--panel);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.14);
  animation: efIn 140ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ctx-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.ctx-item:hover { background: var(--hover-bg); }
.ctx-item.off { opacity: 0.38; cursor: default; }
.ctx-item.off:hover { background: transparent; }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(255, 90, 90, 0.12); }

/* --- #6 技能市场：当前环境状态栏（v0.9.29 放板块下方，右对齐不突兀） --- */
.market-env {
  /* v0.9.35 #2：移到标题下方后左对齐，不再右浮 */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.market-env strong { color: var(--text); font-weight: 650; }
.market-env strong { color: var(--text); font-weight: 650; }
.env-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal);
}

/* --- #7 协作看板四列（需求 / 进行中 / 已交付 / 产物） --- */
.collab-board:has(> .board-cols) { display: block; }
.board-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.board-task { display: block; cursor: default; }
.board-task .bt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}
.board-task .bt-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 650;
}
.board-task .bt-progress {
  flex: none;
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.board-task .rb-sub { font-size: 10.5px; }
.board-task .rb-sub.done .rb-sub-title { text-decoration: line-through; }
.board-req {
  display: block;
  cursor: default;
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: normal;
  border-left: 2px solid var(--accent);
}
.board-empty-inline { color: var(--faint); font-size: 10.5px; }

/* --- #5 个性化：桌面宽弹窗（无左栏、无手机留白），主题卡 = 桌面缩影 --- */
.pz-modal {
  display: flex;
  flex-direction: column;
  width: min(880px, 92vw);
  height: min(76vh, 700px);
  padding: 22px 26px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--modal-bg, var(--panel));
  box-shadow: var(--shadow, 0 24px 70px rgba(0, 0, 0, 0.4));
  overflow: hidden;
}
.pz-modal .settings-head { margin-bottom: 6px; }
.pz-modal .settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.pz-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.theme-thumb .tt-window { height: 148px; }
.theme-thumb .tt-rail { width: 30px; }
.theme-thumb .tt-topbar { height: 18px; }

.ef-bolt.ultra {
  background: linear-gradient(135deg, rgba(77, 147, 248, 0.25), rgba(147, 51, 234, 0.3));
  color: #a855f7;
}
.ef-tier {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
}
.ef-tier.ultra {
  background: linear-gradient(90deg, rgba(77, 147, 248, 0.22), rgba(147, 51, 234, 0.26));
  color: #a855f7;
}
/* v0.9.53 #2：只在颜色/透明度上做 ≤90ms 的过渡，不再改 font-weight
   （字重一变，字符宽度跟着变，视觉上就像文字在追着滑块跳）。 */
.ef-labels b.on { color: var(--text); }
.ef-foot {
  margin-top: 10px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
}

/* --- #11 协作看板：需求 / 方案 两卡布局（v0.9.29 精简） --- */
.board-cards {
  /* v0.9.30 #3：自适应流式布局，卡片横向铺满可用区域，不设固定窄 width */
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}
.board-card {
  width: 100%;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}
.board-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}
.board-card-head .icon { width: 14px; height: 14px; color: var(--accent); }
.board-card .rb-text {
  width: 100%;
  max-width: none;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text);
  max-height: 320px;
  overflow-y: auto;
}
/* 成员条目折叠（#10） */
.agent-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.agent-summary:hover { background: var(--hover-bg); }
.agent-summary-text { flex: 1; min-width: 0; }
.agent-summary-text strong { display: block; font-size: 13px; }
.agent-summary-text small { color: var(--muted); font-size: 11px; }
.agent-chev { flex: none; color: var(--faint); font-size: 11px; }
.agent-model-row.collapsed { padding: 2px; }
.agent-model-row.open { border: 1px solid var(--line); border-radius: 13px; padding: 10px; }

/* --- #6 主题页：桌面窗口横版样机 + 等宽多列自适应（v0.9.30） --- */
.pz-modal { width: min(1180px, 96vw); height: auto; max-height: 88vh; }
.pz-grid {
  /* 横向铺满页面，消除两侧大片留白；卡片等宽、列数随宽度自适应 */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 16px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 11px;
  padding: 13px !important;
}
.theme-thumb {
  flex: none;
  width: 100%;
  max-width: none;
}
.theme-thumb .tt-window {
  width: 100%;
  height: auto;
  /* 桌面 16:10，而不是手机 9:19.5 竖屏比例 */
  aspect-ratio: 16 / 10;
}
.theme-thumb .tt-topbar { height: 13%; min-height: 13px; }
.theme-thumb .tt-rail { width: 11%; }
.theme-thumb .tt-chat { padding: 6% 5%; gap: 4px; }
.theme-card .theme-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  text-align: left;
}
.pz-block { margin-bottom: 18px; }
.pz-block:last-child { margin-bottom: 4px; }

/* 桌面窗口内部新增：顶栏标题条 / 会话列表 / 右侧详情栏 */
.tt-topbar-title {
  flex: 1;
  height: 4px;
  margin-left: 8px;
  border-radius: 3px;
}
.tt-list,
.tt-detail {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: none;
  min-width: 0;
  padding: 8px 5px;
  border-right: 1px solid;
}
.tt-list { width: 18%; }
.tt-detail {
  width: 14%;
  border-right: 0;
  border-left: 1px solid;
}
.tt-list i,
.tt-detail i {
  display: block;
  height: 4px;
  border-radius: 3px;
}

/* v0.9.36：文件行改为紧凑卡片 + 三点菜单，旧行内「打开提示 / 删除」规则已移除 */

/* ─────────────────────────────────────────────────────────────
   v0.9.30 #1：右下角头像弹窗取消背景高斯模糊
   .overlay 全局带 backdrop-filter: blur(9px)，.me-overlay 原只覆盖了
   background 没覆盖 blur，主画布仍被糊掉。这里显式关掉，弹窗只保留
   自身圆角 + 主题底色，背景页面保持原样清晰。
   ───────────────────────────────────────────────────────────── */
.me-overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
}

/* ─────────────────────────────────────────────────────────────
   v0.9.30 #5：产物预览改为右侧内置面板（对标 WorkBuddy）
   HTML / PDF / MD 都在这个面板里用 Electron 内置 Chromium 渲染，
   不调用系统浏览器；右上角三点菜单挂载文件动作。
   ───────────────────────────────────────────────────────────── */
#artifactOverlay {
  place-items: stretch;
  justify-items: end;
  padding: 0;
  background: rgba(4, 6, 10, 0.34);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#artifactOverlay .artifact-modal {
  width: min(860px, 56vw);
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  border: 0;
  border-left: 1px solid var(--line-2);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes drawerIn {
  from { transform: translateX(28px); opacity: 0.45; }
  to { transform: none; opacity: 1; }
}

#artifactOverlay .artifact-actions {
  flex: none;
  align-items: center;
  padding: 10px 21px 4px;
}

/* v0.9.52：产物预览自适应。
   之前 body 固定 overflow:auto、图片 max-height:none 按原始尺寸撑开，
   于是竖版长图 / 大图只能看出一个局部，必须手动滚。
   现在默认「适应窗口」：容器不滚动，图片按 contain 完整放进可视区；
   需要看细节时点右上角「实际尺寸」切换成 1:1（此时才允许滚动）。 */
#artifactOverlay .artifact-body {
  position: relative;
  flex: 1;
  min-height: 0;
  max-height: none;
  margin-top: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#artifactOverlay .preview-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: auto;
  border-radius: 10px;
}

#artifactOverlay .preview-code {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#artifactOverlay .preview-img {
  display: block;
  margin: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* v0.9.53 #1：折叠产物栏后，消息行 / 系统行 / 思考卡跟着列宽撑满，
   不再因为 1180px 的硬上限在右侧留下一大片空白。 */
.shell.details-closed .msg-row,
.shell.details-closed .system-row,
.shell.details-closed .think-card {
  max-width: none;
}

/* v0.9.53 #4：HTML / PDF 预览用「虚拟画布 + 整体缩放」，
   像主流 agent 平台的 Artifact 面板一样，默认一屏看到完整内容，而不是裁掉一半。 */
/* v0.9.53 #6：音视频与二进制文件的预览容器 */
#artifactOverlay .preview-media {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

#artifactOverlay .preview-media video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  background: #000;
}

#artifactOverlay .preview-media.preview-audio { background: var(--soft); }

#artifactOverlay .preview-media audio {
  width: min(560px, 100%);
}

#artifactOverlay .preview-binary {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

#artifactOverlay .preview-binary .pb-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--chip-bg, rgba(128,128,128,0.10));
  color: var(--faint);
  margin-bottom: 2px;
}

#artifactOverlay .preview-binary strong { color: var(--text); font-size: 14px; }
#artifactOverlay .preview-binary p { margin: 0; font-size: 12px; color: var(--faint); }
#artifactOverlay .preview-binary .pb-dot { margin: 0 6px; opacity: .5; }

#artifactOverlay .preview-binary .pb-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

#artifactOverlay .preview-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

#artifactOverlay .preview-stage .preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  transform-origin: top left;
  background: #fff;
}

.artifact-menu { position: relative; margin-left: auto; }

.artifact-menu-btn {
  min-width: 34px;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 2px;
  padding: 4px 10px;
}

.artifact-menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 12;
  min-width: 232px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel-2, var(--panel));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
}

.artifact-menu-pop[hidden] { display: none; }

.artifact-menu-pop button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.artifact-menu-pop button:hover { background: var(--hover-bg); }

.artifact-menu-pop button small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 400;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-missing {
  padding: 18px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}


/* ---------------- v0.9.35 UI 批次 ---------------- */

/* #1 主题/开屏卡片：横向多列铺满，杜绝竖向堆叠与两侧大片留白 */
.pz-modal .pz-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  grid-auto-flow: row !important;
  width: 100% !important;
  align-content: start;
}
/* 真凶修复：.pz-block 的左右 auto 边距在 flex 列容器里使其收缩为 fit-content(300px)，
   必须拉回满宽，网格才有可用的多列空间 */
.pz-modal .pz-block {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.pz-modal .pz-grid .theme-card,
.pz-modal .pz-grid .splash-card {
  width: 100% !important;
  max-width: none !important;
}

/* #5 开屏动画：卡片选中态 + 三种缩略图 + web 预览的 nebula/aurora 变体 */
.splash-card { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.splash-card.active { border-color: var(--accent); background: var(--accent-soft); }
.splash-inuse {
  font-style: normal;
  font-size: 10px;
  font-weight: 650;
  color: var(--accent);
  border: 1px solid var(--accent-line, var(--accent));
  border-radius: 99px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: 1px;
}
/* 缩略图：星河（蓝紫星点） / 极光（底部极光带） */
.splash-thumb-nebula {
  background:
    radial-gradient(2px 2px at 30% 30%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1.6px 1.6px at 66% 60%, rgba(180,200,255,.8), transparent 60%),
    radial-gradient(1.8px 1.8px at 78% 26%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.4px 1.4px at 44% 76%, rgba(200,215,255,.7), transparent 60%),
    radial-gradient(circle at 50% 45%, rgba(88,120,255,.35), rgba(120,80,220,.14) 55%, #0a0c11 78%);
}
.splash-thumb-aurora {
  background:
    radial-gradient(circle at 50% 40%, rgba(110,140,255,.22), #0a0c11 72%),
    linear-gradient(12deg, rgba(64,110,255,.42), rgba(120,80,230,.30) 40%, rgba(60,190,220,.26) 62%, transparent 80%);
}
/* 金属（默认）：与星河/极光同构的深色径向底，避免缩略图风格不一致 */
.splash-thumb-metal {
  background:
    radial-gradient(circle at 50% 45%, rgba(199,204,212,.32), rgba(120,140,170,.14) 55%, #0a0c11 78%),
    linear-gradient(135deg, rgba(160,170,190,.18), transparent 60%);
}
/* web 端预览变体：数据属性驱动背景层 */
.splash[data-splash='nebula']::before {
  content: "";
  position: absolute; inset: -12%;
  background-image:
    radial-gradient(2px 2px at 18% 26%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1.6px 1.6px at 42% 68%, rgba(190,205,255,.85), transparent 60%),
    radial-gradient(2.2px 2.2px at 66% 22%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1.4px 1.4px at 82% 58%, rgba(170,190,255,.8), transparent 60%),
    radial-gradient(1.8px 1.8px at 30% 84%, rgba(255,255,255,.7), transparent 60%);
  background-size: 640px 480px;
  animation: splashDrift 7s linear infinite;
}
.splash[data-splash='nebula']::after {
  content: "";
  position: absolute; left: 50%; top: 44%; width: 900px; height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(88,120,255,.28), rgba(120,80,220,.12) 55%, transparent 75%);
  animation: splashGlow 2.6s ease-in-out infinite;
}
.splash[data-splash='aurora']::before {
  content: "";
  position: absolute; left: -30%; right: -30%; bottom: -42%; height: 120%;
  background: conic-gradient(from 250deg at 50% 100%, rgba(64,110,255,.30), rgba(120,80,230,.22) 25%, rgba(60,190,220,.18) 50%, rgba(64,110,255,.28) 75%, rgba(64,110,255,.30));
  filter: blur(46px);
  animation: splashAurora 5.2s ease-in-out infinite;
}
.splash[data-splash='aurora']::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 44%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110,140,255,.5) 35%, rgba(170,130,255,.5) 65%, transparent);
}
/* 金属（默认）web 预览层：主题色氛围光，与其他两档视觉对齐 */
.splash[data-splash='metal']::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px 300px at 50% 42%, rgba(199,204,212,.22), transparent 60%);
}
@keyframes splashDrift { from { transform: translate(2.4%, 1.6%); } to { transform: translate(-2.4%, -1.6%); } }
@keyframes splashGlow { 0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(.94); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } }
@keyframes splashAurora { 0%, 100% { transform: translateX(-6%) skewX(-8deg) scaleY(1); } 50% { transform: translateX(6%) skewX(10deg) scaleY(1.14); } }

/* #5 splash 卡片在窄列内改竖排，避免 thumb/meta/预览按钮挤压折行 */
.pz-modal .pz-grid .splash-card {
  flex-direction: column;
  align-items: stretch;
}
.pz-modal .pz-grid .splash-card .splash-thumb {
  width: 100%;
  height: 110px;
  border-radius: 12px;
}
.pz-modal .pz-grid .splash-card .splash-play {
  width: 100%;
  margin-top: 10px;
}

/* ── v0.9.43：Token 用量独立面板（与设置同风格，单栏无左导航） ── */
.usage-center {
  display: flex;
  flex-direction: column;
  width: min(680px, 92vw);
  height: min(72vh, 640px);
  padding: 22px 26px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.usage-center .settings-head { margin-bottom: 6px; }
.usage-center .settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}


/* v0.9.45：开屏卡片——关闭项 + Quorum 视频缩略图 */
.splash-thumb-off {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 20px;
}
.splash-thumb-off::after { content: "⃠"; }
.splash-thumb-video { overflow: hidden; }
.splash-thumb-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* v0.9.47：协作状态条改为消息流里的一行 —— 与 .msg-row 共用栏宽与左内距，
   左缘和 PM 气泡/头像列对齐（旧版独立在消息区外，宽屏下会掉到屏幕正中下方） */
.status-strip {
  max-width: 1180px;
  margin: 0 0 12px 60px;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.5;
}
.status-strip .pulse {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(110, 211, 182, 0.45);
  animation: statusPulse 1.8s ease-out infinite;
}
@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 211, 182, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(110, 211, 182, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 211, 182, 0); }
}

/* ═══ v0.9.47：开屏动画卡片布局修正 ═══
   根因：卡片外层原本是 <button>，里面又塞了「预览」<button> —— 非法嵌套，
   浏览器会把内层按钮提到卡片外，于是出现「关闭卡片窄 / Quorum 卡片宽 / 预览飘到右边空白」。
   现在外层改成 div[role=button]，卡片统一竖排：缩略图满宽 132px + 文案 + 满宽预览按钮。 */
.pz-modal #splashGrid,
.pz-modal .pz-grid#splashGrid {
  /* 固定 300px 列宽：16:9 缩略图才能整帧显示，又不会把弹窗撑到要滚动 */
  grid-template-columns: repeat(auto-fit, 300px) !important;
  justify-content: start;
  align-items: stretch;
  gap: 14px;
}
.pz-modal #splashGrid .splash-card,
.pz-modal .pz-grid .splash-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  padding: 10px;
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
}
.pz-modal #splashGrid .splash-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.pz-modal #splashGrid .splash-card .splash-thumb,
.pz-modal .pz-grid .splash-card .splash-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(128, 128, 128, 0.10);
}
.pz-modal #splashGrid .splash-card .splash-meta {
  flex: 1 1 auto;
  padding: 0 2px;
}
.pz-modal #splashGrid .splash-card .splash-play,
.pz-modal .pz-grid .splash-card .splash-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 30px;
  margin: 0;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}
.pz-modal #splashGrid .splash-card .splash-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* 缩略图统一 16:9 裁切，视频类与「关闭」占位同高，两张卡片高度不再参差 */
.pz-modal #splashGrid .splash-thumb-video img {
  width: 100%;
  height: 100%;
  /* 视频源本身是 2560×1440 的 16:9，用 contain 保证预览图完整不裁切 */
  object-fit: contain;
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════
   推理强度滑块 · 唯一实现（v0.9.48）
   参照官方 dsh-codex-effort-slider 的机制 + 用户真机参照图的外观：
   · 轨道是**方一点的大圆角矩形**（radius 10px），不是胶囊
   · 旋钮是**方一点的白块**（26×26，radius 7px），四周没有白圈、没有彩色光晕
   · 填充段左端恒蓝、右端随位置色；高能量时被紫色星云层覆盖（左深右浅）
   · 星尘是 3px 小圆点横穿填充段，亮度 0.55~1，数量 = round(能量×22)
   · 全程无白色扫光条（旧版的白色竖条就是扫光造成的）
   ══════════════════════════════════════════════════════════════════════ */
.ef-slider {
  --ef-pos: 50%;
  position: relative;
  /* v0.9.52：轨高对齐官方 TRACK_HEIGHT = 28px（旋钮直径与之相同，
     所以 pct=1 时圆正好填满管口、右端不再留 1~2px 缝）。 */
  height: 28px;
  width: 100%;
  max-width: none;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* 轨道：方一点的大圆角矩形 */
.ef-slider .ef-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin-top: 0;
  /* v0.9.52：官方是胶囊形（border-radius:999px），不是 r10 的方角矩形 */
  border-radius: 999px;
  transform: none;
  overflow: hidden;
  background: rgba(128, 128, 128, 0.20);
  /* v0.9.52：官方在能量 > 0 时给整条轨道一层紫色外发光（0 → 16px，强度随能量） */
  box-shadow:
    inset 0 0 0 1px rgba(128, 128, 128, 0.10),
    0 0 calc(var(--ef-energy, 0) * 16px) rgba(168, 85, 247, 0.5);
  transition: box-shadow 200ms ease;
}
[data-theme='paper'] .ef-slider .ef-track {
  background: rgba(30, 25, 15, 0.11);
  box-shadow: inset 0 0 0 1px rgba(30, 25, 15, 0.08);
}

/* 填充段：左端恒蓝 → 右端当前位置色（官方 fillBackgroundFor） */
.ef-slider .ef-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  margin-top: 0;
  width: var(--ef-pos);
  transform: none;
  border-radius: 0;
  background: var(--ef-fill-bg, linear-gradient(90deg, #4d93f8, #4d93f8));
  box-shadow: none;
  overflow: hidden;
  z-index: 1;
}
/* 旧版的白扫光条一律关掉 */
.ef-slider .ef-fill::before,
.ef-slider .ef-fill::after { content: none; display: none; }

/* 能量层：紫色星云，只覆盖已填充段，透明度 = 能量（左深右浅，Max 档即参照图效果） */
.ef-slider .ef-energy {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  margin-top: 0;
  width: var(--ef-pos);
  border-radius: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--ef-energy, 0);
  transition: opacity 0.2s ease;
  background: linear-gradient(90deg, #3b1178 0%, #6d28d9 30%, #9333ea 62%, #c084fc 100%);
  z-index: 1;
}
.ef-slider .ef-energy::after { content: none; display: none; }

/* 星尘宿主：宽度=填充段，裁掉溢出；不跟星云淡入（否则会被压暗） */
.ef-slider .ef-stars {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  margin-top: 0;
  width: var(--ef-pos);
  border-radius: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
/* v0.9.52：星尘还原官方 .ces-star / .ces-star__dot ——
   不是原位呼吸闪烁，而是**整条宽度的轨道自己在向左连续横穿**，
   圆点在最右端出生、向左穿出；两端淡出发生在可视区之外，所以看起来「从不消失」。
   时长与负延迟写在元素上（官方实测：写进样式表时负相位在宿主里不生效）。 */
.ef-slider .ef-star {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  margin-top: -1.5px;
  pointer-events: none;
  animation-name: efStarSweep;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  /* v0.9.53 #2：越靠右越快。速度由 applySliderFx 通过 WAAPI 的 playbackRate 实时下发，
     这里不再写 animation-playback-rate（CSS 无此属性，会被整条忽略）。 */
}
.ef-slider .ef-star__dot {
  position: absolute;
  left: 100%;
  top: 0;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.85);
  transform: scale(var(--ef-b, 1));
}
/* 深色主题下官方用略偏紫的白点 + 紫色光晕，在紫星云上更清楚 */
[data-theme='glacier'] .ef-slider .ef-star__dot,
:root:not([data-theme='paper']) .ef-slider .ef-star__dot {
  background: #f5f3ff;
  box-shadow: 0 0 5px rgba(216, 180, 254, 0.95);
}
@keyframes efStarSweep {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { transform: translate3d(-100%, 0, 0); opacity: 0; }
}

/* v0.9.52：旋钮对齐官方 .ces-knob —— 28×28 的**正圆**（直径 = 轨高），
   圆心走 14px 内缩几何，因此 pct=1 时右缘正好落在轨道右端，不会再留一条缝。 */
.ef-slider .ef-thumb {
  position: absolute;
  top: 50%;
  left: var(--ef-pos);
  transition: left 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
  width: 28px;
  height: 28px;
  margin: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.34), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  z-index: 3;
}

/* 最高档不外扩描边、不给填充段加彩色光晕（旧版紫圈就是这里的锅） */
.ef-slider.ultra { outline: none; }
.ef-slider.ultra .ef-fill { filter: none; box-shadow: none; }
.ef-slider.ultra .ef-thumb { box-shadow: 0 1px 5px rgba(0, 0, 0, 0.34), 0 0 0 0.5px rgba(0, 0, 0, 0.06); }
.ef-slider.ultra .ef-track {
  box-shadow:
    inset 0 0 0 1px rgba(128, 128, 128, 0.10),
    0 0 calc(var(--ef-energy, 0) * 16px) rgba(168, 85, 247, 0.5);
}
.ef-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

/* 拖动 / 吸附 */
.ef-slider.dragging .ef-thumb { transition: none; cursor: grabbing; }
.ef-slider.dragging .ef-fill,
.ef-slider.dragging .ef-energy,
.ef-slider.dragging .ef-stars { transition: none !important; }
.ef-slider.snapping .ef-thumb { transition: left 160ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.ef-slider.snapping .ef-fill,
.ef-slider.snapping .ef-energy,
.ef-slider.snapping .ef-stars { transition: width 160ms cubic-bezier(0.2, 0.8, 0.2, 1); }

/* 数值气泡：悬浮在轨道上方的小标签（不是铺满轨道的条）。
   之前它的定位规则在历次清理中被删掉，退化成宽度 100% 的矩形块，
   正是用户看到的「拖动时蓝色条铺满、上沿变直角、下面露一条空白」。 */
.ef-slider .ef-bubble {
  position: absolute;
  bottom: calc(100% + 9px);
  left: var(--ef-pos);
  transform: translateX(-50%);
  min-width: 34px;
  padding: 4px 9px;
  height: auto;
  border-radius: 7px;
  background: var(--ef-color, #4d93f8);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.26), 0 2px 5px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 4;
}
.ef-slider .ef-bubble[hidden] { display: none; }
/* 小三角：指向下方旋钮 */
.ef-slider .ef-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ef-color, #4d93f8);
}

/* 刻度（档位小点，只在内部，不画白圈） */
.ef-slider .ef-tick { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ef-slider .ef-energy { transition: none; }
  .ef-slider .ef-stars { transition: none; }
  .ef-slider .ef-star { animation-duration: 6s !important; }
}

/* v0.9.48：侧栏品牌位换成正式 Logo（原「Q」文字标） */
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  background: #fff;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  user-select: none;
  -webkit-user-drag: none;
}

/* v0.9.48：个性化弹窗高度改成固定 92vh 并让内容区滚动 ——
   开屏缩略图改成完整 16:9 后内容变高，旧版 88vh + 面板不滚会截掉「预览」按钮 */
.pz-modal {
  height: 92vh;
  max-height: 92vh;
}
.pz-modal .settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}

/* v0.9.48：压缩主题/开屏两块的高度，让「预览」按钮完整落在可视区内 */
.pz-modal .tt-window { height: 92px; }
.pz-modal #splashGrid { grid-template-columns: repeat(auto-fit, 272px) !important; }
.pz-modal .pz-block { margin-bottom: 10px; }
.pz-modal .pz-grid { gap: 12px; }
.pz-modal .splash-meta small { line-height: 1.45; }


/* v0.9.49：档位标签重新做成三等分布 —— 低=左下、中=正下、高=右下。
   旧版用 left:calc(...) 绝对定位，容器一旦没有 position:relative 就全部挤到左边。 */
.ef-slider + .ef-labels,
.ef-labels {
  position: relative;
  /* 等宽三列：低贴左、中正好居中、高贴右（用 flex space-between 时中间那颗会偏） */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: baseline;
  width: 100%;
  margin: 6px 0 0;
  padding: 0 2px;
  height: auto;
}
.ef-labels b {
  position: static;
  left: auto;
  transform: none;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.2;
  /* v0.9.53 #2：跟着滑块逐帧点亮，短过渡只为消除锯齿，不再有滞后 */
  transition: color 80ms linear, opacity 80ms linear;
  will-change: color, opacity;
}
.ef-labels b.on { color: var(--text); font-weight: 750; }
.ef-labels b { text-align: center; }
.ef-labels b:first-child { text-align: left; }
.ef-labels b:last-child { text-align: right; }

/* 拖动/吸附时不做任何尺寸过渡，避免拖动过程中各层错位（下半截空、边角变形） */
.ef-slider.dragging .ef-fill,
.ef-slider.dragging .ef-energy,
.ef-slider.dragging .ef-stars {
  transition: none !important;
}

/* v0.9.54：右侧边栏的预览复用全屏预览那套分支，这里补几何 + 加载转圈。
   原先后两套各写各的，侧栏只认图片/HTML/文本，Word 与二进制只能落到空 <pre>。 */
.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  color: var(--muted);
}

.preview-loading p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: wsSpin 0.8s linear infinite;
}

#contextPanel .preview-stage {
  position: relative;
  overflow: hidden;
  height: min(58vh, 520px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

#contextPanel .preview-stage .preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
}

#contextPanel .preview-img {
  max-width: 100%;
  border-radius: 10px;
}

#contextPanel .preview-code {
  max-height: min(58vh, 520px);
  overflow: auto;
}

#contextPanel .preview-binary {
  min-height: 220px;
}

#contextPanel .preview-media video,
#contextPanel .preview-media audio {
  width: 100%;
}

/* v0.9.54：爱发电一级界面 —— Quorum 字标 + 爱发电二维码 */
.sp-bio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.sp-wordmark {
  font-family: "Segoe UI", -apple-system, "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(45, 20, 90, 0.3);
}

.sp-q {
  color: #ffd9a8;
}

.sp-tagline {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.78);
}

.sp-afdian {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.sp-afdian-box {
  width: 150px;
  height: 150px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(45, 20, 90, 0.12);
}

.sp-afdian-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sp-afdian-tip {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}
