/* BOX · VOICE CONSOLE — 深空对话台 */

:root {
  --bg: #05070c;
  --bg-soft: #080d15;
  --panel: rgba(8, 13, 22, 0.82);
  --panel-solid: #0a101a;
  --line: #182333;
  --line-bright: #26384f;
  --ink: #e8f4ff;
  --muted: #7f94a8;
  --faint: #4a5f73;
  --lime: #59e8ff;
  --lime-dim: rgba(89, 232, 255, 0.12);
  --amber: #f2a33c;
  --red: #ff6b5e;
  --cyan: #8b7dff;
  --violet: #8b7dff;
  --display: "Bahnschrift", "DIN Alternate", "Microsoft YaHei UI", sans-serif;
  --body: "Microsoft YaHei UI", "Segoe UI", "PingFang SC", sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --radius: 10px;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-window: 0 32px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  padding: 12px;
  background:
    radial-gradient(1000px 640px at 8% -12%, rgba(89, 232, 255, 0.11), transparent 60%),
    radial-gradient(900px 700px at 108% 108%, rgba(139, 125, 255, 0.1), transparent 58%),
    radial-gradient(760px 520px at 52% 42%, rgba(24, 92, 160, 0.09), transparent 72%),
    linear-gradient(180deg, #060910 0%, #04060b 100%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 200, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 255, 0.032) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }

/* 细滚动条，避免深色界面里出现系统粗条 */
* { scrollbar-width: thin; scrollbar-color: var(--line-bright) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #32485f; }

/* 实时回合气泡在回合结束后收起 */
.is-hidden { display: none !important; }

/* ---------- 应用骨架 ---------- */

.app {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(9, 14, 23, 0.94), rgba(5, 8, 14, 0.97));
  box-shadow: var(--shadow-window);
  transition: grid-template-columns 0.24s ease;
}

/* ---------- 左侧栏 ---------- */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 18px 14px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 16, 26, 0.86), rgba(7, 11, 18, 0.74));
  backdrop-filter: blur(14px);
}

.sidebar-top { display: grid; gap: 18px; }

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  color: var(--lime);
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: -0.02em;
  background: linear-gradient(145deg, rgba(89, 232, 255, 0.18), rgba(139, 125, 255, 0.1));
  box-shadow:
    inset 0 0 18px rgba(89, 232, 255, 0.16),
    0 0 24px rgba(89, 232, 255, 0.08);
}

.brand-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.32em;
  line-height: 1;
}

.brand-copy p {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(89, 232, 255, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(89, 232, 255, 0.18), rgba(139, 125, 255, 0.12));
  color: var(--lime);
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 0 26px rgba(89, 232, 255, 0.08);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.new-chat:hover { background: rgba(89, 232, 255, 0.2); border-color: rgba(89, 232, 255, 0.5); }

.side-nav { display: flex; flex-direction: column; gap: 3px; }

.side-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.side-item svg { flex: none; opacity: 0.78; }

.side-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--ink); }

.side-item.active {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.side-item.active svg { color: var(--lime); opacity: 1; }

.side-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--lime), var(--violet));
  box-shadow: 0 0 10px var(--lime);
}

.side-item em {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  color: var(--faint);
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* 桌面端侧栏收起：只留图标 */
@media (min-width: 641px) {
  .app.sidebar-collapsed { grid-template-columns: 68px minmax(0, 1fr); }

  .app.sidebar-collapsed .sidebar {
    align-items: center;
    padding: 18px 10px 16px;
  }

  .app.sidebar-collapsed .brand { padding: 4px 0; }

  .app.sidebar-collapsed .brand-copy,
  .app.sidebar-collapsed .new-chat span,
  .app.sidebar-collapsed .side-item span,
  .app.sidebar-collapsed .side-item em,
  .app.sidebar-collapsed .pill em { display: none; }

  .app.sidebar-collapsed .sidebar-top { width: 100%; gap: 14px; }

  .app.sidebar-collapsed .new-chat {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    padding: 0;
    border-radius: 10px;
  }

  .app.sidebar-collapsed .side-nav,
  .app.sidebar-collapsed .side-foot { width: 100%; }

  .app.sidebar-collapsed .side-item { justify-content: center; padding: 10px 0; }

  .app.sidebar-collapsed .side-foot { align-items: center; }

  .app.sidebar-collapsed .pill {
    width: 36px;
    height: 36px;
    justify-content: center;
    padding: 0;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.pill:hover { border-color: var(--line-bright); color: var(--ink); }

.pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.pill.online { color: var(--lime); border-color: rgba(89, 232, 255, 0.32); }
.pill.online i { background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: breathe 2.4s ease-in-out infinite; }
.pill.offline { color: var(--red); border-color: rgba(255, 107, 94, 0.34); }
.pill.offline i { background: var(--red); box-shadow: 0 0 10px var(--red); }

/* ---------- 中间会话区 ---------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 14, 23, 0.88), rgba(6, 10, 16, 0.72));
  backdrop-filter: blur(14px);
}

.chat-title { display: flex; align-items: center; gap: 10px; }

.chat-title h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.meta-item b { margin-left: 4px; color: var(--muted); font-weight: 400; }

.clock { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--faint); }

.phase {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 0.25s, border-color 0.25s;
}

.phase.listening { color: var(--amber); border-color: rgba(242, 163, 60, 0.45); }
.phase.thinking { color: var(--cyan); border-color: rgba(99, 213, 196, 0.4); }
.phase.speaking { color: var(--lime); border-color: rgba(89, 232, 255, 0.42); }
.phase.error { color: var(--red); border-color: rgba(255, 107, 94, 0.4); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.icon-btn:hover { color: var(--lime); border-color: var(--line-bright); }

.only-mobile { display: none; }

/* ---------- 消息流 ---------- */

.chat-flow {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 0 18px;
  scroll-behavior: smooth;
}

.chat-empty {
  width: min(680px, calc(100% - 48px));
  margin: 8vh auto 0;
  text-align: center;
  animation: rise 0.5s ease both;
}

.chat-empty-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border: 1px solid var(--line-bright);
  border-radius: 18px;
  color: var(--lime);
  font-family: var(--display);
  font-size: 24px;
  box-shadow: inset 0 0 26px rgba(89, 232, 255, 0.14);
}

.chat-empty h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.chat-empty p { margin: 0; font-size: 13px; color: var(--faint); }

.msg-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
}

.msg-list.live { margin-top: 22px; }

.msg {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: rise 0.3s ease both;
}

.msg.user { flex-direction: row-reverse; }

.msg-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--faint);
  font-family: var(--display);
  font-size: 12px;
}

.msg.user .msg-avatar { color: var(--ink); background: rgba(255, 255, 255, 0.06); }

.msg-avatar.accent {
  color: var(--lime);
  border-color: rgba(89, 232, 255, 0.28);
  box-shadow: inset 0 0 14px rgba(89, 232, 255, 0.12);
}

.msg-bubble {
  max-width: min(78%, 620px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(89, 232, 255, 0.045), rgba(8, 13, 22, 0.86));
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.msg.user .msg-bubble {
  border-color: rgba(89, 232, 255, 0.26);
  border-top-right-radius: 6px;
  background: linear-gradient(135deg, rgba(89, 232, 255, 0.12), rgba(139, 125, 255, 0.1));
}

.msg.assistant .msg-bubble { border-top-left-radius: 6px; }

.msg-bubble p { margin: 0; }

.tx-text.muted { color: var(--faint); }

.msg-bubble p:empty::after { content: "…"; color: var(--faint); }

/* ---------- 输入区 ---------- */

.composer {
  padding: 10px 26px 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.7), rgba(5, 8, 14, 0.92));
  backdrop-filter: blur(16px);
}

.timings {
  display: flex;
  align-items: baseline;
  gap: 18px;
  width: min(820px, 100%);
  margin: 0 auto 10px;
  font-family: var(--mono);
}

/* ---------- 思考过程（对话流内联折叠） ---------- */

.think-box {
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  overflow: hidden;
}

.think-box > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s, background 0.2s;
}

.think-box > summary::-webkit-details-marker { display: none; }

.think-box > summary:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }

.think-box > summary::after {
  content: "展开";
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.think-box[open] > summary::after { content: "收起"; }

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

.think-box.running .think-pulse {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: breathe 1.6s ease-in-out infinite;
}

.think-title { color: var(--muted); letter-spacing: 0.06em; }

.think-box.running .think-title { color: var(--cyan); }

.think-box > summary em {
  font-style: normal;
  font-size: 10px;
  color: var(--faint);
}

.think-body {
  padding: 0 10px 9px;
  border-top: 1px solid var(--line);
}

.think-reasoning {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  color: var(--muted);
}

.think-steps {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.think-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.18);
}

.think-step-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.think-step-head b { font-weight: 400; color: var(--cyan); }

.think-step-head em { font-style: normal; font-size: 10px; color: var(--faint); }

.think-step pre {
  margin: 5px 0 0;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 10px;
  line-height: 1.5;
  color: var(--faint);
}

.think-step-result { color: var(--muted) !important; }

.think-step.failed { border-color: rgba(255, 107, 94, 0.4); }

.think-step.failed b,
.think-step.failed em { color: var(--red); }

.timings div { display: flex; align-items: baseline; gap: 6px; }

/* 上下文额度条：80% 处画阈值线，超过后转为琥珀色。 */
.timings .ctx-meter { align-items: center; gap: 7px; min-width: 172px; cursor: pointer; }
.ctx-track {
  position: relative;
  width: 86px;
  height: 4px;
  background: var(--line);
}
.ctx-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  transition: width 0.25s ease;
}
.ctx-track b {
  position: absolute;
  top: -3px;
  left: 80%;
  width: 1px;
  height: 10px;
  background: var(--faint);
  opacity: 0.85;
}
.ctx-meter.warn .ctx-track i { background: var(--amber); }
.ctx-meter.warn #ctxText { color: var(--amber); }

/* 发送旁的额度按钮与内联编辑面板 */
.quota-btn { font-family: var(--mono); font-size: 11px; white-space: nowrap; }

.quota-editor {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: min(820px, 100%);
  margin: 0 auto 8px;
}

.quota-editor[hidden] { display: none; }

.quota-editor label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.quota-editor input {
  width: 96px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.timings em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.timings b { font-size: 11px; font-weight: 500; color: var(--lime); }

.composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(820px, 100%);
  margin: 0 auto;
}

.mic-btn {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(89, 232, 255, 0.12), transparent 58%),
    #080d0e;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.18s ease, border-color 0.3s, box-shadow 0.35s, color 0.25s;
}

.mic-btn:hover { border-color: rgba(89, 232, 255, 0.4); color: var(--ink); }
.mic-btn:active { transform: scale(0.96); }

.mic-btn canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.55;
}

.mic-icon { position: relative; z-index: 2; width: 18px; height: 18px; }

.mic-btn.listening {
  color: var(--amber);
  border-color: rgba(242, 163, 60, 0.55);
  box-shadow: 0 0 0 1px rgba(242, 163, 60, 0.12), 0 0 36px rgba(242, 163, 60, 0.22);
}

.mic-btn.speaking {
  color: var(--lime);
  border-color: rgba(89, 232, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(89, 232, 255, 0.12), 0 0 40px rgba(89, 232, 255, 0.2);
}

/* 唤醒命中：短促亮一下，配合提示音给出“听到了”的反馈 */
.mic-btn.wake-hit {
  color: var(--lime);
  border-color: rgba(89, 232, 255, 0.75);
  box-shadow: 0 0 0 2px rgba(89, 232, 255, 0.18), 0 0 46px rgba(89, 232, 255, 0.45);
  animation: wakeFlash 0.7s ease-out;
}

@keyframes wakeFlash {
  0% { transform: scale(1); }
  28% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* 常听：麦克风开着但还没进入回合，用一条青色细环区分 */
.mic-btn.wake {
  color: var(--cyan);
  border-color: rgba(99, 213, 196, 0.45);
  box-shadow: 0 0 0 1px rgba(99, 213, 196, 0.1), 0 0 26px rgba(99, 213, 196, 0.14);
}

.say-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 5px 5px 5px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.say-form:focus-within {
  border-color: rgba(89, 232, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(89, 232, 255, 0.06);
}

.say-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 0;
  border: none;
  background: none;
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  outline: none;
}

.say-form input::placeholder { color: var(--faint); }

.send-btn {
  flex: none;
  padding: 8px 18px;
  border: 1px solid rgba(89, 232, 255, 0.38);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(89, 232, 255, 0.2), rgba(139, 125, 255, 0.16));
  color: var(--lime);
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(89, 232, 255, 0.1);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.send-btn:hover { background: rgba(89, 232, 255, 0.18); border-color: rgba(89, 232, 255, 0.5); }

.composer-hint {
  width: min(820px, 100%);
  margin: 8px auto 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-align: center;
}

.btn {
  padding: 9px 16px;
  border: 1px solid rgba(89, 232, 255, 0.32);
  border-radius: 10px;
  background: rgba(89, 232, 255, 0.08);
  color: var(--lime);
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover { background: rgba(89, 232, 255, 0.14); border-color: rgba(89, 232, 255, 0.5); }

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

.btn.ghost:hover { color: var(--ink); border-color: var(--line-bright); background: rgba(255, 255, 255, 0.02); }

.btn.small { flex: none; padding: 8px 14px; }

/* 常听开关 */
.wake-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.wake-btn i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  transition: background 0.2s, box-shadow 0.2s;
}

.wake-btn.active {
  color: var(--lime);
  border-color: rgba(89, 232, 255, 0.42);
  background: rgba(89, 232, 255, 0.08);
}

.wake-btn.active i {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: breathe 2.4s ease-in-out infinite;
}

.wake-btn.loading { opacity: 0.72; cursor: progress; }

.phase.wake { color: var(--lime); border-color: rgba(89, 232, 255, 0.42); }

/* ---------- 右侧抽屉 ---------- */

.drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  width: min(412px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-lg);
  background: rgba(8, 12, 18, 0.97);
  backdrop-filter: blur(18px);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.03);
  transform: translateX(calc(100% + 16px));
  transition: transform 0.28s cubic-bezier(0.22, 0.68, 0.32, 1);
}

.drawer.open { transform: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-tabs { display: flex; gap: 4px; }

.drawer-tabs button {
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.drawer-tabs button:hover { color: var(--ink); }

.drawer-tabs button.active {
  color: var(--lime);
  border-color: rgba(89, 232, 255, 0.35);
  background: var(--lime-dim);
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 26px;
}

.drawer-panel { display: none; }

.drawer-panel.active { display: block; animation: rise 0.25s ease both; }

.drawer-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.hint { font-size: 11px; color: var(--faint); letter-spacing: 0.04em; }

.mono { font-family: var(--mono); }

/* ---------- 记忆 ---------- */

.mem-search { display: flex; gap: 8px; margin-bottom: 10px; }

.mem-search input,
.mem-write input,
.field input,
.field select {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-family: var(--body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mem-search input:focus,
.mem-write input:focus,
.field input:focus,
.field select:focus {
  border-color: rgba(89, 232, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(89, 232, 255, 0.06);
}

.mem-search input::placeholder,
.mem-write input::placeholder { color: var(--faint); }

.mem-modes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chip {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.chip:hover { color: var(--ink); border-color: var(--line-bright); }

.chip.active {
  color: var(--lime);
  border-color: rgba(89, 232, 255, 0.4);
  background: var(--lime-dim);
}

.mem-modes .divider { width: 1px; height: 16px; margin: 0 4px; background: var(--line); }

.mem-list {
  display: grid;
  gap: 1px;
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.mem-group {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 12px;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.mem-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 74px;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel-solid);
  animation: rise 0.35s ease both;
  transition: background 0.2s ease;
}

.mem-item:hover { background: #0d1622; }

.mem-item .rank {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  padding-top: 2px;
}

.mem-item .body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mem-item .meta {
  display: flex;
  gap: 10px;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.mem-item .meta .kind { color: var(--cyan); opacity: 0.75; }

.mem-score { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

.mem-score b { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--lime); }

.score-track { width: 64px; height: 2px; background: var(--line); }

.score-track i { display: block; height: 100%; background: var(--lime); opacity: 0.75; }

.mem-write { display: flex; gap: 8px; margin-top: 12px; }

.empty {
  margin: 0;
  padding: 18px 12px;
  background: var(--panel-solid);
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.mem-list .empty, .timeline .empty { border: none; }

/* ---------- 时间线 ---------- */

.timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 12px;
  padding-left: 14px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 1px;
  background: linear-gradient(180deg, var(--line-bright), transparent);
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 12px;
  padding: 8px 0 8px 10px;
  animation: rise 0.3s ease both;
}

.tl-item::before {
  content: "";
  position: absolute;
  top: 15px;
  left: -13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-bright);
}

.tl-item.user::before { background: var(--amber); box-shadow: 0 0 8px rgba(242, 163, 60, 0.5); }
.tl-item.assistant::before { background: var(--lime); box-shadow: 0 0 8px rgba(89, 232, 255, 0.5); }

.tl-meta {
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.tl-meta b { display: block; color: var(--muted); font-weight: 400; }

.tl-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  word-break: break-word;
}

.tl-item.assistant .tl-text { color: var(--ink); }

/* ---------- 浮层 ---------- */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  padding: 10px 16px;
  border: 1px solid var(--line-bright);
  border-left: 2px solid var(--lime);
  border-radius: var(--radius);
  background: rgba(10, 15, 16, 0.96);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-left-color: var(--red); }

/* ---------- 设置视图 ---------- */

.settings-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  padding: 32px;
  overflow-y: auto;
  background: rgba(3, 5, 6, 0.86);
  backdrop-filter: blur(10px);
}

.settings-view.open { display: block; }

.settings-shell {
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  min-height: min(720px, calc(100vh - 64px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.7);
  animation: rise 0.3s cubic-bezier(0.22, 0.68, 0.32, 1) both;
}

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

.settings-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--lime);
}

.settings-top h2 { margin: 5px 0 4px; font-family: var(--display); font-size: 20px; letter-spacing: 0.12em; }

.settings-top p { margin: 0; font-size: 11px; color: var(--faint); }

/* ---------- 技能库 / 技能商店 ---------- */

.skill-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
}

.skill-tabs button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.skill-tabs button.active {
  color: var(--lime);
  border-color: rgba(154, 255, 79, 0.5);
  background: rgba(154, 255, 79, 0.08);
}

.skill-tip {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
}

.skill-scroll {
  flex: 1;
  min-height: 0;
  padding: 20px 26px 28px;
  overflow-y: auto;
}

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

.skill-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-card:hover {
  border-color: var(--line-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.skill-card.disabled { opacity: 0.6; }

.skill-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.skill-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.skill-badges { display: flex; flex-wrap: wrap; gap: 5px; }

.skill-badge {
  padding: 2px 6px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
}

.skill-badge.kind { color: var(--cyan); border-color: rgba(89, 232, 255, 0.3); }
.skill-badge.on { color: var(--lime); border-color: rgba(154, 255, 79, 0.35); }

.skill-card > p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.skill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
}

.skill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.skill-doc {
  margin: 0;
  max-height: 220px;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.settings-body {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.settings-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.settings-nav button span { font-family: var(--mono); font-size: 9px; color: var(--faint); }

.settings-nav button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.02); }

.settings-nav button.active {
  color: var(--lime);
  border-color: rgba(89, 232, 255, 0.25);
  background: var(--lime-dim);
}

.settings-nav button.active span { color: var(--lime); }

.settings-content { padding: 24px 26px; overflow-y: auto; max-height: calc(100vh - 250px); }

.settings-panel { display: none; }

.settings-panel.active { display: block; animation: rise 0.25s ease both; }

.settings-panel h3 { margin: 0 0 18px; font-family: var(--display); font-size: 15px; letter-spacing: 0.14em; }
.settings-panel h3.sub { margin: 26px 0 16px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; opacity: 0.86; }
.voice-advanced { margin: 6px 0 18px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.voice-advanced summary { cursor: pointer; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.voice-advanced[open] summary { margin-bottom: 12px; }

.field {
  display: block;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.field input,
.field select { display: block; width: 100%; margin-top: 6px; }

.field .model-custom { margin-top: 8px; }

/* 原生 select 在 WebView2 里弹层不可控，设置页统一换成页内下拉 */
.combo { position: relative; display: block; margin-top: 6px; }

.combo > select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.combo-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-family: var(--body);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.combo-trigger:hover { border-color: var(--line-bright); }

.combo.open .combo-trigger {
  border-color: rgba(89, 232, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(89, 232, 255, 0.06);
}

.combo-caret { color: var(--faint); font-size: 10px; }

.combo-menu {
  position: fixed;
  z-index: 90;
  display: none;
  max-height: 220px;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: #0b1112;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.combo.open .combo-menu { display: block; }

.combo-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.combo-option:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); }

.combo-option.active { background: var(--lime-dim); color: var(--lime); }

.field-hint { margin: 10px 0 0; font-size: 11px; line-height: 1.7; color: var(--faint); }

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.kv em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.kv b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
}

.settings-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--faint);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}

.switch-row input { display: none; }

.switch-row span {
  position: relative;
  flex: none;
  width: 34px;
  height: 18px;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.2s, border-color 0.2s;
}

.switch-row span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--faint);
  transition: transform 0.2s, background 0.2s;
}

.switch-row input:checked + span {
  border-color: rgba(89, 232, 255, 0.45);
  background: var(--lime-dim);
}

.switch-row input:checked + span::after { transform: translateX(16px); background: var(--lime); }

.switch-row input:disabled + span { opacity: 0.5; }

.swatches { display: flex; gap: 10px; margin-top: 8px; }

.swatch {
  position: relative;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.swatch::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: currentColor;
}

.swatch.lime { color: #b8f25f; }
.swatch.amber { color: #f2a33c; }
.swatch.cyan { color: #63d5c4; }

.swatch.active { border-color: currentColor; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05); }

.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
}

.settings-foot-right { display: flex; gap: 10px; }

.settings-foot .btn { flex: none; min-width: 96px; }

/* 主题覆盖：强调色、动效与网格 */
body[data-accent="amber"] {
  --lime: #f2a33c;
  --lime-dim: rgba(242, 163, 60, 0.14);
}

body[data-accent="cyan"] {
  --lime: #63d5c4;
  --lime-dim: rgba(99, 213, 196, 0.14);
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}

body.no-grid::before { display: none; }

/* ---------- 动效 ---------- */

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

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

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

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  body { padding: 8px; }
  .app {
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    border-radius: 20px;
  }
  .drawer { top: 8px; right: 8px; bottom: 8px; }
  .chat-meta { gap: 10px; }
  .chat-meta .meta-item:nth-child(n + 3) { display: none; }
  .clock { display: none; }
  .composer { padding: 10px 16px 12px; }
  .msg-list { width: calc(100% - 32px); }
}

@media (max-width: 640px) {
  body { padding: 0; }

  .app {
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

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

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 36;
    width: 264px;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    background: rgba(8, 12, 18, 0.98);
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.22, 0.68, 0.32, 1);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open { transform: none; }

  .drawer {
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    border: 0;
    border-radius: 0;
  }

  .settings-view { padding: 12px; }
  .settings-shell {
    min-height: calc(100dvh - 24px);
    border-radius: 16px;
  }

  .only-mobile { display: grid; }

  .chat-head { padding: 10px 16px; }
  .chat-meta { gap: 10px; }
  .chat-meta .meta-item:nth-child(n + 3) { display: none; }
  .clock { display: none; }
  .composer { padding: 10px 14px 12px; }
  .chat-flow { padding: 18px 0 12px; }
  .msg-list { width: calc(100% - 28px); }
  .chat-empty { width: calc(100% - 40px); margin-top: 6vh; }
  .timings { gap: 12px; flex-wrap: wrap; }
  .composer-hint { display: none; }
}

@media (max-width: 560px) {
  .msg-bubble { max-width: 84%; }
  .timings div:nth-child(n + 3) { display: none; }
  .say-form { padding-left: 12px; }
  .send-btn { padding: 8px 13px; }
  .icon-btn { width: 30px; height: 30px; }
  .drawer { width: 100vw; }
}

/* ---------- 高风险操作审批 ---------- */

.approval-card {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 60;
  width: min(420px, calc(100vw - 40px));
  padding: 14px 16px 12px;
  border: 1px solid rgba(89, 232, 255, 0.35);
  border-radius: 18px;
  background: rgba(10, 16, 26, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(89, 232, 255, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  backdrop-filter: blur(12px);
}

.approval-card.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.approval-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--lime);
}

.approval-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  animation: breathe 1.6s ease-in-out infinite;
}

.approval-summary {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
}

.approval-target {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

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

.approval-actions button {
  height: 30px;
  padding: 0 16px;
  border: 1px solid var(--line-bright);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.approval-actions button:hover {
  color: var(--ink);
}

.approval-actions .approval-allow {
  color: var(--lime);
  border-color: rgba(89, 232, 255, 0.5);
  background: rgba(89, 232, 255, 0.1);
}

.approval-actions .approval-allow:hover {
  background: rgba(89, 232, 255, 0.18);
}

.approval-actions .approval-deny:hover {
  color: var(--red);
  border-color: rgba(255, 107, 94, 0.5);
}

.approval-actions button:disabled {
  opacity: 0.5;
  cursor: default;
}

.approval-hint {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  text-align: right;
}

/* ---------- 导航视图 ---------- */

.nav-shell { max-width: 940px; }

.nav-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 26px;
  overflow-y: auto;
}

.nav-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.nav-search input {
  flex: 1 1 200px;
  min-width: 180px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 14, 24, 0.9);
  color: var(--ink);
  font: inherit;
}

.nav-search input:focus {
  outline: none;
  border-color: rgba(89, 232, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(89, 232, 255, 0.1);
}

.nav-modes { display: flex; gap: 6px; }

.nav-status { margin: 0; color: var(--muted); font-size: 13px; }

.nav-now {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(89, 232, 255, 0.28);
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(89, 232, 255, 0.08), rgba(139, 125, 255, 0.06));
}

.nav-now-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.nav-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

.nav-now-main strong {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.nav-now-main p { margin: 0; color: var(--muted); font-size: 12.5px; }
.nav-now-main b { color: var(--ink); font-weight: 600; }
.nav-dot { margin: 0 6px; color: var(--faint); }

.nav-now-side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.nav-provider { font-size: 11px; color: var(--muted); }

.nav-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.nav-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--violet));
  transition: width 0.35s ease;
}

.nav-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 13px;
}

.nav-steps li.active {
  border-color: rgba(89, 232, 255, 0.5);
  background: rgba(89, 232, 255, 0.08);
  color: var(--ink);
}

.nav-steps li.done { opacity: 0.45; }

.nav-steps .n {
  min-width: 18px;
  padding-top: 2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.nav-steps li.active .n { color: var(--lime); }
.nav-steps .ins { flex: 1; }
.nav-steps .dist { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.nav-steps li.active .dist { color: var(--muted); }

@media (max-width: 720px) {
  .nav-now { flex-direction: column; }
  .nav-now-side { flex-direction: row; justify-content: space-between; width: 100%; }
}

/* ---------- 账号登录 ---------- */

.login-view {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 5, 6, 0.9);
  backdrop-filter: blur(12px);
}

.login-view.open { display: flex; }

.login-card {
  width: min(420px, 100%);
  padding: 28px 26px 24px;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}

.login-card h2 {
  margin: 6px 0 6px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
}

.login-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.login-card .field { margin-bottom: 12px; }

.login-error {
  margin: 4px 0 10px;
  color: var(--red);
  font-size: 12.5px;
  word-break: break-word;
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
