/* ==========================================================================
   元认知工作台 · 视觉样式
   深色、克制、留白优先。Agent A = 青绿，Agent B = 琥珀。
   动态内容一律由 JS 以 textContent/DOM API 注入，本文件只负责表现。
   ========================================================================== */

:root {
  --bg: #0b0f14;
  --surface: #121821;
  --surface-2: #1a2230;
  --surface-3: #202a39;
  --text: #e8eef7;
  --muted: #94a3b8;
  --faint: #64748b;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.26);
  --accent: #6ee7c7;
  --accent-soft: rgba(110, 231, 199, 0.11);
  --accent-line: rgba(110, 231, 199, 0.32);
  --amber: #f5c26b;
  --amber-soft: rgba(245, 194, 107, 0.1);
  --amber-line: rgba(245, 194, 107, 0.3);
  --danger: #f87171;
  --radius: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  --header-h: 106px;
  --footer-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(920px 520px at 6% -12%, rgba(110, 231, 199, 0.075), transparent 62%),
    radial-gradient(760px 460px at 102% -4%, rgba(245, 194, 107, 0.05), transparent 62%),
    linear-gradient(180deg, #0b0f14 0%, #0a0e13 60%, #0b0f14 100%);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* V5.5.1 · 首屏防旧界面闪烁：JS 初始化完成前，整页先由遮罩接管。 */
#app {
  opacity: 0;
  visibility: hidden;
}

body.app-ready #app {
  opacity: 1;
  visibility: visible;
}

body:not(.app-ready) {
  overflow: hidden;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #d9efe8;
  background:
    radial-gradient(560px 360px at 50% 38%, rgba(110, 231, 199, 0.06), transparent 68%),
    linear-gradient(180deg, #0b0f14 0%, #0a0e13 60%, #0b0f14 100%);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.app-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loading-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 2px;
}

.app-loading-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(110, 231, 199, 0.18);
  border-top-color: rgba(110, 231, 199, 0.9);
  border-radius: 50%;
  animation: app-loading-spin 900ms linear infinite;
}

.app-loading-core {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #9cf3d9;
  font-family: var(--font-serif, "Songti SC", "STSong", serif);
  font-size: 15px;
  border: 1px solid rgba(110, 231, 199, 0.2);
  border-radius: 50%;
  background: rgba(8, 18, 18, 0.55);
}

.app-loading-title {
  margin: 0;
  color: #d9efe8;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.app-loading-meta {
  margin: 0;
  color: #5d716f;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

@keyframes app-loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading-ring { animation: none; }
  .app-loading { transition: none; }
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(110, 231, 199, 0.72);
  outline-offset: 2px;
}

::selection {
  color: #06231d;
  background: var(--accent);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.38);
  background-clip: padding-box;
}

/* ==========================================================================
   顶部：品牌 / 操作 / API 设置
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 19, 0.86);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 60px;
  padding: 10px clamp(16px, 2.6vw, 34px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  user-select: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 199, 0.18);
  border-radius: 11px;
  background: rgba(110, 231, 199, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  overflow: hidden;
  color: #eef5ff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.brand-meta {
  color: #5c6d80;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.17em;
  white-space: nowrap;
}

.demo-badge {
  margin-left: 4px;
  padding: 3px 6px;
  color: var(--amber);
  border: 1px solid var(--amber-line);
  border-radius: 5px;
  background: var(--amber-soft);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.11em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  color: #aab8c9;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 11.5px;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.top-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.top-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.06);
}

.top-btn-report {
  color: #c4f9eb;
  border-color: rgba(110, 231, 199, 0.2);
  background: rgba(110, 231, 199, 0.055);
}

.top-btn-report:hover {
  color: #e8fff8;
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.top-btn-quiet {
  color: #718295;
}

.top-btn-quiet:hover {
  color: #aab8c9;
}

.api-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 22px;
  flex-wrap: wrap;
  min-height: 44px;
  padding: 6px clamp(16px, 2.6vw, 34px);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(7, 11, 16, 0.42);
}

.api-credentials,
.api-model {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.api-credentials {
  flex: 1 1 520px;
  flex-wrap: wrap;
}

.api-model {
  flex: 0 1 auto;
}

.api-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 2px;
  color: #75879b;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.api-title svg {
  width: 13px;
  height: 13px;
  opacity: 0.9;
}

.key-input,
.model-input {
  height: 28px;
  min-width: 0;
  padding: 0 9px;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.17);
  border-radius: 7px;
  background: rgba(5, 9, 14, 0.45);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.015em;
  transition: border-color 160ms ease, background 160ms ease;
}

.key-input {
  flex: 0 1 260px;
  width: 260px;
}

.model-input {
  width: 208px;
  color: #94a3b8;
}

.key-input::placeholder {
  color: #5f7185;
}

.key-input:hover,
.model-input:hover {
  border-color: rgba(148, 163, 184, 0.28);
}

.key-input:focus,
.model-input:focus {
  outline: none;
  border-color: rgba(245, 194, 107, 0.46);
  background: rgba(5, 9, 14, 0.68);
}

.mini-btn {
  height: 28px;
  padding: 0 9px;
  color: #93a3b6;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  background: transparent;
  font-size: 10.5px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mini-btn:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.06);
}

.mini-btn-solid {
  color: #d9fff6;
  border-color: rgba(110, 231, 199, 0.24);
  background: rgba(110, 231, 199, 0.09);
}

.mini-btn-solid:hover {
  color: #effffb;
  border-color: rgba(110, 231, 199, 0.42);
  background: rgba(110, 231, 199, 0.15);
}

.key-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6e8094;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.key-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4b5b6d;
}

.key-status.is-saved {
  color: #9db7ad;
}

.key-status.is-saved::before {
  background: var(--accent);
  box-shadow: 0 0 7px rgba(110, 231, 199, 0.55);
}

.model-label {
  color: #56677a;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
}

.local-note {
  padding-left: 9px;
  color: #516173;
  border-left: 1px solid rgba(148, 163, 184, 0.13);
  font-size: 9px;
  white-space: nowrap;
}

/* ==========================================================================
   Onboarding
   ========================================================================== */

.onboarding-view {
  padding: clamp(34px, 6vh, 62px) clamp(20px, 4vw, 36px) 122px;
}

.onboarding-inner {
  max-width: 980px;
  margin: 0 auto;
}

.hero {
  max-width: 780px;
  animation: hero-in 520ms cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #6f8396;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.19em;
}

.eyebrow-rule {
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), rgba(110, 231, 199, 0.06));
}

.hero h1 {
  margin: 16px 0 18px;
  color: #f2f7fd;
  font-size: clamp(36px, 4.6vw, 58px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.hero-accent {
  color: var(--accent);
  font-weight: 500;
  text-shadow: 0 0 46px rgba(110, 231, 199, 0.14);
}

.hero-sub {
  max-width: 610px;
  margin: 0;
  color: #92a2b4;
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.005em;
}

.hero-aside {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0 0;
  color: #5f7185;
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.hero-aside span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.72;
}

.bubble-groups {
  margin-top: clamp(28px, 4.6vh, 44px);
  border-top: 1px solid var(--line);
}

.bubble-group {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.group-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 5px;
}

.group-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5e7185;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
}

.group-kicker::after {
  content: "";
  width: 18px;
  height: 1px;
  background: rgba(148, 163, 184, 0.15);
}

.group-title {
  margin: 0;
  color: #d9e3ef;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.group-rule {
  color: #5d6d7f;
  font-size: 10px;
}

.bubble-set {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 1px;
}

.bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 37px;
  padding: 8px 16px;
  color: #b7c5d5;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent),
    rgba(18, 24, 33, 0.78);
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0.005em;
  cursor: pointer;
  transform: translateY(0);
  transition:
    color 170ms ease,
    border-color 170ms ease,
    background 170ms ease,
    transform 170ms ease,
    box-shadow 170ms ease;
  animation: bubble-in 380ms cubic-bezier(0.22, 0.8, 0.24, 1) both;
  animation-delay: var(--bubble-delay, 0ms);
}

.bubble::after {
  content: "";
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 170ms ease, transform 170ms ease;
}

.bubble:hover {
  color: #eaf2fb;
  border-color: rgba(110, 231, 199, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), transparent),
    rgba(26, 34, 48, 0.92);
  transform: translateY(-1px);
}

.bubble:active {
  transform: translateY(0);
}

.bubble[aria-pressed="true"] {
  color: #e6fff9;
  border-color: var(--accent-line);
  background:
    linear-gradient(180deg, rgba(110, 231, 199, 0.1), rgba(110, 231, 199, 0.045)),
    rgba(17, 31, 32, 0.88);
  box-shadow:
    inset 0 0 0 1px rgba(110, 231, 199, 0.055),
    0 6px 24px rgba(0, 0, 0, 0.16);
}

.bubble[aria-pressed="true"]::after {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 8px rgba(110, 231, 199, 0.55);
}

.bubble[data-group="ai"][aria-pressed="true"] {
  color: #fff2d9;
  border-color: var(--amber-line);
  background:
    linear-gradient(180deg, rgba(245, 194, 107, 0.085), rgba(245, 194, 107, 0.035)),
    rgba(28, 26, 21, 0.88);
}

.bubble[data-group="ai"]::after {
  background: var(--amber);
}

.bubble[data-group="ai"][aria-pressed="true"]::after {
  box-shadow: 0 0 8px rgba(245, 194, 107, 0.5);
}

.onboarding-actions {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(980px, calc(100vw - 32px));
  padding: 12px 14px 12px 20px;
  border: 1px solid rgba(148, 163, 184, 0.19);
  border-radius: 15px;
  background: rgba(14, 19, 27, 0.9);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  transform: translateX(-50%);
}

.selection-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.selection-hint {
  color: #c4d1df;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.selection-sub {
  color: #5d6e81;
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 17px;
  color: #06221c;
  border: 1px solid rgba(110, 231, 199, 0.7);
  border-radius: 10px;
  background: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-btn svg {
  width: 16px;
  height: 16px;
}

.primary-btn:hover:not(:disabled) {
  background: #8bf3da;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(110, 231, 199, 0.16);
}

.primary-btn:disabled {
  color: #687b8e;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.08);
  cursor: not-allowed;
  box-shadow: none;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 22px 0 0;
  color: #526275;
  font-size: 9.5px;
  letter-spacing: 0.025em;
}

.privacy-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #526275;
}

/* ==========================================================================
   Workspace 骨架
   ========================================================================== */

.workspace-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100dvh - var(--header-h));
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px clamp(14px, 2.2vw, 28px) 18px;
  /* V5.5.1 · 不在遮罩层下启动 view-in，避免首屏露出半透明内容。 */
  animation: none;
}

body:not(.is-onboarding) .workspace-view {
  height: calc(100dvh - var(--header-h) - var(--footer-h));
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 40px;
}

.room-switcher {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1 1 auto;
}

.section-label {
  flex: 0 0 auto;
  color: #56687c;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
}

.room-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.room-tabs::-webkit-scrollbar {
  display: none;
}

.room-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 33px;
  padding: 0 11px;
  color: #8b9caf;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.room-tab::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  transition: opacity 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.room-tab:hover {
  color: #d6e1ed;
  background: rgba(148, 163, 184, 0.05);
}

.room-tab.is-active {
  color: #e9f1fa;
  border-color: var(--line);
  background: rgba(26, 34, 48, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.room-tab.is-active::before {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 8px rgba(110, 231, 199, 0.46);
}

.room-tab.is-lie.is-active::before {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245, 194, 107, 0.5);
}

.workspace-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  color: #8798ab;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 999px;
  background: rgba(18, 24, 33, 0.5);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mode-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

.mode-badge.is-lie {
  color: var(--amber);
  border-color: var(--amber-line);
  background: var(--amber-soft);
}

.mode-badge.is-lie::before {
  background: var(--amber);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.lie-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  color: #899bad;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: transparent;
  font-size: 10.5px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.lie-btn svg {
  width: 14px;
  height: 14px;
}

.lie-btn:hover {
  color: #d9e3ee;
  border-color: rgba(148, 163, 184, 0.27);
  background: rgba(148, 163, 184, 0.05);
}

.lie-btn.is-on {
  color: var(--amber);
  border-color: var(--amber-line);
  background: var(--amber-soft);
}

.lie-btn.is-on:hover {
  color: #ffe4b0;
  background: rgba(245, 194, 107, 0.15);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
}

/* ==========================================================================
   Agent A · Chat panel
   ========================================================================== */

.chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 18px;
  background:
    radial-gradient(700px 320px at 40% -16%, rgba(110, 231, 199, 0.045), transparent 70%),
    linear-gradient(180deg, rgba(20, 27, 37, 0.92), rgba(15, 21, 29, 0.96));
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.chat-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  width: 118px;
  height: 1px;
  background: linear-gradient(90deg, rgba(110, 231, 199, 0.7), transparent);
  pointer-events: none;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 25, 34, 0.42);
}

.room-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.agent-a-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 199, 0.18);
  border-radius: 9px;
  background: rgba(110, 231, 199, 0.065);
}

.agent-a-mark span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.room-title-wrap {
  min-width: 0;
}

.room-title-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.room-title-line h2 {
  overflow: hidden;
  margin: 0;
  color: #edf4fd;
  font-size: 14.5px;
  font-weight: 550;
  letter-spacing: 0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-domain {
  overflow: hidden;
  color: #5f7185;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-sub {
  overflow: hidden;
  margin: 2px 0 0;
  color: #5e7084;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-sep {
  padding: 0 3px;
  opacity: 0.5;
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: #6d7f92;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

.chat-status.is-loading .status-dot {
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.chat-status.is-error {
  color: #c99696;
}

.chat-status.is-error .status-dot {
  background: var(--danger);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 17px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px clamp(16px, 2.4vw, 28px) 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.msg {
  display: flex;
  gap: 9px;
  width: auto;
  max-width: 89%;
  animation: message-in 240ms ease both;
}

.msg-assistant {
  align-self: flex-start;
}

.msg-user {
  align-self: flex-end;
  max-width: 79%;
}

.msg-avatar {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  margin-top: 19px;
  color: #8edecb;
  border: 1px solid rgba(110, 231, 199, 0.14);
  border-radius: 8px;
  background: rgba(110, 231, 199, 0.045);
  font-family: var(--font-mono);
  font-size: 9px;
  user-select: none;
}

.msg-content {
  min-width: 0;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 5px 2px;
  color: #5c6e81;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.msg-user .msg-meta {
  justify-content: flex-end;
  margin-right: 2px;
}

.msg-role {
  color: #788ba0;
  letter-spacing: 0.08em;
}

.msg-role-user {
  color: #8ba6a0;
}

.msg-time {
  color: #4d5d70;
}

.msg-bubble {
  padding: 12px 15px;
  color: #d7e2ef;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 4px 13px 13px;
  background: rgba(26, 34, 48, 0.72);
  font-size: 13.5px;
  line-height: 1.78;
  letter-spacing: 0.004em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg-user .msg-bubble {
  color: #e6fff9;
  border-color: rgba(110, 231, 199, 0.22);
  border-radius: 13px 4px 13px 13px;
  background:
    linear-gradient(180deg, rgba(110, 231, 199, 0.105), rgba(110, 231, 199, 0.055)),
    rgba(18, 33, 34, 0.8);
}

.msg-error .msg-bubble {
  color: #f0b7b7;
  border-color: rgba(248, 113, 113, 0.22);
  background: rgba(248, 113, 113, 0.06);
}

.msg-note {
  color: #6f8195;
  font-size: 10.5px;
}

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 12px 15px;
  color: #75889c;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 4px 13px 13px;
  background: rgba(26, 34, 48, 0.58);
  font-size: 10.5px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 10px;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.32;
  animation: typing 1.25s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 150ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 300ms;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1;
  min-height: 180px;
  color: #5d6f83;
  text-align: center;
}

.chat-empty-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #6e8499;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(148, 163, 184, 0.035);
}

.chat-empty-mark svg {
  width: 19px;
  height: 19px;
}

.chat-empty-title {
  color: #8497ab;
  font-size: 12.5px;
}

.chat-empty-sub {
  max-width: 290px;
  font-size: 10.5px;
  line-height: 1.75;
}

.api-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0 18px 7px;
  padding: 9px 10px;
  color: #f2baba;
  border: 1px solid rgba(248, 113, 113, 0.22);
  border-radius: 9px;
  background: rgba(248, 113, 113, 0.055);
  font-size: 10.5px;
  line-height: 1.55;
  animation: message-in 200ms ease both;
}

.api-error > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 1px;
}

.api-error span {
  flex: 1;
  min-width: 0;
}

.error-dismiss {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 0;
  color: #c58f8f;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.error-dismiss:hover {
  color: #ffdede;
  background: rgba(248, 113, 113, 0.1);
}

.composer {
  flex: 0 0 auto;
  padding: 8px 16px 13px;
  background: linear-gradient(180deg, transparent, rgba(12, 17, 24, 0.52) 35%);
}

.composer-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 9px 7px 13px;
  border: 1px solid rgba(148, 163, 184, 0.19);
  border-radius: 12px;
  background: rgba(7, 11, 16, 0.48);
  transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.composer-box:focus-within {
  border-color: rgba(110, 231, 199, 0.36);
  background: rgba(7, 11, 16, 0.66);
  box-shadow: 0 0 0 3px rgba(110, 231, 199, 0.045);
}

.composer-box.is-disabled {
  opacity: 0.72;
}

#chatInput {
  display: block;
  width: 100%;
  min-height: 24px;
  max-height: 144px;
  padding: 2px 0;
  overflow-y: auto;
  color: #e0e9f4;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.65;
  resize: none;
}

#chatInput::placeholder {
  color: #5b6d81;
}

#chatInput:disabled {
  cursor: not-allowed;
}

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

.composer-hint {
  color: #536477;
  font-size: 9.5px;
  letter-spacing: 0.015em;
}

.composer-hint.is-loading {
  color: #7fae9f;
}

.send-btn {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  padding: 0;
  color: #06221c;
  border: 1px solid rgba(110, 231, 199, 0.55);
  border-radius: 8px;
  background: var(--accent);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.send-btn svg {
  width: 17px;
  height: 17px;
}

.send-btn:hover:not(:disabled) {
  background: #8bf3da;
  transform: translateY(-1px);
}

.send-btn:disabled {
  color: #5f7285;
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(148, 163, 184, 0.08);
  cursor: not-allowed;
  transform: none;
}

.composer-foot {
  margin: 7px 2px 0;
  color: #4e6072;
  font-size: 9px;
  letter-spacing: 0.015em;
  text-align: center;
}

/* ==========================================================================
   Agent B · Sidebar
   ========================================================================== */

.b-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(440px 250px at 90% -16%, rgba(245, 194, 107, 0.055), transparent 68%),
    linear-gradient(180deg, rgba(22, 26, 34, 0.92), rgba(16, 21, 29, 0.96));
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.b-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 194, 107, 0.68), transparent);
  pointer-events: none;
}

.b-panel.is-lie {
  border-color: rgba(245, 194, 107, 0.19);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.22),
    inset 0 0 80px rgba(245, 194, 107, 0.025);
}

.b-header {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(28, 27, 27, 0.32);
}

.agent-b-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  color: var(--amber);
  border: 1px solid rgba(245, 194, 107, 0.18);
  border-radius: 9px;
  background: rgba(245, 194, 107, 0.06);
}

.agent-b-mark svg {
  width: 20px;
  height: 20px;
}

.b-title-wrap {
  min-width: 0;
}

.b-title-wrap h2 {
  margin: 0;
  color: #f0f4f9;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.055em;
}

.b-title-wrap p {
  overflow: hidden;
  margin: 1px 0 0;
  color: #5f7185;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.b-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 3px 7px;
  color: #8b9dae;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.035);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.b-status::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #627487;
}

.b-status.is-active {
  color: var(--amber);
  border-color: var(--amber-line);
  background: var(--amber-soft);
}

.b-status.is-active::before {
  background: var(--amber);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.score-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  flex: 0 0 auto;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(245, 194, 107, 0.035), transparent 80%);
}

.score-block {
  min-width: 0;
}

.score-block-right {
  padding-left: 13px;
  border-left: 1px solid rgba(148, 163, 184, 0.1);
}

.score-label {
  display: block;
  margin-bottom: 5px;
  color: #6a7c8f;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.points-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  line-height: 1;
}

#pointsValue {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.points-unit {
  color: #7b8c9f;
  font-size: 9px;
}

.catch-line {
  overflow: hidden;
  margin: 5px 0 0;
  color: #c6d2e0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catch-line.is-empty {
  color: #64768a;
}

.b-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px 16px 7px;
  color: #677a8e;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.feed-scope {
  color: #4f6073;
  letter-spacing: 0.03em;
}

.b-feed {
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1 1 auto;
  min-height: 80px;
  padding: 1px 16px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.b-feed-empty {
  padding: 10px 0;
  color: #5b6d80;
  font-size: 10.5px;
  line-height: 1.75;
}

.b-note {
  padding: 1px 0 1px 11px;
  border-left: 1px solid rgba(245, 194, 107, 0.25);
  animation: note-in 240ms ease both;
}

.b-note-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aa8b55;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.075em;
  line-height: 1.5;
}

.b-note-head::before {
  content: "";
  width: 3px;
  height: 3px;
  flex: 0 0 3px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.8;
}

.b-note-text {
  margin: 3px 0 0;
  color: #c0ccda;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.004em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.b-note.is-muted {
  border-left-color: rgba(148, 163, 184, 0.14);
}

.b-note.is-muted .b-note-head {
  color: #64768a;
}

.b-note.is-muted .b-note-head::before {
  background: #5f7185;
}

.b-note.is-muted .b-note-text {
  color: #8b9caf;
}

.b-note.is-strong {
  border-left-color: rgba(245, 194, 107, 0.5);
}

.b-note.is-strong .b-note-text {
  color: #f1dfbd;
}

.b-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 0 0 auto;
  padding: 11px 16px 13px;
  border-top: 1px solid var(--line);
  background: rgba(10, 14, 19, 0.22);
}

/* 规则引导：用户不用猜，点一下就能看到“怎么得分”。 */
.b-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 2px;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(26, 34, 48, 0.88), rgba(14, 19, 27, 0.9));
}

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

.b-guide-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.b-guide-close {
  padding: 2px 6px;
  color: #8496a9;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-size: 9.5px;
  cursor: pointer;
}

.b-guide-close:hover {
  color: #d5dfeb;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.06);
}

.b-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding-left: 17px;
  color: #c5d2e1;
  font-size: 10px;
  line-height: 1.65;
}

.b-guide-steps b {
  color: var(--amber);
  font-weight: 500;
}

.b-guide-note {
  margin: 0;
  padding-top: 7px;
  color: #7f91a5;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 9px;
  line-height: 1.65;
}

.b-rules-link {
  margin-left: 3px;
  padding: 0;
  color: var(--amber);
  border: 0;
  border-bottom: 1px dotted rgba(245, 194, 107, 0.55);
  background: transparent;
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.b-rules-link:hover {
  color: #ffe4b0;
  border-bottom-color: rgba(245, 194, 107, 0.9);
}

/* 类别判断：先标记、再选类别，选对才加分。 */
.b-quiz {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 2px;
  padding: 11px;
  border: 1px solid var(--amber-line);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(245, 194, 107, 0.085), rgba(18, 24, 33, 0.72));
}

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

.b-quiz-kicker {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.b-quiz-cancel {
  padding: 2px 6px;
  color: #8496a9;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-size: 9.5px;
  cursor: pointer;
}

.b-quiz-cancel:hover {
  color: #d5dfeb;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.06);
}

.b-quiz-claim {
  max-height: 72px;
  margin: 0;
  padding: 8px 9px;
  overflow-y: auto;
  color: #c8d5e3;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 7px;
  background: rgba(5, 9, 14, 0.42);
  font-size: 10px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.b-quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.b-quiz-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  color: #d8e2ee;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(18, 24, 33, 0.55);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.b-quiz-option strong {
  color: var(--amber);
  font-size: 11.5px;
  font-weight: 500;
}

.b-quiz-option span {
  color: #7f91a5;
  font-size: 9px;
}

.b-quiz-option:hover {
  border-color: var(--amber-line);
  background: rgba(245, 194, 107, 0.09);
}

.b-quiz-option:focus-visible {
  outline: 2px solid var(--amber-line);
  outline-offset: 1px;
}

.b-quiz-location {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid rgba(110, 231, 199, 0.18);
  border-radius: 8px;
  background: rgba(110, 231, 199, 0.045);
}

.b-quiz-location-title {
  margin: 0;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 500;
}

.b-quiz-location-hint {
  margin: 0;
  color: #8ea1b4;
  font-size: 9px;
  line-height: 1.65;
}

.b-quiz-location-claim {
  max-height: 64px;
  margin: 0;
  padding: 7px 8px;
  overflow-y: auto;
  color: #c8d5e3;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 6px;
  background: rgba(5, 9, 14, 0.4);
  font-size: 9.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.b-quiz-confirm {
  width: 100%;
  min-height: 30px;
  padding: 5px 10px;
  color: #06231d;
  border: 1px solid rgba(110, 231, 199, 0.55);
  border-radius: 7px;
  background: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.b-quiz-confirm:hover {
  background: #8ff0d6;
}

.b-quiz-hint {
  margin: 0;
  color: #7f91a5;
  font-size: 9px;
  line-height: 1.6;
}

.suspect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--amber);
  border: 1px solid var(--amber-line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(245, 194, 107, 0.09), rgba(245, 194, 107, 0.045));
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.suspect-btn svg {
  width: 15px;
  height: 15px;
}

.suspect-btn:hover:not(:disabled) {
  border-color: rgba(245, 194, 107, 0.47);
  background: rgba(245, 194, 107, 0.14);
}

.suspect-btn:disabled {
  color: #7a6d5a;
  border-color: rgba(148, 163, 184, 0.13);
  background: rgba(148, 163, 184, 0.035);
  cursor: not-allowed;
  opacity: 0.64;
}

.redeem-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 6px 11px;
  color: #a9b8c9;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: transparent;
  font-size: 10.5px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.redeem-btn:hover:not(:disabled) {
  color: #e4edf7;
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.05);
}

.redeem-btn:disabled {
  color: #617386;
  cursor: not-allowed;
  opacity: 0.65;
}

.redeem-cost {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.b-price-note {
  margin: 0;
  color: #6f8195;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.b-price-note:empty {
  display: none;
}

.b-hint {
  margin: 1px 0 0;
  color: #536477;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.b-footer {
  flex: 0 0 auto;
  padding: 8px 14px 10px;
  color: #7c90a2;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  font-family: var(--font-sans);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ==========================================================================
   Toast / 杂项
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  max-width: min(460px, calc(100vw - 32px));
  padding: 10px 15px;
  color: #dbe5f1;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(24, 32, 43, 0.96);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.4);
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast.is-success {
  border-color: var(--accent-line);
  color: #d9fff6;
}

.toast.is-error {
  border-color: rgba(248, 113, 113, 0.36);
  color: #fecaca;
}

.noscript-note {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10000;
  left: 50%;
  right: auto;
  bottom: 50%;
  transform: translate(-50%, 50%);
  width: min(420px, calc(100vw - 32px));
  padding: 12px;
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  background: #141a22;
  text-align: center;
}

/* ==========================================================================
   动画
   ========================================================================== */

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes view-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes note-in {
  from {
    opacity: 0;
    transform: translateX(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.45;
    box-shadow: 0 0 0 0 rgba(245, 194, 107, 0);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 8px 1px rgba(245, 194, 107, 0.32);
  }
}

@keyframes typing {
  0%,
  70%,
  100% {
    opacity: 0.26;
    transform: translateY(0);
  }
  35% {
    opacity: 0.95;
    transform: translateY(-2px);
  }
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .bubble-group {
    grid-template-columns: 184px minmax(0, 1fr);
    gap: 18px;
  }

  .local-note {
    display: none;
  }
}

@media (max-width: 980px) {
  .onboarding-view {
    padding-bottom: 40px;
  }

  /* 窄屏把操作条放回文档流，避免固定条遮住气泡选项。 */
  .onboarding-actions {
    position: static;
    left: auto;
    bottom: auto;
    width: 100%;
    margin-top: 20px;
    transform: none;
  }

  .workspace-view {
    height: auto;
    min-height: calc(100dvh - var(--header-h));
    padding-bottom: 30px;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    flex: 0 0 auto;
  }

  .chat-panel {
    height: min(72dvh, 760px);
    min-height: 520px;
  }

  .b-panel {
    min-height: 430px;
  }

  .b-feed {
    flex: 0 0 auto;
    max-height: 275px;
  }

  .b-actions {
    margin-top: auto;
  }

  .b-panel {
    overflow: visible;
  }

  .b-panel::before {
    border-radius: 18px 0 0 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .top-btn-label {
    display: none;
  }

  .top-btn {
    width: 32px;
    padding: 0;
  }

  #resetBtn {
    width: auto;
    padding: 0 9px;
  }

  #resetBtn .top-btn-label {
    display: inline;
  }

  .top-btn-report {
    width: auto;
    padding: 0 9px;
  }

  .top-btn-report .top-btn-label {
    display: inline;
  }

  .brand-meta {
    display: none;
  }

  .api-credentials {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .api-title {
    display: none;
  }

  .key-input {
    flex: 1 1 150px;
    width: auto;
    min-width: 0;
  }

  .key-status {
    order: 10;
    flex: 1 1 100%;
    padding-left: 2px;
    padding-top: 0;
  }

  .api-model {
    flex: 1 1 100%;
  }

  .model-input {
    flex: 1;
    width: auto;
  }

  .api-bar {
    gap: 6px;
  }

  .bubble-group {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 17px 0;
  }

  .group-head {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding-top: 0;
  }

  .group-kicker {
    flex-basis: 100%;
  }

  .group-kicker::after {
    display: none;
  }

  .group-rule {
    margin-left: auto;
  }

  .bubble-set {
    gap: 8px;
  }

  .hero-sub {
    font-size: 13px;
  }

  .workspace-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .room-switcher {
    flex: 1 1 100%;
  }

  .workspace-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .room-tab {
    height: 31px;
    font-size: 11px;
  }

  .chat-panel {
    height: min(70dvh, 700px);
    min-height: 500px;
    border-radius: 16px;
  }

  .b-panel {
    border-radius: 16px;
  }

  .msg {
    max-width: 96%;
  }

  .msg-user {
    max-width: 88%;
  }

  .msg-bubble {
    font-size: 13px;
    line-height: 1.75;
  }

  .chat-messages {
    padding-top: 18px;
    gap: 15px;
  }

  .chat-header {
    padding: 12px 14px;
  }

  .composer {
    padding: 8px 12px 12px;
  }

  .chat-status {
    display: none;
  }

  .onboarding-actions {
    width: 100%;
    padding: 11px 12px 11px 16px;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 6px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar-actions {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-end;
  }

  .brand-name {
    font-size: 13.5px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .demo-badge {
    margin-left: 0;
  }

  .api-bar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .mini-btn {
    flex: 0 0 auto;
    padding: 0 8px;
  }

  .onboarding-view {
    padding: 26px 16px 40px;
  }

  .hero h1 {
    font-size: clamp(34px, 10vw, 42px);
    margin: 13px 0 15px;
    letter-spacing: -0.05em;
  }

  .hero-sub {
    max-width: none;
    font-size: 12.5px;
    line-height: 1.85;
  }

  .bubble-groups {
    margin-top: 26px;
  }

  /* 小屏：气泡单列，保证每个选项都有完整、够大的点击面积。 */
  .bubble-set {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .bubble {
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 11px;
    font-size: 12.5px;
  }

  .onboarding-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 11px 12px 12px;
  }

  .selection-copy {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }

  .selection-sub {
    text-align: right;
  }

  .primary-btn {
    width: 100%;
    min-height: 41px;
  }

  .privacy-note {
    margin-top: 17px;
    font-size: 9px;
  }

  .workspace-view {
    padding: 11px 12px 24px;
    gap: 10px;
  }

  .section-label {
    display: none;
  }

  .room-switcher {
    gap: 0;
  }

  .room-tabs {
    padding-left: 0;
  }

  .workspace-controls {
    justify-content: space-between;
  }

  .chat-panel {
    height: 64dvh;
    min-height: 460px;
  }

  .chat-messages {
    padding: 16px 12px 8px;
    gap: 14px;
  }

  .msg {
    max-width: 100%;
  }

  .msg-user {
    max-width: 92%;
  }

  .msg-avatar {
    display: none;
  }

  .msg-bubble {
    padding: 11px 13px;
    border-radius: 3px 12px 12px;
  }

  .msg-user .msg-bubble {
    border-radius: 12px 3px 12px 12px;
  }

  .room-domain {
    display: none;
  }

  .room-sub {
    max-width: 210px;
  }

  .composer-hint {
    font-size: 9px;
  }

  .composer-foot {
    display: none;
  }

  .api-error {
    margin-left: 12px;
    margin-right: 12px;
  }

  .score-card {
    padding: 13px 14px;
  }

  .b-header,
  .b-feed-head,
  .b-feed,
  .b-actions {
    padding-left: 14px;
    padding-right: 14px;
  }

  .b-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .toast {
    bottom: 16px;
  }
}

@media (max-width: 400px) {
  .brand-copy {
    max-width: 132px;
  }

  .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .model-label {
    flex: 0 0 auto;
  }

  .model-input {
    font-size: 9.5px;
  }

  .selection-sub {
    display: none;
  }

  .lie-btn {
    padding: 0 8px;
    font-size: 10px;
  }

  .mode-badge {
    font-size: 8.5px;
  }
}

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

/* ==========================================================================
   使用手册 / 设置 / Onboarding 引导
   ========================================================================== */

.onboarding-guide {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 760px);
  margin: 0 auto 18px;
  padding: 11px 13px;
  border: 1px solid rgba(110, 231, 199, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(120deg, rgba(110, 231, 199, 0.06), rgba(110, 231, 199, 0.015)),
    rgba(12, 19, 27, 0.72);
}

.onboarding-guide-mark {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 199, 0.28);
  border-radius: 50%;
  font: 600 14px/1 var(--sans);
}

.onboarding-guide-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.onboarding-guide-copy strong {
  color: #dce8f3;
  font-size: 11.5px;
  font-weight: 500;
}

.onboarding-guide-copy span {
  color: #71869a;
  font-size: 9.5px;
  line-height: 1.5;
}

.onboarding-guide-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.guide-btn {
  min-height: 27px;
  padding: 4px 9px;
  color: #a9bccd;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  background: rgba(9, 14, 20, 0.5);
  font: 500 9.5px/1.3 var(--sans);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.guide-btn:hover {
  color: #e2edf7;
  border-color: rgba(148, 163, 184, 0.4);
}

.guide-btn-solid {
  color: #06231d;
  border-color: rgba(110, 231, 199, 0.55);
  background: var(--accent);
}

.guide-btn-solid:hover {
  color: #06231d;
  background: #8ff0d6;
}

.guide-btn.danger {
  color: #ffb7ad;
  border-color: rgba(255, 120, 105, 0.28);
  background: rgba(255, 120, 105, 0.06);
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  padding: 18px;
  overflow-y: auto;
  place-items: center;
  background: rgba(2, 6, 10, 0.78);
  backdrop-filter: blur(9px);
}

.modal-card,
.manual-card,
.settings-card {
  position: relative;
  display: flex;
  width: min(1040px, calc(100vw - 36px));
  max-height: min(90vh, 900px);
  flex-direction: column;
  overflow: hidden;
  color: #d7e3ef;
  border: 1px solid rgba(148, 163, 184, 0.17);
  border-radius: 13px;
  background: #0b1017;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.62);
}

.settings-card {
  width: min(660px, calc(100vw - 36px));
}

.modal-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(9, 14, 20, 0.7);
}

.modal-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font: 500 8px/1.3 var(--mono);
  letter-spacing: 0.14em;
}

.modal-head h2 {
  margin: 0;
  color: #eef6ff;
  font: 500 21px/1.2 var(--sans);
  letter-spacing: -0.02em;
}

.modal-sub {
  margin: 4px 0 0;
  color: #708397;
  font-size: 10px;
  line-height: 1.5;
}

.modal-close {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: #8498ac;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  background: rgba(9, 14, 20, 0.55);
  font: 300 20px/1 var(--sans);
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
  border-color: rgba(148, 163, 184, 0.34);
}

.manual-layout {
  display: flex;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.manual-toc {
  display: flex;
  width: 164px;
  flex: 0 0 164px;
  flex-direction: column;
  gap: 2px;
  padding: 15px 10px;
  overflow-y: auto;
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(8, 13, 19, 0.55);
}

.manual-toc a {
  display: block;
  padding: 7px 9px;
  color: #7f94a8;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.35;
  text-decoration: none;
}

.manual-toc a:hover {
  color: #dce9f5;
  background: rgba(110, 231, 199, 0.07);
}

.manual-body {
  min-width: 0;
  flex: 1;
  padding: 20px 24px 30px;
  overflow-y: auto;
  scroll-behavior: auto;
}

.manual-section {
  padding: 0 0 22px;
  margin: 0 0 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  scroll-margin-top: 12px;
}

.manual-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.manual-kicker {
  margin: 0 0 6px;
  color: #6e8296;
  font: 500 8px/1.3 var(--mono);
  letter-spacing: 0.12em;
}

.manual-section h3 {
  margin: 0 0 9px;
  color: #edf5ff;
  font: 500 17px/1.35 var(--sans);
  letter-spacing: -0.01em;
}

.manual-lead,
.manual-section p {
  margin: 0 0 9px;
  color: #9bafc1;
  font-size: 11px;
  line-height: 1.75;
}

.manual-lead b,
.manual-section p b {
  color: #d6e4f0;
  font-weight: 500;
}

.manual-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.manual-card-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.035);
}

.manual-card-item b {
  color: #cfe0ef;
  font-size: 10.5px;
  font-weight: 500;
}

.manual-card-item span {
  color: #8498aa;
  font-size: 9.5px;
  line-height: 1.6;
}

.manual-steps {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
  counter-reset: manual-step;
}

.manual-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px 9px 38px;
  border: 1px solid rgba(148, 163, 184, 0.09);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.028);
  counter-increment: manual-step;
}

.manual-steps li::before {
  position: absolute;
  top: 10px;
  left: 11px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: #06231d;
  border-radius: 50%;
  background: var(--accent);
  content: counter(manual-step);
  font: 600 9px/1 var(--sans);
}

.manual-steps b {
  color: #d8e7f4;
  font-size: 10.5px;
  font-weight: 500;
}

.manual-steps span {
  color: #8598aa;
  font-size: 9.5px;
  line-height: 1.6;
}

.manual-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.manual-step-card {
  padding: 11px;
  border: 1px solid rgba(110, 231, 199, 0.14);
  border-radius: 8px;
  background: rgba(110, 231, 199, 0.035);
}

.manual-step-num {
  color: var(--accent);
  font: 500 8px/1.3 var(--mono);
  letter-spacing: 0.08em;
}

.manual-step-card h4 {
  margin: 5px 0 3px;
  color: #e0edf8;
  font: 500 12px/1.3 var(--sans);
}

.manual-step-card p {
  margin: 0;
  color: #8499ab;
  font-size: 9.5px;
  line-height: 1.6;
}

.manual-table {
  width: 100%;
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-collapse: collapse;
  border-radius: 7px;
  font-size: 9.5px;
}

.manual-table th,
.manual-table td {
  padding: 7px 9px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.manual-table th {
  color: #91a5b8;
  background: rgba(148, 163, 184, 0.055);
  font-weight: 500;
}

.manual-table td {
  color: #a6b9ca;
}

.manual-table tr:last-child td {
  border-bottom: 0;
}

.manual-table .good {
  color: #8ff0d6;
}

.manual-table .warn {
  color: #ffc79b;
}

.manual-note {
  margin: 10px 0;
  padding: 8px 10px;
  color: #94a9bb;
  border-left: 2px solid rgba(110, 231, 199, 0.45);
  border-radius: 0 6px 6px 0;
  background: rgba(110, 231, 199, 0.035);
  font-size: 9.5px;
  line-height: 1.65;
}

.manual-note b {
  color: #c8dbe9;
  font-weight: 500;
}

.manual-note.warn {
  border-left-color: rgba(255, 176, 105, 0.6);
  background: rgba(255, 176, 105, 0.045);
}

.manual-grant {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(110, 231, 199, 0.2);
  border-radius: 9px;
  background: linear-gradient(120deg, rgba(110, 231, 199, 0.09), rgba(110, 231, 199, 0.02));
}

.manual-grant-num {
  color: var(--accent);
  font: 600 32px/1 var(--sans);
  letter-spacing: -0.05em;
}

.manual-grant b {
  color: #dcecf7;
  font-size: 11px;
  font-weight: 500;
}

.manual-grant p {
  margin: 2px 0 0;
  color: #8298aa;
  font-size: 9.5px;
}

.manual-formula {
  margin: 10px 0;
  padding: 10px 12px;
  overflow-x: auto;
  color: #a9c7d8;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 7px;
  background: rgba(3, 8, 13, 0.55);
  font: 9.5px/1.75 var(--mono);
  white-space: pre-wrap;
}

.manual-list,
.manual-check {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 9px 0;
  list-style: none;
}

.manual-list li,
.manual-check li {
  position: relative;
  padding-left: 17px;
  color: #98adbf;
  font-size: 10px;
  line-height: 1.65;
}

.manual-list li::before {
  position: absolute;
  top: 0.68em;
  left: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(110, 231, 199, 0.55);
  content: "";
}

.manual-check li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  content: "✓";
  font-size: 10px;
}

.manual-list code,
.manual-section p code,
.manual-lead code {
  padding: 1px 4px;
  color: #b9d6e5;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.08);
  font: 9px/1.4 var(--mono);
  overflow-wrap: anywhere;
}

.manual-faq {
  padding: 8px 10px;
  margin: 6px 0;
  border: 1px solid rgba(148, 163, 184, 0.09);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.025);
}

.manual-faq summary {
  color: #b9ccdc;
  font-size: 10px;
  line-height: 1.5;
  cursor: pointer;
}

.manual-faq p {
  margin: 7px 0 0;
  color: #8599aa;
  font-size: 9.5px;
  line-height: 1.65;
}

.modal-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(9, 14, 20, 0.82);
}

.modal-foot p {
  margin: 0;
  color: #6d8194;
  font-size: 9px;
  line-height: 1.45;
}

.modal-primary {
  width: auto;
  min-height: 32px;
  padding: 6px 16px;
  font-size: 10px;
}

/* 设置面板 */
.settings-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

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

.settings-copy h3 {
  margin: 0 0 2px;
  color: #d6e5f2;
  font: 500 11.5px/1.35 var(--sans);
}

.settings-copy p {
  margin: 0;
  color: #7d91a3;
  font-size: 9.5px;
  line-height: 1.55;
}

.settings-copy code {
  color: #a9c4d4;
  font: 9px/1.4 var(--mono);
  overflow-wrap: anywhere;
}

.settings-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.settings-status {
  padding: 3px 7px;
  color: #728699;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.035);
  font: 9px/1.3 var(--mono);
  white-space: nowrap;
}

.settings-status.is-saved {
  color: #8ff0d6;
  border-color: rgba(110, 231, 199, 0.2);
  background: rgba(110, 231, 199, 0.055);
}

.settings-model-row {
  flex: 0 1 240px;
}

.settings-input {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 7px;
  color: #c7d8e7;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 6px;
  outline: none;
  background: rgba(5, 9, 14, 0.55);
  font: 9px/1.4 var(--mono);
}

.settings-input:focus {
  border-color: rgba(110, 231, 199, 0.45);
}

.settings-version {
  color: #5f7488;
  font: 9px/1.3 var(--mono);
  white-space: nowrap;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  display: block;
  width: 34px;
  height: 19px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #708397;
  content: "";
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch input:checked + .switch-track {
  border-color: rgba(110, 231, 199, 0.5);
  background: rgba(110, 231, 199, 0.2);
}

.switch input:checked + .switch-track::after {
  background: var(--accent);
  transform: translateX(15px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid rgba(110, 231, 199, 0.5);
  outline-offset: 2px;
}

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

@media (max-width: 760px) {
  .onboarding-guide {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px;
  }

  .onboarding-guide-copy {
    flex-basis: calc(100% - 40px);
  }

  .onboarding-guide-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .modal-backdrop {
    padding: 8px;
    align-items: end;
  }

  .modal-card,
  .manual-card,
  .settings-card {
    width: 100%;
    max-height: 94vh;
    border-radius: 11px;
  }

  .modal-head {
    padding: 14px 14px 11px;
  }

  .modal-head h2 {
    font-size: 18px;
  }

  .manual-layout {
    flex-direction: column;
  }

  .manual-toc {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 3px;
    padding: 7px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  }

  .manual-toc a {
    flex: 0 0 auto;
    padding: 5px 7px;
    white-space: nowrap;
  }

  .manual-body {
    padding: 15px 14px 22px;
  }

  .manual-section h3 {
    font-size: 15px;
  }

  .manual-cards,
  .manual-two {
    grid-template-columns: 1fr;
  }

  .modal-foot {
    padding: 9px 14px;
  }

  .modal-foot p {
    display: none;
  }

  .modal-primary {
    width: 100%;
  }

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

  .settings-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .settings-model-row {
    flex-basis: auto;
    width: 100%;
  }

  .settings-input {
    flex: 1;
  }
}

:root {
  --sans: var(--font-sans);
  --mono: var(--font-mono);
  --panel: #0b1017;
}

.settings-model-row {
  flex: 0 1 280px;
  flex-wrap: nowrap;
}

.settings-model-row .settings-input {
  flex: 1 1 auto;
  width: auto;
}

.settings-model-row .guide-btn {
  flex: 0 0 auto;
}

.modal-close:focus {
  outline: none;
}

.modal-close:focus-visible {
  box-shadow: 0 0 0 2px rgba(110, 231, 199, 0.5);
}

@media (max-width: 760px) {
  .settings-model-row {
    flex-basis: auto;
    width: 100%;
  }

  .settings-model-row .settings-input {
    width: 100%;
  }
}

.brand-intro {
  display: block;
  margin-top: 2px;
  color: #71869a;
  font-size: 9.5px;
  line-height: 1.35;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.bubble-more {
  color: var(--accent) !important;
  border-style: dashed !important;
  background: rgba(110, 231, 199, 0.045) !important;
}

.bubble-more:hover {
  border-color: rgba(110, 231, 199, 0.48) !important;
  background: rgba(110, 231, 199, 0.085) !important;
}

@media (max-width: 760px) {
  .brand-intro {
    display: none;
  }
}

.room-profile {
  overflow: hidden;
  margin: 3px 0 0;
  color: #71869a;
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-profile::before {
  color: #566b7e;
  content: "画像 · ";
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

@media (max-width: 760px) {
  .room-profile {
    max-width: 52vw;
  }
}

.reprofile-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 760px);
  margin: 0 auto 16px;
  padding: 10px 12px;
  color: #b7a17d;
  border: 1px solid rgba(245, 194, 107, 0.22);
  border-radius: 9px;
  background: rgba(245, 194, 107, 0.055);
  font-size: 10px;
  line-height: 1.55;
}

.reprofile-note b {
  color: #f5d19a;
  font-weight: 500;
}

.reprofile-note .guide-btn {
  color: #f5d19a;
  border-color: rgba(245, 194, 107, 0.28);
}

@media (max-width: 760px) {
  .reprofile-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}


.app-footer {
  width: min(980px, calc(100vw - 40px));
  padding: 20px 0 26px;
  margin: 0 auto;
  text-align: center;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
}

.app-footer-quote {
  margin: 0;
  color: #8ca0b2;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.035em;
}

.app-footer-meta {
  margin: 4px 0 0;
  color: #4f6274;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

body.is-onboarding .app-footer {
  padding-bottom: 104px;
}

@media (max-width: 760px) {

  .app-footer {
    width: calc(100vw - 32px);
    padding-top: 16px;
  }

  .app-footer-quote {
    font-size: 11px;
  }

  body.is-onboarding .app-footer {
    padding-bottom: 96px;
  }
}

.b-footer-a {
  color: rgba(110, 231, 199, 0.76);
}

.b-footer-b {
  color: rgba(245, 194, 107, 0.8);
}

.b-footer-sep {
  color: #3f5061;
}

@media (max-width: 760px) {}

/* V5.4.3.1 · hero 右栏寄语已移除，寄语统一放在开场页左下角。 */
.hero-row {
  display: block;
}

.hero-row .hero {
  max-width: none;
}

.chat-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.chat-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 3px 7px;
  color: #8fa3b5;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 6px;
  background: rgba(9, 14, 20, 0.34);
  font: 500 9px/1.3 var(--sans);
  cursor: pointer;
}

.chat-save-btn svg {
  width: 13px;
  height: 13px;
}

.chat-save-btn:hover:not(:disabled) {
  color: #dce9f4;
  border-color: rgba(110, 231, 199, 0.32);
}

.chat-save-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .chat-save-btn span {
    display: none;
  }

  .chat-save-btn {
    padding: 4px 6px;
  }
}

.account-avatar {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 199, 0.26);
  border-radius: 50%;
  background: rgba(110, 231, 199, 0.09);
  font: 600 8.5px/1 var(--sans);
}

.account-card {
  width: min(540px, calc(100vw - 36px));
}

.account-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 15px;
  padding: 18px 20px 20px;
  overflow-y: auto;
}

.account-hero {
  display: flex;
  align-items: center;
  gap: 13px;
}

.account-avatar-large {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 199, 0.3);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(110, 231, 199, 0.18), rgba(110, 231, 199, 0.03) 62%),
    rgba(9, 14, 20, 0.55);
  font: 600 22px/1 var(--sans);
}

.account-hero-copy {
  min-width: 0;
}

.account-kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font: 500 7.5px/1.3 var(--font-mono);
  letter-spacing: 0.14em;
}

.account-hero-copy h3 {
  margin: 0;
  color: #e7f1fb;
  font: 500 18px/1.3 var(--sans);
  letter-spacing: -0.01em;
}

.account-hero-copy p:last-child {
  margin: 3px 0 0;
  color: #6f8296;
  font-size: 9.5px;
}

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

.account-field span {
  color: #8498aa;
  font: 500 9px/1.4 var(--sans);
  letter-spacing: 0.03em;
}

.account-field input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  color: #d7e5f2;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  outline: none;
  background: rgba(5, 9, 14, 0.55);
  font: 12px/1.4 var(--sans);
}

.account-field input:focus {
  border-color: rgba(110, 231, 199, 0.45);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-save-status {
  color: #5f7488;
  font: 8.5px/1.4 var(--font-mono);
}

.account-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.028);
}

.account-meta span {
  color: #617588;
  font-size: 8.5px;
}

.account-meta b {
  color: #b9cddd;
  font: 500 10px/1.4 var(--sans);
  overflow-wrap: anywhere;
}

.account-note {
  margin: 0;
  padding: 9px 10px;
  color: #73879a;
  border-left: 2px solid rgba(245, 194, 107, 0.4);
  border-radius: 0 6px 6px 0;
  background: rgba(245, 194, 107, 0.035);
  font-size: 9.5px;
  line-height: 1.65;
}

@media (max-width: 560px) {
  .account-body {
    padding: 15px 14px 17px;
  }

  .account-meta {
    grid-template-columns: 1fr;
  }

  .account-avatar-large {
    width: 50px;
    height: 50px;
    font-size: 19px;
  }
}

.privacy-link {
  color: #7f9bad;
  text-decoration: none;
  border-bottom: 1px dotted rgba(127, 155, 173, 0.4);
}

.privacy-link:hover {
  color: var(--accent);
  border-bottom-color: rgba(110, 231, 199, 0.65);
}

.account-note a {
  color: #9ac2d0;
  text-decoration: none;
  border-bottom: 1px dotted rgba(154, 194, 208, 0.4);
}

.account-note a:hover {
  color: var(--accent);
}

a.guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.audit-card {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 36px));
  max-height: min(90vh, 880px);
}

.audit-body {
  min-height: 0;
  flex: 1;
  padding: 16px 20px 20px;
  overflow-y: auto;
}

.audit-step[hidden] {
  display: none !important;
}

.audit-label {
  display: block;
  margin: 0 0 7px;
  color: #91a6b9;
  font-size: 10px;
}

.audit-paste,
.audit-guess {
  display: block;
  width: 100%;
  color: #d5e4f2;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  outline: none;
  background: rgba(5, 9, 14, 0.52);
  font: 12px/1.7 var(--sans);
  resize: vertical;
}

.audit-paste {
  min-height: 190px;
  padding: 10px 11px;
}

.audit-guess {
  min-height: 62px;
  padding: 8px 10px;
  font-size: 11px;
}

.audit-paste:focus,
.audit-guess:focus {
  border-color: rgba(110, 231, 199, 0.45);
}

.audit-paste-actions,
.audit-submit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* 转写自检芯片：只提示，不阻断 */
.audit-text-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.audit-text-checks[hidden] {
  display: none;
}

.audit-check-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  color: #f2cf8b;
  background: rgba(242, 207, 139, 0.08);
  border: 1px solid rgba(242, 207, 139, 0.34);
  border-radius: 999px;
  font: 500 10px/1.55 var(--font-mono);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.audit-check-chip.is-ok {
  color: #8fe6da;
  background: rgba(103, 245, 227, 0.07);
  border-color: rgba(103, 245, 227, 0.26);
}

.audit-hint {
  margin: 8px 0 0;
  color: #62788b;
  font-size: 9px;
  line-height: 1.65;
}

.audit-error {
  margin: 9px 0 0;
  color: #d9a0a0;
  font-size: 9.5px;
  line-height: 1.6;
}

.audit-loading {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.audit-loading p {
  margin: 0;
  color: #9fb4c6;
  font-size: 11px;
}

.audit-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(110, 231, 199, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: audit-spin 0.9s linear infinite;
}

@keyframes audit-spin {
  to { transform: rotate(360deg); }
}

.audit-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 0 0 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.audit-count {
  margin: 0;
  color: #e0edf7;
  font-size: 15px;
  line-height: 1.5;
}

.audit-count b {
  color: var(--accent);
  font: 600 22px/1 var(--font-mono);
}

.audit-progress {
  margin: 0;
  color: #73899c;
  font: 500 9px/1.4 var(--font-mono);
}

.audit-source-wrap {
  margin: 12px 0 0;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(5, 9, 14, 0.32);
}

.audit-source {
  max-height: 235px;
  padding: 11px 12px;
  overflow-y: auto;
  color: #a9bccd;
  font: 11.5px/1.8 var(--sans);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

.audit-source::selection,
.audit-source *::selection {
  color: #07100f;
  background: rgba(110, 231, 199, 0.7);
}

.audit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 0;
}

.audit-clue {
  margin: 9px 0 0;
  padding: 8px 10px;
  color: #c6d6e4;
  border-left: 2px solid rgba(245, 194, 107, 0.5);
  border-radius: 0 6px 6px 0;
  background: rgba(245, 194, 107, 0.045);
  font-size: 10px;
  line-height: 1.7;
}

.audit-submit-panel {
  margin: 13px 0 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.028);
}

.audit-submit-title {
  margin: 0 0 8px;
  color: #a8bdce;
  font-size: 10px;
}

.audit-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.audit-category {
  min-height: 26px;
  padding: 3px 9px;
  color: #869cae;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  background: rgba(9, 14, 20, 0.35);
  font: 500 9px/1.3 var(--sans);
  cursor: pointer;
}

.audit-category:hover {
  color: #c9dbe9;
  border-color: rgba(148, 163, 184, 0.3);
}

.audit-category.is-selected {
  color: #07100f;
  border-color: var(--accent);
  background: var(--accent);
}

.audit-feedback {
  margin: 9px 0 0;
  color: #9fb4c6;
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.audit-feedback.is-hit {
  color: #9de8cf;
}

.audit-feedback.is-miss {
  color: #d1ae8e;
}

.audit-reveal {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.audit-reveal-title {
  margin: 0 0 8px;
  color: #8fa6b8;
  font: 500 8.5px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
}

.audit-reveal-card {
  padding: 9px 10px;
  margin: 0 0 7px;
  border-left: 2px solid rgba(110, 231, 199, 0.35);
  border-radius: 0 6px 6px 0;
  background: rgba(110, 231, 199, 0.035);
}

.audit-reveal-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.audit-reveal-type {
  color: var(--accent);
  font: 500 8.5px/1.3 var(--font-mono);
}

.audit-reveal-card p {
  margin: 0 0 4px;
  color: #9fb2c3;
  font-size: 10px;
  line-height: 1.7;
}

.audit-reveal-card p:last-child {
  margin-bottom: 0;
}

.audit-reveal-card b {
  color: #c8dae8;
  font-weight: 500;
}

@media (max-width: 640px) {
  .audit-card {
    width: calc(100vw - 20px);
    max-height: 94vh;
  }

  .audit-body {
    padding: 13px 14px 16px;
  }

  .audit-paste {
    min-height: 150px;
  }

  .audit-source {
    max-height: 210px;
    font-size: 11px;
  }

  .audit-actions .guide-btn {
    flex: 1;
  }
}

.audit-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-caveat {
  margin: 10px 0 0;
  padding: 8px 10px;
  color: #c9b297;
  border-left: 2px solid rgba(245, 194, 107, 0.55);
  border-radius: 0 6px 6px 0;
  background: rgba(245, 194, 107, 0.045);
  font-size: 10.5px;
  line-height: 1.7;
}

.audit-caveat b {
  color: #f0c987;
  font-weight: 500;
}

/* External Audit is a first-class workspace, not a room modal. */
.room-switcher-sep {
  width: 1px;
  height: 20px;
  flex: 0 0 1px;
  margin: 0 2px;
  background: rgba(148, 163, 184, 0.14);
}

.room-tab-audit {
  flex: 0 0 auto;
  color: #c6b18e;
  border-color: rgba(245, 194, 107, 0.14);
  background: rgba(245, 194, 107, 0.025);
}

.room-tab-audit svg {
  width: 13px;
  height: 13px;
}

.room-tab-audit::before {
  background: var(--amber);
  opacity: 0.9;
}

.room-tab-audit:hover {
  color: #f0d6aa;
  border-color: rgba(245, 194, 107, 0.3);
}

.room-tab-audit.is-active {
  color: #f5d9a9;
  border-color: rgba(245, 194, 107, 0.34);
  background: rgba(245, 194, 107, 0.075);
}

.room-tab-audit.is-active::before {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245, 194, 107, 0.42);
}

.audit-tab-dot {
  width: 5px;
  height: 5px;
  margin-left: 1px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(110, 231, 199, 0.5);
}

.workspace-grid[hidden],
.audit-view[hidden] {
  display: none !important;
}

.workspace-view.is-audit-mode .workspace-controls {
  display: none;
}

.audit-view {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.audit-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1180px;
  height: 100%;
  max-height: none;
  margin: 0 auto;
  border-radius: 12px;
}

.audit-view-head {
  flex: 0 0 auto;
}

.audit-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.audit-points {
  color: #7f95a8;
  font: 500 9px/1.3 var(--font-mono);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.audit-points b {
  margin-left: 3px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.audit-body {
  flex: 1 1 auto;
  min-height: 0;
}

.audit-source {
  max-height: 330px;
}

.audit-card .modal-foot {
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .room-tab-audit span:not(.audit-tab-dot) {
    display: none;
  }

  .room-tab-audit {
    padding: 0 9px;
  }

  .audit-card {
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .audit-card {
    width: 100%;
    max-height: none;
    border-radius: 9px;
  }

  .audit-head-actions {
    gap: 6px;
  }

  .audit-points {
    display: none;
  }

  .audit-body {
    padding: 13px 14px 16px;
  }

  .audit-source {
    max-height: 260px;
  }
}

.audit-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: stretch;
  overflow: hidden;
}

.audit-main {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.audit-side {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
}

.audit-side-panel {
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.025);
}

.audit-side-kicker {
  margin: 0 0 5px;
  color: #61778a;
  font: 500 7.5px/1.3 var(--font-mono);
  letter-spacing: 0.14em;
}

.audit-side-panel h3 {
  margin: 0;
  color: #c8dbe9;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.audit-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.audit-stat-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-stat-grid span {
  color: #657b8d;
  font-size: 8.5px;
}

.audit-stat-grid b {
  color: #cfe3f1;
  font: 500 15px/1.2 var(--font-mono);
}

.audit-stat-grid b.is-accent {
  color: var(--accent);
}

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

.audit-text-btn {
  padding: 0;
  color: #6f8496;
  border: 0;
  background: transparent;
  font: 500 8px/1.4 var(--font-mono);
  cursor: pointer;
}

.audit-text-btn:hover {
  color: #d5a3a3;
}

.audit-history-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 9px;
  max-height: 240px;
  overflow-y: auto;
}

.audit-history-item {
  display: block;
  width: 100%;
  padding: 7px 8px;
  color: inherit;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 6px;
  background: rgba(5, 9, 14, 0.25);
  text-align: left;
  cursor: pointer;
}

.audit-history-item:hover {
  border-color: rgba(110, 231, 199, 0.26);
  background: rgba(110, 231, 199, 0.035);
}

.audit-history-title {
  display: block;
  overflow: hidden;
  color: #adc1d2;
  font-size: 9.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-history-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 3px;
  color: #5f7588;
  font: 500 7.5px/1.4 var(--font-mono);
}

.audit-history-status {
  color: #8ba99f;
}

.audit-history-status.is-active {
  color: #c9ae82;
}

.audit-history-empty {
  padding: 6px 0 2px;
  color: #5f7488;
  font-size: 9px;
  line-height: 1.7;
}

.audit-side-rules ul {
  padding-left: 15px;
  margin: 8px 0 0;
}

.audit-side-rules li {
  margin-bottom: 4px;
  color: #7e94a6;
  font-size: 8.8px;
  line-height: 1.65;
}

@media (max-width: 980px) {
  .audit-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .audit-main,
  .audit-side {
    overflow: visible;
  }

  .audit-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .audit-side-rules {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .audit-side {
    grid-template-columns: 1fr;
  }

  .audit-side-rules {
    grid-column: auto;
  }

  .audit-history-list {
    max-height: 190px;
  }
}

.settings-model-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  flex: 1 1 360px;
}

.settings-model-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.settings-model-field > span {
  color: #7f94a7;
  font: 500 8px/1.3 var(--font-mono);
  letter-spacing: 0.03em;
}

.settings-model-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.settings-model-status {
  color: #617588;
  font: 500 8px/1.4 var(--font-mono);
}

.settings-trueb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #93a8ba;
  font-size: 9px;
}

.settings-trueb input {
  accent-color: var(--accent);
}

.settings-trueb small {
  color: #5f7488;
  font: 500 7.5px/1.4 var(--font-mono);
}

#bModelLabel {
  color: #9aabba;
  transition: color 160ms ease;
}

#bModelLabel.is-enabled {
  color: var(--accent);
}

@media (max-width: 760px) {
  .settings-model-field {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .settings-model-stack {
    flex-basis: 100%;
  }
}

/* Safe Markdown rendering for Agent A messages. */
.msg-bubble.markdown-body {
  white-space: normal;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p {
  margin: 0 0 9px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 14px 0 6px;
  color: #eef6fd;
  font-weight: 550;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.markdown-body h1 { font-size: 19px; }
.markdown-body h2 { font-size: 17px; }
.markdown-body h3 { font-size: 15px; }
.markdown-body h4 { font-size: 14px; }

.markdown-body ul,
.markdown-body ol {
  padding-left: 20px;
  margin: 0 0 9px;
}

.markdown-body li {
  margin-bottom: 3px;
}

.markdown-body blockquote {
  padding: 2px 0 2px 11px;
  margin: 0 0 9px;
  color: #a9bdcd;
  border-left: 2px solid rgba(110, 231, 199, 0.35);
}

.markdown-body blockquote p {
  margin: 0 0 4px;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-body .md-inline-code {
  padding: 1px 4px;
  color: #bce7dc;
  border: 1px solid rgba(110, 231, 199, 0.14);
  border-radius: 4px;
  background: rgba(5, 9, 14, 0.45);
  font: 10.5px/1.5 var(--font-mono);
  overflow-wrap: anywhere;
}

.markdown-body .md-code-block {
  padding: 10px 12px;
  margin: 9px 0;
  overflow-x: auto;
  color: #bfd6e5;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 7px;
  background: rgba(5, 9, 14, 0.5);
  font: 10.5px/1.7 var(--font-mono);
  white-space: pre;
}

.markdown-body .md-code-block code {
  font: inherit;
  white-space: inherit;
}

.markdown-body hr {
  margin: 12px 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.markdown-body .md-link {
  color: #8ee7d1;
  text-decoration: none;
  border-bottom: 1px dotted rgba(142, 231, 209, 0.5);
}

.markdown-body .md-link:hover {
  color: #c1fff0;
}

.markdown-body .md-table {
  width: 100%;
  margin: 9px 0;
  border-collapse: collapse;
  font-size: 11px;
}

.markdown-body .md-table th,
.markdown-body .md-table td {
  padding: 5px 7px;
  text-align: left;
  vertical-align: top;
  border: 1px solid rgba(148, 163, 184, 0.13);
}

.markdown-body .md-table th {
  color: #cbdfea;
  background: rgba(148, 163, 184, 0.06);
  font-weight: 500;
}

.markdown-body .md-table td {
  color: #b7c9d8;
}

.review-clue-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px 9px;
  color: #d8c19c;
  border: 1px solid rgba(245, 194, 107, 0.24);
  border-radius: 6px;
  background: rgba(245, 194, 107, 0.045);
  font: 500 9px/1.4 var(--sans);
  cursor: pointer;
}

.review-clue-btn:hover {
  color: #f3d9ab;
  border-color: rgba(245, 194, 107, 0.44);
}

.review-card {
  width: min(620px, calc(100vw - 36px));
}

.review-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  padding: 16px 20px 18px;
  overflow-y: auto;
}

.review-context {
  margin: 0;
  color: #71879a;
  font: 500 8px/1.5 var(--font-mono);
  letter-spacing: 0.03em;
}

.review-block {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.025);
}

.review-label {
  display: block;
  margin: 0 0 5px;
  color: #7f94a7;
  font: 500 8px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
}

.review-type {
  margin: 0 0 5px;
  color: var(--accent);
  font: 500 9px/1.4 var(--font-mono);
}

.review-quote {
  margin: 0 0 6px;
  color: #d3e2ee;
  font-size: 11px;
  line-height: 1.7;
}

.review-reason,
.review-fix {
  margin: 0 0 4px;
  color: #8fa5b6;
  font-size: 9.5px;
  line-height: 1.7;
}

.review-fix {
  color: #9dc9bb;
}

.review-verdicts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-verdict {
  min-height: 28px;
  padding: 4px 12px;
  color: #8fa5b6;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  background: rgba(9, 14, 20, 0.35);
  font: 500 9.5px/1.3 var(--sans);
  cursor: pointer;
}

.review-verdict:hover {
  color: #cfe0ec;
  border-color: rgba(148, 163, 184, 0.3);
}

.review-verdict.is-selected {
  color: #07100f;
  border-color: var(--accent);
  background: var(--accent);
}

.review-note {
  width: 100%;
  min-height: 64px;
  padding: 8px 10px;
  color: #c9dbe8;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 7px;
  outline: none;
  background: rgba(5, 9, 14, 0.42);
  font: 10.5px/1.7 var(--sans);
  resize: vertical;
}

.review-note:focus {
  border-color: rgba(110, 231, 199, 0.42);
}

.review-status {
  min-height: 14px;
  margin: 0;
  color: #7f94a7;
  font-size: 9px;
  line-height: 1.6;
}

.review-actions {
  display: flex;
  gap: 8px;
}

.audit-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.1);
}

.audit-review-status {
  color: #7f94a7;
  font: 500 8px/1.4 var(--font-mono);
}

.audit-review-btn {
  padding: 3px 7px;
  color: #d8c19c;
  border: 1px solid rgba(245, 194, 107, 0.22);
  border-radius: 5px;
  background: rgba(245, 194, 107, 0.04);
  font: 500 8px/1.4 var(--sans);
  cursor: pointer;
}

.audit-review-btn:hover {
  color: #f3d9ab;
  border-color: rgba(245, 194, 107, 0.42);
}

.audit-side-note {
  margin: 8px 0 8px;
  color: #73899c;
  font-size: 8.8px;
  line-height: 1.65;
}

.pool-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 8px;
  margin-left: 4px;
  color: #8fa5b6;
  border: 1px solid rgba(110, 231, 199, 0.2);
  border-radius: 999px;
  background: rgba(110, 231, 199, 0.045);
  font: 500 8px/1.3 var(--font-mono);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pool-chip b {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.room-points {
  display: block;
  margin-top: 2px;
  color: #617588;
  font: 500 8px/1.4 var(--font-mono);
  letter-spacing: 0.02em;
}

.ledger-card {
  width: min(680px, calc(100vw - 36px));
  max-height: min(90vh, 820px);
}

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

.ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ledger-summary > div {
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.025);
}

.ledger-summary span {
  display: block;
  margin-bottom: 3px;
  color: #6f8497;
  font-size: 8.5px;
}

.ledger-summary b {
  color: #d4e5f2;
  font: 500 20px/1.2 var(--font-mono);
}

.ledger-summary b.is-earned { color: #8ee7d1; }
.ledger-summary b.is-spent { color: #e0b28e; }

.ledger-section {
  margin-top: 15px;
}

.ledger-kicker {
  margin: 0 0 7px;
  color: #657b8e;
  font: 500 7.5px/1.3 var(--font-mono);
  letter-spacing: 0.12em;
}

.ledger-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ledger-breakdown-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 7px;
  color: #8fa5b6;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.025);
  font: 500 8px/1.4 var(--font-mono);
}

.ledger-breakdown-item b {
  color: #c8dbe8;
  font-weight: 500;
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}

.ledger-entry {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 6px;
  background: rgba(5, 9, 14, 0.22);
}

.ledger-entry-time {
  color: #5f7488;
  font: 500 7px/1.5 var(--font-mono);
}

.ledger-entry-copy b {
  display: block;
  color: #a8bdcf;
  font-size: 9px;
  font-weight: 500;
}

.ledger-entry-copy span {
  display: block;
  margin-top: 1px;
  color: #617588;
  font-size: 8px;
  line-height: 1.5;
}

.ledger-entry-delta {
  color: #8ee7d1;
  font: 500 10px/1.4 var(--font-mono);
  text-align: right;
}

.ledger-entry-delta-value {
  display: block;
}

.ledger-entry-balance {
  display: block;
  margin-top: 2px;
  color: #5f7488;
  font-size: 7.5px;
  font-weight: 500;
  white-space: nowrap;
}

.ledger-entry-delta.is-spent {
  color: #e0b28e;
}

.ledger-empty {
  padding: 8px 0;
  color: #617588;
  font-size: 9px;
}

.ledger-note {
  margin: 14px 0 0;
  color: #617588;
  font-size: 8.5px;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .pool-chip {
    margin-left: 0;
    padding: 3px 7px;
  }

  .pool-chip-label {
    display: none;
  }

  .ledger-summary {
    grid-template-columns: 1fr;
  }

  .ledger-entry {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }
}

.markdown-body .md-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 9px 0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 7px;
  background: rgba(5, 9, 14, 0.3);
}

.markdown-body .md-task {
  list-style: none;
  margin-left: -16px;
}

.markdown-body .md-task input {
  width: 12px;
  height: 12px;
  margin: 0 6px 0 0;
  vertical-align: -1px;
  accent-color: var(--accent);
}

.markdown-body .md-image-pending {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 11px;
  margin: 9px 0;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.025);
}

.md-image-host {
  color: #8fa5b6;
  font: 500 9px/1.4 var(--font-mono);
}

.md-image-alt {
  color: #b7c9d8;
  font-size: 10px;
  line-height: 1.5;
}

.md-image-load {
  align-self: flex-start;
  padding: 3px 7px;
  color: #d8c19c;
  border: 1px solid rgba(245, 194, 107, 0.24);
  border-radius: 5px;
  background: rgba(245, 194, 107, 0.04);
  font: 500 8px/1.4 var(--sans);
  cursor: pointer;
}

.md-image-load:hover {
  color: #f3d9ab;
  border-color: rgba(245, 194, 107, 0.44);
}

/* ==========================================================================
   Agent B · 浮动雷达 / 抽屉（2026-10-25）
   ========================================================================== */

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

.b-panel {
  position: fixed;
  top: calc(var(--header-h, 96px) + 12px);
  right: 14px;
  bottom: 14px;
  z-index: 9100;
  width: min(392px, calc(100vw - 28px));
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(100% + 24px));
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease, visibility 180ms ease;
}

.b-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.b-panel-close {
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  padding: 0;
  color: #7f94a7;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 50%;
  background: rgba(5, 9, 14, 0.3);
  font: 400 15px/1 var(--sans);
  cursor: pointer;
}

.b-panel-close:hover {
  color: #d9e8f2;
  border-color: rgba(148, 163, 184, 0.3);
}

.b-panel-scrim {
  position: fixed;
  inset: 0;
  z-index: 9050;
  background: rgba(2, 6, 10, 0.38);
  backdrop-filter: blur(2px);
}

.b-radar {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 9200;
  display: grid;
  width: 58px;
  height: 58px;
  padding: 0;
  color: var(--accent);
  border: 1px solid rgba(110, 231, 199, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(110, 231, 199, 0.18), transparent 48%),
    #0d151d;
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.45),
    0 0 0 0 rgba(110, 231, 199, 0.24);
  cursor: pointer;
  place-items: center;
  animation: b-radar-breathe 3.2s ease-in-out infinite;
}

.b-radar svg {
  width: 31px;
  height: 31px;
}

.b-radar:hover {
  border-color: rgba(110, 231, 199, 0.6);
}

.b-radar-ring {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(110, 231, 199, 0.18);
  border-radius: 50%;
  animation: b-radar-ring 2.8s ease-out infinite;
}

.b-radar-label {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: grid;
  width: 18px;
  height: 18px;
  color: #07100f;
  border-radius: 50%;
  background: var(--accent);
  font: 600 9px/1 var(--font-mono);
  place-items: center;
}

.b-radar-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: grid;
  width: 17px;
  height: 17px;
  color: #1a1207;
  border-radius: 50%;
  background: var(--amber);
  font: 700 10px/1 var(--font-mono);
  place-items: center;
  animation: b-radar-badge 1.4s ease-in-out infinite;
}

.b-radar.has-signal {
  border-color: rgba(245, 194, 107, 0.55);
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.45),
    0 0 0 5px rgba(245, 194, 107, 0.08);
}

.b-radar-bubble {
  position: fixed;
  right: 18px;
  bottom: 160px;
  z-index: 9200;
  max-width: 265px;
  padding: 10px 13px;
  color: #e6eef6;
  border: 1px solid rgba(245, 194, 107, 0.34);
  border-radius: 13px 13px 3px 13px;
  background: rgba(20, 27, 36, 0.97);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  font: 11px/1.65 var(--sans);
  cursor: pointer;
  animation: b-bubble-in 220ms ease-out both;
}

.b-radar-bubble.is-correct {
  color: #c9ffe9;
  border-color: rgba(110, 231, 199, 0.48);
}

.b-radar-bubble.is-wrong {
  color: #ffd9b0;
  border-color: rgba(245, 194, 107, 0.5);
}

@keyframes b-radar-breathe {
  0%, 100% { box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(110, 231, 199, 0.22); }
  50% { box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(110, 231, 199, 0); }
}

@keyframes b-radar-ring {
  0% { transform: scale(.8); opacity: .7; }
  80%, 100% { transform: scale(1.45); opacity: 0; }
}

@keyframes b-radar-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

@keyframes b-bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 移动端：B 抽屉占满可用宽度；雷达避开输入区 */
@media (max-width: 760px) {
  .b-panel {
    top: max(8px, env(safe-area-inset-top));
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    border-radius: 14px;
  }

  .b-radar {
    right: 14px;
    bottom: 78px;
    width: 52px;
    height: 52px;
  }

  .b-radar-bubble {
    right: 14px;
    bottom: 140px;
    max-width: min(260px, calc(100vw - 44px));
  }
}

/* ==========================================================================
   文本换行 / 溢出修复（2026-10-25）
   ========================================================================== */

.msg {
  min-width: 0;
  overflow: hidden;
}

.msg-content {
  min-width: 0;
  max-width: 100%;
}

.msg-bubble {
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg-bubble.markdown-body {
  max-width: 100%;
}

.markdown-body,
.markdown-body p,
.markdown-body li,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body blockquote {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.audit-main,
.audit-side,
.audit-main p,
.audit-main li,
.audit-summary,
.audit-count,
.audit-caveat,
.audit-reveal-card,
.audit-reveal-card p,
.audit-side-panel,
.audit-history-item,
.audit-history-title {
  min-width: 0;
  max-width: 100%;
  word-break: break-all;
  white-space: normal;
}

.audit-source {
  word-break: break-all;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .audit-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .audit-main,
  .audit-side {
    min-width: 0;
    overflow: visible;
  }

  .audit-side {
    padding-bottom: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .b-panel {
    transition: none;
  }

  .b-radar,
  .b-radar-ring,
  .b-radar-badge,
  .b-radar-bubble {
    animation: none;
  }
}

/* ==========================================================================
   V4 · 赛博实验室视觉 / 气泡分步向导（2026-10-25）
   ========================================================================== */

:root {
  --lab-bg: #070b11;
  --lab-bg-2: #0b1220;
  --lab-cyan: #67f5e3;
  --lab-green: #a7ff83;
  --lab-cyan-soft: rgba(103, 245, 227, 0.1);
  --lab-glass: rgba(12, 19, 30, 0.68);
  --lab-glass-strong: rgba(10, 16, 26, 0.88);
  --lab-border: rgba(103, 245, 227, 0.28);
  --lab-glow: 0 0 32px rgba(103, 245, 227, 0.12);
}

body {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(103, 245, 227, 0.07), transparent 65%),
    radial-gradient(700px 480px at 100% 0%, rgba(167, 255, 131, 0.035), transparent 60%),
    linear-gradient(180deg, var(--lab-bg), var(--bg) 38%, #080d14);
}

.is-onboarding .api-bar {
  display: none;
}

.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 18px;
  overflow-y: auto;
  place-items: center;
  background:
    radial-gradient(650px 380px at 50% 20%, rgba(103, 245, 227, 0.08), transparent 70%),
    rgba(2, 6, 11, 0.78);
  backdrop-filter: blur(18px) saturate(110%);
  -webkit-backdrop-filter: blur(18px) saturate(110%);
}

.wizard-overlay[hidden] {
  display: none !important;
}

.wizard-card {
  width: min(620px, calc(100vw - 28px));
  max-height: min(86dvh, 760px);
  padding: 22px;
  overflow-y: auto;
  color: var(--text);
  border: 1px solid var(--lab-border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(20, 32, 48, 0.72), rgba(7, 12, 20, 0.92)),
    var(--lab-glass);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.55),
    var(--lab-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: wizard-in 260ms cubic-bezier(.2,.8,.2,1) both;
}

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

.wizard-kicker {
  color: var(--lab-cyan);
  font: 500 8px/1.4 var(--font-mono);
  letter-spacing: 0.14em;
}

.wizard-step {
  color: #6f879b;
  font: 500 9px/1.4 var(--font-mono);
}

.wizard-title {
  margin: 14px 0 5px;
  color: #f2fbff;
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.wizard-sub {
  margin: 0 0 15px;
  color: #8fa7ba;
  font-size: 11px;
  line-height: 1.7;
}

.wizard-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.wizard-option {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #c8dbe8;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.035);
  font: 500 10.5px/1.45 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.wizard-option::before {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: rgba(103, 245, 227, 0.35);
  content: "";
}

.wizard-option:hover,
.wizard-option.is-selected {
  color: #ecfffb;
  border-color: rgba(103, 245, 227, 0.52);
  background: rgba(103, 245, 227, 0.1);
  transform: translateY(-1px);
}

.wizard-option.is-selected::before {
  background: var(--lab-cyan);
  box-shadow: 0 0 10px rgba(103, 245, 227, 0.7);
}

.wizard-foot {
  margin-top: 16px;
}

.wizard-back {
  padding: 4px 7px;
  color: #7f95a8;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 6px;
  background: transparent;
  font: 500 8px/1.4 var(--font-mono);
  cursor: pointer;
}

.wizard-back:hover {
  color: var(--lab-cyan);
  border-color: var(--lab-border);
}

.wizard-hint {
  margin-left: auto;
  color: #60788a;
  font: 500 8px/1.5 var(--font-mono);
}

.wizard-card.is-leaving {
  animation: wizard-out 180ms ease-in both;
}

@keyframes wizard-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wizard-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.985); }
}

@media (max-width: 640px) {
  .wizard-overlay {
    padding: 10px;
    align-items: center;
  }

  .wizard-card {
    width: 100%;
    max-height: 88dvh;
    padding: 17px 14px;
    border-radius: 15px;
  }

  .wizard-options {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .wizard-option {
    min-height: 38px;
    font-size: 10px;
  }

  .wizard-title {
    font-size: 21px;
  }
}

/* A 主动开场的操作按钮 */
.opening-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.opening-action {
  padding: 5px 9px;
  color: #9ecfca;
  border: 1px solid rgba(103, 245, 227, 0.22);
  border-radius: 6px;
  background: rgba(103, 245, 227, 0.05);
  font: 500 9px/1.4 var(--sans);
  cursor: pointer;
}

.opening-action:hover {
  color: #e6fffa;
  border-color: rgba(103, 245, 227, 0.5);
}

.opening-action.is-secondary {
  color: #9aabbb;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.035);
}

/* 设置里的 Key 表单 */
.settings-key-row {
  align-items: flex-start;
}

.settings-key-form {
  display: flex;
  min-width: min(330px, 100%);
  gap: 7px;
}

.settings-key-input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  color: #d8e8f4;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 6px;
  outline: none;
  background: rgba(5, 9, 14, 0.5);
  font: 10px/1.4 var(--font-mono);
}

.settings-key-input:focus {
  border-color: rgba(103, 245, 227, 0.5);
}

@media (max-width: 640px) {
  .settings-key-row {
    flex-direction: column;
    gap: 8px;
  }

  .settings-key-form {
    width: 100%;
    min-width: 0;
  }
}

/* 旧的四组同屏画像不再展示，统一由 wizard 接管 */
.bubble-groups,
#onboardingActions {
  display: none !important;
}

.wizard-more {
  grid-column: 1 / -1;
  min-height: 34px;
  color: #8da6b8;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: transparent;
  font: 500 9px/1.4 var(--font-mono);
  cursor: pointer;
}

.wizard-more:hover {
  color: var(--lab-cyan);
  border-color: var(--lab-border);
}

@media (max-width: 640px) {
  .wizard-card {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    min-width: 0;
    overflow-x: hidden;
  }

  .wizard-options,
  .wizard-option {
    min-width: 0;
    max-width: 100%;
  }

  .wizard-option {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .wizard-sub,
  .wizard-title {
    overflow-wrap: anywhere;
  }
}

/* API Key / 模型输入统一收进设置：顶部栏不再显示 */
.api-bar {
  display: none !important;
}

/* ==========================================================================
   V4.1 · 首屏气泡云（圆形球体 / 错落悬浮）
   ========================================================================== */

.wizard-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 1.6vw, 15px);
  min-height: 350px;
  max-height: min(48dvh, 430px);
  padding: 18px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: center;
}

.wizard-option {
  display: grid;
  width: var(--bubble-size, 104px);
  height: var(--bubble-size, 104px);
  min-height: 0;
  flex: 0 0 auto;
  padding: 12%;
  color: #d7eaf1;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 25%, rgba(103, 245, 227, 0.16), transparent 52%),
    linear-gradient(145deg, rgba(30, 45, 62, 0.82), rgba(8, 14, 23, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.3);
  font: 500 clamp(8.5px, 1.05vw, 11px)/1.28 var(--sans);
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  place-items: center;
  transform: translateY(var(--bubble-y, 0));
  animation: bubble-drift 5.8s ease-in-out infinite;
  animation-delay: var(--bubble-delay, 0s);
  transition:
    opacity 220ms ease,
    transform 260ms cubic-bezier(.2,.8,.2,1),
    border-color 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;
}

.wizard-option::before {
  display: none;
}

.wizard-option:hover {
  color: #f1fffc;
  border-color: rgba(103, 245, 227, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 4px rgba(103, 245, 227, 0.06),
    0 16px 38px rgba(0, 0, 0, 0.38);
  transform: translateY(var(--bubble-y, 0)) scale(1.06);
}

.wizard-option.is-picked {
  z-index: 2;
  color: #f4fffd;
  border-color: rgba(103, 245, 227, 0.92);
  background:
    radial-gradient(circle at 35% 25%, rgba(167, 255, 131, 0.34), transparent 56%),
    linear-gradient(145deg, rgba(25, 72, 72, 0.96), rgba(6, 25, 29, 0.98));
  box-shadow:
    0 0 0 6px rgba(103, 245, 227, 0.12),
    0 0 38px rgba(103, 245, 227, 0.55),
    0 22px 52px rgba(0, 0, 0, 0.45);
  transform: translateY(var(--bubble-y, 0)) scale(1.18);
  animation-play-state: paused;
}

.wizard-option.is-faded {
  opacity: 0.08;
  transform: translateY(var(--bubble-y, 0)) scale(.82);
  pointer-events: none;
}

.wizard-option:nth-child(1) { --bubble-size: 116px; --bubble-y: -12px; --bubble-delay: -0.4s; }
.wizard-option:nth-child(2) { --bubble-size: 88px; --bubble-y: 10px; --bubble-delay: -1.8s; }
.wizard-option:nth-child(3) { --bubble-size: 132px; --bubble-y: -5px; --bubble-delay: -0.9s; }
.wizard-option:nth-child(4) { --bubble-size: 84px; --bubble-y: 14px; --bubble-delay: -2.4s; }
.wizard-option:nth-child(5) { --bubble-size: 108px; --bubble-y: 8px; --bubble-delay: -3.2s; }
.wizard-option:nth-child(6) { --bubble-size: 94px; --bubble-y: -14px; --bubble-delay: -1.2s; }
.wizard-option:nth-child(7) { --bubble-size: 122px; --bubble-y: 4px; --bubble-delay: -2.8s; }
.wizard-option:nth-child(8) { --bubble-size: 82px; --bubble-y: -8px; --bubble-delay: -0.6s; }

.wizard-more {
  display: block;
  width: 100%;
  min-height: 32px;
  flex: 0 0 100%;
  color: #8da6b8;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(7, 14, 22, 0.5);
  font: 500 8.5px/1.4 var(--font-mono);
  cursor: pointer;
}

.wizard-more:hover {
  color: var(--lab-cyan);
  border-color: var(--lab-border);
}

@keyframes bubble-drift {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

@media (max-width: 640px) {
  .wizard-options {
    min-height: 360px;
    max-height: 54dvh;
    gap: 4px;
    padding: 10px 0;
  }

  .wizard-option {
    width: var(--bubble-size, 80px);
    height: var(--bubble-size, 80px);
    padding: 11%;
    font-size: 8px;
    line-height: 1.22;
  }

  .wizard-option:nth-child(1) { --bubble-size: 92px; --bubble-y: -6px; }
  .wizard-option:nth-child(2) { --bubble-size: 72px; --bubble-y: 8px; }
  .wizard-option:nth-child(3) { --bubble-size: 104px; --bubble-y: 0; }
  .wizard-option:nth-child(4) { --bubble-size: 70px; --bubble-y: 10px; }
  .wizard-option:nth-child(5) { --bubble-size: 88px; --bubble-y: -4px; }
  .wizard-option:nth-child(6) { --bubble-size: 76px; --bubble-y: 6px; }
  .wizard-option:nth-child(7) { --bubble-size: 96px; --bubble-y: -8px; }
  .wizard-option:nth-child(8) { --bubble-size: 68px; --bubble-y: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-option {
    animation: none;
  }
}

/* V4.1 气泡云：避免内容过多时向上溢出，文字更易读 */
.wizard-options {
  align-content: flex-start;
  margin-top: 6px;
  padding: 10px 4px 4px;
  max-height: min(46dvh, 420px);
}

.wizard-option {
  padding: 7%;
  font-size: clamp(9px, 1vw, 11.5px);
  line-height: 1.22;
  text-wrap: balance;
}

@media (max-width: 640px) {
  .wizard-options {
    align-content: flex-start;
    max-height: 52dvh;
    padding-top: 8px;
  }

  .wizard-option {
    padding: 7%;
    font-size: 8.5px;
  }
}

/* V4.1 气泡：限制文字在球体内，避免向下溢出造成“重叠” */
.wizard-option {
  overflow: hidden;
  padding: 5%;
  font-size: clamp(8.5px, .92vw, 10.5px);
  line-height: 1.24;
}

.wizard-option:nth-child(1) { --bubble-size: 110px; }
.wizard-option:nth-child(2) { --bubble-size: 100px; }
.wizard-option:nth-child(3) { --bubble-size: 128px; }
.wizard-option:nth-child(4) { --bubble-size: 96px; }
.wizard-option:nth-child(5) { --bubble-size: 112px; }
.wizard-option:nth-child(6) { --bubble-size: 104px; }
.wizard-option:nth-child(7) { --bubble-size: 120px; }
.wizard-option:nth-child(8) { --bubble-size: 94px; }

@media (max-width: 640px) {
  .wizard-option {
    padding: 5%;
    font-size: 8px;
  }

  .wizard-option:nth-child(1) { --bubble-size: 92px; }
  .wizard-option:nth-child(2) { --bubble-size: 80px; }
  .wizard-option:nth-child(3) { --bubble-size: 104px; }
  .wizard-option:nth-child(4) { --bubble-size: 78px; }
  .wizard-option:nth-child(5) { --bubble-size: 90px; }
  .wizard-option:nth-child(6) { --bubble-size: 82px; }
  .wizard-option:nth-child(7) { --bubble-size: 98px; }
  .wizard-option:nth-child(8) { --bubble-size: 76px; }
}

/* ==========================================================================
   V5.0 · 沉浸式开场 / 全屏气泡向导
   ========================================================================== */

.intro-screen,
.engine-transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(900px 580px at 50% 38%, rgba(22, 54, 66, 0.24), transparent 68%),
    radial-gradient(700px 420px at 82% 88%, rgba(103, 245, 227, 0.045), transparent 70%),
    #05090f;
}

.intro-screen[hidden],
.engine-transition[hidden] {
  display: none !important;
}

.intro-stars {
  position: absolute;
  inset: -20%;
  opacity: 0.6;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(220, 255, 250, 0.55), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(160, 230, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 40% 75%, rgba(167, 255, 131, 0.36), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255, 255, 255, 0.42), transparent),
    radial-gradient(1px 1px at 10% 85%, rgba(103, 245, 227, 0.38), transparent);
  background-size: 320px 280px, 420px 360px, 260px 300px, 380px 340px, 290px 260px;
  animation: star-drift 28s linear infinite;
  pointer-events: none;
}

.intro-code {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 22px,
    rgba(103, 245, 227, 0.16) 22px 23px,
    transparent 23px 46px
  );
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  animation: code-fall 12s linear infinite;
  pointer-events: none;
}

.intro-content {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100vw - 36px));
  text-align: center;
  animation: intro-in 700ms cubic-bezier(.2,.8,.2,1) both;
}

.intro-kicker {
  margin: 0 0 28px;
  color: rgba(103, 245, 227, 0.62);
  font: 500 9px/1.4 var(--font-mono);
  letter-spacing: 0.22em;
}

/* V5.5.4.4 · 首屏标题「层级混排」：小号宽字距引子 + 超大重字主体 + 渐变细线 */
.intro-title {
  margin: 0;
  color: #f4fffd;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  text-align: center;
}

.intro-title-lead {
  display: block;
  margin: 0 0 16px;
  color: rgba(103, 245, 227, 0.8);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.42em;
}

.intro-title-main {
  display: block;
  font-size: clamp(52px, 6.8vw, 92px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.012em;
  text-shadow: 0 0 30px rgba(103, 245, 227, 0.16);
}


.intro-title-rule {
  display: block;
  width: min(420px, 62%);
  height: 1px;
  margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, rgba(103, 245, 227, 0.9), transparent);
}

.intro-sub {
  margin: 22px 0 40px;
  color: #8da8b8;
  font-size: clamp(12px, 1.5vw, 15px);
  line-height: 1.7;
  letter-spacing: 0.08em;
}

.engine-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  overflow: visible;
  color: #061311;
  border: 1px solid rgba(167, 255, 131, 0.85);
  border-radius: 999px;
  background:
    linear-gradient(110deg, var(--lab-cyan), var(--lab-green));
  box-shadow:
    0 0 24px rgba(103, 245, 227, 0.32),
    0 0 60px rgba(103, 245, 227, 0.12);
  font: 600 12px/1.2 var(--sans);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.engine-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 32px rgba(103, 245, 227, 0.52),
    0 0 90px rgba(103, 245, 227, 0.2);
}

.engine-btn svg {
  width: 17px;
  height: 17px;
}

.engine-btn-ring {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(103, 245, 227, 0.28);
  border-radius: 999px;
  animation: engine-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

.intro-note {
  margin: 20px 0 0;
  color: #506878;
  font: 500 8px/1.5 var(--font-mono);
  letter-spacing: 0.08em;
}

.engine-transition {
  z-index: 110;
  background: #02060a;
}

.engine-core {
  position: relative;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
}

.engine-core span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(103, 245, 227, 0.55);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(103, 245, 227, 0.25);
  animation: engine-ring 1.5s ease-out infinite;
}

.engine-core span:nth-child(2) {
  animation-delay: 0.25s;
}

.engine-core span:nth-child(3) {
  animation-delay: 0.5s;
}

.engine-core::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lab-cyan);
  box-shadow: 0 0 40px 12px rgba(103, 245, 227, 0.55);
  content: "";
}

.engine-log {
  position: absolute;
  bottom: 16%;
  left: 50%;
  width: min(520px, calc(100vw - 40px));
  color: rgba(103, 245, 227, 0.62);
  font: 500 9px/1.9 var(--font-mono);
  letter-spacing: 0.05em;
  text-align: left;
  transform: translateX(-50%);
  white-space: pre-wrap;
}

@keyframes intro-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes star-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-60px, 40px, 0); }
}

@keyframes code-fall {
  from { background-position: 0 -120px; }
  to { background-position: 0 120px; }
}

@keyframes engine-pulse {
  0% { transform: scale(.94); opacity: .7; }
  80%, 100% { transform: scale(1.18); opacity: 0; }
}

@keyframes engine-ring {
  0% { transform: scale(.2); opacity: 1; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* 全屏向导：去掉卡片外框，只留悬浮内容 */
.wizard-overlay {
  z-index: 90;
  background:
    radial-gradient(800px 520px at 50% 45%, rgba(15, 45, 52, 0.22), transparent 70%),
    radial-gradient(600px 400px at 80% 90%, rgba(103, 245, 227, 0.04), transparent 70%),
    rgba(3, 8, 13, 0.86);
}

.wizard-card {
  width: min(980px, calc(100vw - 28px));
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wizard-topline,
.wizard-title,
.wizard-sub,
.wizard-foot {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.wizard-title {
  text-align: center;
}

.wizard-sub {
  text-align: center;
}

.wizard-options {
  max-height: min(54dvh, 500px);
  min-height: 360px;
}

.wizard-foot {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .intro-kicker {
    margin-bottom: 20px;
    font-size: 8px;
  }

  .intro-title-lead {
    margin-bottom: 10px;
    font-size: 10px;
    letter-spacing: 0.34em;
  }

  .intro-title-main {
    font-size: clamp(34px, 10.4vw, 54px);
    line-height: 1.04;
  }

  .intro-title-rule {
    width: min(260px, 68%);
    margin-top: 14px;
  }

  .intro-sub {
    margin: 17px 0 32px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .engine-btn {
    padding: 12px 19px;
    font-size: 11px;
  }

  .engine-log {
    bottom: 12%;
    font-size: 8px;
  }

  .wizard-card {
    width: 100%;
    padding: 0;
  }

  .wizard-options {
    min-height: 380px;
    max-height: 55dvh;
  }

  .wizard-title {
    font-size: 23px;
  }

  .wizard-sub {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-stars,
  .intro-code,
  .engine-btn-ring,
  .engine-core span {
    animation: none;
  }
}

.intro-content {
  transition: opacity 260ms ease, transform 260ms ease;
}

.intro-screen.is-leaving .intro-content {
  opacity: 0;
  transform: translateY(-10px) scale(.985);
}

/* 气泡文字用 span 控制宽度，避免 grid 匿名项把字挤成竖排 */
.wizard-option {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-option-label {
  display: block;
  max-width: 88%;
  line-height: 1.22;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.wizard-options {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

/* 唤醒引擎：统一 hover / active / focus / disabled 的发光状态，禁止 UA 默认黑态 */
.engine-btn {
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  min-height: 44px;
  color: #061311;
  -webkit-text-fill-color: #061311;
  background: linear-gradient(110deg, var(--lab-cyan), var(--lab-green));
  opacity: 1;
  filter: none;
}

.engine-btn:hover,
.engine-btn:focus,
.engine-btn:focus-visible,
.engine-btn:active,
.engine-btn:disabled,
.engine-btn[disabled],
.engine-btn[aria-busy="true"] {
  color: #061311;
  -webkit-text-fill-color: #061311;
  border-color: rgba(214, 255, 237, 0.95);
  background: linear-gradient(110deg, var(--lab-cyan), var(--lab-green));
  opacity: 1;
  filter: none;
}

.engine-btn:active {
  transform: translateY(1px) scale(.985);
  box-shadow:
    0 0 34px rgba(103, 245, 227, 0.62),
    0 0 100px rgba(103, 245, 227, 0.25);
}

.engine-btn:focus-visible {
  outline: 2px solid rgba(231, 255, 249, 0.9);
  outline-offset: 4px;
}

.engine-btn:disabled,
.engine-btn[aria-busy="true"] {
  cursor: wait;
  box-shadow:
    0 0 30px rgba(103, 245, 227, 0.48),
    0 0 85px rgba(103, 245, 227, 0.2);
}

.engine-btn:disabled:hover {
  transform: none;
}

.engine-btn.is-awake .engine-btn-ring {
  animation-duration: 0.9s;
}

/* 点击瞬间 / 转场期间：无论 disabled、focus 还是 active，都保持亮态 */
.engine-btn.is-awake,
.engine-btn.is-awake:hover,
.engine-btn.is-awake:focus,
.engine-btn.is-awake:focus-visible,
.engine-btn.is-awake:active,
.engine-btn.is-awake:disabled,
.engine-btn.is-awake[aria-busy="true"] {
  color: #061311 !important;
  -webkit-text-fill-color: #061311 !important;
  opacity: 1 !important;
  filter: none !important;
  border-color: rgba(231, 255, 249, 0.98) !important;
  background: linear-gradient(110deg, var(--lab-cyan), var(--lab-green)) !important;
  box-shadow:
    0 0 34px rgba(103, 245, 227, 0.6),
    0 0 100px rgba(103, 245, 227, 0.24) !important;
}

/* ==========================================================================
   V5.1 · 聚光灯新手引导
   ========================================================================== */

.is-tour-open {
  overflow: hidden;
}

.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.tour-layer[hidden] {
  display: none !important;
}

.tour-shade {
  position: fixed;
  z-index: 1;
  background: rgba(3, 8, 13, 0.74);
  backdrop-filter: blur(7px) saturate(80%);
  -webkit-backdrop-filter: blur(7px) saturate(80%);
  pointer-events: auto;
  transition: left 220ms ease, top 220ms ease, width 220ms ease, height 220ms ease;
}

.tour-focus {
  position: fixed;
  z-index: 2;
  border: 1px solid rgba(103, 245, 227, 0.92);
  border-radius: 13px;
  box-shadow:
    0 0 0 1px rgba(103, 245, 227, 0.22),
    0 0 24px rgba(103, 245, 227, 0.35),
    0 0 70px rgba(103, 245, 227, 0.16);
  pointer-events: none;
  transition: left 220ms ease, top 220ms ease, width 220ms ease, height 220ms ease;
}

.tour-bubble {
  position: fixed;
  z-index: 3;
  width: min(360px, calc(100vw - 24px));
  padding: 16px;
  color: var(--text);
  border: 1px solid rgba(103, 245, 227, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(18, 30, 42, 0.94), rgba(5, 11, 18, 0.98));
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.55),
    0 0 30px rgba(103, 245, 227, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: auto;
  animation: tour-bubble-in 280ms cubic-bezier(.2,.8,.2,1) both;
}

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

.tour-step,
.tour-kicker {
  color: rgba(103, 245, 227, 0.7);
  font: 500 8px/1.4 var(--font-mono);
  letter-spacing: 0.12em;
}

.tour-kicker {
  color: #60798b;
}

.tour-title {
  margin: 12px 0 7px;
  color: #f1ffff;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.tour-text {
  margin: 0;
  color: #a4b8c7;
  font-size: 12px;
  line-height: 1.75;
}

.tour-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr 0.8fr;
  gap: 6px;
  margin-top: 16px;
}

.tour-btn {
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.05);
  color: #9fb4c4;
  font: 500 10px/1.3 var(--sans);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.tour-btn:hover {
  color: #e9fffb;
  border-color: rgba(103, 245, 227, 0.45);
  background: rgba(103, 245, 227, 0.1);
}

.tour-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.tour-next {
  color: #061311;
  border-color: rgba(167, 255, 131, 0.7);
  background: linear-gradient(110deg, var(--lab-cyan), var(--lab-green));
}

.tour-next:hover {
  color: #061311;
  border-color: rgba(231, 255, 249, 0.95);
  background: linear-gradient(110deg, var(--lab-cyan), var(--lab-green));
}

.tour-skip {
  color: #73899a;
  border-color: transparent;
  background: transparent;
}

.tour-skip:hover {
  color: #d8e9f3;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.06);
}

@keyframes tour-bubble-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .tour-bubble {
    width: calc(100vw - 20px);
    padding: 14px;
    border-radius: 12px;
  }

  .tour-title {
    font-size: 17px;
  }

  .tour-text {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-shade,
  .tour-focus {
    transition: none;
  }

  .tour-bubble {
    animation-duration: 1ms;
  }
}

.tour-bubble {
  outline: none;
}

.tour-bubble:focus-visible {
  outline: 1px solid rgba(103, 245, 227, 0.65);
  outline-offset: 3px;
}

.tour-bubble:focus,
.tour-bubble:focus-visible {
  outline: none !important;
}

/* B 抽屉必须位于 scrim 之上、内容保持完全不透明；fixed 面板不能被困在 workspace 的 stacking context 里 */
.b-panel {
  opacity: 0;
  filter: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: linear-gradient(180deg, #171d26, #10151d);
  isolation: isolate;
}

.b-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  filter: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: translateX(0);
}

.b-panel > * {
  opacity: 1;
  filter: none;
}

body.b-panel-open .b-panel-scrim {
  z-index: 9050;
}

/* 抽屉打开时雷达让位，避免按钮压在面板内容上 */
body.b-panel-open .b-radar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.82);
}

.b-radar {
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

/* 抽屉只滑动，不做整体透明度渐变；避免淡入过程中文字看起来半透明/叠影 */
.b-panel {
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), border-color 220ms ease, box-shadow 220ms ease;
}

.b-panel.is-open {
  opacity: 1 !important;
  visibility: visible !important;
}

body.b-panel-open .b-radar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* ==========================================================================
   V5.3 · 长文本质检 / API Key 引导 / 能量数据球 / 电影级转场
   颜色仍使用原有青绿 + 琥珀 + 深夜蓝，不新增色系。
   ========================================================================== */

/* ---------- 1. 外部寻宝：模式切换、STT 上传、长文报告 ---------- */

.audit-input-modes {
  display: inline-flex;
  gap: 3px;
  margin-top: 10px;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(5, 9, 14, 0.55);
}

.audit-mode-btn {
  padding: 7px 13px;
  color: #8198aa;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 500 10px/1.2 var(--sans);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.audit-mode-btn:hover {
  color: #d9f4ef;
}

.audit-mode-btn.is-active {
  color: #061311;
  background: linear-gradient(110deg, var(--lab-cyan, var(--accent)), var(--lab-green, #a7ff83));
  box-shadow: 0 0 18px rgba(103, 245, 227, 0.22);
}

.audit-long-options[hidden] {
  display: none !important;
}

.audit-long-options {
  margin-top: 12px;
}

.audit-file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px dashed rgba(103, 245, 227, 0.3);
  border-radius: 10px;
  background:
    radial-gradient(320px 80px at 20% 0%, rgba(103, 245, 227, 0.07), transparent 70%),
    rgba(5, 12, 19, 0.5);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.audit-file-drop:hover,
.audit-file-drop:focus-within {
  border-color: rgba(167, 255, 131, 0.55);
  background: rgba(103, 245, 227, 0.06);
  box-shadow: inset 0 0 24px rgba(103, 245, 227, 0.06);
}

.audit-file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.audit-file-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: var(--lab-cyan, var(--accent));
  border: 1px solid rgba(103, 245, 227, 0.3);
  border-radius: 50%;
  background: rgba(103, 245, 227, 0.06);
  font: 500 13px/1 var(--font-mono);
  place-items: center;
}

.audit-file-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.audit-file-copy b {
  color: #cfe6e2;
  font-size: 10.5px;
  font-weight: 500;
}

.audit-file-copy small {
  color: #637b8d;
  font: 500 8.5px/1.5 var(--font-mono);
}

.audit-file-status {
  margin: 7px 0 0;
  color: #688094;
  font-size: 8.5px;
  line-height: 1.6;
}

.audit-radar-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 11px;
  color: #8fa7b8;
  border: 1px solid rgba(103, 245, 227, 0.14);
  border-radius: 8px;
  background: rgba(103, 245, 227, 0.035);
  font-size: 9.5px;
  line-height: 1.65;
}

.audit-radar-note b {
  color: var(--lab-cyan, var(--accent));
  font-weight: 500;
}

.audit-radar-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--lab-cyan, var(--accent));
  box-shadow: 0 0 0 3px rgba(103, 245, 227, 0.1), 0 0 12px rgba(103, 245, 227, 0.6);
  animation: radar-breathe 2.6s ease-in-out infinite;
}

@keyframes radar-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1.12); }
}

.audit-paste.is-long {
  min-height: 270px;
  font-size: 11.5px;
  line-height: 1.75;
}

.audit-long-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.audit-long-kicker {
  margin: 0 0 4px;
  color: var(--lab-cyan, var(--accent));
  font: 500 7.5px/1.4 var(--font-mono);
  letter-spacing: 0.16em;
}

.audit-long-meta {
  margin: 5px 0 0;
  color: #647c8f;
  font: 500 8.5px/1.5 var(--font-mono);
}

.audit-long-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audit-long-disclaimer {
  margin: 12px 0;
  padding: 10px 12px;
  color: #8ea6b6;
  border: 1px solid rgba(103, 245, 227, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(100deg, rgba(103, 245, 227, 0.055), rgba(5, 12, 19, 0.2));
  font-size: 9.5px;
  line-height: 1.7;
}

.audit-long-disclaimer b {
  color: #d9f4ef;
  font-weight: 500;
}

.audit-long-report {
  padding: 4px 2px 20px;
  color: #b6c9d8;
  font-size: 11.5px;
  line-height: 1.78;
}

.audit-long-report h1 {
  margin: 8px 0 12px;
  color: #f0fffc;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.audit-long-report h2 {
  margin: 22px 0 9px;
  padding-left: 9px;
  color: #dff8f2;
  border-left: 2px solid rgba(103, 245, 227, 0.55);
  font-size: 14px;
  font-weight: 500;
}

.audit-long-report h3 {
  margin: 16px 0 7px;
  color: #cfeae4;
  font: 500 11px/1.5 var(--font-mono);
  letter-spacing: 0.01em;
}

.audit-long-report p {
  margin: 6px 0;
}

.audit-long-report blockquote,
.audit-long-report .md-quote {
  margin: 6px 0;
  padding: 5px 7px;
  color: #a9c4c7;
  border-left: 2px solid rgba(103, 245, 227, 0.3);
  background: rgba(103, 245, 227, 0.03);
}

.audit-long-report ul,
.audit-long-report ol {
  margin: 4px 0;
  padding-left: 12px;
}

/* V5.5.4.3 · 长文嵌套收敛：第二层 list 只留 6px，不再逐层累加；竖线只保留最外一条。 */
.audit-long-report ul ul,
.audit-long-report ul ol,
.audit-long-report ol ul,
.audit-long-report ol ol {
  margin: 2px 0;
  padding-left: 6px;
  list-style: none;
}

.audit-long-report blockquote blockquote,
.audit-long-report blockquote .md-quote,
.audit-long-report .md-quote blockquote,
.audit-long-report .md-quote .md-quote {
  margin: 2px 0;
  padding: 0;
  color: #a9c4c7;
  border-left: 0;
  background: transparent;
}

.audit-long-report .md-flat-quote {
  margin: 2px 0;
  padding: 0;
  color: #a9c4c7;
  border: 0;
  background: transparent;
}

.audit-long-report .md-flat-list {
  margin: 2px 0;
  padding: 0;
  list-style: none;
}

.audit-long-report .md-flat-item {
  margin: 2px 0;
}

.audit-long-report li {
  margin: 3px 0;
}

.audit-long-report strong {
  color: var(--lab-cyan, var(--accent));
  font-weight: 500;
}

.audit-long-report code {
  padding: 1px 4px;
  color: #c8f6e9;
  border: 1px solid rgba(103, 245, 227, 0.14);
  border-radius: 4px;
  background: rgba(103, 245, 227, 0.06);
  font: 500 10px/1.5 var(--font-mono);
}

.audit-long-report hr {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

/* ---------- 2. API Key 引导：向导 / 聚光灯 / 设置 / 教程弹窗 ---------- */

.wizard-key-hint[hidden],
.tour-key-hint[hidden] {
  display: none !important;
}

.wizard-key-hint {
  display: flex;
  width: min(760px, 100%);
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin: 14px auto 0;
  padding: 9px 13px;
  color: #7e95a7;
  border: 1px dashed rgba(103, 245, 227, 0.18);
  border-radius: 10px;
  background: rgba(103, 245, 227, 0.028);
  font-size: 9.5px;
  line-height: 1.6;
  text-align: center;
}

.wizard-key-link,
.tour-key-link {
  padding: 0;
  color: var(--lab-cyan, var(--accent));
  border: 0;
  background: transparent;
  font: 500 9.5px/1.6 var(--sans);
  text-decoration: underline;
  text-decoration-color: rgba(103, 245, 227, 0.35);
  text-underline-offset: 3px;
  cursor: pointer;
}

.wizard-key-link:hover,
.tour-key-link:hover {
  color: #a7ff83;
  text-decoration-color: rgba(167, 255, 131, 0.6);
}

.tour-key-hint {
  margin: 8px 0 0;
  padding: 7px 9px;
  color: #7e95a7;
  border: 1px dashed rgba(103, 245, 227, 0.16);
  border-radius: 8px;
  background: rgba(103, 245, 227, 0.025);
  font-size: 9px;
  line-height: 1.6;
}

.settings-key-guide .settings-copy p {
  color: #8fa7b8;
}

.key-guide-card {
  width: min(620px, calc(100vw - 24px));
  max-height: min(88dvh, 760px);
  padding: 22px;
  overflow-y: auto;
  color: var(--text);
  border: 1px solid var(--lab-border, rgba(103, 245, 227, 0.28));
  border-radius: 18px;
  background:
    radial-gradient(520px 260px at 18% -10%, rgba(103, 245, 227, 0.09), transparent 70%),
    linear-gradient(145deg, rgba(20, 32, 48, 0.96), rgba(6, 12, 20, 0.99));
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.6),
    0 0 44px rgba(103, 245, 227, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.key-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.key-guide-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  background: rgba(5, 12, 19, 0.42);
}

.key-guide-index {
  display: grid;
  width: 28px;
  height: 28px;
  color: var(--lab-cyan, var(--accent));
  border: 1px solid rgba(103, 245, 227, 0.28);
  border-radius: 50%;
  background: rgba(103, 245, 227, 0.05);
  font: 500 9px/1 var(--font-mono);
  place-items: center;
}

.key-guide-steps b {
  display: block;
  color: #dff2ee;
  font-size: 11px;
  font-weight: 500;
}

.key-guide-steps p {
  margin: 3px 0 0;
  color: #8298a9;
  font-size: 9.5px;
  line-height: 1.65;
}

.key-guide-link {
  padding: 5px 8px;
  color: var(--lab-cyan, var(--accent));
  border: 1px solid rgba(103, 245, 227, 0.22);
  border-radius: 6px;
  font: 500 8.5px/1.4 var(--font-mono);
  text-decoration: none;
  white-space: nowrap;
}

.key-guide-link:hover {
  color: #061311;
  background: var(--lab-cyan, var(--accent));
}

.key-guide-steps .guide-btn {
  padding: 6px 9px;
  font-size: 8.5px;
  white-space: nowrap;
}

.key-guide-note {
  margin-top: 13px;
  padding: 10px 12px;
  color: #879dac;
  border: 1px solid rgba(245, 194, 107, 0.16);
  border-radius: 8px;
  background: rgba(245, 194, 107, 0.035);
  font-size: 9px;
  line-height: 1.7;
}

.key-guide-note b {
  color: var(--amber);
  font-weight: 500;
}

@media (max-width: 640px) {
  .key-guide-card {
    width: calc(100vw - 16px);
    padding: 16px;
  }

  .key-guide-steps li {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .key-guide-link,
  .key-guide-steps .guide-btn {
    grid-column: 2 / 3;
    justify-self: start;
  }
}

/* ---------- 3. 能量数据球：无网格、随机失重、强内发光、霓虹边、点击波纹 ---------- */

.wizard-options {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.2vw, 12px);
  min-height: 390px;
  max-height: min(58dvh, 560px);
  padding: 30px 8px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: center;
}

.wizard-option {
  position: relative;
  display: flex;
  width: var(--bubble-size, 104px);
  height: var(--bubble-size, 104px);
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #e2f8f3;
  border: 1px solid rgba(103, 245, 227, 0.5);
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 24%, rgba(255, 255, 255, 0.18), transparent 32%),
    radial-gradient(circle at 36% 29%, rgba(103, 245, 227, 0.26), transparent 55%),
    radial-gradient(circle at 72% 80%, rgba(167, 255, 131, 0.12), transparent 62%),
    linear-gradient(150deg, rgba(26, 56, 68, 0.96), rgba(4, 13, 21, 0.99) 70%);
  box-shadow:
    inset 0 0 24px rgba(103, 245, 227, 0.24),
    inset 0 -16px 28px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(167, 255, 131, 0.12),
    0 0 0 1px rgba(103, 245, 227, 0.08),
    0 0 24px rgba(103, 245, 227, 0.18),
    0 20px 38px rgba(0, 0, 0, 0.44);
  font: 500 clamp(8px, 0.92vw, 10.5px)/1.22 var(--sans);
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  isolation: isolate;
  transform: none;
  translate: 0 0;
  rotate: 0deg;
  animation: bubble-float var(--drift-duration, 8s) ease-in-out var(--drift-delay, 0s) infinite alternate;
  transition:
    opacity 240ms ease,
    transform 280ms cubic-bezier(.2, .8, .2, 1),
    border-color 220ms ease,
    box-shadow 240ms ease,
    filter 240ms ease;
  will-change: translate, rotate;
}

.wizard-option::before {
  position: absolute;
  top: 12%;
  left: 21%;
  display: block;
  width: 27%;
  height: 17%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.52), transparent 72%);
  filter: blur(2px);
  opacity: 0.52;
  content: "";
  pointer-events: none;
  z-index: 0;
}

.wizard-option::after {
  position: absolute;
  inset: 6.5%;
  border: 1px solid rgba(167, 255, 131, 0.16);
  border-radius: 50%;
  box-shadow:
    inset 0 0 18px rgba(103, 245, 227, 0.13),
    0 0 12px rgba(103, 245, 227, 0.06);
  content: "";
  pointer-events: none;
  z-index: 0;
}

.wizard-option-label {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 82%;
  line-height: 1.22;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.wizard-option:hover {
  color: #ffffff;
  border-color: rgba(167, 255, 131, 0.78);
  transform: scale(1.07);
  filter: brightness(1.08);
  box-shadow:
    inset 0 0 30px rgba(103, 245, 227, 0.34),
    inset 0 -14px 26px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 0 0 6px rgba(103, 245, 227, 0.055),
    0 0 40px rgba(103, 245, 227, 0.36),
    0 24px 46px rgba(0, 0, 0, 0.5);
}

.wizard-option.is-selected {
  border-color: rgba(167, 255, 131, 0.66);
  box-shadow:
    inset 0 0 28px rgba(103, 245, 227, 0.3),
    inset 0 -14px 26px rgba(0, 0, 0, 0.5),
    0 0 0 5px rgba(103, 245, 227, 0.05),
    0 0 34px rgba(103, 245, 227, 0.3);
}

.wizard-option.is-picked {
  z-index: 3;
  color: #f4fffd;
  border-color: rgba(231, 255, 249, 0.98);
  background:
    radial-gradient(circle at 33% 24%, rgba(255, 255, 255, 0.22), transparent 32%),
    radial-gradient(circle at 38% 30%, rgba(167, 255, 131, 0.34), transparent 58%),
    radial-gradient(circle at 74% 82%, rgba(103, 245, 227, 0.2), transparent 62%),
    linear-gradient(150deg, rgba(28, 82, 76, 0.98), rgba(3, 18, 25, 0.99));
  transform: scale(1.17);
  animation-play-state: paused;
  box-shadow:
    inset 0 0 34px rgba(167, 255, 131, 0.34),
    inset 0 0 0 1px rgba(231, 255, 249, 0.42),
    0 0 0 7px rgba(103, 245, 227, 0.12),
    0 0 46px rgba(103, 245, 227, 0.6),
    0 0 100px rgba(103, 245, 227, 0.26),
    0 24px 52px rgba(0, 0, 0, 0.48);
}

.wizard-option.is-faded {
  opacity: 0.06;
  filter: blur(1.4px);
  transform: scale(0.8);
  pointer-events: none;
}

.wizard-option.is-burst {
  animation: bubble-burst 900ms cubic-bezier(.16, .9, .3, 1) both;
}

.wizard-option.is-motion-off {
  animation: none !important;
}

.wizard-ripple {
  position: absolute;
  z-index: 4;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.wizard-ripple::before,
.wizard-ripple::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(103, 245, 227, 0.9);
  border-radius: 50%;
  box-shadow:
    0 0 18px rgba(103, 245, 227, 0.4),
    inset 0 0 20px rgba(103, 245, 227, 0.24);
  content: "";
  animation: wizard-ripple-out 880ms cubic-bezier(.16, .84, .32, 1) forwards;
}

.wizard-ripple::after {
  border-color: rgba(167, 255, 131, 0.68);
  animation-delay: 120ms;
}

@keyframes bubble-float {
  0% { translate: 0 0; rotate: 0deg; }
  28% { translate: var(--drift-x, 8px) var(--drift-y, -10px); rotate: var(--drift-rot, 2deg); }
  61% { translate: calc(var(--drift-x, 8px) * -0.55) calc(var(--drift-y, -10px) * 1.45); rotate: calc(var(--drift-rot, 2deg) * -0.8); }
  100% { translate: calc(var(--drift-x, 8px) * 0.4) calc(var(--drift-y, -10px) * -0.65); rotate: calc(var(--drift-rot, 2deg) * 0.55); }
}

@keyframes bubble-burst {
  0% { scale: 1; filter: brightness(1); }
  16% { scale: 1.3; filter: brightness(1.22); }
  52% { scale: 1.1; filter: brightness(1.12); }
  100% { scale: 1; filter: brightness(1); }
}

@keyframes wizard-ripple-out {
  0% { transform: scale(0.62); opacity: 0.95; }
  70% { opacity: 0.26; }
  100% { transform: scale(3.3); opacity: 0; }
}

/* ---------- 4. 首屏“唤醒引擎”：数据流 + 极光爆开 + 冲击波 ---------- */

.engine-transition {
  isolation: isolate;
}

.engine-aurora {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(circle at 50% 50%, rgba(103, 245, 227, 0.34), rgba(103, 245, 227, 0.12) 24%, transparent 58%),
    conic-gradient(from 0deg, rgba(167, 255, 131, 0.16), transparent 34%, rgba(103, 245, 227, 0.2), transparent 68%);
  filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  animation: aurora-burst 1500ms cubic-bezier(.16, .84, .3, 1) forwards;
}

.engine-grid {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image:
    linear-gradient(rgba(103, 245, 227, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 245, 227, 0.18) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(620px) rotateX(62deg) translateY(12%);
  transform-origin: 50% 70%;
  pointer-events: none;
  animation: grid-surge 1500ms ease-out forwards;
}

.engine-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}

.engine-rain span {
  position: absolute;
  top: -55vh;
  color: rgba(103, 245, 227, 0.72);
  font: 500 10px/1 var(--font-mono);
  text-shadow:
    0 0 8px rgba(103, 245, 227, 0.6),
    0 0 22px rgba(103, 245, 227, 0.24);
  white-space: nowrap;
  writing-mode: vertical-rl;
  animation-name: data-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  pointer-events: none;
}

.engine-shockwave {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.engine-shockwave span {
  position: absolute;
  width: 24vmin;
  height: 24vmin;
  border: 1px solid rgba(103, 245, 227, 0.72);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 24px rgba(103, 245, 227, 0.22);
  animation: shock-out 1200ms cubic-bezier(.16, .84, .3, 1) forwards;
}

.engine-shockwave span:nth-child(2) {
  border-color: rgba(167, 255, 131, 0.56);
  animation-delay: 90ms;
}

.engine-shockwave span:nth-child(3) {
  animation-delay: 180ms;
}

.engine-shockwave span:nth-child(4) {
  border-color: rgba(167, 255, 131, 0.42);
  animation-delay: 270ms;
}

.engine-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0 44%, rgba(214, 255, 237, 0.7) 50%, transparent 56%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: scan-sweep 900ms ease-out 180ms forwards;
}

.engine-core {
  z-index: 2;
  animation: core-pop 900ms cubic-bezier(.16, .84, .3, 1) both;
}

.engine-log {
  z-index: 3;
  text-shadow: 0 0 12px rgba(103, 245, 227, 0.3);
}

.engine-transition::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(2, 6, 10, 0.55) 72%, rgba(2, 6, 10, 0.94));
  content: "";
  pointer-events: none;
  z-index: 1;
}

@keyframes aurora-burst {
  0% { transform: scale(0.1) rotate(0deg); opacity: 1; }
  55% { opacity: 0.82; }
  100% { transform: scale(2.25) rotate(34deg); opacity: 0; }
}

@keyframes grid-surge {
  0% { opacity: 0; background-position: center 0; }
  32% { opacity: 0.32; }
  100% { opacity: 0.05; background-position: center 140px; }
}

@keyframes data-fall {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.95; }
  100% { transform: translateY(150vh); opacity: 0; }
}

@keyframes shock-out {
  0% { transform: scale(0.18); opacity: 0.95; }
  100% { transform: scale(7); opacity: 0; }
}

@keyframes scan-sweep {
  0% { transform: translateY(-60%); opacity: 0; }
  22% { opacity: 0.72; }
  100% { transform: translateY(60%); opacity: 0; }
}

@keyframes core-pop {
  0% { transform: scale(0.72); opacity: 0.4; }
  38% { transform: scale(1.16); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- 5. 移动端与减少动效 ---------- */

@media (max-width: 640px) {
  .audit-input-modes {
    display: flex;
    width: 100%;
  }

  .audit-mode-btn {
    flex: 1;
  }

  .audit-long-head {
    flex-direction: column;
  }

  .audit-long-actions {
    width: 100%;
  }

  .audit-long-actions .guide-btn {
    flex: 1;
  }

  .wizard-options {
    min-height: 360px;
    max-height: 56dvh;
    gap: 3px;
    padding: 22px 2px 16px;
  }

  .wizard-key-hint {
    font-size: 9px;
    padding: 8px 10px;
  }

  .audit-long-report {
    font-size: 11px;
  }

  .audit-long-report h1 {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-option,
  .wizard-option.is-burst,
  .wizard-ripple::before,
  .wizard-ripple::after,
  .engine-aurora,
  .engine-grid,
  .engine-rain span,
  .engine-shockwave span,
  .engine-scan,
  .engine-core,
  .audit-radar-dot {
    animation: none !important;
  }

  .wizard-option::after {
    box-shadow: none;
  }
}

html.reduce-motion .wizard-option,
html.reduce-motion .wizard-option.is-burst,
html.reduce-motion .wizard-ripple::before,
html.reduce-motion .wizard-ripple::after,
html.reduce-motion .engine-aurora,
html.reduce-motion .engine-grid,
html.reduce-motion .engine-rain span,
html.reduce-motion .engine-shockwave span,
html.reduce-motion .engine-scan,
html.reduce-motion .engine-core,
html.reduce-motion .audit-radar-dot {
  animation: none !important;
}

/* 长文模式只展示长文档案与通用规则，避免短对话的 0 捕获率造成误读 */
.audit-view.is-long-mode .audit-short-only {
  display: none !important;
}

.audit-view:not(.is-long-mode) .audit-long-only {
  display: none !important;
}

/* ==========================================================================
   V5.3.1 · 认知反应堆首页 / API 状态指引 / 大尺寸轨道气泡
   颜色仍沿用青绿、琥珀与深夜蓝，不引入新色系。
   ========================================================================== */

/* ---------- 1. API 状态胶囊 / 引导条 / 教程位置图 ---------- */

.api-status-chip {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #8da6b8;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  background: rgba(8, 15, 23, 0.55);
  font: 500 8.5px/1 var(--font-mono);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.api-status-chip:hover {
  color: #e3f8f2;
  border-color: rgba(103, 245, 227, 0.35);
  background: rgba(103, 245, 227, 0.06);
}

.api-status-chip[data-state="missing"] {
  color: #8a9aa8;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.035);
}

.api-status-chip[data-state="ready"],
.api-status-chip[data-state="ds"],
.api-status-chip[data-state="sf"],
.api-status-chip[data-state="dual"] {
  color: #9ff3dd;
  border-color: rgba(110, 231, 199, 0.3);
  background: rgba(110, 231, 199, 0.06);
}

.api-status-chip[data-state="demo"] {
  color: #7f95a8;
  border-color: rgba(148, 163, 184, 0.14);
}

.api-status-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.api-status-chip[data-state="missing"] .api-status-dot {
  animation: none;
}

.api-status-label {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-status-arrow {
  color: currentColor;
  opacity: 0.55;
}

@keyframes api-dot-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1.15); }
}

.api-connect-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 9px 12px;
  color: #b9c9c7;
  border: 1px solid rgba(245, 194, 107, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(100deg, rgba(245, 194, 107, 0.06), rgba(5, 12, 19, 0.3)),
    rgba(5, 12, 19, 0.55);
  font-size: 9px;
  line-height: 1.55;
}

.api-connect-banner[hidden] {
  display: none !important;
}

.api-connect-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: var(--amber);
  border: 1px solid rgba(245, 194, 107, 0.28);
  border-radius: 50%;
  background: rgba(245, 194, 107, 0.06);
  font: 500 10px/1 var(--font-mono);
  place-items: center;
}

.api-connect-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.api-connect-copy b {
  color: #f2dfbc;
  font-size: 9.5px;
  font-weight: 500;
}

.api-connect-copy span {
  color: #8298a9;
  font-size: 8.5px;
}

.api-connect-btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: #061311;
  border: 1px solid rgba(245, 194, 107, 0.6);
  border-radius: 999px;
  background: linear-gradient(110deg, #f5c26b, #f0d39a);
  font: 600 8.5px/1.3 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.api-connect-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(245, 194, 107, 0.24);
}

.audit-api-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  padding: 9px 11px;
  color: #a5b7c5;
  border: 1px solid rgba(245, 194, 107, 0.2);
  border-radius: 8px;
  background: rgba(245, 194, 107, 0.04);
  font-size: 9px;
  line-height: 1.55;
}

.audit-api-note[hidden] {
  display: none !important;
}

.audit-api-mark {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--amber);
  border: 1px solid rgba(245, 194, 107, 0.24);
  border-radius: 50%;
  font: 500 9px/1 var(--font-mono);
  place-items: center;
}

.audit-api-note > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.audit-api-note b {
  color: #f2dfbc;
  font-weight: 500;
}

.audit-api-note .guide-btn {
  flex: 0 0 auto;
  padding: 5px 8px;
  font-size: 8px;
}

.key-guide-map {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid rgba(103, 245, 227, 0.14);
  border-radius: 9px;
  background: rgba(103, 245, 227, 0.03);
}

.key-guide-map-label {
  margin-right: 3px;
  color: #617b8d;
  font: 500 7.5px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
}

.key-guide-map-step {
  padding: 3px 7px;
  color: #a9c4c2;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 5px;
  background: rgba(5, 12, 19, 0.4);
  font-size: 8.5px;
  white-space: nowrap;
}

.key-guide-map-step b {
  color: #e2f8f2;
  font-weight: 500;
}

.key-guide-map-step.is-target {
  color: #061311;
  border-color: rgba(103, 245, 227, 0.5);
  background: rgba(103, 245, 227, 0.82);
}

.key-guide-map-step.is-target b {
  color: #061311;
}

.key-guide-map-arrow {
  color: #4e6778;
  font: 500 9px/1 var(--font-mono);
}

/* ---------- 2. 首屏：认知反应堆 ---------- */

.intro-screen {
  isolation: isolate;
  background:
    radial-gradient(1100px 720px at 50% 38%, rgba(17, 54, 62, 0.34), transparent 66%),
    radial-gradient(720px 520px at 84% 88%, rgba(103, 245, 227, 0.06), transparent 70%),
    radial-gradient(560px 380px at 10% 82%, rgba(167, 255, 131, 0.035), transparent 72%),
    #04080d;
}

.intro-screen::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 0.5px, transparent 0.6px);
  background-size: 3px 3px;
  content: "";
  opacity: 0.16;
  pointer-events: none;
}

.intro-stars,
.intro-code {
  z-index: 0;
}

.intro-dust {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0.8;
  pointer-events: none;
}

.intro-dust[hidden] {
  display: none !important;
}

.intro-aurora {
  position: absolute;
  inset: -18%;
  z-index: 1;
  opacity: 0.62;
  background:
    radial-gradient(ellipse at 32% 38%, rgba(103, 245, 227, 0.13), transparent 48%),
    radial-gradient(ellipse at 70% 64%, rgba(167, 255, 131, 0.08), transparent 46%),
    conic-gradient(from 210deg at 53% 45%, rgba(103, 245, 227, 0.13), transparent 28%, rgba(167, 255, 131, 0.06), transparent 62%, rgba(103, 245, 227, 0.1));
  filter: blur(46px);
  pointer-events: none;
  animation: intro-aurora-drift 26s ease-in-out infinite alternate;
}

.intro-hud {
  position: absolute;
  inset: 26px 28px;
  z-index: 4;
  pointer-events: none;
}

.intro-hud-top,
.intro-hud-bottom {
  position: absolute;
  right: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(142, 176, 188, 0.56);
  font: 500 7.5px/1.4 var(--font-mono);
  letter-spacing: 0.12em;
}

.intro-hud-top { top: 0; }
.intro-hud-bottom { bottom: 0; color: rgba(103, 245, 227, 0.38); }

.intro-hud-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(103, 245, 227, 0.35);
  border-style: solid;
}

.intro-hud-corner.is-tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.intro-hud-corner.is-tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.intro-hud-corner.is-bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.intro-hud-corner.is-br { right: 0; bottom: 0; border-width: 0 1px 1px 0; }

.intro-reactor {
  position: absolute;
  top: 48%;
  left: 50%;
  z-index: 2;
  width: min(72vmin, 720px);
  aspect-ratio: 1;
  opacity: 0.9;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.intro-ring {
  position: absolute;
  border: 1px solid rgba(103, 245, 227, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 30px rgba(103, 245, 227, 0.07),
    inset 0 0 26px rgba(103, 245, 227, 0.04);
  will-change: transform;
}

.intro-ring.is-one {
  inset: 15%;
  border-style: dashed;
  animation: reactor-spin 34s linear infinite;
}

.intro-ring.is-two {
  inset: 26%;
  border-color: rgba(167, 255, 131, 0.14);
  animation: reactor-spin 22s linear infinite reverse;
}

.intro-ring.is-three {
  inset: 37%;
  border-color: rgba(103, 245, 227, 0.28);
  animation: reactor-spin 14s linear infinite;
}

.intro-core-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(103, 245, 227, 0.22), transparent 66%);
  filter: blur(18px);
  transform: translate(-50%, -50%);
  animation: reactor-breathe 5.4s ease-in-out infinite;
}

.intro-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c9fff3;
  box-shadow:
    0 0 12px 3px rgba(103, 245, 227, 0.75),
    0 0 46px 16px rgba(103, 245, 227, 0.28);
  transform: translate(-50%, -50%);
  animation: reactor-breathe 5.4s ease-in-out infinite;
}

.intro-content {
  z-index: 5;
  text-shadow: 0 2px 24px rgba(2, 7, 11, 0.62);
}

.engine-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.engine-btn {
  min-width: 208px;
  min-height: 56px;
  justify-content: center;
  padding: 0 28px;
  font-size: 12.5px;
}

.engine-btn > span:not(.engine-btn-ring):not(.engine-btn-sheen) {
  position: relative;
  z-index: 2;
}

.engine-btn svg {
  position: relative;
  z-index: 2;
}

.engine-btn-sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: 999px;
  pointer-events: none;
}

.engine-btn-sheen::before {
  position: absolute;
  top: -70%;
  bottom: -70%;
  left: -45%;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
  content: "";
  transform: rotate(18deg);
  animation: engine-sheen 4.6s ease-in-out infinite;
}

.engine-caption {
  color: #4f6878;
  font: 500 7.5px/1.5 var(--font-mono);
  letter-spacing: 0.12em;
}

.intro-checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  width: min(760px, calc(100vw - 32px));
  margin: 28px auto 0;
}

.intro-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #748c9d;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 7px;
  background: rgba(4, 10, 16, 0.42);
  font: 500 8px/1.3 var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.intro-check i {
  color: #466171;
  font-style: normal;
}

.intro-check b {
  color: #7f998f;
  font-weight: 500;
}

.intro-check.is-ready b {
  color: #8ff0d6;
}

.intro-check.is-action {
  color: #d9c39b;
  border-color: rgba(245, 194, 107, 0.2);
  background: rgba(245, 194, 107, 0.035);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.intro-check.is-action:hover {
  border-color: rgba(245, 194, 107, 0.45);
  background: rgba(245, 194, 107, 0.07);
}

.intro-check.is-action b {
  color: #f5c26b;
}

.intro-check.is-action.is-ready {
  border-color: rgba(103, 245, 227, 0.22);
  background: rgba(103, 245, 227, 0.04);
}

.intro-check.is-action.is-ready b {
  color: #8ff0d6;
}

.intro-check em {
  color: currentColor;
  font-style: normal;
  opacity: 0.72;
}

/* V5.4.3.1 · 开场页题记：写给自己的一句话，不进入工作台布局。
   位置只在全屏开场页的左下留白；工作台、向导、报告都不出现。 */
.intro-epigraph {
  position: absolute;
  left: clamp(28px, 4.6vw, 64px);
  bottom: clamp(64px, 8.6vh, 96px);
  z-index: 5;
  max-width: min(25em, 36vw);
  padding-left: 16px;
  border-left: 1px solid rgba(110, 231, 199, 0.3);
  text-align: left;
}

.intro-epigraph-label {
  display: block;
  margin: 0 0 10px;
  color: rgba(110, 231, 199, 0.6);
  font: 500 8.5px/1.4 var(--font-mono);
  letter-spacing: 0.16em;
}

.intro-epigraph-line {
  margin: 0;
  color: #bcc9d6;
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 15px;
  line-height: 1.95;
  letter-spacing: 0.05em;
}

@media (max-width: 900px) {
  .intro-epigraph-line {
    font-size: 13.5px;
  }
}

@media (max-width: 760px) {
  .intro-epigraph {
    display: none;
  }
}

@media (min-width: 761px) and (max-height: 740px) {
  .intro-epigraph {
    display: none;
  }
}

@keyframes intro-aurora-drift {
  0% { transform: scale(1) rotate(0deg); opacity: 0.48; }
  50% { transform: scale(1.08) rotate(8deg); opacity: 0.68; }
  100% { transform: scale(1.02) rotate(-6deg); opacity: 0.52; }
}

@keyframes reactor-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes reactor-breathe {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes engine-sheen {
  0%, 58% { left: -45%; opacity: 0; }
  64% { opacity: 0.7; }
  78%, 100% { left: 118%; opacity: 0; }
}

/* ---------- 3. 气泡：6 个大球 / 轨道星座 / 景深 ---------- */

.wizard-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 660px;
  min-height: 500px;
  max-height: 62dvh;
  justify-items: center;
  align-items: center;
  align-content: center;
  gap: clamp(16px, 2.1vw, 26px) 8px;
  padding: 42px 18px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(19, 58, 64, 0.24), transparent 62%);
}

.wizard-options.is-expanded {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: 12px 8px;
}

.wizard-options.is-expanded .wizard-option {
  width: clamp(96px, 9vw, 124px);
  font-size: 10px;
}

.wizard-options::before {
  position: absolute;
  inset: -26% -18%;
  z-index: 0;
  background:
    repeating-radial-gradient(circle at 50% 46%, transparent 0 118px, rgba(103, 245, 227, 0.1) 118px 119px, transparent 119px 236px),
    radial-gradient(ellipse at 50% 46%, rgba(103, 245, 227, 0.05), transparent 58%);
  content: "";
  opacity: 0.72;
  pointer-events: none;
}

.wizard-options::after {
  position: absolute;
  top: 46%;
  left: 50%;
  width: 70%;
  height: 42%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(103, 245, 227, 0.07), transparent 68%);
  content: "";
  filter: blur(20px);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.wizard-option {
  z-index: 1;
  width: var(--bubble-size, 160px);
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  border-color: rgba(103, 245, 227, 0.46);
  font-size: clamp(10px, 0.9vw, 12.5px);
  line-height: 1.25;
  box-shadow:
    inset 0 0 30px rgba(103, 245, 227, 0.22),
    inset 0 -20px 34px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(167, 255, 131, 0.12),
    0 0 0 1px rgba(103, 245, 227, 0.08),
    0 0 34px rgba(103, 245, 227, 0.16),
    0 24px 48px rgba(0, 0, 0, 0.46);
}

.wizard-option::after {
  inset: 5.5%;
}

.wizard-option-label {
  max-width: 78%;
  font-weight: 500;
}

.wizard-option.is-picked {
  transform: scale(1.14);
}

.wizard-more {
  position: relative;
  z-index: 2;
  display: inline-flex;
  grid-column: 1 / -1;
  justify-self: center;
  width: auto;
  min-width: 206px;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: #8da6b8;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(5, 12, 19, 0.58);
  font: 500 9px/1.4 var(--font-mono);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.wizard-more:hover {
  color: #e1fbf4;
  border-color: rgba(103, 245, 227, 0.4);
  background: rgba(103, 245, 227, 0.06);
}

/* ---------- 4. 移动端：更少、更大、更好点 ---------- */

@media (max-width: 640px) {
  .api-status-chip {
    height: 26px;
    padding: 0 8px;
    font-size: 7.5px;
  }

  .api-status-label {
    max-width: 74px;
  }

  .api-status-arrow {
    display: none;
  }

  .api-connect-banner {
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 10px 8px;
    padding: 9px 10px;
  }

  .api-connect-copy {
    flex: 1 1 calc(100% - 38px);
  }

  .api-connect-btn {
    width: 100%;
    padding: 7px 10px;
    text-align: center;
  }

  .audit-api-note {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .audit-api-note .guide-btn {
    margin-left: 31px;
  }

  .key-guide-map {
    gap: 5px;
  }

  .key-guide-map-step {
    font-size: 8px;
  }

  .intro-hud {
    inset: 14px;
  }

  .intro-hud-top,
  .intro-hud-bottom {
    font-size: 6px;
    letter-spacing: 0.06em;
  }

  .intro-hud-top span:last-child,
  .intro-hud-bottom span:last-child {
    display: none;
  }

  .intro-reactor {
    top: 44%;
    width: min(88vw, 420px);
    opacity: 0.7;
  }

  .intro-ring.is-one { inset: 12%; }
  .intro-ring.is-two { inset: 24%; }
  .intro-ring.is-three { inset: 36%; }

  .intro-core-glow {
    width: 120px;
    height: 120px;
  }

  .intro-content {
    width: calc(100vw - 28px);
  }

  .intro-kicker {
    margin-bottom: 20px;
    font-size: 7px;
    letter-spacing: 0.16em;
  }

  .intro-title-lead {
    margin-bottom: 10px;
    font-size: 10px;
    letter-spacing: 0.34em;
  }

  .intro-title-main {
    font-size: clamp(34px, 10.4vw, 54px);
    line-height: 1.04;
  }

  .intro-title-rule {
    width: min(260px, 68%);
    margin-top: 14px;
  }

  .intro-sub {
    margin: 16px 0 26px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .engine-wrap {
    width: 100%;
    gap: 10px;
  }

  .engine-btn {
    width: min(320px, 100%);
    min-height: 52px;
    padding: 0 20px;
    font-size: 11.5px;
  }

  .engine-caption {
    font-size: 7px;
  }

  .intro-checks {
    width: min(340px, 100%);
    flex-direction: column;
    gap: 5px;
    margin-top: 22px;
  }

  .intro-check {
    width: 100%;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 8px;
  }

  .intro-check em {
    margin-left: auto;
  }

  .wizard-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
    min-height: 460px;
    max-height: 68dvh;
    gap: 8px 6px;
    padding: 24px 4px 12px;
    scrollbar-width: none;
  }

  .wizard-options::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .wizard-options::before {
    inset: -12% -30%;
    opacity: 0.52;
  }

  .wizard-option {
    width: var(--bubble-size, 144px);
    font-size: 10.5px;
  }

  .wizard-options.is-expanded {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px 5px;
  }

  .wizard-options.is-expanded .wizard-option {
    width: clamp(88px, 26vw, 108px);
    font-size: 9px;
  }

  .wizard-option-label {
    max-width: 80%;
  }

  .wizard-option.is-picked {
    transform: scale(1.09);
  }

  .wizard-more {
    min-width: 178px;
    min-height: 36px;
    margin-top: 2px;
    font-size: 8.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-aurora,
  .intro-ring,
  .intro-core,
  .intro-core-glow,
  .engine-btn-sheen::before,
  .api-status-chip[data-state="missing"] .api-status-dot {
    animation: none !important;
  }
}

html.reduce-motion .intro-aurora,
html.reduce-motion .intro-ring,
html.reduce-motion .intro-core,
html.reduce-motion .intro-core-glow,
html.reduce-motion .engine-btn-sheen::before,
html.reduce-motion .api-status-chip[data-state="missing"] .api-status-dot {
  animation: none !important;
}

/* ---------- 5. 外部寻宝移动端：单列流式布局，避免侧栏覆盖正文 ---------- */

@media (max-width: 980px) {
  .audit-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .audit-main,
  .audit-side {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
  }

  .audit-side {
    display: grid;
    grid-template-columns: 1fr;
    padding-bottom: 8px;
  }

  .audit-side-panel {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .audit-body {
    padding: 12px 14px 14px;
  }

  .audit-paste.is-long {
    min-height: 168px;
    max-height: 34dvh;
  }

  .audit-paste-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 8px;
    padding: 8px 0 4px;
    background: linear-gradient(180deg, rgba(7, 12, 20, 0), rgba(7, 12, 20, 0.92) 42%);
  }

  .audit-long-options {
    margin-top: 10px;
  }

  .audit-file-drop {
    padding: 10px 11px;
  }

  .audit-radar-note,
  .audit-api-note {
    font-size: 8.5px;
  }
}

/* ---------- 6. 多选向导：下一步按钮 ---------- */

.wizard-foot {
  flex-wrap: wrap;
  gap: 8px;
}

.wizard-next {
  margin-left: 0;
  padding: 8px 16px;
  color: #061311;
  border: 1px solid rgba(103, 245, 227, 0.6);
  border-radius: 999px;
  background: linear-gradient(110deg, var(--lab-cyan, var(--accent)), var(--lab-green, #a7ff83));
  font: 600 9.5px/1.2 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.wizard-next:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(103, 245, 227, 0.28);
}

.wizard-next:disabled {
  color: rgba(159, 243, 221, 0.42);
  border-color: rgba(103, 245, 227, 0.14);
  background: rgba(103, 245, 227, 0.045);
  cursor: not-allowed;
  opacity: 1;
  filter: none;
  box-shadow: none;
}

@media (max-width: 640px) {
  .wizard-next {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 10.5px;
  }

  .wizard-hint {
    width: 100%;
    margin-left: 0;
    order: -1;
    text-align: center;
  }
}

/* 开始寻宝/开始质检：有内容时高亮，且永远不被页脚或侧栏盖住 */
.audit-paste-actions {
  position: relative;
  z-index: 4;
}

#auditStart {
  position: relative;
  z-index: 5;
  transition: box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
}

#auditStart.is-ready {
  box-shadow:
    0 0 0 3px rgba(110, 231, 199, 0.12),
    0 0 24px rgba(110, 231, 199, 0.28);
}

#auditStart[disabled],
#auditStart[aria-disabled="true"] {
  cursor: wait;
}

/* 画像页粒子：只做背景景深，不参与点击 */
.wizard-dust {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}

.wizard-dust[hidden] {
  display: none !important;
}

.wizard-overlay .wizard-card {
  position: relative;
  z-index: 2;
}

@media (max-width: 640px) {
  .wizard-dust {
    opacity: 0.42;
  }
}

/* ==========================================================================
   V5.3.2 · 纯净模式 / 上下文隔离 / CoT 思考过程
   ========================================================================== */

.mode-badge.is-pure {
  color: #9ff3dd;
  border-color: rgba(103, 245, 227, 0.3);
  background: rgba(103, 245, 227, 0.06);
}

.mode-badge.is-pure::before {
  background: var(--lab-cyan, var(--accent));
  box-shadow: 0 0 10px rgba(103, 245, 227, 0.6);
}

.pure-btn.is-on {
  color: #9ff3dd;
  border-color: rgba(103, 245, 227, 0.34);
  background: rgba(103, 245, 227, 0.07);
}

.pure-btn.is-on:hover {
  color: #d8fff6;
  background: rgba(103, 245, 227, 0.12);
}

.context-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  color: #6f8799;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(5, 11, 18, 0.32);
  font: 500 8px/1.4 var(--font-mono);
  letter-spacing: 0.02em;
}

.context-isolation {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: #7f9a9a;
  border: 0;
  background: none;
  font: inherit;
  white-space: nowrap;
  cursor: help;
}

.context-isolation::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(103, 245, 227, 0.55);
  box-shadow: 0 0 8px rgba(103, 245, 227, 0.4);
  content: "";
}

.context-usage {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  white-space: nowrap;
}

.context-track {
  display: block;
  width: 86px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

#contextBar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(103, 245, 227, 0.55), rgba(167, 255, 131, 0.8));
  transition: width 260ms ease, background 220ms ease;
}

.context-token {
  color: #8298a9;
}

.context-token b {
  color: #b9d9d4;
  font-weight: 500;
}

.context-warning {
  color: #e8c98f;
  white-space: nowrap;
}

.context-warning[hidden] {
  display: none !important;
}

.context-new {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: #9db4c3;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: transparent;
  font: 500 8px/1.3 var(--mono, var(--font-mono));
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.context-new:hover {
  color: #e1fbf4;
  border-color: rgba(103, 245, 227, 0.4);
  background: rgba(103, 245, 227, 0.06);
}

.context-strip.is-warn {
  border-top-color: rgba(245, 194, 107, 0.16);
}

.context-strip.is-warn #contextBar {
  background: linear-gradient(90deg, rgba(245, 194, 107, 0.6), rgba(245, 194, 107, 0.95));
}

.cot-panel {
  width: min(100%, 720px);
  margin: 0 0 9px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(148, 163, 184, 0.055), rgba(7, 13, 21, 0.25));
}

.cot-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: #879dad;
  font: 500 8.5px/1.4 var(--font-mono);
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
  transition: color 160ms ease, background 160ms ease;
}

.cot-summary::-webkit-details-marker {
  display: none;
}

.cot-summary::before {
  color: #5c7385;
  content: "▸";
  font-size: 9px;
}

.cot-panel[open] .cot-summary::before {
  content: "▾";
}

.cot-summary:hover {
  color: #c9e5e0;
  background: rgba(103, 245, 227, 0.03);
}

.cot-icon {
  font-size: 10px;
  filter: saturate(0.7);
}

.cot-hint {
  margin-left: auto;
  color: #5f7688;
  font-size: 7.5px;
}

.cot-body {
  max-height: 260px;
  padding: 8px 10px 10px;
  overflow-y: auto;
  color: #8fa6b8;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font: 400 10px/1.75 var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-bubble.is-streaming + .cot-panel {
  margin-top: 0;
}

@media (max-width: 640px) {
  .context-strip {
    flex-wrap: wrap;
    gap: 5px 8px;
    padding: 6px 10px;
  }

  .context-isolation {
    font-size: 7.5px;
  }

  .context-usage {
    margin-left: auto;
  }

  .context-track {
    width: 58px;
  }

  .context-warning {
    width: 100%;
    order: 3;
    font-size: 7.5px;
  }

  .context-new {
    order: 2;
  }

  .cot-body {
    max-height: 200px;
    font-size: 9.5px;
  }
}

/* V5.4 · 参考解法免责声明 */
.audit-reference-disclaimer,
.b-reference-disclaimer {
  margin: 8px 0 0;
  color: #5f7384;
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.b-reference-disclaimer {
  font-size: 8px;
}

/* V5.4.2 · 语音转写 */
.stt-panel {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(103, 245, 227, 0.14);
  border-radius: 9px;
  background:
    radial-gradient(220px 80px at 8% 0%, rgba(103, 245, 227, 0.055), transparent 70%),
    rgba(7, 13, 21, 0.42);
}

.stt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stt-kicker {
  color: #7de3d2;
  font: 500 8px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
}

.stt-model-label {
  margin-left: auto;
  color: #62798b;
  font-size: 8px;
}

.stt-model {
  max-width: 230px;
  height: 25px;
  padding: 0 7px;
  color: #c7dce4;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: #0a121a;
  font: 9px var(--font-mono);
}

.stt-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

.stt-record-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.stt-record-btn.is-recording {
  color: #ffe0d6;
  border-color: rgba(255, 122, 105, 0.4);
  background: rgba(255, 122, 105, 0.1);
}

.stt-drop {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 7px 10px;
  color: #8fa6b8;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.025);
  font-size: 9px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.stt-drop small {
  color: #5d7385;
  font-size: 7.5px;
}

.stt-drop:hover,
.stt-drop.is-dragging {
  border-color: rgba(103, 245, 227, 0.45);
  background: rgba(103, 245, 227, 0.045);
}

.stt-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.stt-cancel {
  flex: 0 0 auto;
  padding: 0 9px;
  color: #c59a9a;
  border: 1px solid rgba(255, 122, 105, 0.2);
  border-radius: 6px;
  background: transparent;
  font-size: 8.5px;
  cursor: pointer;
}

.stt-status {
  margin: 8px 0 0;
  color: #647b8d;
  font-size: 8px;
  line-height: 1.65;
}

.stt-status.is-error {
  color: #d9a0a0;
}

.stt-status.is-loading {
  color: #9ed9cc;
}

.stt-status.is-ok {
  color: #9ff3dd;
}

@media (max-width: 640px) {
  .stt-row {
    flex-wrap: wrap;
  }

  .stt-record-btn {
    width: 100%;
    min-height: 36px;
  }

  .stt-drop {
    width: 100%;
    flex-basis: 100%;
  }

  .stt-model {
    max-width: 100%;
    flex: 1 1 100%;
  }

  .stt-model-label {
    margin-left: 0;
  }
}

/* V5.4.3.2 · 长文质检通过 / 实质修正 */
.audit-long-pass {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 0 4px;
  padding: 11px 13px;
  border: 1px solid rgba(245, 194, 107, 0.26);
  border-radius: 10px;
  background:
    radial-gradient(260px 120px at 0% 0%, rgba(245, 194, 107, 0.06), transparent 72%),
    rgba(18, 14, 8, 0.45);
}

.audit-long-pass[hidden] {
  display: none !important;
}

.audit-long-pass-stars {
  flex: 0 0 auto;
  color: #f5c26b;
  font-size: 14px;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.audit-long-pass div b {
  display: block;
  color: #f5d19a;
  font-size: 11.5px;
  font-weight: 500;
}

.audit-long-pass div span {
  display: block;
  margin-top: 3px;
  color: #a89478;
  font-size: 8.5px;
  line-height: 1.65;
}

.audit-long-pass-list {
  margin: 6px 0 0;
  padding-left: 15px;
  color: #c8b08a;
  font-size: 8.5px;
  line-height: 1.7;
}

.audit-long-pass-list li {
  margin: 2px 0;
}

/* V5.4.4 · Ground Truth 定向捕猎 */
.audit-gt {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(10, 15, 22, 0.45);
}

.audit-gt.has-gt {
  border-color: rgba(245, 194, 107, 0.3);
  background:
    radial-gradient(240px 100px at 0% 0%, rgba(245, 194, 107, 0.06), transparent 70%),
    rgba(10, 15, 22, 0.5);
}

.audit-gt-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.audit-gt-summary::-webkit-details-marker {
  display: none;
}

.audit-gt-summary-title {
  color: #c8d5e1;
  font-size: 10px;
  font-weight: 500;
}

.audit-gt-badge {
  padding: 2px 6px;
  color: #8fa5b6;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  font: 500 7.5px/1.3 var(--font-mono);
  letter-spacing: 0.04em;
}

.audit-gt.has-gt .audit-gt-badge {
  color: #f5c26b;
  border-color: rgba(245, 194, 107, 0.26);
  background: rgba(245, 194, 107, 0.08);
}

.audit-gt-chevron {
  margin-left: auto;
  color: #6d8193;
  font-size: 12px;
  transition: transform 160ms ease;
}

.audit-gt[open] .audit-gt-chevron {
  transform: rotate(180deg);
}

.audit-gt-body {
  padding: 0 12px 12px;
}

.audit-gt-help {
  margin: 0 0 8px;
  color: #7f92a4;
  font-size: 8.5px;
  line-height: 1.7;
}

.audit-gt-input {
  width: 100%;
  min-height: 96px;
  padding: 9px 10px;
  color: #dbe7f2;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(5, 9, 14, 0.55);
  font: 400 10px/1.75 var(--font-sans);
  resize: vertical;
}

.audit-gt-input:focus {
  border-color: rgba(245, 194, 107, 0.4);
  outline: none;
}

.audit-gt-input::placeholder {
  color: #536575;
}

.audit-gt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.audit-gt-file {
  cursor: pointer;
}

.audit-gt-status {
  color: #6f8495;
  font-size: 8px;
}

.audit-gt.has-gt .audit-gt-status {
  color: #d8b07a;
}

.audit-gt-clear {
  margin-left: auto;
  padding: 4px 7px;
  color: #6f8495;
  border: 0;
  background: transparent;
  font-size: 8px;
  cursor: pointer;
}

.audit-gt-clear:hover {
  color: #d8b07a;
}

.audit-gt-privacy {
  margin: 7px 0 0;
  color: #536575;
  font-size: 7.5px;
  line-height: 1.6;
}

.audit-web-verify {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 10px 13px;
  border: 1px solid rgba(110, 231, 199, 0.2);
  border-radius: 10px;
  background: rgba(8, 18, 18, 0.46);
}

.audit-web-verify.is-fail {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(40, 12, 12, 0.36);
}

.audit-web-kicker {
  flex: 0 0 auto;
  color: #6ee7c7;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  line-height: 1.8;
  white-space: nowrap;
}

.audit-web-verify.is-fail .audit-web-kicker {
  color: #fca5a5;
}

.audit-web-verify div b {
  display: block;
  color: #cdeee3;
  font-size: 10px;
  font-weight: 500;
}

.audit-web-verify.is-fail div b {
  color: #fca5a5;
}

.audit-web-verify div span {
  display: block;
  margin-top: 2px;
  color: #7f9b93;
  font-size: 8px;
  line-height: 1.6;
}

.audit-long-gt {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 10px 13px;
  border: 1px solid rgba(245, 194, 107, 0.24);
  border-radius: 10px;
  background:
    radial-gradient(280px 120px at 0% 0%, rgba(245, 194, 107, 0.08), transparent 72%),
    rgba(18, 14, 8, 0.36);
}

.audit-long-gt[hidden] {
  display: none !important;
}

.audit-long-gt.is-hit {
  border-color: rgba(245, 194, 107, 0.34);
}

.audit-long-gt.is-miss {
  border-color: rgba(248, 113, 113, 0.34);
  background:
    radial-gradient(280px 120px at 0% 0%, rgba(248, 113, 113, 0.06), transparent 72%),
    rgba(20, 10, 10, 0.4);
}

.audit-long-gt-kicker {
  color: #a88f68;
  font: 500 7.5px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
}

.audit-long-gt b {
  color: #f5d19a;
  font-size: 11px;
  font-weight: 500;
}

.audit-long-gt.is-miss b {
  color: #fca5a5;
}

.audit-long-gt span:last-child {
  color: #8f8273;
  font-size: 8.5px;
  line-height: 1.6;
}

.audit-long-gt-fail {
  margin: 10px 0 8px;
  padding: 12px 14px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  background: rgba(40, 12, 12, 0.4);
}

.audit-long-gt-fail b {
  display: block;
  color: #fca5a5;
  font-size: 11.5px;
  font-weight: 500;
}

.audit-long-gt-fail p {
  margin: 4px 0 0;
  color: #a88b8b;
  font-size: 9px;
  line-height: 1.65;
}

.audit-long-gt-failed-report {
  opacity: 0.72;
}

.audit-search-status {
  margin: 8px 0 0;
  cursor: pointer;
  color: #6f8495;
  font-size: 8px;
  line-height: 1.6;
}

.audit-search-status.is-on {
  color: #8ff0d6;
}

.audit-search-status.is-warn {
  color: #d8b07a;
}

/* V5.4.2 · 长文参考解法 */
.audit-long-reference {
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid rgba(245, 194, 107, 0.2);
  border-radius: 10px;
  background:
    radial-gradient(260px 120px at 0% 0%, rgba(245, 194, 107, 0.06), transparent 70%),
    rgba(10, 15, 22, 0.55);
}

.audit-long-reference-head h3 {
  margin: 2px 0 4px;
  color: #e8c98f;
  font-size: 12px;
  font-weight: 500;
}

.audit-long-reference-head p {
  margin: 0;
  color: #7f8f9d;
  font-size: 8.5px;
  line-height: 1.7;
}

.audit-long-reference-kicker {
  color: #a88f68;
  font: 500 7.5px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
}

.audit-long-reference-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.audit-long-ref-item {
  padding: 8px 9px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.03);
}

.audit-long-ref-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.audit-long-ref-type {
  color: #e8c98f;
  font: 500 8px/1.2 var(--font-mono);
}

.audit-long-ref-index {
  color: #617789;
  font: 500 7.5px/1.2 var(--font-mono);
}

.audit-long-ref-quote {
  margin: 0 0 4px;
  color: #b8c9d4;
  font-size: 9.5px;
  line-height: 1.65;
}

.audit-long-ref-action {
  margin: 0;
  color: #86a08d;
  font-size: 8.5px;
  line-height: 1.65;
}

.audit-long-ref-action b {
  color: #a9c4b0;
  font-weight: 500;
}

.audit-long-ref-correction {
  margin: 5px 0 0;
  padding-top: 5px;
  border-top: 1px solid rgba(110, 231, 199, 0.12);
  color: #c9d9d2;
  font-size: 10px;
  line-height: 1.7;
}

.audit-long-ref-correction b {
  color: #8ff0d6;
  font-weight: 500;
}

.audit-long-ref-basis {
  margin: 3px 0 0;
  color: #6f887d;
  font-size: 8.5px;
  line-height: 1.6;
}

.audit-long-ref-unresolved {
  margin: 5px 0 0;
  color: #d8b07a;
  font-size: 9px;
  line-height: 1.6;
}

.audit-long-ref-busy {
  margin: 5px 0 0;
  color: #8fa5b6;
  font-size: 9px;
  line-height: 1.6;
}

.audit-long-manual {
  margin: 4px 0 8px;
  color: #5f7384;
  font-size: 8px;
  line-height: 1.6;
}

/* V5.4.3 · 多会话历史 */
.context-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.context-history-btn b {
  color: #bff7e9;
  font-weight: 500;
}

.session-history-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9300;
  width: min(360px, 100vw);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(103, 245, 227, 0.22);
  background:
    radial-gradient(300px 140px at 0% 0%, rgba(103, 245, 227, 0.07), transparent 70%),
    #0a121a;
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.55);
}

.session-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 13px 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.session-history-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-history-kicker {
  color: #6d8798;
  font: 500 7.5px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
}

.session-history-head b {
  color: #d7e9ee;
  font-size: 12px;
  font-weight: 500;
}

.session-history-close {
  width: 26px;
  height: 26px;
  color: #879dad;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 50%;
  background: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.session-history-list {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  overflow-y: auto;
}

.session-history-item {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  color: #a9bdc9;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.025);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.session-history-item:hover {
  border-color: rgba(103, 245, 227, 0.28);
  background: rgba(103, 245, 227, 0.04);
}

.session-history-item.is-active {
  border-color: rgba(103, 245, 227, 0.4);
  background: rgba(103, 245, 227, 0.065);
}

.session-history-item-title {
  color: #d7ebe8;
  font-size: 10.5px;
  line-height: 1.4;
}

.session-history-item-meta {
  color: #60788a;
  font: 500 7.5px/1.4 var(--font-mono);
}

.session-history-item-preview {
  overflow: hidden;
  color: #728a9b;
  font-size: 8.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-history-empty {
  padding: 18px 10px;
  color: #6a8090;
  font-size: 9px;
  text-align: center;
}

.session-history-note {
  margin: 0;
  padding: 8px 13px 11px;
  color: #5d7385;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 8px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .session-history-panel {
    width: 100vw;
  }
}

/* V5.5.3.1 · 双 Key 设置卡 */
.settings-keys {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(7, 12, 18, 0.42);
}

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

.settings-keys-head h3 {
  margin: 0;
  color: #e4f2ef;
  font-size: 13px;
  font-weight: 500;
}

.settings-keys-lead {
  margin: 4px 0 0;
  color: #8198a8;
  font-size: 9.5px;
  line-height: 1.6;
}

.settings-mode-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
}

.settings-mode-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border: 1px solid #66788a;
  border-radius: 50%;
  background: transparent;
}

.settings-mode-row.is-ready .settings-mode-dot {
  border-color: #6ee7c7;
  background: #6ee7c7;
}

.settings-mode-row.is-none .settings-mode-dot {
  border-color: #66788a;
  background: transparent;
}

.settings-mode-row b {
  color: #cfe5df;
  font-size: 9.5px;
  font-weight: 500;
}

.settings-mode-row span:last-child {
  color: #748b9b;
  font-size: 8.5px;
}

.settings-key-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-key-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 9px;
  background: rgba(5, 10, 16, 0.46);
}

.settings-key-card[data-key="deepseek"] {
  border-top: 1px solid rgba(143, 182, 255, 0.52);
}

.settings-key-card[data-key="siliconflow"] {
  border-top: 1px solid rgba(110, 231, 199, 0.46);
}

.settings-key-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-key-card-head h4 {
  margin: 0;
  color: #dcecea;
  font-size: 10.5px;
  font-weight: 500;
}

.settings-key-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  font: 7px/1.4 var(--font-mono);
  letter-spacing: 0.04em;
}

.settings-key-badge.is-optional {
  color: #d8b07a;
  border-color: rgba(245, 194, 107, 0.28);
}

.settings-key-badge.is-required {
  color: #9fe8d3;
  border-color: rgba(110, 231, 199, 0.26);
}

.settings-key-use {
  margin: 0;
  color: #c0d5d1;
  font-size: 9.5px;
}

.settings-key-help {
  margin: 0;
  color: #758b99;
  font-size: 8.5px;
  line-height: 1.55;
}

.settings-key-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.settings-key-actions .settings-status {
  margin-left: auto;
}

.settings-key-session {
  margin: 2px 0 0;
  color: #5f737f;
  font-size: 8px;
  line-height: 1.55;
}

.settings-focus-key {
  display: none;
}

.settings-keys-tagline {
  margin: 0;
  color: #b9d8cf;
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.settings-keys-reassurance {
  margin: 0;
  color: #6f8492;
  font-size: 8.5px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .settings-key-grid {
    grid-template-columns: 1fr;
  }

  .settings-keys {
    padding: 13px;
  }

  .settings-keys-head {
    align-items: flex-start;
  }
}

/* V5.5.3.1 · Key 门禁 */
.key-gate-backdrop {
  z-index: 100010;
}

.key-gate-card {
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: #0c131b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.key-gate-card h2 {
  margin: 7px 0 0;
  color: #e5f2ef;
  font-size: 19px;
  font-weight: 500;
}

.key-gate-card p {
  margin: 8px 0 0;
  color: #8fa5b2;
  font-size: 10px;
  line-height: 1.7;
}

.key-gate-session {
  color: #637985 !important;
  font-size: 8.5px !important;
}

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

.key-gate-actions .primary-btn {
  min-height: 32px;
  padding: 0 14px;
  font-size: 9px;
}

.settings-key-card.is-highlight {
  outline: 1px solid rgba(110, 231, 199, 0.7);
  outline-offset: 2px;
}

/* V5.5.3.1 · STT 无 SF Key 时保持可点击，只做视觉提示 */
.stt-panel.is-key-locked {
  border-color: rgba(245, 194, 107, 0.22);
}

.stt-panel.is-key-locked .stt-kicker {
  color: #d8b07a;
}

.stt-status.is-warn {
  color: #d8b07a;
}

.key-guide-providers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

/* V5.5.3.2 · 长文报告防右侧溢出：长链接、连续英文、表格与 flex 子项都不得撑破容器 */
.audit-card,
.audit-body,
.audit-main,
.audit-long-step,
.audit-long-report,
.audit-long-reference {
  min-width: 0;
  max-width: 100%;
}

.audit-main,
.audit-long-step {
  overflow-x: hidden;
}

.audit-long-head {
  min-width: 0;
}

.audit-long-head > div {
  min-width: 0;
}

.audit-long-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-long-report {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-long-report a,
.audit-long-report code,
.audit-long-report p,
.audit-long-report li,
.audit-long-report blockquote,
.audit-long-report h1,
.audit-long-report h2,
.audit-long-report h3,
.audit-long-report h4 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-long-report .md-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.audit-long-report .md-table th,
.audit-long-report .md-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-long-report .md-code-block,
.audit-long-report pre {
  max-width: 100%;
  overflow-x: auto;
}

.audit-long-actions {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .audit-body {
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* V5.5.4 · DeepSeek 模型选择 */
.settings-key-model {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.settings-key-model > span {
  color: #9bb3b7;
  font: 500 8px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
}

.settings-key-model .settings-key-input {
  width: 100%;
  min-height: 28px;
  padding: 4px 7px;
  color: #d8e8f4;
  background: rgba(5, 9, 14, 0.6);
}

.settings-key-model .settings-key-input:disabled {
  color: #637985;
  cursor: not-allowed;
}

.settings-key-model-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.settings-key-model-actions .settings-model-status {
  color: #697f8c;
  font-size: 8px;
  line-height: 1.45;
}

/* V5.5.5 · 模型选择与 Key 入口分离 */
.settings-model-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(7, 12, 18, 0.42);
}

.settings-model-picker-head h3 {
  margin: 0;
  color: #e4f2ef;
  font-size: 13px;
  font-weight: 500;
}

.settings-model-picker-lead {
  margin: 4px 0 0;
  color: #8198a8;
  font-size: 9.5px;
  line-height: 1.6;
}

.settings-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-model-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 9px;
  background: rgba(5, 10, 16, 0.46);
}

.settings-model-card[data-provider="deepseek"] {
  border-top: 1px solid rgba(143, 182, 255, 0.52);
}

.settings-model-card[data-provider="siliconflow"] {
  border-top: 1px solid rgba(110, 231, 199, 0.46);
}

.settings-model-card .settings-key-input,
.settings-model-card .settings-input {
  width: 100%;
  min-width: 0;
}

.settings-key-model-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .settings-model-grid {
    grid-template-columns: 1fr;
  }

  .settings-model-picker {
    padding: 13px;
  }
}

/* V5.5.5 · 记住 Key */
.settings-remember {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 2px;
  color: #9db0b7;
  font-size: 8.5px;
  line-height: 1.5;
  cursor: pointer;
}

.settings-remember input {
  width: 13px;
  height: 13px;
  margin: 1px 0 0;
  accent-color: #6ee7c7;
}

.settings-remember-note {
  margin: -2px 0 0 20px;
  color: #5f737f;
  font-size: 8px;
  line-height: 1.5;
}

/* V5.5.5 · 报告防溢出加强：覆盖 .audit-result 与所有后代 */
.audit-result,
.audit-view,
.audit-card,
.audit-body,
.audit-main,
.audit-long-step,
.audit-long-report,
.audit-long-reference {
  min-width: 0;
  max-width: 100%;
}

.audit-result,
.audit-main,
.audit-long-step,
.audit-long-report {
  overflow-x: hidden;
}

.audit-long-report,
.audit-long-report * {
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.audit-long-report .md-table {
  width: 100% !important;
  table-layout: fixed;
}

.audit-long-report .md-table th,
.audit-long-report .md-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-long-report pre,
.audit-long-report .md-code-block {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* V5.5.4 · 设置面板移动端防右侧裁切 */
.settings-body,
.settings-key-grid,
.settings-key-card,
.settings-model-picker,
.settings-model-grid,
.settings-model-card,
.settings-key-actions,
.settings-key-model-actions {
  min-width: 0;
  max-width: 100%;
}

.settings-body,
.settings-key-card,
.settings-model-picker,
.settings-model-card {
  overflow-x: hidden;
}

.settings-key-actions,
.settings-model-actions {
  flex-wrap: wrap;
}

.settings-key-actions .settings-status,
.settings-model-status {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .settings-key-card,
  .settings-model-card,
  .settings-model-picker {
    width: 100%;
  }

  .settings-model-field {
    grid-template-columns: 52px minmax(0, 1fr);
  }
}

/* V5.5.4 · 页面级横向兜底：报告/侧栏/头部都不得把页面撑宽 */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.workspace-view,
.audit-view,
.audit-long-head,
.audit-long-gt,
.audit-web-verify,
.audit-long-pass,
.audit-long-reference,
.audit-long-reference-list,
.audit-long-actions {
  min-width: 0;
  max-width: 100%;
}

.audit-long-gt,
.audit-web-verify,
.audit-long-pass,
.audit-long-reference {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-long-report {
  word-break: break-all;
}

/* V5.5.4 · 模型区不能被 settings-body 的 flex 压缩裁掉 */
.settings-keys,
.settings-model-picker,
.settings-model-card,
.settings-key-card {
  flex: 0 0 auto;
}

.settings-model-picker {
  overflow: visible;
}
