:root {
  /* 固定使用暖色浅色调色板，不跟随系统深色模式——这是产品明确定下来的决定 */
  color-scheme: only light;
  --cream: #F7F1E3; --cream-2: #EFE6D2; --ink: #2A2340; --navy: #332B52;
  --amber: #F2A93B; --amber-deep: #80530F; --lavender: #5D537F; --lavender-2: #5D537F;
  --card-bg: rgba(255,255,255,0.72); --border: rgba(42,35,64,0.12); --shadow: rgba(42,35,64,0.08);
  --wash-1: #FCFAF3; --wash-2: #FBF1E1;
  --glow-a: rgba(242,169,59,0.30); --glow-b: rgba(109,100,148,0.26);
  /* 单层阴影会显得扁平——近处一层清晰的接触阴影 + 远处一层柔和的扩散阴影叠加，
     才会有"悬浮在纸面上"的真实感，而不是 PPT 默认投影那种廉价感 */
  --shadow-sm: 0 1px 2px rgba(42,35,64,0.05), 0 3px 8px rgba(42,35,64,0.06);
  --shadow-md: 0 2px 4px rgba(42,35,64,0.05), 0 10px 24px rgba(42,35,64,0.10);
  --shadow-lg: 0 2px 6px rgba(42,35,64,0.06), 0 20px 44px rgba(42,35,64,0.14);
  /* Fraunces/Nunito Sans 本身不含中文字形，绝大部分文字是中文，
     所以要显式接一段跨平台的中文字体兜底，不然不同系统上显示效果差很多 */
  --font-sans: 'Nunito Sans', -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Heiti SC', sans-serif;
  --font-serif: 'Fraunces', 'Songti SC', 'STSong', serif;

  /* Shared visual tokens (Issue #147). Keep these scoped to the Glowl UI,
     so component rules do not accidentally inherit the browser's defaults. */
  --ui-text: var(--ink);
  --ui-text-muted: var(--lavender);
  --ui-action: var(--navy);
  --ui-accent: var(--amber);
  --ui-accent-strong: var(--amber-deep);
  --ui-surface: var(--card-bg);
  --ui-outline: var(--border);
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 24px;
  --ui-space-6: 32px;
  --ui-radius-control: 12px;
  --ui-radius-card: 18px;
  --ui-radius-feature: 20px;
  --ui-radius-pill: 999px;
  --ui-font-title: 30px;
  --ui-font-section: 22px;
  --ui-font-body: 16px;
  --ui-font-support: 14px;
  --ui-font-caption: 13px;
  --ui-line-body: 1.7;
  --ui-control-height: 48px;
  --ui-control-height-secondary: 44px;
  --ui-border-width: 1px;
  --ui-shadow-card: 0 8px 24px rgba(42,35,64,0.08);
  --ui-shadow-control: 0 2px 8px rgba(42,35,64,0.08);
  --ui-motion-fast: 150ms;
  --ui-motion-normal: 200ms;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  color: var(--ui-text); font-family: var(--font-sans); font-size: var(--ui-font-body); line-height: var(--ui-line-body); min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  background:
    radial-gradient(circle at 100% 0%, var(--glow-a), transparent 45%),
    radial-gradient(circle at 0% 100%, var(--glow-b), transparent 45%),
    linear-gradient(150deg, var(--wash-1) 0%, var(--wash-2) 100%);
  background-attachment: fixed;
}
button, input, textarea, select { font-family: var(--font-sans); }
button { line-height: 1.35; }
select { min-height: var(--ui-control-height-secondary); }
.wrap { width: 100%; max-width: 460px; padding: 76px 20px 60px; display: flex; flex-direction: column; align-items: center; transition: padding-top 160ms ease; }
/* 非首页不用再给一整块通栏大 logo 留位置——品牌标识缩到顶部角标里去了 */
.wrap.compact { padding-top: 68px; }
header { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 30px; }
header svg { width: 60px; height: 60px; }
header.hidden { display: none; }
.brand { font-family: var(--font-serif); font-size: 21px; font-weight: 600; letter-spacing: 0.3px; }
.brand-en { font-size: 11px; color: var(--lavender); letter-spacing: 1.5px; }

.screen { width: 100%; display: none; flex-direction: column; align-items: center; gap: var(--ui-space-4); }
.screen.active { display: flex; animation: screen-in 240ms ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .screen.active { animation: none; } }

.home-kicker { color: var(--amber-deep); font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; margin: 0; }
.home-title { font-family: var(--font-serif); font-size: var(--ui-font-title); font-weight: 600; text-align: center; line-height: 1.35; margin: -5px 0 0; }
.home-title:focus { outline: 2px solid var(--amber-deep); outline-offset: 6px; border-radius: 4px; }
.home-note { color: var(--lavender); font-size: 13px; line-height: 1.6; text-align: center; margin: -7px 0 2px; }
.home-disclaimer { color: var(--ui-text-muted); font-size: 12px; line-height: 1.6; text-align: center; margin: 4px 0 0; }
.default-perspective-card {
  width: 100%; border: var(--ui-border-width) solid var(--ui-outline); border-radius: var(--ui-radius-feature); padding: var(--ui-space-4) var(--ui-space-5);
  background: linear-gradient(155deg, rgba(255,255,255,0.82), rgba(253,241,218,0.76));
  box-shadow: var(--ui-shadow-card); text-align: center;
}
.perspective-glyph { display: block; width: 38px; height: 38px; margin: 0 auto 9px; color: var(--lavender); }
.perspective-eyebrow { color: var(--amber-deep); font-size: 11px; font-weight: 800; letter-spacing: .7px; margin: 0 0 6px; }
.default-perspective-card h2 { font-family: var(--font-serif); font-size: var(--ui-font-section); margin: 0 0 6px; }
.perspective-style {
  font-size: 14px; line-height: 1.55; margin: 0 auto; max-width: 34em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.perspective-topics {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  list-style: none; padding: 0; margin: 10px 0 0;
}
.perspective-topics li {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid rgba(109,100,148,0.2); border-radius: 999px; padding: 3px 9px;
  color: var(--lavender); background: rgba(255,255,255,0.5); font-size: 11px; line-height: 1.4;
}
.perspective-ai, .philosopher-picker-ai {
  display: inline-block; align-self: center; border-radius: 999px; padding: 3px 9px;
  color: var(--amber-deep); background: rgba(242,169,59,0.14); font-size: 10px; font-weight: 800;
  line-height: 1.4; margin: 10px 0 12px;
}
.default-perspective-card > .btn-primary { width: 100%; }
.perspective-details { width: 100%; color: var(--lavender); font-size: 12px; text-align: left; }
.perspective-details summary { display: flex; width: fit-content; min-height: var(--ui-control-height-secondary); align-items: center; margin: 0 auto; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.perspective-details summary::before { content: '▸'; flex: 0 0 auto; margin-right: 6px; text-decoration: none; }
.perspective-details[open] summary::before { content: '▾'; }
.perspective-details summary:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 4px; border-radius: 3px; }
.perspective-details-body { padding-top: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.perspective-details-body p { margin: 0 0 8px; }
.perspective-details-body ul { margin: 0 0 8px; padding-left: 18px; }
.perspective-details-ai { font-size: 11px; }
.catalog-status { color: var(--lavender); font-size: 12px; line-height: 1.5; text-align: center; margin: -5px 0; }
.perspective-composer { width: 100%; display: flex; flex-direction: column; gap: var(--ui-space-4); align-items: center; padding-top: var(--ui-space-2); scroll-margin-top: 76px; }
.session-heading { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--lavender); }
.session-heading strong { color: var(--ink); }
.prompt-line { font-family: var(--font-serif); font-size: 16px; text-align: center; line-height: 1.6; margin: 0; max-width: 320px; }
.input-label { align-self: flex-start; font-size: 12px; color: var(--lavender); margin: 1px 2px -9px; }
.input-meta { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: -10px; color: var(--lavender-2); font-size: 11px; }
.draft-note { display: flex; align-items: center; gap: 6px; }
.draft-clear-btn { background: none; border: none; min-width: 44px; min-height: var(--ui-control-height-secondary); padding: 0 8px; color: var(--lavender); font-size: 11px; text-decoration: underline; cursor: pointer; }
.draft-clear-btn:hover { color: var(--ink); }

textarea#worry-input {
  width: 100%; min-height: 84px; border-radius: var(--ui-radius-card); border: var(--ui-border-width) solid var(--ui-outline);
  background: var(--card-bg); color: var(--ink); font-family: var(--font-sans);
  font-size: var(--ui-font-body); line-height: 1.6; padding: 16px 18px; resize: none; outline: none; box-shadow: var(--ui-shadow-control); scroll-margin-top: 76px;
}
textarea#worry-input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 1px solid var(--border); background: transparent; color: var(--lavender);
  border-radius: 999px; min-height: var(--ui-control-height-secondary); padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.chip:hover, .chip:focus-visible { background: var(--cream-2); color: var(--ui-text); }
.chip:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

.btn-primary {
  background: var(--ui-action); color: var(--cream); border: 0; border-radius: var(--ui-radius-pill);
  width: min(100%, 300px); min-height: var(--ui-control-height); padding: var(--ui-space-3) var(--ui-space-5);
  font: 700 var(--ui-font-body)/1.3 var(--font-sans); cursor: pointer; box-shadow: var(--ui-shadow-control);
  transition: background-color var(--ui-motion-fast) ease, color var(--ui-motion-fast) ease, box-shadow var(--ui-motion-fast) ease, transform var(--ui-motion-fast) ease, opacity var(--ui-motion-fast) ease;
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: 0.6; }
.btn-primary:focus-visible { outline: 2px solid var(--ui-accent-strong); outline-offset: 3px; }

.btn-secondary {
  background: transparent; border: var(--ui-border-width) solid var(--ui-accent-strong); color: var(--ui-accent-strong);
  border-radius: var(--ui-radius-pill); min-height: var(--ui-control-height-secondary);
  padding: var(--ui-space-2) var(--ui-space-4); font: 700 var(--ui-font-support)/1.35 var(--font-sans); cursor: pointer; width: 100%;
  transition: background-color var(--ui-motion-fast) ease, color var(--ui-motion-fast) ease, border-color var(--ui-motion-fast) ease;
}
.btn-secondary:hover { background: var(--cream-2); color: var(--ui-action); border-color: var(--ui-action); }
.btn-secondary:focus-visible { outline: 2px solid var(--ui-accent-strong); outline-offset: 3px; }
.home-money-split-link { display: inline-flex; width: auto; margin: 0 0 18px; text-decoration: none; }

.btn-ghost { display: inline-flex; min-width: 44px; min-height: var(--ui-control-height-secondary); align-items: center; justify-content: center; background: none; border: none; color: var(--ui-text-muted); font: 600 var(--ui-font-caption)/1.35 var(--font-sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 8px 10px; border-radius: var(--ui-radius-control); transition: color var(--ui-motion-fast) ease, background-color var(--ui-motion-fast) ease; }
.btn-ghost#change-perspective-btn { min-width: 0; min-height: 0; padding: 4px; }
.btn-ghost:focus-visible { outline: 2px solid var(--ui-accent-strong); outline-offset: 2px; }
/* 比纯文字链接更有"实体感"，但比 btn-secondary 更低调——给次要邀请类入口用 */
.btn-pill-ghost { background: rgba(255,255,255,0.5); border: 0; color: var(--ui-text-muted); font: 600 var(--ui-font-caption)/1.35 var(--font-sans); cursor: pointer; border-radius: var(--ui-radius-pill); min-height: var(--ui-control-height-secondary); padding: 8px 16px; transition: background-color var(--ui-motion-fast) ease, color var(--ui-motion-fast) ease; }
.btn-pill-ghost:hover { background: rgba(255,255,255,0.75); color: var(--ui-text); }
.btn-pill-ghost:focus-visible { outline: 2px solid var(--ui-accent-strong); outline-offset: 2px; }

.loading-owl { width: 52px; height: 52px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .loading-owl { animation: none; } }
.loading-text { color: var(--lavender); font-size: 14px; }
.waiting-cancel { width: min(100%, 280px); margin-top: 12px; }
#neutral-golden:focus, #phil-golden:focus { outline: 2px solid var(--amber-deep); outline-offset: 5px; border-radius: 4px; }

.play-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: radial-gradient(circle at 32% 28%, #FFC670, var(--amber) 60%, #E0922A 100%);
  box-shadow: 0 1px 1px rgba(255,255,255,0.6) inset, 0 6px 16px rgba(242,169,59,0.45);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.play-btn svg { width: 16px; height: 16px; fill: var(--navy); }
.play-btn.playing { animation: pulse 1s ease-in-out infinite; }
.play-btn.audio-loading { animation: pulse 0.6s ease-in-out infinite; opacity: 0.75; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--shadow); } 50% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .play-btn.playing, .play-btn.audio-loading { animation: none; } }
.play-btn-sm { width: 44px; height: 44px; }
.play-btn-sm svg { width: 13px; height: 13px; }
.audio-control { display: flex; align-items: center; gap: 10px; color: var(--lavender); font-size: 12px; }
.audio-label { min-width: 48px; }

.golden-hero { font-family: var(--font-serif); font-weight: 500; font-size: 22px; text-align: center; line-height: 1.5; margin: 6px 0; letter-spacing: 0.1px; }
/* 一个纯几何色块，不是引号符号——之前用的弯引号形状容易让人以为"这是原文引用"，
   尤其是哲学家角色扮演页面，跟 prompt 里"绝不编造具体引用"的红线是矛盾的。
   换成一个抽象标记，保留"这里是视觉焦点"的效果，不带"这是谁说的话"的联想。 */
.quote-mark { position: absolute; top: 24px; left: 24px; width: 5px; height: 22px; border-radius: 3px; background: var(--amber-deep); opacity: 0.55; }
.golden-card { font-family: var(--font-serif); font-weight: 500; font-size: 17px; text-align: center; line-height: 1.5; margin: 0; }

.transcript-toggle { min-height: var(--ui-control-height-secondary); font: 600 var(--ui-font-caption)/1.35 var(--font-sans); color: var(--ui-text-muted); background: none; border: none; cursor: pointer; padding: 8px 10px; margin: -6px -4px; border-radius: var(--ui-radius-control); }
.transcript-full {
  display: none; font-size: 14px; line-height: 1.7; color: var(--ink); text-align: left;
  border-top: 1px solid var(--border); padding-top: 14px; width: 100%; max-width: 340px;
}
.transcript-full.open { display: block; }

.action-row { display: flex; gap: var(--ui-space-2); align-items: center; justify-content: center; flex-wrap: wrap; }
.icon-btn {
  display: flex; align-items: center; gap: 6px; background: var(--cream-2); border: none;
  border-radius: var(--ui-radius-pill); min-height: var(--ui-control-height-secondary); padding: 8px 16px;
  font: 600 var(--ui-font-caption)/1.35 var(--font-sans); color: var(--ui-text); cursor: pointer;
  transition: background-color var(--ui-motion-fast) ease, color var(--ui-motion-fast) ease;
}
.icon-btn.liked { background: var(--amber); color: var(--navy); font-weight: 700; }
.icon-btn:focus-visible { outline: 2px solid var(--ui-accent-strong); outline-offset: 2px; }

.draw-badge { font-size: 13px; color: var(--amber-deep); font-weight: 700; }
.phil-badge {
  width: 132px; height: 132px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: #fff; text-align: center; padding: 10px;
  /* 内圈一点高光 + 外层多层阴影，纯色徽章才会有"球体"的立体感，不是个色块贴纸 */
  box-shadow: 0 2px 3px rgba(255,255,255,0.3) inset, 0 -6px 14px rgba(0,0,0,0.12) inset, var(--shadow-md);
}
.phil-badge .name { font-family: var(--font-serif); font-weight: 600; font-size: 19px; }
.phil-badge .tag { font-size: 11px; opacity: 0.88; }

.response-card {
  width: 100%; border-radius: var(--ui-radius-feature); padding: var(--ui-space-5);
  display: flex; flex-direction: column; align-items: center; gap: var(--ui-space-4);
  background: linear-gradient(165deg, rgba(255,253,248,0.9) 0%, rgba(253,246,232,0.78) 100%);
  background-image: radial-gradient(circle at 1px 1px, rgba(42,35,64,0.035) 1px, transparent 0),
    linear-gradient(165deg, rgba(255,253,248,0.9) 0%, rgba(253,246,232,0.78) 100%);
  background-size: 14px 14px, auto;
  box-shadow: var(--ui-shadow-card);
}

/* 不打断整体"语音陪伴"的视觉基调（不用刺眼的红色/警告色），但要明显跟普通内容
   区分开——用琥珀色描边+浅底色，跟品牌色呼应而不是突兀地报警。 */
.crisis-resources {
  width: 100%; border-radius: 16px; padding: 14px 16px;
  background: rgba(242,169,59,0.12); border: 1px solid var(--amber);
  text-align: left; font-size: 13px; line-height: 1.7; color: var(--ink);
}
.crisis-resources .crisis-resources-title { font-weight: 700; color: var(--amber-deep); margin: 0 0 4px; }
.crisis-resources .crisis-resources-item { margin: 2px 0; }
.crisis-resources a { color: var(--amber-deep); font-weight: 700; text-decoration: none; }
.crisis-resources a:hover { text-decoration: underline; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; align-items: flex-end; justify-content: center; z-index: 10;
}
.modal-backdrop.open { display: flex; }
.modal-sheet {
  background: var(--cream); width: 100%; max-width: 460px; border-radius: var(--ui-radius-feature) var(--ui-radius-feature) 0 0;
  padding: 24px 22px 32px; max-height: 78vh; display: flex; flex-direction: column;
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-sheet h3 { font-family: var(--font-serif); font-weight: 600; margin: 0 0 4px; }
.modal-sub { font-size: 13px; color: var(--lavender); margin: 0; }
.modal-x {
  background: var(--cream-2); border: none; width: var(--ui-control-height-secondary); height: var(--ui-control-height-secondary); border-radius: 50%;
  font-size: 18px; line-height: 1; color: var(--ink); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: var(--border); }
.modal-x:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 2px; }
.modal-scroll { min-height: 0; flex: 1 1 auto; overflow-y: auto; margin-top: 16px; overscroll-behavior: contain; }
.philosopher-picker-backdrop { align-items: flex-end; }
.philosopher-picker-backdrop .modal-sheet {
  height: min(100vh, 900px); height: min(100dvh, 900px); max-height: 100vh; max-height: 100dvh;
  padding-bottom: max(18px, env(safe-area-inset-bottom)); border-radius: var(--ui-radius-feature) var(--ui-radius-feature) 0 0;
}
.philosopher-picker-list { display: flex; flex-direction: column; gap: var(--ui-space-2); scroll-padding-block: 10px; }
.philosopher-picker-card {
  background: var(--ui-surface); border: var(--ui-border-width) solid var(--ui-outline); border-radius: var(--ui-radius-card);
  min-width: 0; padding: 5px 12px; display: flex; flex-direction: column; gap: 2px; text-align: left;
}
.philosopher-picker-heading { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.philosopher-picker-heading .perspective-glyph { width: 34px; height: 34px; margin: 0; flex: 0 0 34px; }
.philosopher-picker-heading > div { min-width: 0; }
.philosopher-picker-name { font-family: var(--font-serif); font-size: var(--ui-font-section); font-weight: 600; margin: 0 0 3px; }
.philosopher-picker-stance { font-size: 12px; line-height: 1.4; color: var(--lavender); margin: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.philosopher-picker-ai { margin: 2px 0 0; font-size: 12px; line-height: 1.3; }
.philosopher-picker-details { font-size: 11px; }
.philosopher-picker-details summary { margin: 0; min-height: 44px; display: flex; align-items: center; width: fit-content; }
.philosopher-picker-state-note { font-size: 11px; color: var(--lavender); }
.philosopher-picker-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.philosopher-picker-actions button { flex: 1; }
.philosopher-picker-chat { width: 100%; min-height: var(--ui-control-height-secondary); }
.philosopher-picker-list:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 2px; }
@media (min-width: 700px) {
  .philosopher-picker-backdrop { align-items: center; padding: 24px; }
  .philosopher-picker-backdrop .modal-sheet {
    width: min(100%, 620px); max-width: min(100%, 620px); max-height: min(86vh, 900px); height: min(86vh, 900px);
    padding: 26px; border-radius: var(--ui-radius-feature);
  }
  .philosopher-picker-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(116px, auto); align-items: start; column-gap: 16px; }
  .philosopher-picker-heading, .philosopher-picker-details { grid-column: 1; }
  .philosopher-picker-chat { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: auto; min-width: 110px; }
}
.ai-identity-note { font-size: 11px; line-height: 1.55; color: var(--lavender); text-align: center; margin: 12px 0 0; }
.my-tabs { display: flex; flex: 0 0 auto; gap: 6px; margin-top: 14px; flex-wrap: wrap; }

.thought-note-editor { display: grid; gap: 9px; }
.thought-note-editor input, .thought-note-editor textarea {
  box-sizing: border-box; width: 100%; border: 1px solid rgba(92, 75, 110, .22);
  border-radius: 12px; padding: 10px 12px; font: inherit; background: rgba(255,255,255,.72);
}
.thought-note-editor textarea { min-height: 180px; resize: vertical; }
.thought-note-editor input:focus-visible, .thought-note-editor textarea:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}
.thought-note-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.thought-note-count { margin: 0; color: var(--lavender); font-size: 12px; text-align: right; }
.thought-note-list { display: grid; gap: 10px; margin-top: 14px; }
.thought-note-card { text-align: left; width: 100%; }
.cardbook-list, .reflection-exercise-list { display: grid; gap: var(--ui-space-3); }
.cardbook-card, .reflection-exercise-card {
  background: var(--ui-surface); border: var(--ui-border-width) solid var(--ui-outline); border-radius: var(--ui-radius-card); padding: var(--ui-space-3);
}
.cardbook-card h4, .reflection-exercise-card h4 { margin: 0 0 5px; font-family: var(--font-serif); }
.cardbook-card p, .reflection-exercise-card p { margin: 5px 0 10px; color: var(--lavender); font-size: 13px; line-height: 1.55; }
.cardbook-card-actions, .reflection-exercise-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cardbook-unavailable-badge { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #f5e8e1; color: #8a4d3b; font-size: 11px; font-weight: 700; }
.reflection-completion-note { color: var(--lavender); font-size: 12px; }
.my-tab { min-height: var(--ui-control-height-secondary); font: 600 var(--ui-font-caption)/1.35 var(--font-sans); color: var(--ui-text-muted); background: none; border: 1px solid var(--border); border-radius: var(--ui-radius-pill); cursor: pointer; padding: 8px 12px; }
.my-tab:hover { background: var(--cream-2); color: var(--ink); }
.my-tab.active { background: var(--amber); color: var(--navy); font-weight: 700; border-color: var(--amber); }
.my-modal-footer { flex: 0 0 auto; border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; text-align: center; }
.my-modal-footer .btn-ghost { font-size: 12px; opacity: 1; }
/* At browser zoom / short viewports keep the tab strip compact and leave a
   usable scrolling region for the selected panel. */
@media (max-height: 500px) {
  .modal-sheet { max-height: 100vh; padding: 12px 18px; }
  .philosopher-picker-backdrop .modal-sheet { height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .modal-scroll { margin-top: 8px; }
  .my-tabs { flex-wrap: nowrap; gap: 4px; margin-top: 6px; overflow-x: auto; }
  .my-tab { flex: 0 0 auto; }
  .my-modal-footer { margin-top: 6px; padding-top: 6px; }
}
.collection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.collection-item {
  aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; font-size: 12px;
  background: var(--card-bg); border: 1px solid var(--border);
}
.collection-item .dot { width: 20px; height: 20px; border-radius: 50%; }
.collection-item.locked { opacity: 0.35; }

.share-preview { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.share-preview-label { font-size: 11px; color: var(--amber-deep); font-weight: 700; letter-spacing: 0.5px; margin: 0; }
.share-preview-full {
  font-family: var(--font-serif); font-weight: 500; font-size: 13px; color: var(--lavender); line-height: 1.5;
  max-height: 180px; overflow-y: auto; white-space: pre-wrap;
}
.share-options { display: flex; flex-direction: column; gap: 10px; }
.share-option-btn {
  width: 100%; text-align: left; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px; cursor: pointer;
}
.share-option-btn strong { display: block; font-size: 14px; margin-bottom: 2px; }
.share-option-btn span { font-size: 12px; color: var(--lavender); }

.top-links { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 420px); display: flex; align-items: center; justify-content: space-between; z-index: 5; }
/* The private roundtable already has its own back/end controls; keep the fixed site
   navigation from covering the transcript or sticky composer while scrolling/zooming. */
body:has(#screen-roundtable.active) .top-links { display: none; }
/* 非首页的品牌角标：跟"广场/我的"同一行，替代原本占一整屏顶部的大 header */
.top-links-brand {
  display: none; min-height: var(--ui-control-height-secondary); min-width: 44px; align-items: center; gap: 7px;
  background: none; border: none; padding: 8px; cursor: pointer; border-radius: 10px;
}
.top-links-brand.show { display: flex; }
.top-links-brand:hover { background: rgba(255,255,255,0.4); }
.top-links-brand:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.top-links-brand svg { width: 26px; height: 26px; }
.top-links-brand span { font-family: var(--font-serif); font-size: 14px; font-weight: 600; color: var(--ink); }
.top-links-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; row-gap: 8px; margin-left: auto; }
.top-link { min-height: var(--ui-control-height-secondary); font: 600 var(--ui-font-caption)/1.35 var(--font-sans); color: var(--ui-text-muted); background: color-mix(in srgb, var(--cream) 72%, transparent); border: 1px solid var(--border); border-radius: var(--ui-radius-pill); cursor: pointer; padding: 8px 12px; }
.top-link:hover { background: var(--cream-2); color: var(--ink); }

.plaza-back { align-self: flex-start; }
.plaza-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ui-space-3); width: 100%; }
.plaza-card {
  background: var(--card-bg); border-radius: var(--ui-radius-card); padding: var(--ui-space-3); display: flex; flex-direction: column; gap: var(--ui-space-2);
}
.plaza-card:focus-visible { outline: 2px solid var(--ui-accent-strong); outline-offset: 2px; }
.plaza-q {
  font-size: 13px; font-weight: 700; line-height: 1.45; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.plaza-a {
  font-family: var(--font-serif); font-weight: 500; font-size: 13px; color: var(--lavender); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.plaza-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.plaza-plays { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--lavender); }
.plaza-card { cursor: pointer; }
.answer-text { font-size: var(--ui-font-body); line-height: 1.7; text-align: center; max-width: 340px; margin: 0; color: var(--ink); }

.ask-human-box {
  width: 100%; min-height: 90px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--ink); font-family: var(--font-sans);
  font-size: 14px; padding: 14px 16px; resize: none; outline: none;
}
.ask-human-box:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.ask-human-note { font-size: 12px; color: var(--lavender); text-align: center; line-height: 1.6; max-width: 320px; margin: 0; }
.ask-human-consent { font-size: 12px; color: var(--ink); line-height: 1.55; text-align: left; cursor: pointer; }
.ask-human-consent input { accent-color: var(--amber-deep); }
.ask-human-thread { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.ask-human-thread-item { background: var(--card-bg); border-radius: 16px; padding: 14px 16px; text-align: left; }
.ask-human-thread-q { font-size: 13px; color: var(--ink); line-height: 1.6; white-space: pre-wrap; }
.ask-human-thread-meta { font-size: 11px; color: var(--lavender); margin-top: 4px; }
.ask-human-thread-reply {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--ink); line-height: 1.6; white-space: pre-wrap;
}
.ask-human-thread-reply-label { font-size: 11px; color: var(--amber-deep); font-weight: 700; margin-bottom: 4px; }
.ask-human-thread-boundary { font-size: 11px; color: var(--lavender); margin-top: 8px; line-height: 1.5; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 20; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 999px; background: var(--navy); color: var(--cream); font-size: 13px; text-align: center; opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; box-shadow: var(--shadow-md); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer; }
.toast.persist { pointer-events: auto; cursor: pointer; border-radius: 16px; white-space: normal; word-break: break-all; user-select: text; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ui-accent-strong);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 380px) {
  .wrap { padding: 72px 16px 48px; }
  .plaza-grid { grid-template-columns: 1fr; }
  .philosopher-picker-actions { flex-direction: column; }
  .philosopher-picker-actions button { width: 100%; }
  .session-heading { align-items: flex-start; }
}

/* 我的哲学家（领养 + 角色卡） */
.companion-wrap { display: flex; flex-direction: column; gap: 14px; }
.companion-card { background: color-mix(in srgb, var(--cream) 70%, white); border: var(--ui-border-width) solid var(--ui-outline); border-radius: var(--ui-radius-card); padding: 22px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.companion-card > label, .agent-pk-optin { min-height: var(--ui-control-height-secondary); }
.companion-avatar { width: 64px; height: 64px; border-radius: 50%; box-shadow: var(--shadow-md); }
.companion-name { font-family: var(--font-serif); font-weight: 600; font-size: 22px; color: var(--ink); }
.companion-tag { font-size: 12px; color: var(--lavender); }
.companion-level { font-weight: 800; font-size: 13px; color: var(--navy); margin-top: 4px; }
.companion-exp { width: 100%; max-width: 260px; height: 8px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.companion-exp-fill { height: 100%; background: var(--navy); border-radius: 999px; }
.companion-exp-text, .companion-hint { font-size: 12px; color: var(--lavender); margin: 2px 0 6px; line-height: 1.6; }
.companion-attrs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.companion-attr { background: var(--cream-2); border-radius: 16px; padding: 12px; text-align: center; }
.companion-attr .num { font-family: var(--font-serif); font-weight: 600; font-size: 22px; color: var(--ink); }
.companion-attr .label { font-size: 13px; font-weight: 700; color: var(--navy); }
.companion-attr .hint { font-size: 11px; color: var(--lavender); margin-top: 2px; }

/* ---------- 单人私密圆桌（issue #94）----------
   规范：docs/design/issue-131-roundtable-ui-spec.md 第 6 节。复用既有 token 与 .screen
   切换机制，不新造布局系统；色板按产品决定固定为浅色（app.css 顶部 color-scheme: only light），
   所以 composer 的奶油色渐变与页面一致是有意为之，不是漏了深色适配。 */
.roundtable-screen {
  width: 100%; max-width: 460px; display: flex; flex-direction: column;
  align-items: stretch; gap: 14px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
/* app.css 顶部有一条全局 `header { flex-direction: column; align-items: center }`，
   圆桌里这两个都是 <header> 元素，必须显式写回 row + margin，否则会被那条规则带成
   竖排、还多出 30px 下边距（线上截图实测）。 */
.roundtable-topbar {
  width: 100%; display: flex; flex-direction: row; align-items: center;
  justify-content: space-between; gap: 8px; margin: 0;
}
.roundtable-topbar button { min-height: 44px; min-width: 44px; padding: 0 12px; }
.roundtable-privacy, .roundtable-progress { color: var(--lavender); font-size: 12px; text-align: center; margin: 0; }
.roundtable-topic {
  width: 100%; padding: 18px; border: var(--ui-border-width) solid var(--ui-outline); border-radius: var(--ui-radius-feature);
  background: linear-gradient(155deg, rgba(255,255,255,.82), rgba(253,241,218,.76));
  box-shadow: var(--ui-shadow-card);
}
.roundtable-topic-eyebrow { color: var(--amber-deep); font-size: 11px; font-weight: 800; letter-spacing: .7px; margin: 0 0 6px; }
.roundtable-topic h1 { font-family: var(--font-serif); font-size: 21px; line-height: 1.45; margin: 0 0 8px; overflow-wrap: anywhere; }
.roundtable-privacy-note { color: var(--lavender); font-size: 11px; line-height: 1.5; margin: 6px 0 0; }
.roundtable-note { color: var(--lavender); font-size: 12px; line-height: 1.6; margin: 0; }
.roundtable-field { display: grid; gap: 6px; }
.roundtable-field label { color: var(--lavender); font-size: 12px; }
.roundtable-field textarea, .roundtable-field select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--card-bg); color: var(--ink); font: inherit; line-height: 1.55;
}
.roundtable-field textarea { min-height: 84px; resize: vertical; }
.roundtable-field textarea:focus-visible, .roundtable-field select:focus-visible,
.roundtable-composer textarea:focus-visible, .roundtable-actions button:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}
.roundtable-speakers { display: grid; grid-template-columns: minmax(0,1fr) 18px minmax(0,1fr); gap: 7px; align-items: center; }
.roundtable-speakers-x { color: var(--lavender); text-align: center; font-size: 12px; }
.roundtable-speaker {
  min-width: 0; min-height: 64px; padding: 10px; display: grid; gap: 4px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--card-bg); box-shadow: var(--shadow-sm);
}
.roundtable-speaker--a { border-top: 3px solid var(--amber); }
.roundtable-speaker--b { border-top: 3px solid var(--lavender); }
.roundtable-speaker strong { font-family: var(--font-serif); font-size: 14px; overflow-wrap: anywhere; }
.roundtable-speaker small { color: var(--lavender); font-size: 10px; line-height: 1.4; }
.roundtable-timeline { width: 100%; display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.roundtable-turn {
  width: min(94%, 420px); padding: 14px 15px; border: 1px solid var(--border);
  border-radius: 18px; background: var(--card-bg); box-shadow: var(--shadow-sm);
  animation: roundtable-turn-in var(--ui-motion-normal) ease-out;
}
@keyframes roundtable-turn-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.roundtable-turn--a { align-self: flex-start; border-left: 3px solid var(--amber); }
.roundtable-turn--b { align-self: flex-end; border-left: 3px solid var(--lavender); }
.roundtable-turn--user { align-self: center; border-left: 3px dashed var(--lavender-2); background: rgba(109,100,148,.07); }
.roundtable-turn header { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; margin: 0 0 7px; }
.roundtable-turn header strong { font-family: var(--font-serif); font-size: 14px; }
.roundtable-turn header span { color: var(--lavender); font-size: 10px; }
.roundtable-turn p { color: var(--ink); font-size: 14px; line-height: 1.7; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.roundtable-turn[data-state="generating"] { border-style: dashed; color: var(--lavender); }
.roundtable-status { padding: 10px 12px; border-radius: 14px; background: rgba(242,169,59,.12); color: var(--ink); font-size: 12px; line-height: 1.55; }
.roundtable-status--quiet { background: rgba(109,100,148,.10); }
.roundtable-status--error { background: rgba(217,143,31,.16); }
.roundtable-composer {
  position: sticky; bottom: 0; z-index: 2; width: 100%; display: grid; gap: 9px;
  padding: 13px 0 calc(4px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(247,241,227,0), rgba(247,241,227,.96) 18%);
}
.roundtable-composer label { color: var(--lavender); font-size: 12px; }
.roundtable-composer textarea {
  width: 100%; min-height: 72px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 16px; background: var(--card-bg); color: var(--ink); font: inherit; line-height: 1.55; resize: vertical;
}
.roundtable-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.roundtable-actions button { width: 100%; min-height: var(--ui-control-height-secondary); }
.roundtable-actions button.btn-primary { min-height: var(--ui-control-height); }
.roundtable-actions button[disabled] { opacity: .45; cursor: not-allowed; }
.roundtable-summary { display: grid; gap: 8px; }
.roundtable-summary section { padding: 13px; border: 1px solid var(--border); border-radius: 16px; background: var(--card-bg); }
.roundtable-summary h2 { font-family: var(--font-serif); font-size: 14px; margin: 0 0 5px; }
.roundtable-summary p { font-size: 13px; line-height: 1.65; margin: 0; white-space: pre-wrap; }
.roundtable-summary-note { color: var(--lavender); font-size: 11px; margin: 0; }
@media (max-width: 360px) {
  .roundtable-speakers { grid-template-columns: minmax(0,1fr) 12px minmax(0,1fr); gap: 4px; }
  .roundtable-speaker { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .roundtable-screen, .roundtable-turn { scroll-behavior: auto; animation: none; transition: none; }
}
