:root {
  --bg: #0e1014;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf1;
  --muted: #98a0ad;
  --weak: #6d7482;
  --accent: #e3b26b;
  --accent-soft: rgba(227, 178, 107, 0.14);
  --ok: #5ec2a2;
  --err: #e26d6d;
  --err-soft: rgba(226, 109, 109, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(227, 178, 107, 0.07), transparent 60%),
    var(--bg);
}

/* ---------- 顶栏 ---------- */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(227, 178, 107, 0.55);
}

.brand-name {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.icon-btn {
  width: 44px;
  height: 44px;
  margin-right: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* ---------- 布局 ---------- */

.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 20px 28px;
}

.view {
  animation: view-in 260ms var(--ease);
}

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

/* ---------- 激活页 ---------- */

.activate-head {
  padding: 22px 2px 26px;
}

.mark {
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(227, 178, 107, 0.28);
  color: var(--accent);
  font-size: 22px;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.field-label {
  font-size: 13px;
  color: var(--muted);
}

.input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #12151c;
  color: var(--text);
  font-size: 17px;
  letter-spacing: 0.06em;
  outline: none;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

.field:nth-child(2) .input {
  letter-spacing: 0;
  font-size: 16px;
}

.input::placeholder {
  color: #565d6b;
  letter-spacing: 0.02em;
}

.input:focus {
  border-color: rgba(227, 178, 107, 0.6);
  background: #141821;
}

.field-hint {
  font-size: 12px;
  color: var(--weak);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
}

.check-input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.doc-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -8px 0 0 30px;
  font-size: 12.5px;
}

.dot {
  color: var(--weak);
}

.primary-btn {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #191407;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 180ms var(--ease), opacity 180ms var(--ease), background 180ms var(--ease);
}

.primary-btn:active {
  transform: scale(0.985);
}

.primary-btn:disabled {
  background: #2a2d35;
  color: #737a87;
  cursor: not-allowed;
  transform: none;
}

.footnote {
  margin: 18px 2px 0;
  font-size: 12px;
  color: var(--weak);
  text-align: center;
}

/* ---------- 错误提示 ---------- */

.error-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(226, 109, 109, 0.32);
  background: var(--err-soft);
  color: #f0a8a8;
  font-size: 13.5px;
  line-height: 1.6;
}

.error-box .error-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.text-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(226, 109, 109, 0.4);
  background: transparent;
  color: #f0b8b8;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- 首页 ---------- */

.home-head {
  padding: 18px 2px 8px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.space-name {
  font-size: 24px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 2px 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.section-note {
  font-size: 12px;
  color: var(--weak);
}

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

.kb-card {
  position: relative;
  width: 100%;
  padding: 15px 44px 15px 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  cursor: pointer;
  transition: border-color 200ms var(--ease), background 200ms var(--ease), transform 180ms var(--ease);
}

.kb-card:active {
  transform: scale(0.99);
}

.kb-card.selected {
  border-color: rgba(227, 178, 107, 0.55);
  background: linear-gradient(180deg, rgba(227, 178, 107, 0.08), rgba(227, 178, 107, 0.03)), var(--panel);
}

.kb-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.kb-desc {
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
}

.kb-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--weak);
}

.kb-check {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}

.kb-card.selected .kb-check {
  border-color: var(--accent);
  background: var(--accent);
}

.kb-card.selected .kb-check::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 4px auto 0;
  border-right: 2px solid #191407;
  border-bottom: 2px solid #191407;
  transform: rotate(42deg);
}

.empty-state {
  padding: 34px 18px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13.5px;
}

.empty-mark {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--weak);
  font-weight: 600;
}

.empty-state p {
  margin: 0;
}

.start-dock {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dock-hint {
  margin: 0 0 10px;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--weak);
  text-align: center;
}

/* ---------- 对话页 ---------- */

.call-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding-top: 16px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px rgba(94, 194, 162, 0.55);
  transition: background 200ms var(--ease), box-shadow 200ms var(--ease);
}

.status-dot.warn {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(227, 178, 107, 0.55);
}

.call-status {
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.orb {
  --level: 0;
  position: relative;
  width: 190px;
  height: 190px;
  margin: 24px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(227, 178, 107, 0.26);
  animation: pulse 3.6s var(--ease) infinite;
}

.orb-ring.ring-2 {
  inset: 16px;
  opacity: 0.55;
  animation-delay: -1.4s;
}

.orb-core {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(227, 178, 107, 0.9), rgba(227, 178, 107, 0.32) 55%, rgba(227, 178, 107, 0.08) 78%);
  box-shadow: 0 0 42px rgba(227, 178, 107, 0.22);
  transform: scale(calc(1 + var(--level, 0) * 0.16));
  transition: transform 90ms linear;
}

@keyframes pulse {
  0% { transform: scale(0.94); opacity: 0.65; }
  55% { transform: scale(1.06); opacity: 0.22; }
  100% { transform: scale(0.94); opacity: 0.65; }
}

.call-timer {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-align: center;
}

.call-hint {
  margin: 10px auto 0;
  max-width: 300px;
  text-align: center;
  font-size: 13px;
  color: var(--weak);
}

/* ---------- 麦克风选择 ---------- */

.mic-pick {
  margin: 18px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mic-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mic-hint {
  margin: 0;
  font-size: 12px;
  color: var(--weak);
}

/* ---------- 拟人形象与麦克风电平 ---------- */

.avatar-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0 0;
}

.avatar {
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-halo {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(227, 178, 107, 0.18), transparent 68%);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.avatar-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(227, 178, 107, 0.5);
  box-shadow: 0 0 0 7px rgba(227, 178, 107, 0.05), 0 16px 34px rgba(0, 0, 0, 0.5);
  background: #10131a;
  animation: av-img-breathe 5s ease-in-out infinite;
}

.avatar[data-state="connecting"] .avatar-img,
.avatar[data-state="thinking"] .avatar-img {
  animation: av-img-think 1.8s ease-in-out infinite;
}

.avatar[data-state="listening"] .avatar-img {
  border-color: rgba(94, 194, 162, 0.55);
  box-shadow: 0 0 0 7px rgba(94, 194, 162, 0.08), 0 0 26px rgba(94, 194, 162, 0.25);
  animation: av-img-listen 3s ease-in-out infinite;
}

.avatar[data-state="listening"] .avatar-halo {
  opacity: 0.9;
  background: radial-gradient(circle at 50% 45%, rgba(94, 194, 162, 0.22), transparent 70%);
  animation: av-halo 2.4s ease-in-out infinite;
}

.avatar[data-state="speaking"] .avatar-img {
  border-color: rgba(227, 178, 107, 0.85);
  box-shadow: 0 0 0 8px rgba(227, 178, 107, 0.12), 0 0 34px rgba(227, 178, 107, 0.35);
  animation: av-img-speak 0.9s ease-in-out infinite;
}

.avatar[data-state="speaking"] .avatar-halo {
  opacity: 1;
  animation: av-halo 0.9s ease-in-out infinite;
}

@keyframes av-img-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(2px) scale(1.008); }
}

@keyframes av-img-listen {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes av-img-speak {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1.5px) scale(1.015); }
}

@keyframes av-img-think {
  0%, 100% { transform: rotate(-1.2deg); }
  50% { transform: rotate(1.2deg); }
}

@keyframes av-halo {
  0%, 100% { transform: scale(0.94); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 1; }
}

.mic-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px auto 0;
  max-width: 340px;
}

.meter {
  width: 120px;
  height: 5px;
  border-radius: 5px;
  background: #242a36;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ok), var(--accent));
  transition: width 0.08s linear;
}

.mic-stat {
  font-size: 12px;
  color: var(--weak);
  font-variant-numeric: tabular-nums;
}

.transcript {
  margin: 18px 0 4px;
  max-height: 46vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
  scrollbar-width: none;
}

.transcript::-webkit-scrollbar {
  display: none;
}

.transcript-empty {
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: var(--weak);
}

.msg {
  /* 关键：flex 子项默认会收缩，导致长字幕被压扁、滚动条不出现 */
  flex: 0 0 auto;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  animation: msg-in 220ms var(--ease);
}

.msg-role {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #8b929d;
}

.msg.user {
  align-self: flex-end;
  max-width: 86%;
  background: linear-gradient(180deg, rgba(201, 169, 106, 0.18), rgba(201, 169, 106, 0.07));
  border-color: rgba(201, 169, 106, 0.3);
}

.msg.user .msg-role {
  color: rgba(216, 191, 145, 0.92);
}

.msg.user .msg-body {
  color: #f0e2c8;
}

.msg.interrupted {
  opacity: 0.72;
}

.msg-source {
  margin-top: 7px;
  font-size: 12px;
  color: var(--accent);
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.call-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 14px 0 6px;
  background: linear-gradient(180deg, rgba(14, 16, 20, 0), var(--bg) 42%);
}

.action-btn {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 14.5px;
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}

.action-btn:active {
  background: var(--panel-2);
}

.action-btn.active {
  border-color: rgba(227, 178, 107, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
}

.action-btn.danger {
  border-color: rgba(226, 109, 109, 0.34);
  color: #e8a2a2;
}

.ghost-btn {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 200ms var(--ease);
}

.ghost-btn:active {
  background: rgba(255, 255, 255, 0.05);
}

.ghost-btn.wide {
  width: 100%;
  min-height: 44px;
}

/* ---------- 设置抽屉 ---------- */

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(6, 7, 10, 0.6);
  backdrop-filter: blur(2px);
  animation: fade-in 200ms var(--ease);
}

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

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  width: min(86vw, 380px);
  padding: 8px 18px 24px;
  background: #12151c;
  border-left: 1px solid var(--line);
  transform: translateX(102%);
  transition: transform 260ms var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer.open {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 17px;
}

.drawer-group {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}

.drawer-row:last-child {
  border-bottom: none;
}

.drawer-row.static {
  cursor: default;
  color: var(--muted);
}

.row-value {
  color: var(--weak);
  font-size: 13px;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chev {
  color: var(--weak);
}

.note-group {
  padding: 16px;
  border-bottom: none;
}

.note-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.note-group p {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.danger-btn {
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid rgba(226, 109, 109, 0.24);
  color: #e08f8f;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- 弹层 ---------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(6, 7, 10, 0.66);
  animation: fade-in 180ms var(--ease);
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: #14171f;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  animation: sheet-up 240ms var(--ease);
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px 20px;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  padding: 4px 20px 28px;
  overflow-y: auto;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.75;
}

.modal-body h3 {
  margin: 18px 0 6px;
  color: var(--text);
  font-size: 14px;
}

.modal-body p {
  margin: 0 0 10px;
}

/* ---------- 轻提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 58px;
  z-index: 40;
  max-width: 84vw;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(30, 34, 43, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

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

/* ---------- 单场景首页 ---------- */

.stage {
  min-height: calc(100vh - 74px);
  padding-top: 5vh;
  display: flex;
  flex-direction: column;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 6px;
}

.hero .avatar {
  width: 176px;
  height: 176px;
  margin-bottom: 14px;
}

.hero .avatar-img {
  border-width: 2px;
  box-shadow: 0 0 0 9px rgba(227, 178, 107, 0.06), 0 22px 46px rgba(0, 0, 0, 0.55);
}

.avatar[data-state="idle"] .avatar-img {
  animation: av-img-breathe 5s ease-in-out infinite;
}

.avatar[data-state="idle"] .avatar-halo {
  opacity: 0.55;
  animation: av-halo 4.2s ease-in-out infinite;
}

.hero-title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}

.hero .call-head {
  padding-top: 10px;
}

.hero .call-hint {
  margin-top: 6px;
}

.landing {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing .section-head {
  margin: 0 2px 10px;
}

.kb-panel {
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 33, 0.72);
}

.meter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px auto 0;
  max-width: 340px;
}

.call-panel {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
}

/* ---------- 对话参数 ---------- */

.tune {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 26, 33, 0.72);
  overflow: hidden;
}

.tune summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  list-style: none;
}

.tune summary::-webkit-details-marker {
  display: none;
}

.tune summary em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.tune[open] summary {
  border-bottom: 1px solid var(--line);
}

.tune-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.tune-body .input {
  height: 46px;
  font-size: 15px;
  letter-spacing: 0;
}

.textarea {
  height: auto;
  min-height: 108px;
  padding: 12px 14px;
  line-height: 1.6;
  letter-spacing: 0;
  font-family: inherit;
  resize: vertical;
}

.tune-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- 激活弹层 ---------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(6, 7, 10, 0.68);
  backdrop-filter: blur(3px);
  animation: fade-in 180ms var(--ease);
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  width: min(100%, 560px);
  max-height: 88vh;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #14171f;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  transform: translateX(-50%);
  animation: sheet-up 260ms var(--ease);
}

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

.sheet-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.sheet .eyebrow {
  margin: 0 0 4px;
}

.sheet-desc {
  margin: 10px 0 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 360px) {
  .main { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 22px; }
  .space-name { font-size: 22px; }
}

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

/* ============================================================
   香槟金 · 深墨蓝 · 商务静奢主题
   仅在原有结构上做视觉层，不改任何交互
   ============================================================ */

:root {
  --bg: #060a11;
  --panel: #0f1622;
  --panel-2: #141d2b;
  --line: rgba(201, 169, 106, 0.16);
  --line-strong: rgba(201, 169, 106, 0.34);
  --text: #f2ece2;
  --muted: #a3a8b4;
  --weak: #7b8290;
  --accent: #c9a86a;
  --accent-soft: rgba(201, 169, 106, 0.12);
  --radius: 18px;
  --radius-sm: 13px;
}

html, body {
  font-family: "Optima", "Candara", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background:
    radial-gradient(1200px 720px at 50% -14%, rgba(201, 169, 106, 0.11), transparent 62%),
    radial-gradient(980px 640px at 88% 112%, rgba(38, 66, 104, 0.32), transparent 66%),
    radial-gradient(760px 520px at 4% 84%, rgba(24, 44, 72, 0.26), transparent 70%),
    #060a11;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 22%, transparent 42%, rgba(2, 4, 8, 0.62) 100%);
}

.app {
  position: relative;
  z-index: 1;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  background: rgba(6, 10, 17, 0.68);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201, 169, 106, 0.14);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 106, 0.45), transparent);
  opacity: 0.55;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: linear-gradient(145deg, #ecd29c, #b08d50);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(201, 169, 106, 0.55);
}

.brand-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.42em;
  color: #efe5d4;
}

.icon-btn {
  color: var(--muted);
  transition: color 160ms var(--ease), transform 160ms var(--ease);
}

.icon-btn:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* ---------- 场景与头像 ---------- */

.stage {
  padding-top: 6vh;
  position: relative;
}

.stage::before {
  content: "";
  position: absolute;
  top: 2vh;
  left: 50%;
  width: 60%;
  max-width: 340px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(201, 169, 106, 0.35), transparent);
  opacity: 0.5;
}

.hero .avatar {
  width: 188px;
  height: 188px;
  margin-top: 12px;
  margin-bottom: 22px;
}

.avatar {
  position: relative;
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -17px;
  border: 1px solid rgba(201, 169, 106, 0.22);
  border-radius: 50%;
  pointer-events: none;
}

.hero .avatar-img {
  border: 1px solid rgba(201, 169, 106, 0.7);
  border-radius: 50%;
  box-shadow:
    0 0 0 6px rgba(201, 169, 106, 0.05),
    0 0 0 7px rgba(201, 169, 106, 0.16),
    0 26px 62px rgba(0, 0, 0, 0.62),
    0 0 44px rgba(201, 169, 106, 0.12);
}

.hero-title,
.sheet-head h2,
.section-head h2,
.drawer-head h2,
.modal-head h2,
.tune summary > span {
  font-family: "Songti SC", "Noto Serif SC", "STSong", "SimSun", Georgia, serif;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.hero-title {
  font-size: 24px;
  color: #f7efe2;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.call-status {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #b9bcc4;
}

.status-dot {
  background: radial-gradient(circle at 35% 35%, #efd8a6, #b08d50 70%);
  box-shadow: 0 0 10px rgba(201, 169, 106, 0.65);
}

.call-hint {
  color: #969ba6;
  letter-spacing: 0.03em;
}

.call-timer {
  font-family: "Optima", "Candara", "PingFang SC", sans-serif;
  color: #efe6d7;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* ---------- 面板 ---------- */

.kb-panel,
.tune {
  background: linear-gradient(180deg, rgba(20, 29, 43, 0.86), rgba(11, 17, 27, 0.92));
  border: 1px solid rgba(201, 169, 106, 0.18);
  border-radius: 18px;
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(12px);
}

.section-head h2 {
  font-size: 15px;
  color: #f4ead9;
}

.section-head h2::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  margin-right: 10px;
  vertical-align: middle;
  background: linear-gradient(90deg, rgba(201, 169, 106, 0.9), transparent);
}

.section-note {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(201, 169, 106, 0.72);
}

.kb-list {
  gap: 10px;
}

.kb-card {
  background: rgba(7, 12, 20, 0.62);
  border: 1px solid rgba(201, 169, 106, 0.14);
  border-radius: 14px;
  transition: border-color 180ms var(--ease), background 180ms var(--ease),
    transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.kb-card:hover {
  border-color: rgba(201, 169, 106, 0.36);
  transform: translateY(-1px);
}

.kb-card.selected {
  border-color: rgba(201, 169, 106, 0.58);
  background: linear-gradient(90deg, rgba(201, 169, 106, 0.14), rgba(201, 169, 106, 0.02) 70%);
  box-shadow: inset 0 0 0 1px rgba(201, 169, 106, 0.12);
}

.kb-name {
  color: #f1e8d9;
  letter-spacing: 0.04em;
}

.kb-meta,
.kb-desc {
  color: #8c929e;
}

.kb-check {
  border-color: rgba(201, 169, 106, 0.45);
}

.kb-card.selected .kb-check {
  background: linear-gradient(145deg, #e3c58f, #b08d50);
  border-color: transparent;
}

/* ---------- 折叠设置 ---------- */

.tune summary {
  padding: 16px 18px;
  font-size: 14px;
  color: #f0e7d8;
}

.tune summary em {
  font-family: "Optima", "Candara", "PingFang SC", sans-serif;
  letter-spacing: 0.12em;
  color: #9a9589;
}

.tune[open] summary {
  border-bottom: 1px solid rgba(201, 169, 106, 0.16);
}

.tune-body {
  padding: 18px;
  gap: 16px;
}

/* ---------- 表单 ---------- */

.field-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #a8a292;
}

.input {
  background: rgba(5, 9, 15, 0.86);
  border: 1px solid rgba(201, 169, 106, 0.18);
  border-radius: 12px;
  color: #f2ece2;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.input:focus {
  border-color: rgba(201, 169, 106, 0.58);
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 169, 106, 0.1);
}

.input::placeholder {
  color: #6f7784;
}

.field-hint,
.mic-hint,
.tune-hint {
  color: #8a8f9a;
}

.link {
  color: #c9a86a;
  letter-spacing: 0.04em;
}

/* ---------- 主按钮 ---------- */

.primary-btn {
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255, 245, 225, 0.28);
  background: linear-gradient(180deg, #e3c48d 0%, #c9a86a 48%, #ad8a4d 100%);
  color: #171208;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  box-shadow:
    0 16px 34px rgba(201, 169, 106, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: filter 160ms var(--ease), transform 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.primary-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 20px 40px rgba(201, 169, 106, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.primary-btn:disabled {
  background: #232a35;
  color: #7d828c;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.dock-hint {
  color: #8d929d;
  letter-spacing: 0.04em;
}

/* ---------- 催话电平 ---------- */

.meter {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 99px;
}

#meterFill {
  background: linear-gradient(90deg, #8a6d3f, #d6b67c 55%, #f0d8a8);
  box-shadow: 0 0 12px rgba(201, 169, 106, 0.5);
}

.mic-stat {
  color: #9c9587;
  letter-spacing: 0.08em;
}

/* ---------- 对话区 ---------- */

.transcript {
  background: linear-gradient(180deg, rgba(16, 24, 37, 0.75), rgba(9, 14, 22, 0.85));
  border: 1px solid rgba(201, 169, 106, 0.16);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.transcript-empty {
  color: #848a96;
  letter-spacing: 0.04em;
}

.msg {
  background: linear-gradient(180deg, rgba(22, 31, 45, 0.86), rgba(14, 21, 32, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  line-height: 1.75;
}

.msg-source {
  color: #c9a86a;
  letter-spacing: 0.04em;
}

.action-btn {
  border-radius: 13px;
  border: 1px solid rgba(201, 169, 106, 0.26);
  background: rgba(8, 13, 21, 0.7);
  color: #e8dfd0;
  letter-spacing: 0.1em;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.action-btn:hover {
  border-color: rgba(201, 169, 106, 0.5);
  background: rgba(201, 169, 106, 0.08);
}

.action-btn.danger {
  border-color: rgba(217, 139, 127, 0.32);
  color: #e6b3a8;
}

.action-btn.danger:hover {
  border-color: rgba(217, 139, 127, 0.6);
  background: rgba(217, 139, 127, 0.08);
}

/* ---------- 激活弹层 ---------- */

.sheet-mask {
  background: rgba(3, 6, 11, 0.72);
  backdrop-filter: blur(8px);
}

.sheet {
  background: linear-gradient(180deg, #101a28 0%, #0a111b 100%);
  border: 1px solid rgba(201, 169, 106, 0.3);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -32px 90px rgba(0, 0, 0, 0.68);
}

.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 208, 160, 0.85), transparent);
}

.sheet .eyebrow {
  color: rgba(201, 169, 106, 0.78);
  letter-spacing: 0.22em;
  font-size: 11px;
}

.sheet-head h2 {
  font-size: 22px;
  color: #f6edde;
}

.sheet-desc {
  color: #9196a1;
}

/* ---------- 抽屉与弹窗 ---------- */

.drawer {
  background: linear-gradient(180deg, #0f1826, #0a111b);
  border-left: 1px solid rgba(201, 169, 106, 0.24);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.55);
}

.drawer-head h2,
.modal-head h2 {
  font-size: 19px;
  color: #f4eadb;
}

.drawer-group {
  border-bottom: 1px solid rgba(201, 169, 106, 0.12);
}

.drawer-row {
  color: #ddd5c8;
}

.ghost-btn {
  border: 1px solid rgba(201, 169, 106, 0.3);
  border-radius: 12px;
  color: #d9c9a9;
  background: rgba(201, 169, 106, 0.04);
}

.danger-btn {
  border-radius: 12px;
  border: 1px solid rgba(217, 139, 127, 0.3);
  color: #e1a99f;
  background: rgba(217, 139, 127, 0.06);
}

.modal {
  background: linear-gradient(180deg, #101a28, #0a111b);
  border: 1px solid rgba(201, 169, 106, 0.24);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.toast {
  background: rgba(15, 24, 37, 0.96);
  border: 1px solid rgba(201, 169, 106, 0.35);
  color: #f0e6d6;
  border-radius: 12px;
}

@media (max-width: 420px) {
  .hero .avatar {
    width: 164px;
    height: 164px;
  }
  .stage {
    padding-top: 4vh;
  }
}

/* ---------- 安装到桌面引导 ---------- */

.install-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background: rgba(6, 7, 10, 0.78);
  backdrop-filter: blur(6px);
  animation: fade-in 180ms var(--ease);
}

.install-card {
  width: 100%;
  max-width: 380px;
  padding: 26px 22px 22px;
  background: #14171f;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: sheet-up 240ms var(--ease);
}

.install-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

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

.install-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

.install-sub {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
}

.install-steps {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}

.install-steps li::marker {
  color: var(--accent);
  font-weight: 600;
}

.install-note {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--weak);
  text-align: center;
}

.install-note:empty {
  display: none;
}

.install-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.install-actions .action-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 18px;
  min-height: 52px;
}

.install-actions .primary-btn {
  flex: 1 1 auto;
  width: auto;
}


/* ============================================================
   2026-11-17 四页式：语音 / 参数 / 文本 / 我的
   ============================================================ */

.tab-btn {
  gap: 2px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.tab-btn svg {
  width: 20px;
  height: 20px;
}

/* 对话中：整页锁定，只有字幕小窗内部滚动 */
body.in-call {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.in-call .app {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.in-call .main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 8px;
}

body.in-call .page-view,
body.in-call .stage {
  height: 100%;
  min-height: 0;
}

body.in-call .stage {
  padding-top: 0;
}

body.in-call .hero {
  flex: 0 0 auto;
  padding-bottom: 2px;
}

body.in-call .hero .avatar {
  width: 84px;
  height: 84px;
  margin-bottom: 6px;
}

body.in-call .hero-title {
  font-size: 16px;
}

body.in-call .call-hint {
  display: none;
}

body.in-call .hero .call-head {
  padding-top: 4px;
}

body.in-call .meter-row {
  margin-top: 6px;
}

body.in-call .call-panel {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 10px;
  overflow: hidden;
}

body.in-call .transcript {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  position: relative;
  padding-bottom: 38vh;
  scroll-padding-bottom: 38vh;
}

body.in-call .call-actions {
  flex: 0 0 auto;
}

/* 文本问答 */
.text-chat {
  margin-top: 16px;
  min-height: 300px;
  max-height: 52vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(201, 169, 106, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(16, 24, 37, 0.75), rgba(9, 14, 22, 0.85));
}

.text-empty {
  margin: auto;
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--weak);
}

.text-msg {
  max-width: 92%;
  padding: 10px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(22, 31, 45, 0.9), rgba(14, 21, 32, 0.9));
  font-size: 14.5px;
  line-height: 1.7;
}

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

.text-msg.user {
  align-self: flex-end;
  max-width: 86%;
  border-color: rgba(201, 169, 106, 0.3);
  background: linear-gradient(180deg, rgba(201, 169, 106, 0.18), rgba(201, 169, 106, 0.07));
}

.text-msg.error {
  border-color: rgba(217, 139, 127, 0.4);
}

.text-msg-role {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #8b929d;
}

.text-msg.user .text-msg-role {
  color: rgba(216, 191, 145, 0.92);
}

.text-msg-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.text-composer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.text-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.primary-btn.small {
  width: auto;
  min-width: 96px;
  height: 44px;
  padding: 0 22px;
  font-size: 14px;
  letter-spacing: 0.08em;
}

/* 音色复刻 */
.clone-actions {
  display: flex;
  gap: 10px;
}

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

.clone-grid .field-label {
  font-size: 12px;
}

.clone-grid .input {
  padding-left: 10px;
  padding-right: 10px;
}

.clone-actions .ghost-btn {
  flex: 1 1 auto;
  min-height: 44px;
}

.clone-actions .primary-btn.small {
  flex: 1 1 auto;
}

.clone-status {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.clone-status.ok {
  border-color: rgba(94, 194, 162, 0.4);
  background: rgba(94, 194, 162, 0.08);
  color: #9fdcc8;
}

.clone-status.error {
  border-color: rgba(217, 139, 127, 0.4);
  background: rgba(217, 139, 127, 0.08);
  color: #e6b3a8;
}

.clone-audio {
  width: 100%;
  margin-top: 4px;
}

.clone-list-head {
  margin-top: 16px;
}

#voiceClonePanel .kb-list {
  max-height: 240px;
}

/* 文本问答：知识库选择页 + 独立全屏对话层 */
.text-setup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.text-setup-actions .primary-btn,
.text-setup-actions .ghost-btn {
  width: 100%;
  min-height: 46px;
}

.text-workspace {
  position: fixed;
  left: 50%;
  top: 0;
  bottom: calc(66px + env(safe-area-inset-bottom));
  z-index: 16;
  width: min(100%, 560px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 18px 0;
  background: var(--bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.text-ws-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
}

.text-back {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.text-ws-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.text-ws-title strong {
  font-size: 15px;
  font-weight: 600;
}

.text-ws-title span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11.5px;
  color: var(--weak);
}

.text-workspace .text-chat {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-top: 0;
  padding: 12px 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.text-workspace .text-composer {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.text-enter-hint {
  font-size: 11px;
  color: var(--weak);
}


.main {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.page-view {
  animation: view-in 220ms var(--ease);
}

.page-head {
  padding: 8px 2px 16px;
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.page-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.section-side {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.overlay-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(227, 178, 107, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(227, 178, 107, 0.12), rgba(23, 26, 33, 0.72));
}

.overlay-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.overlay-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.overlay-text span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.overlay-card .ghost-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
}

.about-sign {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--weak);
  letter-spacing: 0.02em;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 18;
  width: min(100%, 560px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(14, 16, 20, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 54px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--weak);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}

.tab-btn svg {
  opacity: 0.78;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.tab-btn.active {
  color: var(--accent);
  background: rgba(227, 178, 107, 0.1);
}

.tab-btn.active svg {
  opacity: 1;
  transform: translateY(-1px);
}

.tab-btn:active {
  background: rgba(255, 255, 255, 0.05);
}

#pageTune .tune,
#pageTune .mic-pick {
  margin-bottom: 14px;
}

#pageAbout .drawer-group {
  margin-top: 12px;
}

.hero .avatar {
  width: 148px;
  height: 148px;
  margin-bottom: 12px;
}

.stage {
  min-height: auto;
  padding-top: 2vh;
}

@media (max-height: 700px) {
  .hero .avatar {
    width: 118px;
    height: 118px;
  }

  .stage {
    padding-top: 0;
  }
}

/* 首页主操作固定在底栏上方，知识库再多也不用滚到底，也不会被底栏压住 */
#pageTalk .landing {
  padding-bottom: 112px;
}

#pageTalk .start-dock {
  position: fixed;
  left: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 17;
  width: min(100%, 560px);
  margin: 0;
  padding: 12px 18px 10px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 10, 17, 0) 0%, rgba(6, 10, 17, 0.94) 26%, rgba(6, 10, 17, 0.99) 100%);
}

@media (max-width: 560px) {
  .hero .avatar {
    width: 124px;
    height: 124px;
    margin-bottom: 10px;
  }

  .hero-title {
    font-size: 20px;
  }

  .call-hint {
    margin-top: 6px;
  }
}

/* 模型快捷选择：手机上比 datalist 更好点 */
.model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.model-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 32px;
  cursor: pointer;
  transition: color 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.model-chip.active {
  color: var(--accent);
  border-color: rgba(227, 178, 107, 0.6);
  background: rgba(227, 178, 107, 0.12);
}

.model-chip:active {
  transform: scale(0.98);
}
