:root {
  --bg0: #0c1218;
  --bg1: #13202b;
  --ink: #e8eef4;
  --muted: #8fa3b5;
  --accent: #3dd6c6;
  --line: rgba(255, 255, 255, 0.08);
  --spk0: #3dd6c6;
  --spk1: #f0b429;
  --spk2: #7aa2ff;
  --spk3: #ff7a90;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a3344 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #243018 0%, transparent 50%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 字幕页：html/body 定高 + flex，让 #feed 成为唯一滚动容器（百分比高度链否则会断） */
html:has(body.captions-page) {
  height: 100%;
}
body.captions-page {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.enroll-page {
  height: auto;
  overflow: auto;
}

.top {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.25rem 2rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav:hover { text-decoration: underline; }

.minutes-banner {
  flex-shrink: 0;
  margin: 0.5rem 2rem 0;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(61, 214, 198, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
}
.minutes-banner-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.minutes-summary {
  flex: 1 1 240px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.spk-id {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid var(--line);
}

.pill.on {
  color: #062b27;
  background: var(--accent);
  border-color: transparent;
}

.pill.off {
  color: var(--muted);
}

.pill.warn {
  color: #2b2206;
  background: #f0b429;
  border-color: transparent;
}

.mic-level {
  display: inline-flex;
  align-items: center;
  width: 72px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  vertical-align: middle;
}

.mic-level-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--muted);
  transition: width 80ms linear, background 120ms ease;
}

.mic-level-fill.hot {
  background: var(--accent);
}

.mic-level-fill.cold {
  background: #4a5a68;
}

.feed {
  flex: 1 1 auto;
  min-height: 0; /* flex 子项可收缩，否则 overflow 不生效 */
  overflow-y: auto;
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 0;
  overflow: hidden;
}

.workspace .feed {
  flex: 1 1 65%;
}

.insights {
  flex: 0 0 min(320px, 34%);
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding: 1rem 1.1rem 1.5rem;
  background: rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.insights-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.insights-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.insights .muted {
  color: var(--muted);
  font-size: 0.75rem;
}

.insight-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.04em;
}

.insight-block .count {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.live-summary {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
  min-height: 2.4em;
}
.live-summary.muted {
  color: var(--muted);
}

.insight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.insight-item {
  padding: 0.55rem 0.65rem;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.04);
  animation: rise 0.3s ease-out;
}

.insight-item.kind-decision {
  border-left-color: var(--spk1);
}

.insight-item.kind-agenda_drift {
  border-left-color: var(--spk3);
}

.insight-title {
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
}

.insight-meta {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.item {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  animation: rise 0.35s ease-out;
}

.item.partial {
  opacity: 0.65;
}

.spk {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.text {
  font-size: 1.35rem;
  line-height: 1.45;
  word-break: break-word;
}

.time {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.sys {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
}

.foot {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

body.minutes-page {
  height: auto;
  overflow: auto;
}
.minutes-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
}
.minutes-main h1 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}
.minutes-pre {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-x: auto;
}
.muted { color: var(--muted); }

/* Login gate（对齐 speech.lanlinbaixi.com 全屏门禁） */
.auth-msg {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-msg.err { color: #ff7a90; }
.auth-msg.ok { color: var(--accent); }

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(61, 214, 198, 0.18) 0%, transparent 58%),
    radial-gradient(780px 460px at 96% 4%, rgba(122, 162, 255, 0.16) 0%, transparent 52%),
    rgba(8, 12, 18, 0.92);
  backdrop-filter: blur(8px);
}
.login-overlay[hidden] { display: none !important; }
.login-panel {
  width: min(420px, 100%);
  background: rgba(19, 32, 43, 0.95);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.login-brand {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.login-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.55rem;
  font-weight: 700;
}
.login-sub {
  margin: 0 0 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.login-form .field {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}
.login-form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  font: inherit;
  color: var(--ink);
  background: #0a1016;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}
.login-btn,
.btn.primary {
  display: block;
  width: 100%;
  margin-top: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #062b27;
}
.login-footnote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}
body.login-locked .workspace,
body.login-locked .minutes-banner,
body.login-locked .foot,
body.login-locked .panel {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}
.nav-btn {
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}
.nav-btn:hover {
  color: var(--ink);
  border-color: var(--muted);
}
.nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.nav-btn.meeting-btn {
  border-color: rgba(61, 214, 198, 0.45);
  color: var(--accent);
}
.nav-btn.meeting-btn.danger {
  border-color: rgba(255, 122, 144, 0.45);
  color: var(--spk3);
}
.meeting-hint {
  flex-shrink: 0;
  margin: 0.5rem 2rem 0;
  padding: 0.55rem 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.meeting-hint[hidden] {
  display: none;
}
body.login-locked .meeting-hint {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 720px) {
  .workspace {
    flex-direction: column;
  }
  .insights {
    flex: 0 0 auto;
    max-height: 38%;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .text { font-size: 1.15rem; }
}
