:root {
  color-scheme: light;
  --ink: #292526;
  --muted: #756d70;
  --paper: #fffaf7;
  --rose: #c9687b;
  --rose-dark: #a94f64;
  --rose-soft: #f6dfe3;
  --sage: #7e9a8b;
  --line: rgba(83, 61, 66, 0.13);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(247, 204, 211, 0.85), transparent 33%),
    radial-gradient(circle at 90% 82%, rgba(194, 218, 204, 0.76), transparent 34%),
    #eee7e4;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
[hidden] { display: none !important; }

/* ---------- 外壳与手机 ---------- */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 240px;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 32px 20px;
}

.phone {
  height: min(850px, calc(100vh - 48px));
  min-height: 680px;
  display: grid;
  grid-template-rows: auto auto minmax(160px, 1fr) auto auto;
  overflow: hidden;
  background: rgba(255, 250, 247, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 42px;
  box-shadow: 0 28px 90px rgba(72, 50, 55, 0.22), inset 0 0 0 1px var(--line);
}

.topbar { display: flex; justify-content: space-between; align-items: start; padding: 30px 28px 16px; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }

.eyebrow { margin: 0 0 5px; font-size: 11px; letter-spacing: 0.18em; color: var(--muted); }
h1 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -0.03em; }

/* 状态 pill（app.js 直接写 className = 'status status-xxx'） */
.status {
  display: inline-block;
  margin-top: 9px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: #eee8e6;
  color: var(--muted);
}
.status-idle { background: #eee8e6; color: var(--muted); }
.status-ok { background: #deeee5; color: #436d58; }
.status-busy { background: var(--rose-soft); color: var(--rose-dark); }
.status-idle { background: #eee8e6; color: var(--muted); }

/* 后端连接状态（app.js 写 className = 'backend-status ok/warn/error'） */
.backend-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #eee8e6;
  color: var(--muted);
}
.backend-status.ok { background: #deeee5; color: #436d58; }
.backend-status.warn { background: var(--rose-soft); color: var(--rose-dark); }
.backend-status.error { background: #f7d9de; color: #a33c50; }

/* ---------- 在场 / 闺蜜光球 ---------- */
.presence { text-align: center; padding: 2px 30px 14px; }
.presence p { margin: 7px 0 0; font-size: 14px; }
.presence .hint { color: var(--muted); font-size: 11px; line-height: 1.45; }

.orb {
  width: 76px; height: 76px;
  margin: 0 auto 11px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #f8cbd2, #bd6679);
  box-shadow: 0 12px 40px rgba(191, 94, 115, 0.3);
  transition: transform 180ms ease;
}
.orb span { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.62); }
.orb.active { box-shadow: 0 14px 52px rgba(191, 94, 115, 0.45); animation: breathe 1.7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); box-shadow: 0 14px 52px rgba(191,94,115,.42); } }

/* 我（本地）状态 chip —— 对应 app.js 的 localCard */
.me-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 12px auto 0; padding: 6px 14px;
  border-radius: 999px; background: #fff;
  border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.me-chip #localLabel { font-weight: 650; color: var(--ink); }
.me-chip.active { background: #deeee5; border-color: #9cc8b3; color: #436d58; }

/* ---------- 字幕（对话内容） ---------- */
.transcript {
  overflow-y: auto;
  padding: 12px 22px 18px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 14px;                    /* 行间距加大，让对话气泡之间有呼吸感 */
}
.sub-empty { color: #a89ea1; text-align: center; padding-top: 45px; font-size: 13px; }
.sub-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  animation: subIn .25s ease-out both;
}
@keyframes subIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sub-me { align-items: flex-end; }
.sub-bestie { align-items: flex-start; }
.sub-who {
  font-size: 11px; font-weight: 650;
  color: var(--muted);
  margin-bottom: 3px;
  letter-spacing: 0.04em;
}
.sub-text {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 86%;
  line-height: 1.58;
}
.sub-me .sub-text { background: var(--rose); color: #fff; border-bottom-right-radius: 5px; }
.sub-bestie .sub-text { background: #f2ece8; color: var(--ink); border-bottom-left-radius: 5px; }

/* ---------- 控制按钮（圆形） ---------- */
.controls { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 20px 20px; }
.round { border: 0; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 7px 20px rgba(67,48,52,.13); }
.round.primary { width: 74px; height: 74px; background: var(--rose); color: white; font-weight: 700; font-size: 15px; }
.round.primary.hangup { background: #494144; }
.round.secondary { width: 54px; height: 54px; background: white; color: var(--ink); font-size: 12px; }

footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 26px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

/* ---------- 右侧说明 + 日志 ---------- */
.meeting-note { align-self: end; margin-bottom: 48px; color: rgba(41,37,38,.74); font-size: 13px; line-height: 1.6; }
.meeting-note p { font-weight: 650; margin: 0 0 8px; }
.meeting-note ol { padding-left: 20px; margin: 0; }
.meeting-note .note { font-weight: 400; color: var(--muted); margin: 14px 0 8px; }
.log {
  background: #1b1517; color: #e9dde0;
  border-radius: 14px; padding: 12px 14px;
  font-size: 11.5px; line-height: 1.6; max-height: 240px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 760px) {
  .shell { display: block; padding: 0; }
  .phone { width: 100%; height: 100vh; min-height: 640px; border-radius: 0; }
  .meeting-note { display: none; }
}
