/* =========================================================
   在线虚拟小智 · design system
   冷白 / 深海军蓝 / 单一蓝色品牌色；桌面与移动原生布局
   ========================================================= */

:root {
  color-scheme: light;
  --desk: #e7edf7;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #edf2fa;
  --ink: #182134;
  --ink-2: #4a5770;
  --muted: #7a869c;
  --line: #e1e8f4;
  --line-strong: #cbd6e8;
  --accent: #3355e0;
  --accent-2: #2742b8;
  --accent-soft: #e8edfc;
  --accent-ink: #f7f8ff;
  --sage: #6e7c61;
  --sage-soft: #e6ebdd;
  --danger: #b4452f;
  --shadow-sm: 0 1px 2px rgba(20, 34, 60, 0.04);
  --shadow: 0 2px 6px rgba(20, 34, 60, 0.04), 0 14px 36px rgba(20, 34, 60, 0.07);
  --radius: 18px;
  --radius-sm: 13px;
  --tap: rgba(20, 34, 60, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --desk: #060a13;
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #172236;
  --ink: #edf3ff;
  --ink-2: #cbd5e8;
  --muted: #8996ad;
  --line: #22304a;
  --line-strong: #30415f;
  --accent: #7b90ff;
  --accent-2: #94a6ff;
  --accent-soft: #1b2743;
  --accent-ink: #0e1220;
  --sage: #93a382;
  --sage-soft: #262d22;
  --danger: #e0846c;
  --tap: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 18px 40px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --desk: #060a13;
    --bg: #0b1220;
    --surface: #111a2b;
    --surface-2: #172236;
    --ink: #edf3ff;
    --ink-2: #cbd5e8;
    --muted: #8996ad;
    --line: #22304a;
    --line-strong: #30415f;
    --accent: #7b90ff;
    --accent-2: #94a6ff;
    --accent-soft: #1b2743;
    --accent-ink: #0e1220;
    --sage: #93a382;
    --sage-soft: #262d22;
    --danger: #e0846c;
    --tap: rgba(255, 255, 255, 0.06);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

input,
textarea {
  font: inherit;
  color: var(--ink);
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: none;
}

/* ---------- shell ---------- */

.app-shell {
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-main {
  flex: 1;
  min-height: 0;
}

@media (min-width: 760px) {
  body {
    padding: 26px 0;
  }
  .app-shell {
    min-height: calc(100dvh - 52px);
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 30px 80px rgba(28, 27, 24, 0.16);
  }
  html[data-theme="dark"] .app-shell {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  }
}

/* ---------- top bars ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(env(safe-area-inset-top) + 16px) 20px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
  flex: none;
}

.icon-btn:active {
  background: var(--tap);
  transform: scale(0.95);
}

@media (hover: hover) {
  .icon-btn:hover {
    background: var(--tap);
  }
}

.icon-btn .icon {
  width: 22px;
  height: 22px;
}

.sub-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.sub-top h1 {
  margin: 0;
  text-align: center;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sub-spacer {
  width: 40px;
  height: 40px;
}

/* ---------- home ---------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px 8px;
}

.section-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.section-count {
  font-size: 12px;
  color: var(--muted);
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}

.agent-list {
  padding: 0 12px;
}

.agent-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 10px;
  border-radius: 16px;
  transition: background 0.15s ease, transform 0.12s ease;
}

.agent-row + .agent-row {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.agent-row:active {
  background: var(--tap);
}

@media (hover: hover) {
  .agent-row:hover {
    background: var(--tap);
  }
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.row-title {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.row-time {
  flex: none;
  color: var(--muted);
  font-size: 11.5px;
}

.row-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-chevron {
  color: var(--line-strong);
  width: 17px;
  height: 17px;
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.bind-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 20px 12px;
  padding: 15px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.bind-card:active {
  transform: scale(0.99);
}

.bind-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.bind-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.bind-title {
  font-size: 15px;
  font-weight: 600;
}

.bind-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.status-pill {
  flex: none;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

.status-pill.is-on {
  background: var(--sage-soft);
  color: var(--sage);
}

.home-note,
.settings-note {
  padding: 8px 24px 26px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- avatars ---------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border-radius: 15px;
  background: var(--surface-2);
  color: var(--muted);
}

.avatar svg {
  width: 56%;
  height: 56%;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.avatar-md {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.avatar-lg {
  width: 50px;
  height: 50px;
  border-radius: 16px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  border-radius: 20px;
}

.avatar-ai-sage { background: #e4e9da; color: #5c6b4c; }
.avatar-ai-clay { background: #f3e1d7; color: #b45f3f; }
.avatar-ai-ochre { background: #f2e6cc; color: #9a7434; }
.avatar-user-clay { background: #eadfd7; color: #8c6a57; }
.avatar-user-sage { background: #e2e8da; color: #64735a; }
.avatar-user-ochre { background: #f0e5cc; color: #8f7137; }
.avatar-user-ink { background: #e3e2df; color: #4d4b46; }
.avatar-user-sand { background: #efe7d9; color: #8a7a5f; }
.avatar-user-rose { background: #f1e0dd; color: #9a5f57; }

html[data-theme="dark"] .avatar-ai-sage { background: #2b3225; color: #b3c39e; }
html[data-theme="dark"] .avatar-ai-clay { background: #3a2620; color: #e5a184; }
html[data-theme="dark"] .avatar-ai-ochre { background: #3a2f1c; color: #dcc08a; }
html[data-theme="dark"] .avatar-user-clay { background: #332a25; color: #d3b4a3; }
html[data-theme="dark"] .avatar-user-sage { background: #293025; color: #b8c9a7; }
html[data-theme="dark"] .avatar-user-ochre { background: #332d20; color: #d8c090; }
html[data-theme="dark"] .avatar-user-ink { background: #2b2a27; color: #c9c5bb; }
html[data-theme="dark"] .avatar-user-sand { background: #322c23; color: #d2c2a6; }
html[data-theme="dark"] .avatar-user-rose { background: #342725; color: #d8ada6; }

/* ---------- tabbar ---------- */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  gap: 6px;
  padding: 7px 18px calc(env(safe-area-inset-bottom) + 7px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0 3px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.tab .icon {
  width: 22px;
  height: 22px;
}

.tab.is-active {
  color: var(--accent);
}

/* ---------- chat ---------- */

.chat-page .app-shell {
  height: 100dvh;
  min-height: 100dvh;
}

.chat-page .app-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.chat-top {
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 8px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.chat-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.chat-title strong {
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.online i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7f9a6d;
  box-shadow: 0 0 0 3px rgba(127, 154, 109, 0.16);
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.day-divider {
  text-align: center;
  margin: 2px 0 4px;
}

.day-divider span {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
  animation: msg-in 0.18s ease-out both;
}

.msg-user {
  flex-direction: row-reverse;
}

.bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.52;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-assistant .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.msg-user .bubble {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 6px;
}

.msg.is-typing .bubble {
  padding: 12px 14px;
}

.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.1s infinite ease-in-out;
}

.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}

.composer .icon-btn {
  width: 38px;
  height: 38px;
  margin-bottom: 2px;
}

.composer-field {
  flex: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 6px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-field:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#messageInput {
  width: 100%;
  max-height: 112px;
  padding: 3px 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.45;
  overflow-y: auto;
}

#messageInput::placeholder {
  color: var(--muted);
}

.send-btn {
  width: 40px;
  height: 40px;
  margin-bottom: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  flex: none;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease;
}

.send-btn .icon {
  width: 19px;
  height: 19px;
}

.send-btn:active {
  transform: scale(0.93);
}

.send-btn:disabled {
  opacity: 0.38;
}

.voice-panel {
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 12px);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
}

.hold-talk {
  width: 100%;
  height: 50px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.12s ease;
}

.hold-talk.is-recording {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(0.99);
}

.hold-talk.is-cancel {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--muted);
}

.voice-hint {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
}

.rec-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(18, 16, 13, 0.28);
  backdrop-filter: blur(3px);
}

.rec-card {
  min-width: 210px;
  padding: 26px 30px 22px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 44px;
  margin-bottom: 12px;
}

.wave i {
  width: 4px;
  height: 12px;
  border-radius: 4px;
  background: var(--accent);
  animation: wave 1s infinite ease-in-out;
}

.wave i:nth-child(2) { animation-delay: 0.12s; }
.wave i:nth-child(3) { animation-delay: 0.24s; }
.wave i:nth-child(4) { animation-delay: 0.36s; }
.wave i:nth-child(5) { animation-delay: 0.48s; }

@keyframes wave {
  0%, 100% { height: 10px; opacity: 0.45; }
  50% { height: 34px; opacity: 1; }
}

.rec-time {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.rec-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- sheets ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(18, 16, 13, 0.32);
  backdrop-filter: blur(2px);
}

.sheet {
  width: 100%;
  max-width: 460px;
  padding: 8px 10px calc(env(safe-area-inset-bottom) + 10px);
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  animation: sheet-up 0.22s ease-out both;
}

@keyframes sheet-up {
  from { transform: translateY(14px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-size: 15.5px;
  color: var(--ink-2);
}

.sheet-item:active {
  background: var(--tap);
}

.sheet-item + .sheet-item {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.sheet-cancel {
  margin-top: 6px;
  border-top: 0;
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-2);
}

/* ---------- auth ---------- */

.auth-page {
  background: var(--bg);
}

.auth-page .app-shell {
  background: var(--bg);
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 44px) 24px 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px rgba(51, 85, 224, 0.22);
}

.brand-mark .icon {
  width: 24px;
  height: 24px;
}

.brand-mark-lg {
  width: 62px;
  height: 62px;
  border-radius: 20px;
}

.brand-mark-lg .icon {
  width: 32px;
  height: 32px;
}

.brand-name {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 29px;
  line-height: 1.25;
  letter-spacing: -0.04em;
  font-weight: 650;
}

.auth-sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.auth-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.segmented {
  display: flex;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--bg);
}

.seg-tab {
  flex: 1;
  height: 36px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 13px;
  line-height: 1.5;
}

.auth-form.is-hidden {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 12.5px;
}

.field input {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input::placeholder {
  color: var(--muted);
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.99);
}

.btn:disabled {
  opacity: 0.5;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

.btn-danger {
  background: var(--accent-soft);
  color: var(--danger);
}

.auth-legal {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- settings ---------- */

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 20px 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.profile-copy {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.profile-handle {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 1px;
}

.group {
  margin: 0 20px 16px;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.group-flat {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0 0 18px;
  padding: 0;
  overflow: visible;
}

.group-title {
  padding: 10px 16px 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.group-title + .setting-row,
.group-flat .setting-row:first-of-type {
  border-top: 0;
}

.setting-row .label {
  font-size: 15px;
  color: var(--ink);
}

.setting-row .value {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.setting-row .value .icon {
  width: 16px;
  height: 16px;
  color: var(--line-strong);
}

.setting-danger .label {
  color: var(--danger);
}

.setting-danger .value .icon {
  color: var(--danger);
}

.page-pad {
  padding: 16px 20px 32px;
}

.page-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

/* profile edit */

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.preview-name {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.preview-sub {
  color: var(--muted);
  font-size: 12.5px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.avatar-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.avatar-choice.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
}

/* security */

.info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.info-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--sage-soft);
  color: var(--sage);
  flex: none;
}

.info-title {
  font-size: 14.5px;
  font-weight: 600;
}

.info-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 1px;
}

.form-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

/* theme */

.theme-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
}

.theme-option.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.theme-swatch {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  flex: none;
  border: 1px solid var(--line);
}

.theme-light { background: linear-gradient(135deg, #f4f7fc 50%, #edf2fa 50%); }
.theme-dark { background: linear-gradient(135deg, #111a2b 50%, #0b1220 50%); }
.theme-auto { background: linear-gradient(135deg, #f4f7fc 50%, #111a2b 50%); }

.theme-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.theme-copy strong {
  font-size: 14.5px;
  font-weight: 600;
}

.theme-copy small {
  color: var(--muted);
  font-size: 12px;
}

.theme-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: transparent;
  background: var(--surface-2);
  flex: none;
}

.theme-check .icon {
  width: 14px;
  height: 14px;
}

.theme-option.is-active .theme-check {
  background: var(--accent);
  color: var(--accent-ink);
}

/* about */

.about-hero {
  padding: 18px 0 26px;
  text-align: center;
}

.about-hero .brand-mark {
  margin: 0 auto 14px;
}

.about-hero h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.about-hero p {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 13.5px;
}

.version-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.prose-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.prose-card h3 {
  margin: 18px 0 6px;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.prose-card h3:first-child {
  margin-top: 0;
}

.prose-card p {
  margin: 0 0 4px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
}

/* bind */

.bind-hero {
  padding: 18px 0 22px;
  text-align: center;
}

.bind-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.bind-hero-icon .icon {
  width: 30px;
  height: 30px;
}

.bind-hero-title {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.bind-hero-sub {
  max-width: 280px;
  margin: 7px auto 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.code-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.code-label {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.code-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 16px;
}

.code-boxes span {
  width: 42px;
  height: 50px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.code-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.steps {
  margin: 22px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step {
  display: flex;
  gap: 12px;
}

.step-no {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
  margin-top: 1px;
}

.step strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.device-meta {
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.meta-row:first-child {
  border-top: 0;
}

.meta-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ink-2);
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 92px);
  z-index: 120;
  max-width: 82vw;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(28, 27, 24, 0.92);
  color: #fffaf3;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

html[data-theme="dark"] .toast {
  background: rgba(245, 240, 230, 0.94);
  color: #1a1814;
}

/* ---------- misc ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 360px) {
  .auth-wrap,
  .page-pad {
    padding-left: 16px;
    padding-right: 16px;
  }
  .group,
  .profile-card,
  .bind-card {
    margin-left: 14px;
    margin-right: 14px;
  }
  .code-boxes span {
    width: 36px;
    height: 46px;
  }
}

/* ---------- v0.2: create / plan / manage ---------- */

.row-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line-strong);
  vertical-align: 2px;
}

.create-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 20px 6px;
  padding: 13px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--ink-2);
}

.create-row.is-locked {
  border-style: solid;
  background: var(--surface-2);
  color: var(--muted);
}

.create-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.create-icon .icon {
  width: 18px;
  height: 18px;
}

.create-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.create-copy strong {
  font-size: 14px;
  font-weight: 600;
}

.create-copy small {
  color: var(--muted);
  font-size: 11.5px;
}

.limit-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.limit-strip a {
  color: var(--accent);
  font-weight: 600;
}

.empty-card {
  padding: 34px 22px;
  margin-top: 22px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.empty-card-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-card h2 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.empty-card p {
  margin: 0 auto 18px;
  max-width: 280px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.agent-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.agent-preview-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.agent-preview-copy strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.agent-preview-copy span {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.created-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--sage-soft);
  color: var(--sage);
  font-size: 13px;
  line-height: 1.6;
}

.created-banner > span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--bg);
  display: grid;
  place-items: center;
  flex: none;
}

.created-banner .icon {
  width: 13px;
  height: 13px;
}

.created-banner p {
  margin: 0;
}

.agent-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
  scrollbar-width: none;
}

.agent-chips::-webkit-scrollbar {
  display: none;
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  flex: none;
}

.agent-chip.is-active {
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.chip-dot.is-on {
  background: var(--sage);
}

.demo-bind-btn {
  margin-top: 8px;
  height: 42px;
  font-size: 13.5px;
}

.chat-bind-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
}

.chat-bind-bar span:first-child {
  display: grid;
  place-items: center;
}

.chat-bind-bar .icon {
  width: 15px;
  height: 15px;
}

.chat-bind-bar strong {
  margin-left: auto;
  font-weight: 600;
}

.current-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 28px rgba(51, 85, 224, 0.22);
}

.current-plan-label {
  font-size: 11px;
  opacity: 0.75;
  letter-spacing: 0.1em;
}

.current-plan-name {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.current-plan-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.current-plan-meta strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.current-plan-meta span {
  font-size: 11px;
  opacity: 0.8;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.plan-card.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.plan-name {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.plan-tagline {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.plan-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 10.5px;
  font-weight: 600;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 12px 0 10px;
}

.plan-price strong {
  font-size: 26px;
  letter-spacing: -0.03em;
}

.plan-price span {
  color: var(--muted);
  font-size: 12px;
}

.plan-features {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

.plan-features .icon {
  width: 15px;
  height: 15px;
  color: var(--sage);
  margin-top: 2px;
}

.notice-card {
  margin-top: 18px;
  padding: 15px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-2);
}

.notice-card strong {
  font-size: 13px;
}

.notice-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.manage-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}

.stat-card strong {
  display: block;
  font-size: 21px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
}

.manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.manage-main {
  flex: 1;
  min-width: 0;
}

.manage-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.manage-top strong {
  font-size: 14.5px;
}

.manage-sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
}

.manage-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.manage-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.tier-select {
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 12px;
}

.mini-btn {
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.mini-btn:active {
  background: var(--line);
}

.mini-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  vertical-align: 2px;
}

.tier-free { background: var(--surface-2); color: var(--muted); }
.tier-plus { background: var(--sage-soft); color: var(--sage); }
.tier-pro { background: var(--accent-soft); color: var(--accent-2); }

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 18px;
  color: var(--accent);
  font-size: 13px;
}

.inline-link .icon {
  width: 14px;
  height: 14px;
}

.input-readonly {
  color: var(--muted) !important;
  background: var(--surface-2) !important;
}

@media (max-width: 380px) {
  .manage-row {
    flex-wrap: wrap;
  }
  .manage-actions {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* ---------- v0.3: motion / transitions / stream ---------- */

.app-shell {
  animation: page-in 0.28s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(9px);
  transition: opacity 0.36s ease, transform 0.36s cubic-bezier(0.22, 0.8, 0.3, 1);
}

html.js [data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

html.theme-fading,
html.theme-fading * {
  transition: background-color 0.34s ease, color 0.34s ease,
    border-color 0.34s ease, fill 0.34s ease, stroke 0.34s ease !important;
}

.online-link {
  color: var(--accent);
  text-decoration: none;
}

.online-link::before {
  display: none;
}

.icon-btn.is-off {
  color: var(--line-strong);
}

.icon-btn.is-off::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-45deg);
}

.icon-btn {
  position: relative;
}

.bubble.is-streaming::after {
  content: "▍";
  margin-left: 1px;
  color: var(--accent);
  animation: caret 0.9s steps(1) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

.sheet-danger {
  color: var(--danger);
}

.empty-btn {
  width: auto;
  padding: 0 22px;
  display: inline-flex;
}

.limit-strip {
  justify-content: flex-end;
}

.code-boxes span {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .app-shell,
  html.js [data-reveal] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---------- v0.4: binding / gate / typewriter ---------- */

.bubble.is-streaming::after {
  content: none !important;
  animation: none !important;
}

.bubble .char {
  filter: blur(2.4px);
  opacity: 0.55;
  transition: filter 0.22s ease, opacity 0.22s ease;
}

.bubble .char.is-clear {
  filter: none;
  opacity: 1;
}

.code-card {
  margin-bottom: 18px;
}

.bind-hero {
  margin-bottom: 18px;
}

.device-meta {
  margin-top: 18px;
}

.code-card .btn + .btn {
  margin-top: 12px;
}

.chat-gate {
  padding: 14px 16px calc(env(safe-area-inset-bottom) + 14px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

.chat-gate .btn {
  width: auto;
  min-width: 180px;
  padding: 0 28px;
}

.copy-code {
  display: block;
  margin-top: 9px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.copy-code:active {
  opacity: 0.7;
}

/* ---------- v0.5: call mode / recorder ---------- */

.rec-time {
  width: 96px;
  margin: 0 auto;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.hold-talk {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.icon-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.voice-panel {
  border-top: 1px solid var(--line);
}

.composer {
  border-top: 1px solid var(--line);
}

.composer .icon-btn {
  width: 36px;
  height: 36px;
}

.call-hint {
  color: var(--accent);
  font-size: 11px;
}

/* ---------- v0.6: mood ---------- */

.mood {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  flex: none;
  user-select: none;
}

.mood.is-pop {
  animation: mood-pop 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes mood-pop {
  0% { transform: scale(0.72) rotate(-7deg); }
  55% { transform: scale(1.12) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (max-width: 380px) {
  .mood { display: none; }
}

/* ---------- v0.7: continuation bubbles ---------- */

.msg-continuation {
  margin-left: 40px;
}

.msg-continuation .bubble {
  border-top-left-radius: 18px;
  border-bottom-left-radius: 6px;
}

.msg-assistant + .msg-continuation {
  margin-top: -6px;
}

@media (max-width: 360px) {
  .msg-continuation { margin-left: 34px; }
}

/* ---------- v0.8: py-xiaozhi emoji ---------- */

.mood {
  overflow: hidden;
  padding: 0;
  background: var(--surface);
}

.mood img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mood.is-pop img {
  animation: mood-float 0.5s ease;
}

@keyframes mood-float {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ---------- v0.9: wechat-like align / sheet ---------- */

.msg {
  align-items: flex-start;
}

.msg .avatar {
  margin-top: 2px;
}

.sheet-backdrop {
  opacity: 1;
  transition: opacity 0.18s ease;
}

.sheet {
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.sheet-backdrop.is-closing {
  opacity: 0;
}

.sheet-backdrop.is-closing .sheet {
  transform: translateY(18px);
  opacity: 0;
}

.sheet-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.sheet-setting + .sheet-setting,
.sheet-setting + .sheet-item {
  border-top: 1px solid var(--line);
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.2s ease;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch input:checked + i {
  background: var(--accent);
}

.switch input:checked + i::after {
  transform: translateX(18px);
}

.sheet-select {
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
}

/* ---------- v1.0: no per-char blur ---------- */

.bubble .char {
  filter: none !important;
  opacity: 1 !important;
  transition: none !important;
}

/* ---------- v1.1: desktop + queue ---------- */

@media (min-width: 760px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px 0;
  }

  .app-shell {
    height: calc(100dvh - 52px);
    min-height: 0;
  }

  .app-main {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .chat-page .app-main {
    overflow: hidden;
  }
}

/* ---------- v1.2: desktop chat layout ---------- */

.chat-page .app-shell {
  max-width: 1180px;
}

.chat-page .app-main {
  padding: 0;
  overflow: hidden;
  display: flex;
}

.chat-layout {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.chat-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.chat-sidebar {
  display: none;
}

.chat-stream {
  scroll-behavior: auto;
}

@media (min-width: 760px) {
  .chat-sidebar {
    display: flex;
    flex-direction: column;
    width: 310px;
    flex: none;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 55%, var(--bg));
    min-height: 0;
  }

  .chat-back {
    display: none;
  }

  .chat-page .app-shell {
    height: calc(100dvh - 52px);
  }

  .sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px 10px;
  }

  .sidebar-top h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.03em;
  }

  .sidebar-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 8px;
  }

  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    color: var(--ink);
  }

  .sidebar-item:active,
  .sidebar-item.is-active {
    background: var(--accent-soft);
  }

  .sidebar-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .sidebar-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }

  .sidebar-line strong {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-line time {
    font-size: 10px;
    color: var(--muted);
    flex: none;
  }

  .sidebar-preview {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
  }

  .sidebar-foot .icon {
    width: 17px;
    height: 17px;
  }
}

/* ---------- custom dropdown ---------- */

.dropdown {
  position: relative;
}

.dropdown-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
}

.dropdown-btn::after {
  content: "⌄";
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 5;
  min-width: 92px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-2);
}

.dropdown-menu button:active,
.dropdown-menu button.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 759px) {
  .chat-page .app-shell {
    max-width: 460px;
  }
}

/* ---------- v1.3: chat flex fixes ---------- */

.chat-top,
.composer,
.voice-panel,
.chat-gate {
  flex: none;
}

.chat-stream {
  flex: 1 1 auto;
  min-height: 0;
}

/* ---------- v1.4: composer voice mode ---------- */

.composer {
  align-items: center;
}

.composer-field {
  order: 2;
}

.send-btn {
  order: 3;
}

#callToggle {
  order: 4;
  margin-bottom: 0;
}

.hold-inline {
  order: 3;
  display: none;
  flex: 1;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 600;
}

.composer.is-voice .composer-field,
.composer.is-voice .send-btn {
  display: none;
}

.composer.is-voice .hold-inline {
  display: grid;
  place-items: center;
}

.hold-inline.is-recording {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.hold-inline.is-cancel {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--muted);
}

/* ---------- v1.5: tool chips / scrollbars / modal ---------- */

.tool-row {
  display: flex;
  padding-left: 40px;
  animation: tool-in 0.2s ease both;
}

.tool-chip {
  max-width: 78%;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

@keyframes tool-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-stream,
.sidebar-list,
.app-main {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.chat-stream::-webkit-scrollbar,
.sidebar-list::-webkit-scrollbar,
.app-main::-webkit-scrollbar {
  width: 8px;
}

.chat-stream::-webkit-scrollbar-track,
.sidebar-list::-webkit-scrollbar-track,
.app-main::-webkit-scrollbar-track {
  background: transparent;
}

.chat-stream::-webkit-scrollbar-thumb,
.sidebar-list::-webkit-scrollbar-thumb,
.app-main::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--line-strong) 85%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.chat-stream {
  scrollbar-gutter: stable;
}

@media (min-width: 760px) {
  .sheet-backdrop {
    align-items: center;
    padding: 20px;
  }

  .sheet {
    max-width: 420px;
    border-radius: 20px;
    padding: 8px 10px 10px;
    animation: modal-in 0.2s cubic-bezier(0.22, 0.8, 0.3, 1) both;
  }

  @keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* ---------- v1.6: stable bubble height / auth spacing ---------- */

.msg.is-typing .bubble {
  padding: 9px 13px;
}

.auth-title {
  margin-bottom: 26px;
}

.auth-card {
  margin-top: 4px;
}

/* ---------- v1.7: tighter line height ---------- */

.bubble {
  line-height: 1.45;
}

/* ---------- v1.8: wechat time divider ---------- */

.time-divider {
  align-self: center;
  margin: 3px auto;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
  user-select: none;
}

.time-divider.is-full {
  background: transparent;
}

/* ---------- v1.9: tool avatar / long text ---------- */

.tool-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-left: 0;
}

.tool-row .avatar {
  margin-top: 2px;
}

.tool-chip {
  margin-top: 2px;
}

/* ---------- v1.10: 48-byte text guard ---------- */

.composer {
  position: relative;
}

.composer-warn {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% + 8px);
  z-index: 6;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}

.composer.is-voice .composer-warn {
  display: none;
}

/* ---------- v1.11: inline validation ---------- */

.composer {
  flex-wrap: wrap;
}

.composer-warn {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 100%;
  order: 5;
  z-index: auto;
  margin: 1px 4px 0 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #e6a700;
  font-size: 12px;
  line-height: 1.45;
}

.composer.is-invalid .composer-field,
.composer.is-invalid .composer-field:focus-within {
  border-color: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12);
}

.composer.is-invalid {
  padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}

.composer.is-voice .composer-warn {
  display: none;
}

/* ---------- v1.12: center overlays over chat pane ---------- */

.chat-pane {
  position: relative;
}

.chat-pane > .toast {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 92px);
  max-width: 82%;
}

@media (min-width: 760px) {
  .chat-pane .sheet-backdrop {
    position: absolute;
    inset: 0;
  }
}

/* ---------- v1.13: warning above input, fade ---------- */

.composer {
  flex-wrap: wrap;
}

.composer-warn {
  order: -1;
  flex: 0 0 100%;
  height: 0;
  margin: 0 4px 0 44px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #e6a700;
  font-size: 12px;
  line-height: 18px;
  opacity: 0;
  transform: translateY(3px);
  transition: height 0.18s ease, opacity 0.18s ease, transform 0.18s ease, margin 0.18s ease;
}

.composer-warn.is-show {
  height: 18px;
  margin-bottom: 4px;
  opacity: 1;
  transform: translateY(0);
}

.composer.is-invalid {
  padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
}

.composer.is-invalid .composer-field,
.composer.is-invalid .composer-field:focus-within {
  border-color: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12);
}

/* ---------- v1.14: soft conversation switch ---------- */

.chat-layout {
  transition: opacity 0.12s ease;
}

.chat-layout.is-switching {
  opacity: 0.55;
}

/* ---------- v1.15: stable composer height ---------- */

.composer {
  min-height: 58px;
}

.composer-field,
.hold-inline {
  min-height: 40px;
}

/* ---------- v1.16: email code login / captcha ---------- */

.brand-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.verify-row {
  display: flex;
  gap: 8px;
}

.verify-row input {
  flex: 1;
  min-width: 0;
}

.btn-send-code {
  flex: none;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.btn-send-code:disabled {
  color: var(--muted);
  opacity: .7;
}

.auth-mode-link {
  display: block;
  margin: 12px auto 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 16, 28, .46);
}

.captcha-modal[hidden] {
  display: none;
}

.captcha-card {
  width: 100%;
  max-width: 380px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg, 0 24px 80px rgba(0,0,0,.22));
}

.captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.captcha-head h3 {
  margin: 0;
  font-size: 18px;
}

.captcha-sub {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.captcha-body {
  display: flex;
  justify-content: center;
  min-height: 64px;
  padding: 6px 0;
}

.captcha-modal.is-solved .captcha-body {
  display: none;
}

.captcha-modal.is-solved .captcha-card::after {
  content: "验证通过";
  display: block;
  padding: 22px 0 8px;
  text-align: center;
  color: #22c55e;
  font-size: 18px;
  font-weight: 800;
}

.captcha-modal.is-solved .captcha-head,
.captcha-modal.is-solved .captcha-sub {
  display: none;
}

.alert-ok {
  background: color-mix(in srgb, #22c55e 12%, var(--surface));
  color: #15803d;
  border-color: color-mix(in srgb, #22c55e 35%, var(--line));
}

/* ---------- v1.17: professional login / captcha ---------- */

body.auth-page {
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(51, 85, 224, .35), transparent 62%),
    radial-gradient(700px 460px at 100% 100%, rgba(79, 140, 255, .10), transparent 60%),
    #070a12;
  color: #f5f7ff;
}

.auth-page .auth-wrap {
  color: #f5f7ff;
}

.auth-page .brand-name {
  color: #f5f7ff;
}

.auth-page .brand-sub,
.auth-page .auth-title {
  color: rgba(235, 241, 255, .78);
}

.auth-page .auth-title {
  color: #f8faff;
}

.auth-page .auth-card {
  background: rgba(15, 21, 35, .92);
  border: 1px solid rgba(120, 145, 220, .24);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .48);
  backdrop-filter: blur(18px);
}

.auth-page .segmented {
  background: rgba(255, 255, 255, .06);
}

.auth-page .seg-tab {
  color: rgba(235, 241, 255, .58);
}

.auth-page .seg-tab.is-active {
  background: rgba(255, 255, 255, .10);
  color: #fff;
}

.auth-page .field label {
  color: rgba(235, 241, 255, .66);
}

.auth-page .field input {
  background: rgba(5, 9, 17, .78);
  border-color: rgba(120, 145, 220, .26);
  color: #f5f7ff;
}

.auth-page .field input::placeholder {
  color: rgba(235, 241, 255, .35);
}

.auth-page .field input:focus {
  border-color: #5a76ff;
  box-shadow: 0 0 0 3px rgba(74, 104, 255, .16);
}

.auth-page .terms-row {
  color: rgba(235, 241, 255, .62);
}

.auth-page .terms-row a {
  color: #7f9aff;
}

.auth-page .auth-mode-link {
  color: #7f9aff;
}

.auth-page .alert {
  background: rgba(229, 72, 77, .14);
  border-color: rgba(229, 72, 77, .34);
  color: #ffb4b8;
}

.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.terms-row input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.terms-row a {
  color: var(--accent);
  text-decoration: none;
}

.captcha-modal {
  background: rgba(0, 0, 0, .58);
  animation: auth-fade-in .2s ease both;
}

.captcha-card {
  background: #111827;
  background-image: linear-gradient(315deg, rgba(79, 140, 255, .20) 0%, rgba(79, 140, 255, .10) 100%);
  border: 1px solid rgba(100, 130, 220, .30);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
  animation: auth-modal-in .25s cubic-bezier(.4, 0, .2, 1) both;
}

.captcha-head h3 {
  color: #fff;
}

.captcha-sub {
  color: rgba(235, 241, 255, .64);
  text-align: center;
}

.captcha-solved {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0 42px;
  gap: 20px;
}

.captcha-modal.is-solved .captcha-solved {
  display: flex;
}

.captcha-modal.is-solved .captcha-head,
.captcha-modal.is-solved .captcha-sub,
.captcha-modal.is-solved .captcha-body {
  display: none;
}

.captcha-modal.is-solved .captcha-card::after {
  content: none;
}

.captcha-solved p {
  margin: 0;
  color: #22c55e;
  font-size: 18px;
  font-weight: 700;
  animation: auth-fade-in .3s ease .2s both;
}

.captcha-checkmark-circle {
  width: 80px;
  height: 80px;
  overflow: visible;
}

.captcha-checkmark {
  width: 80px;
  height: 80px;
  overflow: visible;
}

.captcha-checkmark-circle-bg {
  stroke: #22c55e;
  stroke-width: 3;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: captcha-checkmark-circle 1s cubic-bezier(.65, 0, .45, 1) forwards;
}

.captcha-checkmark-check {
  stroke: #22c55e;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: captcha-checkmark-check .5s cubic-bezier(.65, 0, .45, 1) .5s forwards;
}

@keyframes captcha-checkmark-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes captcha-checkmark-check {
  to { stroke-dashoffset: 0; }
}

@keyframes auth-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes auth-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.legal-page h2 {
  margin: 22px 0 8px;
  font-size: 16px;
}

.legal-page p {
  margin: 0 0 10px;
  color: var(--ink-2);
  line-height: 1.75;
}

/* ---------- v1.18: desktop settings split ---------- */

.settings-layout {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.settings-sidebar {
  display: none;
}

.settings-pane {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 18px 14px 28px;
}

.settings-pane-head {
  display: none;
}

@media (min-width: 760px) {
  .settings-page .topbar {
    display: none;
  }

  .settings-page .app-shell {
    max-width: 1180px;
    height: calc(100dvh - 52px);
  }

  .settings-page .app-main {
    padding: 0;
    overflow: hidden;
  }

  .settings-sidebar {
    display: flex;
    flex-direction: column;
    width: 310px;
    flex: none;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 55%, var(--bg));
    min-height: 0;
  }

  .settings-pane {
    padding: 24px 28px 40px;
  }

  .settings-pane-head {
    display: block;
    margin-bottom: 18px;
  }

  .settings-pane-head h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -.03em;
  }

  .settings-pane-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
  }
}
.captcha-modal {
  background:
    radial-gradient(600px 320px at 20% 0%, rgba(51, 85, 224, .22), transparent 65%),
    rgba(0, 0, 0, .58);
}

/* ---------- v1.19: dark navigation pane to match auth ---------- */

@media (min-width: 760px) {
  .chat-sidebar,
  .settings-sidebar {
    background: #0b1020;
    border-right-color: rgba(120, 145, 220, .18);
    color: #eef3ff;
  }

  .sidebar-top h2,
  .sidebar-line strong {
    color: #f5f8ff;
  }

  .sidebar-line time,
  .sidebar-preview,
  .sidebar-foot {
    color: rgba(225, 233, 255, .52);
  }

  .sidebar-item {
    color: #eef3ff;
  }

  .sidebar-item.is-active,
  .sidebar-item:active {
    background: rgba(77, 107, 255, .20);
    color: #fff;
  }

  .sidebar-foot {
    border-top-color: rgba(120, 145, 220, .18);
  }
}

@media (min-width: 760px) {
  .settings-page .topbar {
    display: flex;
  }

  .settings-page.settings-home .topbar {
    display: none;
  }

  .settings-page.settings-home .app-shell {
    max-width: 1180px;
    height: calc(100dvh - 52px);
  }

  .settings-page.settings-home .app-main {
    padding: 0;
    overflow: hidden;
  }
}

/* =========================================================
   v2.0 · 登录 / 注册（参考项目完整复刻）
   深色品牌页、滑动 Tab、自定义勾选框、错误抖动自动消失
   ========================================================= */

body.auth-page {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #05070d;
  color: #e8eaed;
}

body.auth-page .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  background: transparent;
}

body.auth-page .app-main {
  min-height: 100dvh;
  padding: 0;
}

body.auth-page .auth-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 44px 20px 32px;
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(33, 150, 243, .22), transparent 64%),
    radial-gradient(680px 430px at 100% 105%, rgba(102, 187, 106, .09), transparent 62%),
    radial-gradient(540px 380px at 0% 100%, rgba(79, 140, 255, .08), transparent 65%),
    #05070d;
}

body.auth-page .auth-stage::before,
body.auth-page .auth-stage::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(1px);
}

body.auth-page .auth-stage::before {
  width: 420px;
  height: 420px;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(107, 163, 255, .12);
  box-shadow: 0 0 120px rgba(33, 150, 243, .08) inset;
}

body.auth-page .auth-stage::after {
  width: 620px;
  height: 620px;
  bottom: -500px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(102, 187, 106, .08);
}

body.auth-page .auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  animation: authFadeIn .5s ease-out both;
}

body.auth-page .auth-logo {
  text-align: center;
  margin-bottom: 22px;
}

body.auth-page .auth-logo-mark {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(135deg, #6ba3ff 0%, #4f8cff 48%, #3355e0 100%);
  box-shadow: 0 14px 38px rgba(33, 150, 243, .26), inset 0 1px 0 rgba(255, 255, 255, .28);
}

body.auth-page .auth-logo-mark .icon {
  width: 31px;
  height: 31px;
}

body.auth-page .auth-logo h1 {
  margin: 0;
  color: #f5f8ff;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.2;
}

body.auth-page .auth-slogan {
  margin: 9px 0 0;
  color: #dce7ff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
}

body.auth-page .auth-subtitle {
  max-width: 350px;
  margin: 6px auto 0;
  color: rgba(225, 233, 255, .50);
  font-size: 12.5px;
  line-height: 1.7;
}

body.auth-page .auth-card {
  padding: 24px 28px;
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  background: rgba(18, 18, 18, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255, 255, 255, .03);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.auth-page .auth-tabs {
  position: relative;
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid #1f1f1f;
}

body.auth-page .auth-tab {
  flex: 1;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #5f6368;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: color .25s ease;
}

body.auth-page .auth-tab.active {
  color: #69a7ff;
}

body.auth-page .auth-tab-indicator {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50%;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, #6ba3ff, #3355e0);
  pointer-events: none;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

body.auth-page .auth-form {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    max-height .55s cubic-bezier(.4, 0, .2, 1),
    opacity .45s ease,
    visibility 0s linear .55s;
}

body.auth-page .auth-form.active {
  max-height: 1000px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    max-height .55s cubic-bezier(.4, 0, .2, 1),
    opacity .45s ease,
    visibility 0s linear 0s;
}

body.auth-page .auth-form form {
  margin: 0;
}

body.auth-page .auth-error {
  max-height: 0;
  margin: 0;
  padding: 0 16px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(239, 68, 68, .10);
  color: #ff8b8b;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  opacity: 0;
  transition:
    max-height .35s cubic-bezier(.4, 0, .2, 1),
    opacity .3s ease,
    padding .3s ease,
    margin .3s ease,
    border-color .3s ease;
}

body.auth-page .auth-error.show {
  max-height: 120px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border-color: rgba(239, 68, 68, .28);
  opacity: 1;
}

body.auth-page .auth-error.shake {
  animation: authShake .4s cubic-bezier(.36, .07, .19, .97) both;
}

body.auth-page .input-group {
  margin-bottom: 16px;
}

body.auth-page .input-group label {
  display: block;
  margin-bottom: 6px;
  color: #9aa0a6;
  font-size: 13px;
  font-weight: 700;
}

body.auth-page .input-group input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #0a0a0a;
  color: #f1f4fb;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

body.auth-page .input-group input::placeholder {
  color: #5f6368;
}

body.auth-page .input-group input:focus {
  border-color: #4f8cff;
  background: #0d111b;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .16);
}

body.auth-page .auth-switch-content {
  position: relative;
}

body.auth-page .auth-switch-pane {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    max-height .45s cubic-bezier(.4, 0, .2, 1),
    opacity .35s ease,
    visibility 0s linear .45s;
}

body.auth-page .auth-switch-pane.active {
  max-height: 150px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    max-height .45s cubic-bezier(.4, 0, .2, 1),
    opacity .35s ease,
    visibility 0s linear 0s;
}

body.auth-page .verify-code-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

body.auth-page .verify-code-input-wrap {
  flex: 2;
  min-width: 0;
}

body.auth-page .verify-code-input-wrap input {
  width: 100%;
}

body.auth-page .verify-code-btn-wrap {
  flex: 1;
  min-width: 0;
}

body.auth-page .btn-send-code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background-image: linear-gradient(120deg, #6ba3ff 0%, #4f8cff 46%, #3355e0 100%);
  background-size: 400% 100%;
  background-position: 12.5% 50%;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-position .8s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease, transform .2s ease;
}

body.auth-page .btn-send-code:hover:not(:disabled) {
  background-position: 87.5% 50%;
  box-shadow: 0 0 24px rgba(79, 140, 255, .24);
  transform: translateY(-1px);
}

body.auth-page .btn-send-code:active:not(:disabled) {
  transform: scale(.97);
}

body.auth-page .btn-send-code:disabled {
  border-color: #2a2a2a;
  background: #1a1a1a;
  color: #5f6368;
  opacity: .8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

body.auth-page .auth-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 2px 0 16px;
}

body.auth-page .checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  color: #9aa0a6;
  font-size: 13px;
  line-height: 1.55;
}

body.auth-page .checkbox-row .dsh-check {
  min-width: 0;
}

body.auth-page .auth-inline-hint {
  flex: none;
  white-space: nowrap;
  font-size: 12.5px;
}

body.auth-page .auth-inline-hint .muted {
  color: #5f6368;
}

body.auth-page .auth-inline-hint a,
body.auth-page .auth-side-link {
  color: #69a7ff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

body.auth-page .auth-inline-hint a:hover,
body.auth-page .auth-side-link:hover {
  color: #8fc0ff;
  text-decoration: underline;
}

body.auth-page .auth-side-link {
  flex: none;
  font-size: 12.5px;
  white-space: nowrap;
}

body.auth-page .dsh-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #9aa0a6;
  font-family: inherit;
  font-size: 13px;
  user-select: none;
}

body.auth-page .dsh-check > input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

body.auth-page .dsh-check > svg {
  display: block;
  flex-shrink: 0;
  border-radius: 6px;
}

body.auth-page .dsh-check .dsh-check-box {
  fill: transparent;
  stroke: #3b3b3b;
  transition: fill .18s ease, stroke .18s ease;
}

body.auth-page .dsh-check .dsh-check-tick {
  fill: none;
  stroke: #fff;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset .22s cubic-bezier(.4, 0, .2, 1) .04s;
}

body.auth-page .dsh-check > input:checked + svg {
  animation: dshCheckPop .2s cubic-bezier(.34, 1.56, .64, 1);
}

body.auth-page .dsh-check > input:checked + svg .dsh-check-box {
  fill: #4f8cff;
  stroke: #4f8cff;
}

body.auth-page .dsh-check > input:checked + svg .dsh-check-tick {
  stroke-dashoffset: 0;
}

body.auth-page .dsh-check > input:focus-visible + svg {
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .24);
}

body.auth-page .dsh-check a {
  color: #69a7ff;
  font-weight: 600;
  text-decoration: none;
}

body.auth-page .dsh-check a:hover {
  text-decoration: underline;
}

body.auth-page .btn-primary.pulse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background-image: linear-gradient(120deg, #6ba3ff 0%, #4f8cff 46%, #3355e0 100%);
  background-size: 400% 100%;
  background-position: 12.5% 50%;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background-position .8s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease, transform .2s ease, opacity .2s ease;
}

body.auth-page .btn-primary.pulse:hover:not(:disabled) {
  background-position: 87.5% 50%;
  box-shadow: 0 8px 28px rgba(33, 150, 243, .26);
  transform: translateY(-1px);
}

body.auth-page .btn-primary.pulse:active:not(:disabled) {
  transform: scale(.985);
  box-shadow: none;
}

body.auth-page .btn-primary.pulse:disabled {
  opacity: .62;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

body.auth-page .auth-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.auth-page .auth-btn-loading svg {
  animation: authSpin .8s linear infinite;
}

body.auth-page .reset-back-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 14px;
}

body.auth-page .reset-back-row a {
  color: #69a7ff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

body.auth-page .reset-back-row a:hover {
  text-decoration: underline;
}

body.auth-page .auth-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #1f1f1f;
  color: #9aa0a6;
  font-size: 13.5px;
  text-align: center;
}

body.auth-page .auth-footer a {
  color: #69a7ff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

body.auth-page .auth-footer a:hover {
  color: #8fc0ff;
  text-decoration: underline;
}

body.auth-page .auth-footer .is-hidden {
  display: none;
}

body.auth-page .auth-bottom-note {
  max-width: 360px;
  margin: 18px auto 0;
  color: rgba(225, 233, 255, .28);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

body.auth-page .captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .64);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: authFadeIn .2s ease both;
}

body.auth-page .captcha-modal[hidden] {
  display: none;
}

body.auth-page .captcha-card {
  width: 100%;
  max-width: 380px;
  padding: 18px;
  border: 1px solid rgba(100, 130, 220, .30);
  border-radius: 18px;
  background: #111827;
  background-image: linear-gradient(315deg, rgba(79, 140, 255, .20) 0%, rgba(79, 140, 255, .10) 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  animation: authModalIn .25s cubic-bezier(.4, 0, .2, 1) both;
}

body.auth-page .captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.auth-page .captcha-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

body.auth-page .captcha-modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
  color: #9aa0a6;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

body.auth-page .captcha-modal-close:hover {
  background: rgba(239, 68, 68, .15);
  color: #ff8b8b;
}

body.auth-page .captcha-modal-close .icon {
  width: 18px;
  height: 18px;
}

body.auth-page .captcha-sub {
  margin: 6px 0 16px;
  color: rgba(235, 241, 255, .64);
  font-size: 13px;
  text-align: center;
}

body.auth-page .captcha-body {
  display: flex;
  justify-content: center;
  min-height: 64px;
  padding: 10px 0 14px;
}

body.auth-page .captcha-solved {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 46px 0 42px;
}

body.auth-page .captcha-modal.is-solved .captcha-solved {
  display: flex;
}

body.auth-page .captcha-modal.is-solved .captcha-body,
body.auth-page .captcha-modal.is-solved .captcha-head,
body.auth-page .captcha-modal.is-solved .captcha-sub {
  display: none;
}

body.auth-page .captcha-solved p {
  margin: 0;
  color: #22c55e;
  font-size: 18px;
  font-weight: 700;
  animation: authFadeIn .3s ease .2s both;
}

body.auth-page .captcha-checkmark-circle,
body.auth-page .captcha-checkmark {
  width: 80px;
  height: 80px;
  overflow: visible;
}

body.auth-page .captcha-checkmark-circle-bg {
  stroke: #22c55e;
  stroke-width: 3;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: captchaCheckCircle 1s cubic-bezier(.65, 0, .45, 1) forwards;
}

body.auth-page .captcha-checkmark-check {
  stroke: #22c55e;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: captchaCheckCheck .5s cubic-bezier(.65, 0, .45, 1) .5s forwards;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes authModalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

@keyframes dshCheckPop {
  0% { transform: scale(.86); }
  100% { transform: scale(1); }
}

@keyframes captchaCheckCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes captchaCheckCheck {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 560px) {
  body.auth-page .auth-stage {
    padding: 30px 14px 24px;
    align-items: flex-start;
  }

  body.auth-page .auth-container {
    margin-top: 6px;
  }

  body.auth-page .auth-logo {
    margin-bottom: 18px;
  }

  body.auth-page .auth-logo-mark {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    margin-bottom: 12px;
  }

  body.auth-page .auth-logo-mark .icon {
    width: 27px;
    height: 27px;
  }

  body.auth-page .auth-logo h1 {
    font-size: 24px;
  }

  body.auth-page .auth-slogan {
    font-size: 14.5px;
  }

  body.auth-page .auth-subtitle {
    font-size: 12px;
  }

  body.auth-page .auth-card {
    padding: 20px 18px;
    border-radius: 13px;
  }

  body.auth-page .auth-tab {
    font-size: 15px;
  }

  body.auth-page .checkbox-row {
    align-items: flex-start;
    font-size: 12.5px;
  }

  body.auth-page .auth-inline-hint,
  body.auth-page .auth-side-link {
    font-size: 12px;
  }

  body.auth-page .auth-bottom-note {
    margin-top: 14px;
  }
}

@media (max-height: 700px) and (min-width: 561px) {
  body.auth-page .auth-stage {
    align-items: flex-start;
    padding-top: 28px;
  }
}

/* 浏览器自动填充时保持深色输入框（Chrome/Edge 会给白底） */
body.auth-page .input-group input:-webkit-autofill,
body.auth-page .input-group input:-webkit-autofill:hover,
body.auth-page .input-group input:-webkit-autofill:focus,
body.auth-page .input-group input:-webkit-autofill:active {
  -webkit-text-fill-color: #f1f4fb !important;
  -webkit-box-shadow: 0 0 0 1000px #0a0a0a inset !important;
  box-shadow: 0 0 0 1000px #0a0a0a inset !important;
  caret-color: #f1f4fb;
  transition: background-color 99999s ease-out 0s;
}

/* =========================================================
   v2.1 · 登录切换手感 / 电脑端导航 / 管理员平台
   ========================================================= */

/* 登录/注册切换：保留参考页的 max-height，同时加入明显的横向滑入 */
body.auth-page .auth-form {
  transform: translate3d(-18px, 8px, 0) scale(.995);
  filter: blur(1.5px);
  transition:
    max-height .5s cubic-bezier(.4, 0, .2, 1),
    opacity .32s ease,
    transform .42s cubic-bezier(.22, .8, .3, 1),
    filter .32s ease,
    visibility 0s linear .5s;
}

body.auth-page .auth-form[data-auth-panel="register"] {
  transform: translate3d(18px, 8px, 0) scale(.995);
}

body.auth-page .auth-form.active {
  max-height: 1000px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
  animation: authPanelIn .42s cubic-bezier(.22, .8, .3, 1) both;
  transition:
    max-height .5s cubic-bezier(.4, 0, .2, 1),
    opacity .32s ease,
    transform .42s cubic-bezier(.22, .8, .3, 1),
    filter .32s ease,
    visibility 0s linear 0s;
}

@keyframes authPanelIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* 电脑端不再显示手机底部「对话 / 我的」，避免和左侧栏重复 */
@media (min-width: 760px) {
  .tabbar {
    display: none !important;
  }
}

/* 系统开启“减少动态效果”时，登录页仍保留完整的切换和验证动画 */
@media (prefers-reduced-motion: reduce) {
  body.auth-page .auth-form,
  body.auth-page .auth-switch-pane,
  body.auth-page .auth-tab-indicator {
    transition-duration: .5s !important;
  }

  body.auth-page .auth-form.active,
  body.auth-page .captcha-checkmark-circle-bg,
  body.auth-page .captcha-checkmark-check {
    animation-duration: 1s !important;
  }

  body.auth-page .captcha-checkmark-check {
    animation-delay: .5s !important;
  }

  body.auth-page .auth-error.shake {
    animation-duration: .4s !important;
  }
}

/* “我的”里的管理员分类：与普通账号设置明确分开 */
.settings-page .admin-entry-zone {
  margin: 0 20px 16px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(420px 160px at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%),
    var(--surface);
}

.settings-page .admin-zone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 10px;
}

.settings-page .admin-zone-title {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}

.settings-page .admin-zone-note {
  color: var(--muted);
  font-size: 11px;
}

.settings-page .admin-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--ink);
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.settings-page .admin-entry:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  transform: translateY(-1px);
}

.settings-page .admin-entry-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.settings-page .admin-entry-mark .icon {
  width: 21px;
  height: 21px;
}

.settings-page .admin-entry-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.settings-page .admin-entry-copy strong {
  font-size: 14.5px;
  font-weight: 650;
}

.settings-page .admin-entry-copy small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

@media (min-width: 760px) {
  .settings-page .admin-entry-zone {
    margin-right: 0;
    margin-left: 0;
  }
}

/* 独立的管理员平台 */
body.admin-page {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(760px 480px at 8% -8%, rgba(79, 140, 255, .16), transparent 64%),
    radial-gradient(620px 420px at 100% 100%, rgba(62, 207, 142, .07), transparent 62%),
    #080b12;
  color: #e8edf7;
}

body.admin-page .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  background: transparent;
}

body.admin-page .app-main {
  min-height: 100dvh;
  padding: 0;
}

.admin-shell {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  min-height: 100dvh;
  margin: 0 auto;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  width: 236px;
  flex: none;
  padding: 34px 18px 26px;
  border-right: 1px solid rgba(120, 145, 220, .16);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 26px;
  color: #f5f8ff;
  text-decoration: none;
}

.admin-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #6ba3ff, #4f8cff 50%, #3355e0);
  color: #fff;
  box-shadow: 0 10px 26px rgba(33, 150, 243, .22);
}

.admin-brand-mark .icon {
  width: 22px;
  height: 22px;
}

.admin-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-brand-copy strong {
  font-size: 15px;
  letter-spacing: -.01em;
}

.admin-brand-copy small {
  color: rgba(225, 233, 255, .42);
  font-size: 11px;
}

.admin-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(225, 233, 255, .62);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}

.admin-nav-item .icon {
  width: 18px;
  height: 18px;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

.admin-nav-item.is-active {
  background: rgba(79, 140, 255, .16);
  color: #fff;
}

.admin-nav-back {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(120, 145, 220, .14);
  color: rgba(225, 233, 255, .52);
  font-size: 12.5px;
  text-decoration: none;
}

.admin-nav-back:hover {
  color: #dce7ff;
}

.admin-nav-back .icon {
  width: 16px;
  height: 16px;
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 48px 44px 56px;
  overflow-y: auto;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.admin-eyebrow {
  margin: 0 0 8px;
  color: #69a7ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
}

.admin-head h1 {
  margin: 0;
  color: #f7faff;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.admin-lead {
  margin: 7px 0 0;
  color: rgba(225, 233, 255, .46);
  font-size: 12.5px;
}

.admin-identity {
  flex: none;
  margin-top: 4px;
  padding: 7px 11px;
  border: 1px solid rgba(120, 145, 220, .20);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: rgba(225, 233, 255, .66);
  font-size: 11.5px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px;
  border: 1px solid rgba(120, 145, 220, .16);
  border-radius: 14px;
  background: rgba(16, 22, 36, .72);
}

.admin-stat-label {
  color: rgba(225, 233, 255, .48);
  font-size: 11.5px;
}

.admin-stat strong {
  color: #f7faff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.admin-stat-note {
  color: rgba(225, 233, 255, .32);
  font-size: 10.5px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 96px;
  padding: 18px;
  border: 1px solid rgba(120, 145, 220, .16);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(19, 27, 45, .92), rgba(12, 17, 29, .92));
  color: #eef3ff;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.admin-card:hover {
  border-color: rgba(105, 167, 255, .48);
  background: linear-gradient(145deg, rgba(26, 38, 63, .96), rgba(14, 20, 35, .96));
  transform: translateY(-2px);
}

.admin-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: rgba(79, 140, 255, .14);
  color: #69a7ff;
}

.admin-card-icon .icon {
  width: 21px;
  height: 21px;
}

.admin-card-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.admin-card-copy strong {
  font-size: 15px;
  font-weight: 650;
}

.admin-card-copy small {
  color: rgba(225, 233, 255, .42);
  font-size: 11.5px;
  line-height: 1.55;
}

.admin-card .row-chevron {
  color: rgba(225, 233, 255, .28);
}

.admin-note {
  margin: 20px 0 0;
  color: rgba(225, 233, 255, .28);
  font-size: 11px;
}

@media (max-width: 820px) {
  .admin-shell {
    display: block;
    width: 100%;
  }

  .admin-nav {
    width: auto;
    padding: 18px 16px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(120, 145, 220, .16);
  }

  .admin-brand {
    padding: 0 2px 14px;
  }

  .admin-nav-list {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
  }

  .admin-nav-item {
    flex: none;
    white-space: nowrap;
  }

  .admin-nav-back {
    margin-top: 10px;
    padding: 10px 2px 2px;
  }

  .admin-main {
    padding: 26px 18px 40px;
    overflow: visible;
  }

  .admin-head {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }

  .admin-head h1 {
    font-size: 26px;
  }

  .admin-identity {
    margin-top: 0;
  }

  .admin-stats,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   v2.2 · 聊天时间点 / 等待回复 / 渐进模糊
   ========================================================= */

/* 等待回复：显示在用户消息气泡左侧 */
.msg-delivery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
}

.msg-delivery-ring {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: deliverySpin .7s linear infinite;
}

.msg-delivery.is-timeout {
  color: var(--muted);
}

@keyframes deliverySpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .msg-delivery-text {
    display: none;
  }

  .msg-delivery {
    gap: 0;
    margin-top: 8px;
  }
}

/* 聊天顶部：半透明玻璃 + 向下渐进模糊 */
.chat-pane {
  position: relative;
  background:
    radial-gradient(900px 420px at 72% -12%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 66%),
    var(--bg);
}

.chat-pane::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 15;
  height: 86px;
  pointer-events: none;
  -webkit-backdrop-filter: blur(9px) saturate(1.08);
  backdrop-filter: blur(9px) saturate(1.08);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .82) 48%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .82) 48%, transparent 100%);
}

.chat-top {
  position: relative;
  z-index: 20;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 88%, transparent) 0%,
    color-mix(in srgb, var(--bg) 72%, transparent) 72%,
    color-mix(in srgb, var(--bg) 18%, transparent) 100%
  );
  border-bottom-color: color-mix(in srgb, var(--line) 64%, transparent);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 5%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  backdrop-filter: blur(22px) saturate(1.12);
}

.chat-top .icon-btn,
.chat-top .mood {
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--surface) 48%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chat-top .icon-btn {
  border-radius: 12px;
}

.chat-top .mood {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.chat-top .mood img {
  width: 22px;
  height: 22px;
}

@media (max-width: 600px) {
  .chat-pane::after {
    height: 70px;
  }

  .chat-top {
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
  }
}

/* =========================================================
   v2.2 · 设置子页面保持左右两栏
   ========================================================= */

.settings-my-sidebar {
  background: #0b1020;
  border-right-color: rgba(120, 145, 220, .18);
  color: #eef3ff;
}

.settings-my-sidebar .sidebar-top {
  padding: 20px 18px 10px;
}

.settings-my-sidebar .sidebar-top h2,
.settings-my-sidebar .sidebar-top h2 a {
  color: #f5f8ff;
  text-decoration: none;
}

.settings-my-sidebar .my-profile-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 12px 14px;
  padding: 10px 11px;
  border: 1px solid rgba(120, 145, 220, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.settings-my-sidebar .my-profile-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: rgba(79, 140, 255, .16);
  color: #8db7ff;
}

.settings-my-sidebar .my-profile-icon .icon {
  width: 18px;
  height: 18px;
}

.settings-my-sidebar .my-profile-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.settings-my-sidebar .my-profile-copy strong {
  color: #eef3ff;
  font-size: 13px;
  font-weight: 650;
}

.settings-my-sidebar .my-profile-copy small {
  color: rgba(225, 233, 255, .44);
  font-size: 11px;
}

.settings-my-sidebar .my-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 10px;
}

.settings-my-sidebar .my-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 10px 11px;
  border-radius: 9px;
  color: rgba(225, 233, 255, .62);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}

.settings-my-sidebar .my-nav-item .icon {
  width: 17px;
  height: 17px;
}

.settings-my-sidebar .my-nav-item:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

.settings-my-sidebar .my-nav-item.is-active {
  background: rgba(77, 107, 255, .20);
  color: #fff;
}

.settings-my-sidebar .my-side-foot {
  margin-top: auto;
  padding-bottom: 8px;
}

.settings-my-sidebar .sidebar-admin-entry {
  border-top: 0;
  color: #8db7ff;
}

.settings-subpage .settings-subpane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.settings-subpane .settings-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex: none;
  margin-bottom: 20px;
}

.settings-subpane .settings-subhead h1 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -.03em;
}

.settings-subpane .settings-subhead p:not(.settings-eyebrow) {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-subpane .settings-eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.settings-subpane .settings-subcontent {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.settings-subpane .page-pad {
  padding: 0 0 24px;
}

@media (min-width: 760px) {
  .settings-subpage .sub-top {
    display: none;
  }

  .settings-subpage .settings-my-sidebar {
    display: flex;
    flex-direction: column;
    width: 270px;
    flex: none;
    min-height: 0;
  }

  .settings-subpage .settings-subhead {
    display: flex;
  }

  .settings-subpage .settings-subcontent {
    overflow-y: auto;
  }
}

@media (max-width: 759px) {
  .settings-my-sidebar {
    display: none;
  }

  .settings-subpage .settings-subpane {
    padding: 18px 14px 28px;
  }

  .settings-subpage .settings-subhead {
    display: none;
  }

  .settings-subpage .settings-subcontent {
    overflow: visible;
  }

  .settings-subpage .page-pad {
    padding: 16px 20px 32px;
  }
}

@media (min-width: 760px) {
  .sidebar-foot.sidebar-admin-entry {
    margin-top: 0;
    border-top: 0;
    color: #8db7ff;
  }

  .sidebar-foot.sidebar-admin-entry:hover {
    color: #cfe0ff;
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}





/* =========================================================
   v2.3 · 原生桌面/平板布局 + 统一主题
   ========================================================= */

@media (min-width: 760px) {
  body {
    padding: 0;
  }

  .chat-page .app-shell,
  .settings-page .app-shell,
  .settings-page.settings-home .app-shell,
  .admin-page .app-shell,
  .auth-page .app-shell {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-page .app-main,
  .settings-page .app-main {
    height: 100dvh;
    min-height: 0;
  }

  .chat-page .chat-layout,
  .settings-page .settings-layout {
    height: 100dvh;
  }

  /* 对话列表、我的首页、账号安全等子页统一左栏宽度 */
  .chat-sidebar,
  .settings-sidebar,
  .settings-subpage .settings-my-sidebar {
    width: 310px;
    flex: 0 0 310px;
  }

  .admin-shell {
    width: 100%;
    max-width: none;
  }

  .admin-nav {
    width: 260px;
  }
}

/* =========================================================
   v2.4 · 顶部真正的高斯玻璃卡片 / 左右主题分区
   ========================================================= */

/* 去掉之前那层“光晕模板”，改为顶部卡片本身透明高斯模糊 */
.chat-pane::after {
  content: none !important;
  display: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.chat-pane {
  --chat-head-offset: 86px;
  background: #f7f9fe;
  border-left: 1px solid color-mix(in srgb, var(--accent) 9%, var(--line));
}

html[data-theme="dark"] .chat-pane {
  background: #0b1220;
}

.chat-top {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px);
  right: 12px;
  left: 12px;
  z-index: 35;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, #ffffff 58%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface) 46%, transparent);
  box-shadow:
    0 12px 34px rgba(15, 31, 64, .10),
    0 2px 8px rgba(15, 31, 64, .05),
    inset 0 1px 0 rgba(255, 255, 255, .52);
  -webkit-backdrop-filter: blur(26px) saturate(1.28);
  backdrop-filter: blur(26px) saturate(1.28);
}

html[data-theme="dark"] .chat-top {
  border-color: rgba(142, 168, 220, .20);
  background: rgba(18, 28, 48, .54);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, .34),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.chat-top .icon-btn,
.chat-top .mood {
  background: color-mix(in srgb, var(--surface) 38%, transparent);
  border-color: color-mix(in srgb, #ffffff 42%, var(--line));
  -webkit-backdrop-filter: blur(14px) saturate(1.16);
  backdrop-filter: blur(14px) saturate(1.16);
}

.chat-stream {
  padding-top: calc(var(--chat-head-offset) + 10px);
}

.chat-gate {
  margin-top: var(--chat-head-offset);
}

@media (max-width: 600px) {
  .chat-pane {
    --chat-head-offset: 78px;
  }

  .chat-top {
    top: calc(env(safe-area-inset-top) + 8px);
    right: 8px;
    left: 8px;
    border-radius: 15px;
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
  }
}

/* 左栏和右栏用明确的深/浅对比，不再是一片同色 */
@media (min-width: 760px) {
  .chat-sidebar,
  .settings-page .settings-sidebar {
    background: #070d19 !important;
    border-right: 1px solid rgba(114, 148, 216, .20);
    box-shadow: 12px 0 34px rgba(10, 24, 53, .08);
  }

  .settings-page .settings-my-sidebar {
    background: #070d19 !important;
  }

  .settings-pane,
  .settings-subpane {
    background: #f7f9fe;
    border-left: 1px solid color-mix(in srgb, var(--accent) 8%, var(--line));
  }

  html[data-theme="dark"] .settings-pane,
  html[data-theme="dark"] .settings-subpane {
    background: #0b1220;
  }

  .admin-page {
    background: #060b15;
  }

  .admin-nav {
    background: #060b15;
    border-right: 1px solid rgba(114, 148, 216, .18);
  }

  .admin-main {
    background: #0b1424;
  }
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .chat-pane,
  html[data-theme="auto"] .settings-pane,
  html[data-theme="auto"] .settings-subpane {
    background: #0b1220;
  }

  html[data-theme="auto"] .chat-top {
    border-color: rgba(142, 168, 220, .20);
    background: rgba(18, 28, 48, .54);
    box-shadow:
      0 14px 36px rgba(0, 0, 0, .34),
      inset 0 1px 0 rgba(255, 255, 255, .08);
  }
}




/* =========================================================
   v2.5 · 浅色侧栏 / 顶栏回归原位 / 底部横线对齐
   ========================================================= */

:root {
  --side-bg: #e2ebf9;
  --side-text: #182134;
  --side-muted: #65728a;
  --side-line: #d5e0f0;
  --side-active-bg: #dbe7fb;
  --side-active-text: #2742b8;
  --side-hover: rgba(51, 85, 224, .06);
}

html[data-theme="dark"] {
  --side-bg: #070d19;
  --side-text: #eef3ff;
  --side-muted: rgba(225, 233, 255, .52);
  --side-line: #22304a;
  --side-active-bg: rgba(77, 107, 255, .20);
  --side-active-text: #ffffff;
  --side-hover: rgba(255, 255, 255, .05);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --side-bg: #070d19;
    --side-text: #eef3ff;
    --side-muted: rgba(225, 233, 255, .52);
    --side-line: #22304a;
    --side-active-bg: rgba(77, 107, 255, .20);
    --side-active-text: #ffffff;
    --side-hover: rgba(255, 255, 255, .05);
  }
}

@media (min-width: 760px) {
  .chat-sidebar,
  .settings-page .settings-sidebar,
  .settings-page .settings-my-sidebar {
    background: var(--side-bg) !important;
    border-right: 1px solid var(--side-line);
    box-shadow: 10px 0 28px rgba(20, 34, 60, .04);
    color: var(--side-text);
  }

  .sidebar-top h2,
  .sidebar-top h2 a,
  .sidebar-line strong,
  .settings-my-sidebar .my-profile-copy strong {
    color: var(--side-text);
  }

  .sidebar-line time,
  .sidebar-preview,
  .sidebar-foot,
  .settings-my-sidebar .my-profile-copy small {
    color: var(--side-muted);
  }

  .sidebar-item {
    color: var(--side-text);
  }

  .sidebar-item:hover {
    background: var(--side-hover);
  }

  .sidebar-item.is-active {
    background: var(--side-active-bg);
    color: var(--side-active-text);
  }

  .settings-my-sidebar .my-nav-item {
    color: var(--side-muted);
  }

  .settings-my-sidebar .my-nav-item:hover {
    background: var(--side-hover);
    color: var(--side-text);
  }

  .settings-my-sidebar .my-nav-item.is-active {
    background: var(--side-active-bg);
    color: var(--side-active-text);
  }

  .settings-my-sidebar .my-profile-mini {
    border-color: var(--side-line);
    background: color-mix(in srgb, var(--side-bg) 60%, var(--surface));
  }

  .settings-my-sidebar .my-profile-icon {
    background: var(--side-active-bg);
    color: var(--side-active-text);
  }

  .sidebar-admin-entry {
    color: var(--accent) !important;
  }

  /* 左右两侧底部横线使用同一个 64px 底栏高度 */
  .sidebar-bottom,
  .settings-my-sidebar .my-side-foot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-height: 64px;
    margin-top: auto;
    padding: 4px 8px;
    border-top: 1px solid var(--side-line);
  }

  .sidebar-bottom .sidebar-foot,
  .settings-my-sidebar .my-side-foot .sidebar-foot {
    min-height: 26px;
    margin: 0;
    padding: 4px 8px;
    border: 0;
  }

  .composer {
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .chat-pane,
  .settings-pane,
  .settings-subpane {
    background: #fbfcff;
  }

  .chat-top {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--bg) 45%, transparent);
    box-shadow: none;
    -webkit-backdrop-filter: blur(22px) saturate(1.12);
    backdrop-filter: blur(22px) saturate(1.12);
  }

  .chat-top .icon-btn,
  .chat-top .mood {
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .chat-top .icon-btn:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
  }

  .chat-pane {
    --chat-head-offset: 82px;
  }

  .chat-stream {
    padding-top: calc(var(--chat-head-offset) + 10px);
  }

  .chat-gate {
    margin-top: var(--chat-head-offset);
  }
}

@media (max-width: 759px) {
  .chat-pane {
    --chat-head-offset: 78px;
  }

  .chat-top {
    top: 0;
    right: 0;
    left: 0;
    padding: calc(env(safe-area-inset-top) + 8px) 10px 8px;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--bg) 45%, transparent);
    box-shadow: none;
    -webkit-backdrop-filter: blur(20px) saturate(1.1);
    backdrop-filter: blur(20px) saturate(1.1);
  }

  .chat-top .icon-btn,
  .chat-top .mood {
    border: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .chat-stream {
    padding-top: calc(var(--chat-head-offset) + 10px);
  }

  .chat-gate {
    margin-top: var(--chat-head-offset);
  }
}

/* 浅色主题下管理台也跟随浅色，避免单独一块深色 */
html[data-theme="light"] body.admin-page,
html[data-theme="auto"] body.admin-page {
  background: #eef3fb;
  color: #182134;
}

html[data-theme="light"] .admin-nav,
html[data-theme="auto"] .admin-nav {
  background: #e8effa;
  border-right-color: #d5e0f0;
}

html[data-theme="light"] .admin-main,
html[data-theme="auto"] .admin-main {
  background: #fbfcff;
}

html[data-theme="light"] .admin-brand,
html[data-theme="auto"] .admin-brand,
html[data-theme="light"] .admin-brand-copy strong,
html[data-theme="auto"] .admin-brand-copy strong,
html[data-theme="light"] .admin-head h1,
html[data-theme="auto"] .admin-head h1,
html[data-theme="light"] .admin-stat strong,
html[data-theme="auto"] .admin-stat strong,
html[data-theme="light"] .admin-card,
html[data-theme="auto"] .admin-card {
  color: #182134;
}

html[data-theme="light"] .admin-brand-copy small,
html[data-theme="auto"] .admin-brand-copy small,
html[data-theme="light"] .admin-lead,
html[data-theme="auto"] .admin-lead,
html[data-theme="light"] .admin-stat-label,
html[data-theme="auto"] .admin-stat-label,
html[data-theme="light"] .admin-stat-note,
html[data-theme="auto"] .admin-stat-note,
html[data-theme="light"] .admin-card-copy small,
html[data-theme="auto"] .admin-card-copy small,
html[data-theme="light"] .admin-note,
html[data-theme="auto"] .admin-note {
  color: #65728a;
}

html[data-theme="light"] .admin-nav-item,
html[data-theme="auto"] .admin-nav-item,
html[data-theme="light"] .admin-nav-back,
html[data-theme="auto"] .admin-nav-back {
  color: #65728a;
}

html[data-theme="light"] .admin-nav-item.is-active,
html[data-theme="auto"] .admin-nav-item.is-active {
  background: #dbe7fb;
  color: #2742b8;
}

html[data-theme="light"] .admin-nav-item:hover,
html[data-theme="auto"] .admin-nav-item:hover,
html[data-theme="light"] .admin-nav-back:hover,
html[data-theme="auto"] .admin-nav-back:hover {
  background: rgba(51, 85, 224, .06);
  color: #182134;
}

html[data-theme="light"] .admin-identity,
html[data-theme="auto"] .admin-identity {
  border-color: #d5e0f0;
  background: rgba(255, 255, 255, .64);
  color: #65728a;
}

html[data-theme="light"] .admin-stat,
html[data-theme="auto"] .admin-stat {
  border-color: #d5e0f0;
  background: #ffffff;
}

html[data-theme="light"] .admin-card,
html[data-theme="auto"] .admin-card {
  border-color: #d5e0f0;
  background: linear-gradient(145deg, #ffffff, #f7faff);
}

html[data-theme="light"] .admin-card:hover,
html[data-theme="auto"] .admin-card:hover {
  border-color: #8fb2ff;
  background: linear-gradient(145deg, #ffffff, #eef4ff);
}

html[data-theme="light"] .admin-card-icon,
html[data-theme="auto"] .admin-card-icon {
  background: #e8efff;
  color: #3355e0;
}

html[data-theme="light"] .admin-nav-back,
html[data-theme="auto"] .admin-nav-back {
  border-top-color: #d5e0f0;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] body.admin-page {
    background: #060b15;
    color: #e8edf7;
  }

  html[data-theme="auto"] .admin-nav {
    background: #060b15;
    border-right-color: rgba(114, 148, 216, .18);
  }

  html[data-theme="auto"] .admin-main {
    background: #0b1424;
  }

  html[data-theme="auto"] .admin-brand,
  html[data-theme="auto"] .admin-brand-copy strong,
  html[data-theme="auto"] .admin-head h1,
  html[data-theme="auto"] .admin-stat strong,
  html[data-theme="auto"] .admin-card {
    color: #e8edf7;
  }

  html[data-theme="auto"] .admin-brand-copy small,
  html[data-theme="auto"] .admin-lead,
  html[data-theme="auto"] .admin-stat-label,
  html[data-theme="auto"] .admin-stat-note,
  html[data-theme="auto"] .admin-card-copy small,
  html[data-theme="auto"] .admin-note,
  html[data-theme="auto"] .admin-nav-item,
  html[data-theme="auto"] .admin-nav-back {
    color: rgba(225, 233, 255, .52);
  }

  html[data-theme="auto"] .admin-nav-item.is-active {
    background: rgba(79, 140, 255, .16);
    color: #fff;
  }

  html[data-theme="auto"] .admin-stat,
  html[data-theme="auto"] .admin-card {
    border-color: rgba(120, 145, 220, .16);
    background: #101624;
  }

  html[data-theme="auto"] .admin-identity {
    border-color: rgba(120, 145, 220, .20);
    background: rgba(255, 255, 255, .04);
    color: rgba(225, 233, 255, .66);
  }
}



@media (min-width: 760px) {
  .composer {
    height: 64px;
    min-height: 64px;
    box-sizing: border-box;
  }

  .composer.is-invalid {
    height: auto;
    min-height: 64px;
  }
}

/* 浅色“我的”侧栏强制使用深色文字，避免旧深色规则残留 */
html[data-theme="light"] .settings-my-sidebar .sidebar-top h2,
html[data-theme="light"] .settings-my-sidebar .sidebar-top h2 a,
html[data-theme="light"] .settings-my-sidebar .my-profile-copy strong {
  color: #182134 !important;
}

html[data-theme="light"] .settings-my-sidebar .my-profile-copy small,
html[data-theme="light"] .settings-my-sidebar .my-nav-item {
  color: #65728a !important;
}

html[data-theme="light"] .settings-my-sidebar .my-nav-item:hover {
  color: #182134 !important;
}

html[data-theme="light"] .settings-my-sidebar .my-nav-item.is-active {
  color: #2742b8 !important;
  background: #dbe7fb !important;
}

@media (prefers-color-scheme: light) {
  html[data-theme="auto"] .settings-my-sidebar .sidebar-top h2,
  html[data-theme="auto"] .settings-my-sidebar .sidebar-top h2 a,
  html[data-theme="auto"] .settings-my-sidebar .my-profile-copy strong {
    color: #182134 !important;
  }

  html[data-theme="auto"] .settings-my-sidebar .my-profile-copy small,
  html[data-theme="auto"] .settings-my-sidebar .my-nav-item {
    color: #65728a !important;
  }

  html[data-theme="auto"] .settings-my-sidebar .my-nav-item.is-active {
    color: #2742b8 !important;
    background: #dbe7fb !important;
  }
}

.chat-top .icon-btn,
.chat-top .mood {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.chat-top .icon-btn:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent) !important;
}

/* =========================================================
   v2.6 · 录音遮罩只覆盖聊天区 / 底部输入栏玻璃模糊
   ========================================================= */

.rec-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 18, 34, .30);
  -webkit-backdrop-filter: blur(8px) saturate(1.06);
  backdrop-filter: blur(8px) saturate(1.06);
}

.rec-overlay.is-cancel {
  background: rgba(180, 69, 47, .22);
}

.rec-overlay.is-cancel .rec-hint {
  color: #e5484d;
  font-weight: 700;
}

.rec-overlay.is-cancel .wave i {
  background: #e5484d;
}

.rec-overlay.is-cancel .rec-card {
  box-shadow: 0 18px 50px rgba(180, 69, 47, .18);
}

@media (min-width: 760px) {
  .composer {
    border-top-color: color-mix(in srgb, var(--line) 58%, transparent);
    background: linear-gradient(
      to top,
      color-mix(in srgb, var(--bg) 72%, transparent) 0%,
      color-mix(in srgb, var(--bg) 48%, transparent) 100%
    );
    box-shadow: 0 -12px 32px rgba(20, 34, 60, .04);
    -webkit-backdrop-filter: blur(24px) saturate(1.12);
    backdrop-filter: blur(24px) saturate(1.12);
  }
}

@media (max-width: 759px) {
  .composer {
    border-top-color: color-mix(in srgb, var(--line) 58%, transparent);
    background: linear-gradient(
      to top,
      color-mix(in srgb, var(--bg) 76%, transparent) 0%,
      color-mix(in srgb, var(--bg) 50%, transparent) 100%
    );
    -webkit-backdrop-filter: blur(20px) saturate(1.08);
    backdrop-filter: blur(20px) saturate(1.08);
  }
}

/* 管理台 · 每个账号独立智能体额度 */
.quota-editor {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.quota-input {
  width: 52px;
  height: 30px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: center;
}

.quota-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.quota-save {
  background: var(--accent-soft);
  color: var(--accent);
}

.quota-save:disabled {
  opacity: .55;
}

@media (max-width: 700px) {
  .manage-row {
    flex-wrap: wrap;
  }

  .manage-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
  }
}

/* 管理台用户列表 / 重置密码弹窗 */
.admin-content {
  width: 100%;
  max-width: 1180px;
}

.manage-content {
  width: 100%;
}

.manage-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: 520px;
}

.quota-save,
.password-reset,
.status-btn {
  white-space: nowrap;
}

.password-reset {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-btn.is-danger {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 12, 24, .54);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal-card {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(5, 12, 28, .28);
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.admin-modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -.03em;
}

.admin-modal-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.admin-modal-actions .btn {
  width: auto;
  min-width: 96px;
  padding: 0 18px;
}

@media (max-width: 700px) {
  .manage-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

.admin-content .group {
  margin: 0 0 16px;
}

.admin-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.admin-form-actions .btn {
  width: auto;
  flex: 1;
  padding: 0 16px;
}

@media (max-width: 620px) {
  .admin-form-actions {
    flex-direction: column;
  }

  .admin-form-actions .btn {
    width: 100%;
  }
}

/* =========================================================
   v2.7 · 登录页跟随系统明暗 / 修复深色管理台悬停
   ========================================================= */

/* 登录页浅色版本：由 auth.js 根据 data-theme / 系统主题添加 auth-light */
body.auth-page.auth-light {
  background: #eef3fb;
  color: #182134;
}

body.auth-page.auth-light .auth-stage {
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(79, 140, 255, .16), transparent 64%),
    radial-gradient(680px 430px at 100% 105%, rgba(51, 85, 224, .08), transparent 62%),
    #eef3fb;
}

body.auth-page.auth-light .auth-stage::before {
  border-color: rgba(79, 140, 255, .14);
}

body.auth-page.auth-light .auth-stage::after {
  border-color: rgba(51, 85, 224, .08);
}

body.auth-page.auth-light .auth-logo h1 {
  color: #182134;
}

body.auth-page.auth-light .auth-slogan {
  color: #2742b8;
}

body.auth-page.auth-light .auth-subtitle,
body.auth-page.auth-light .auth-bottom-note {
  color: #71809a;
}

body.auth-page.auth-light .auth-card {
  border-color: #d5e0f0;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 70px rgba(20, 34, 60, .12), inset 0 1px 0 #fff;
}

body.auth-page.auth-light .auth-tabs {
  border-bottom-color: #d5e0f0;
}

body.auth-page.auth-light .auth-tab {
  color: #7a869c;
}

body.auth-page.auth-light .auth-tab.active {
  color: #2742b8;
}

body.auth-page.auth-light .auth-error {
  border-color: rgba(180, 69, 47, .26);
  background: #fff0ed;
  color: #b4452f;
}

body.auth-page.auth-light .input-group label {
  color: #65728a;
}

body.auth-page.auth-light .input-group input {
  border-color: #d5e0f0;
  background: #f8faff;
  color: #182134;
}

body.auth-page.auth-light .input-group input::placeholder {
  color: #98a5b8;
}

body.auth-page.auth-light .input-group input:focus {
  border-color: #4f8cff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .13);
}

body.auth-page.auth-light .input-group input:-webkit-autofill,
body.auth-page.auth-light .input-group input:-webkit-autofill:hover,
body.auth-page.auth-light .input-group input:-webkit-autofill:focus {
  -webkit-text-fill-color: #182134 !important;
  -webkit-box-shadow: 0 0 0 1000px #f8faff inset !important;
  box-shadow: 0 0 0 1000px #f8faff inset !important;
}

body.auth-page.auth-light .checkbox-row,
body.auth-page.auth-light .dsh-check {
  color: #65728a;
}

body.auth-page.auth-light .dsh-check .dsh-check-box {
  stroke: #b9c8dd;
}

body.auth-page.auth-light .dsh-check > input:checked + svg .dsh-check-box {
  fill: #4f8cff;
  stroke: #4f8cff;
}

body.auth-page.auth-light .auth-inline-hint .muted {
  color: #7a869c;
}

body.auth-page.auth-light .auth-inline-hint a,
body.auth-page.auth-light .auth-side-link,
body.auth-page.auth-light .auth-footer a,
body.auth-page.auth-light .reset-back-row a {
  color: #3355e0;
}

body.auth-page.auth-light .auth-footer {
  border-top-color: #e1e8f4;
  color: #7a869c;
}

body.auth-page.auth-light .captcha-card {
  border-color: #d5e0f0;
  background: #fff;
  background-image: linear-gradient(315deg, rgba(79, 140, 255, .10), rgba(79, 140, 255, .04));
  box-shadow: 0 24px 80px rgba(20, 34, 60, .22);
}

body.auth-page.auth-light .captcha-head h3 {
  color: #182134;
}

body.auth-page.auth-light .captcha-sub {
  color: #65728a;
}

body.auth-page.auth-light .captcha-modal-close {
  background: #edf2fa;
  color: #65728a;
}

body.auth-page.auth-light .captcha-solved p {
  color: #18864b;
}

/* 深色系统 + auto：管理台卡片悬停恢复深色，不要套用浅色悬停 */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .admin-card:hover {
    border-color: rgba(105, 167, 255, .48);
    background: linear-gradient(145deg, rgba(26, 38, 63, .96), rgba(14, 20, 35, .96));
  }

  html[data-theme="auto"] .admin-card-icon {
    background: rgba(79, 140, 255, .14);
    color: #69a7ff;
  }

  html[data-theme="auto"] .admin-card-copy strong,
  html[data-theme="auto"] .admin-card {
    color: #eef3ff;
  }
}

/* =========================================================
   v2.8 · 登录/注册切换稍微放慢
   ========================================================= */

body.auth-page .auth-tab-indicator {
  transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}

body.auth-page .auth-form {
  transition:
    max-height .72s cubic-bezier(.4, 0, .2, 1),
    opacity .55s ease,
    transform .7s cubic-bezier(.22, .8, .3, 1),
    filter .55s ease,
    visibility 0s linear .72s;
}

body.auth-page .auth-form.active {
  max-height: 1000px;
  animation: authPanelIn .7s cubic-bezier(.22, .8, .3, 1) both;
  transition:
    max-height .72s cubic-bezier(.4, 0, .2, 1),
    opacity .55s ease,
    transform .7s cubic-bezier(.22, .8, .3, 1),
    filter .55s ease,
    visibility 0s linear 0s;
}

body.auth-page .auth-switch-pane {
  transition:
    max-height .6s cubic-bezier(.4, 0, .2, 1),
    opacity .5s ease,
    visibility 0s linear .6s;
}

body.auth-page .auth-switch-pane.active {
  transition:
    max-height .6s cubic-bezier(.4, 0, .2, 1),
    opacity .5s ease,
    visibility 0s linear 0s;
}

@media (prefers-reduced-motion: reduce) {
  body.auth-page .auth-form,
  body.auth-page .auth-switch-pane,
  body.auth-page .auth-tab-indicator {
    transition-duration: .7s !important;
  }

  body.auth-page .auth-form.active {
    animation-duration: .7s !important;
  }
}

/* 注销账号危险区与验证弹窗 */
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

.danger-zone-copy {
  min-width: 0;
}

.danger-zone-copy strong {
  color: var(--danger);
  font-size: 14px;
}

.danger-zone-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.danger-note {
  flex: none;
  color: var(--muted);
  font-size: 11px;
}

.danger-zone .danger-action {
  width: auto;
  min-width: 105px;
  flex: none;
  padding: 0 16px;
  background: var(--danger);
  color: #fff;
}

.account-delete-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 12, 24, .58);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.account-delete-modal[hidden] {
  display: none;
}

.account-delete-card {
  width: min(460px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, var(--line));
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(5, 12, 28, .30);
}

.account-delete-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-delete-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -.03em;
}

.account-delete-lead,
.account-delete-email {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.account-delete-email {
  color: var(--ink-2);
}

.delete-captcha {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.delete-label {
  align-self: flex-start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.delete-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
}

.delete-confirm input {
  margin-top: 3px;
  accent-color: var(--danger);
}

.account-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.account-delete-actions .btn {
  width: auto;
  min-width: 100px;
  padding: 0 16px;
}

.account-delete-actions .btn-danger {
  background: var(--danger);
  color: #fff;
}

@media (max-width: 620px) {
  .danger-zone {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .account-delete-actions {
    flex-direction: column-reverse;
  }

  .account-delete-actions .btn {
    width: 100%;
  }
}

/* 关闭流式输出后：整条消息直接出现，只做淡入上浮，不逐字打字 */
.msg.is-instant {
  animation: instant-msg-in .38s cubic-bezier(.22, .8, .3, 1) both;
}

@keyframes instant-msg-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 电脑端无对话时的双栏空状态 */
.home-layout {
  display: block;
  min-height: 0;
}

.home-pane {
  min-width: 0;
}

.home-pane-head,
.home-empty-mark {
  display: none;
}

@media (min-width: 760px) {
  .home-page .topbar {
    display: none;
  }

  .home-page .app-shell {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .home-page .app-main {
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .home-layout {
    display: flex;
    height: 100dvh;
  }

  .home-sidebar {
    display: flex;
    flex-direction: column;
    width: 310px;
    flex: 0 0 310px;
    min-height: 0;
    border-right: 1px solid var(--side-line);
  }

  .home-pane {
    flex: 1;
    height: 100dvh;
    overflow-y: auto;
    padding: 38px 38px 48px;
    background: #fbfcff;
  }

  html[data-theme="dark"] .home-pane {
    background: #0b1220;
  }

  .home-pane-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    max-width: 980px;
    margin: 0 auto 28px;
  }

  .home-eyebrow {
    margin: 0 0 7px;
    color: #6f8fe8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
  }

  .home-pane-head h1 {
    margin: 0;
    color: var(--ink);
    font-size: 30px;
    letter-spacing: -.04em;
  }

  .home-pane-head p:not(.home-eyebrow) {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12.5px;
  }

  .home-new {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    padding: 9px 13px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
  }

  .home-new .icon {
    width: 15px;
    height: 15px;
  }

  .home-pane .agent-list {
    max-width: 980px;
    margin: 0 auto;
    padding: 0;
  }

  .home-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 540px;
    margin: 7vh auto 0;
    padding: 42px 28px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(20, 34, 60, .05);
  }

  .home-empty-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    border-radius: 17px;
    background: linear-gradient(135deg, #6ba3ff, #3355e0);
    color: #fff;
    box-shadow: 0 10px 24px rgba(51, 85, 224, .22);
  }

  .home-empty-mark .icon {
    width: 27px;
    height: 27px;
  }

  .home-empty h2 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
  }

  .home-empty p {
    max-width: 380px;
    margin: 8px 0 20px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
    text-align: center;
  }

  .home-empty .empty-btn {
    width: auto;
    min-width: 150px;
    padding: 0 20px;
  }
}

@media (max-width: 759px) {
  .home-empty {
    padding: 30px 20px;
  }

  .home-empty h2 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
  }

  .home-empty p {
    margin: 8px 0 16px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.65;
  }
}

/* =========================================================
   v2.9 · 左下角「我的」加大 / 空状态深色右侧
   ========================================================= */

/* 空状态右侧跟随主题；auto + 深色系统时必须是深色 */
@media (min-width: 760px) {
  .home-pane {
    background: var(--bg);
  }
}

html[data-theme="dark"] .home-pane {
  background: #0b1220;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .home-pane {
    background: #0b1220;
  }

  html[data-theme="auto"] .home-empty {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  }
}

/* 底部「我的」按钮加大，同时仍保持 64px 底栏对齐 */
.sidebar-bottom,
.settings-my-sidebar .my-side-foot {
  padding: 4px 6px;
  min-height: 64px;
}

.sidebar-bottom .sidebar-foot,
.settings-my-sidebar .my-side-foot .sidebar-foot {
  width: 100%;
  min-height: 28px;
  margin: 0;
  padding: 4px 9px;
  gap: 9px;
  border-radius: 9px;
  font-size: 13.5px;
  transition: background .16s ease, color .16s ease;
}

.sidebar-bottom .sidebar-foot:hover,
.settings-my-sidebar .my-side-foot .sidebar-foot:hover {
  background: var(--side-hover);
  color: var(--side-text);
}

.sidebar-bottom .sidebar-foot .icon,
.settings-my-sidebar .my-side-foot .sidebar-foot .icon {
  width: 18px;
  height: 18px;
}

.sidebar-bottom .sidebar-admin-entry,
.settings-my-sidebar .my-side-foot .sidebar-admin-entry {
  color: var(--accent) !important;
  font-size: 13px;
}


/* 单人底栏时把「我的」做成更大的按钮；管理员双入口保持 64px 对齐 */
.sidebar-bottom .sidebar-foot,
.settings-my-sidebar .my-side-foot .sidebar-foot {
  border: 1px solid var(--side-line);
  background: color-mix(in srgb, var(--side-bg) 72%, var(--surface));
}

.sidebar-bottom:not(:has(.sidebar-admin-entry)) .sidebar-foot,
.settings-my-sidebar .my-side-foot:not(:has(.sidebar-admin-entry)) .sidebar-foot {
  min-height: 38px;
  padding: 7px 12px;
  gap: 10px;
  font-size: 15px;
}

.sidebar-bottom:not(:has(.sidebar-admin-entry)) .sidebar-foot .icon,
.settings-my-sidebar .my-side-foot:not(:has(.sidebar-admin-entry)) .sidebar-foot .icon {
  width: 20px;
  height: 20px;
}

/* =========================================================
   v3.0 · 新建智能体桌面双栏 + AI 默认图标
   ========================================================= */

.avatar-ai-sage {
  background: linear-gradient(135deg, #f2f7e9 0%, #dfe9d2 100%);
  color: #587047;
}

.avatar-ai-clay {
  background: linear-gradient(135deg, #fff1e9 0%, #f2d9cc 100%);
  color: #a95f45;
}

.avatar-ai-ochre {
  background: linear-gradient(135deg, #fff5df 0%, #f0dfb9 100%);
  color: #987236;
}

.avatar-glyph {
  width: 58% !important;
  height: 58% !important;
}

html[data-theme="dark"] .avatar-ai-sage {
  background: linear-gradient(135deg, #303b28 0%, #222b1d 100%);
  color: #c3d4ab;
}

html[data-theme="dark"] .avatar-ai-clay {
  background: linear-gradient(135deg, #3d2922 0%, #2b1e19 100%);
  color: #efb096;
}

html[data-theme="dark"] .avatar-ai-ochre {
  background: linear-gradient(135deg, #3d321f 0%, #2b2418 100%);
  color: #e6c993;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .avatar-ai-sage {
    background: linear-gradient(135deg, #303b28 0%, #222b1d 100%);
    color: #c3d4ab;
  }

  html[data-theme="auto"] .avatar-ai-clay {
    background: linear-gradient(135deg, #3d2922 0%, #2b1e19 100%);
    color: #efb096;
  }

  html[data-theme="auto"] .avatar-ai-ochre {
    background: linear-gradient(135deg, #3d321f 0%, #2b2418 100%);
    color: #e6c993;
  }
}

.create-layout {
  display: block;
  min-height: 0;
}

.create-pane {
  min-width: 0;
}

.create-pane-head {
  display: none;
}

@media (min-width: 760px) {
  .create-page .sub-top {
    display: none;
  }

  .create-layout {
    display: flex;
    height: 100dvh;
  }

  .create-pane {
    flex: 1;
    height: 100dvh;
    overflow-y: auto;
    padding: 38px 38px 48px;
    background: var(--bg);
  }

  html[data-theme="dark"] .create-pane {
    background: #0b1220;
  }

  .create-pane-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 980px;
    margin: 0 auto 26px;
  }

  .create-back {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    margin-top: 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface);
  }

  .create-back:hover {
    color: var(--ink);
    background: var(--surface-2);
  }

  .create-back .icon {
    width: 17px;
    height: 17px;
  }

  .create-pane-head > div {
    min-width: 0;
  }

  .create-pane-head h1 {
    margin: 0;
    color: var(--ink);
    font-size: 30px;
    letter-spacing: -.04em;
  }

  .create-pane-head p:not(.home-eyebrow) {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12.5px;
  }

  .create-quota {
    margin-left: auto;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 99px;
    color: var(--muted);
    background: var(--surface);
    font-size: 11px;
    white-space: nowrap;
  }

  .create-form {
    max-width: 560px;
    margin: 0 auto;
    padding: 0;
  }

  .create-form .agent-preview {
    margin-top: 0;
  }
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .create-pane {
    background: #0b1220;
  }
}

/* =========================================================
   v3.1 · 服务协议 / 隐私政策
   ========================================================= */

body.legal-page-body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
}

.legal-page-body .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.legal-page-body .app-main {
  min-height: 100dvh;
  padding: 0;
  overflow: visible;
}

.legal-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 44px 24px 64px;
  align-items: start;
}

.legal-side {
  position: sticky;
  top: 44px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(340px 240px at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
  box-shadow: 0 18px 50px rgba(20, 34, 60, .06);
}

.legal-brand,
.legal-mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.legal-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #6ba3ff, #3355e0);
  color: #fff;
  box-shadow: 0 7px 18px rgba(51, 85, 224, .22);
}

.legal-brand-mark .icon {
  width: 22px;
  height: 22px;
}

.legal-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-brand-copy strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.legal-brand-copy small {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .14em;
}

.legal-side-kicker {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .04em;
}

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

.legal-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.legal-nav-item:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-color: color-mix(in srgb, var(--accent) 14%, var(--line));
}

.legal-nav-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.legal-nav-no {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
}

.legal-nav-item.is-active .legal-nav-no {
  color: var(--accent);
}

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

.legal-nav-copy strong {
  font-size: 13px;
  font-weight: 650;
}

.legal-nav-copy small {
  color: var(--muted);
  font-size: 10.5px;
}

.legal-nav-item .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.legal-nav-item.is-active .icon {
  color: var(--accent);
}

.legal-side-note {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: none;
}

.legal-back:hover {
  color: var(--accent);
}

.legal-back .icon {
  width: 15px;
  height: 15px;
}

.legal-main {
  min-width: 0;
}

.legal-tabs {
  display: none;
}

.legal-paper {
  padding: 44px 52px 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(20, 34, 60, .07);
}

.legal-head {
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.legal-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-chip {
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
}

.legal-date {
  color: var(--muted);
  font-size: 10.5px;
}

.legal-head h1 {
  margin: 13px 0 12px;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.legal-intro {
  max-width: 690px;
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.85;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 10.5px;
}

.legal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legal-meta .icon {
  width: 13px;
  height: 13px;
}

.legal-content {
  padding-top: 28px;
}

.legal-content h2 {
  position: relative;
  margin: 28px 0 10px;
  padding-left: 17px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -.02em;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .25em;
  width: 3px;
  height: 1.1em;
  border-radius: 3px;
  background: linear-gradient(180deg, #6ba3ff, #3355e0);
}

.legal-content p {
  margin: 0 0 13px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.95;
}

.legal-content ul {
  margin: 8px 0 16px;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.9;
}

.legal-content li + li {
  margin-top: 5px;
}

.legal-content a {
  color: var(--accent);
}

.legal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.legal-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.legal-foot a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.legal-foot a .icon {
  width: 13px;
  height: 13px;
}

.legal-mobile-head {
  display: none;
}

@media (max-width: 899px) {
  .legal-page-body {
    background: var(--bg);
  }

  .legal-page-body .app-main {
    padding: 0;
  }

  .legal-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .legal-side {
    display: none;
  }

  .legal-mobile-head {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px);
  }

  .legal-mobile-brand {
    gap: 8px;
  }

  .legal-mobile-brand .legal-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .legal-mobile-brand .legal-brand-mark .icon {
    width: 18px;
    height: 18px;
  }

  .legal-mobile-brand strong {
    font-size: 12.5px;
    letter-spacing: -.02em;
  }

  .legal-mobile-title {
    margin-left: auto;
    color: var(--muted);
    font-size: 11px;
  }

  .legal-main {
    padding: 0 14px calc(env(safe-area-inset-bottom) + 24px);
  }

  .legal-tabs {
    display: flex;
    gap: 4px;
    margin: 14px 0 12px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .legal-tabs a {
    flex: 1;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
  }

  .legal-tabs a.is-active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .legal-paper {
    padding: 25px 19px 24px;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(20, 34, 60, .05);
  }

  .legal-head {
    padding-bottom: 20px;
  }

  .legal-head h1 {
    margin: 10px 0 10px;
    font-size: 27px;
  }

  .legal-intro {
    font-size: 13px;
    line-height: 1.8;
  }

  .legal-meta {
    gap: 9px;
    margin-top: 14px;
    font-size: 10px;
  }

  .legal-meta span {
    flex: 1 1 100%;
  }

  .legal-content {
    padding-top: 22px;
  }

  .legal-content h2 {
    margin: 24px 0 8px;
    font-size: 16.5px;
  }

  .legal-content p {
    font-size: 13px;
    line-height: 1.9;
  }

  .legal-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

/* 法律页面必须恢复整页滚动：桌面全局的 html/body overflow:hidden 不适用于长文档 */
@media (min-width: 760px) {
  html:has(body.legal-page-body),
  body.legal-page-body {
    display: block;
    height: auto;
    min-height: 100dvh;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .legal-page-body .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .legal-page-body .app-main {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
}
