/* ═══ V4 设计令牌 · 墨夜书房双温色板（P1 移植）═══
   旧名保留（值换新），V4 新名并存；夜色见 html.night */
:root {
  /* 旧名兼容层 */
  --bg: #f5efe6;                            /* 纸 · paper */
  --mist: #ece2d2;                          /* 深纸 · paper-deep */
  --glass: rgba(253, 250, 244, 0.6);
  --glass-strong: rgba(253, 250, 244, 0.82);
  --ink: #2e2a30;
  --muted: #6f6573;                         /* ink-soft */
  --soft: #a399a4;                          /* ink-faint */
  --sage: #7f8f83;                          /* 鼠尾草降饱和 · 系统色 */
  --sage-deep: #7c4a58;                     /* 激活职责移交 wine */
  --lavender: #e3d8da;
  --mauve: #b08593;                         /* rose */
  --cream: #fdfaf4;                         /* surface */
  --line: rgba(72, 58, 62, 0.16);           /* hairline */
  --shadow: 0 18px 50px rgba(58, 42, 48, 0.14);

  /* V4 新名 */
  --paper: #f5efe6;
  --paper-deep: #ece2d2;
  --surface: #fdfaf4;
  --surface-warm: #faf3e9;
  --ink-soft: #6f6573;
  --ink-faint: #a399a4;
  --rose: #b08593;
  --rose-soft: rgba(176, 133, 147, 0.16);
  --wine: #7c4a58;
  --wine-deep: #5d3642;
  --sage-soft: rgba(127, 143, 131, 0.14);
  --gold: #b5915a;
  --gold-deep: #8a6c3c;
  --gold-faint: rgba(181, 145, 90, 0.35);
  --hairline: rgba(72, 58, 62, 0.16);
  --hairline-strong: rgba(72, 58, 62, 0.28);
  --shadow-lift: 0 18px 50px rgba(58, 42, 48, 0.14);
  --shadow-low: 0 6px 18px rgba(58, 42, 48, 0.08);
  --radius-panel: 24px;
  --radius-card: 28px;
  --radius-control: 999px;
  --radius-inner: 18px;

  /* 玻璃/纱面基色（rgba 三元组，夜色翻转） */
  --veil-rgb: 253, 250, 244;
  --sage-ink: #5f6f64;
  --gold-ink: #675b44;

  /* 字体 */
  --serif: "Songti SC", "Noto Serif SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Menlo", "SFMono-Regular", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.22, 0.8, 0.3, 1);
  --dur: 480ms;
}

/* 夜 · 墨蓝黑 + 烛光 */
html.night {
  --bg: #15131d;
  --mist: #100e16;
  --glass: rgba(32, 29, 43, 0.6);
  --glass-strong: rgba(32, 29, 43, 0.85);
  --ink: #ece4d9;
  --muted: #b5aab7; /* P2：夜间正文/narration 对比度提一档（原 #a89daa） */
  --soft: #6f6578;
  --sage-deep: #a86b7c;
  --lavender: #3a3344;
  --mauve: #c9909f;
  --cream: #201d2b;
  --line: rgba(236, 228, 217, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);

  --paper: #15131d;
  --paper-deep: #100e16;
  --surface: #201d2b;
  --surface-warm: #262232;
  --ink-soft: #b5aab7; /* P2：与 --muted 同步上调 */
  --ink-faint: #6f6578;
  --rose: #c9909f;
  --rose-soft: rgba(201, 144, 159, 0.14);
  --wine: #a86b7c;
  --wine-deep: #c9909f;
  --gold: #d3a868;
  --gold-deep: #e6c187;
  --gold-faint: rgba(211, 168, 104, 0.3);
  --hairline: rgba(236, 228, 217, 0.14);
  --hairline-strong: rgba(236, 228, 217, 0.26);
  --shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-low: 0 6px 18px rgba(0, 0, 0, 0.35);

  --veil-rgb: 38, 34, 50;
  --sage-ink: #9fae9f;
  --gold-ink: #d3a868;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 18% 8%, var(--rose-soft), transparent 55%),
    radial-gradient(110% 80% at 85% 92%, var(--sage-soft), transparent 50%),
    var(--paper-deep);
  font-family: var(--sans);
  font-weight: 400;
  transition: background-color 600ms ease, color 600ms ease;
}

button,
textarea,
select {
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out), background 180ms ease, border-color 180ms ease;
}

button:active {
  transform: scale(0.97);
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 3px;
}

i[data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.phone-shell {
  position: relative;
  width: min(430px, 100vw);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(160deg, var(--glass), transparent 38%),
    var(--mist);
  box-shadow: var(--shadow);
}

.splash-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(90% 70% at 50% 0%, var(--rose-soft), transparent 60%),
    var(--paper);
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease-out), visibility var(--dur) var(--ease-out), background-color 600ms ease;
}

.splash-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  display: grid;
  box-sizing: border-box;
  gap: 18px;
  width: min(100%, 360px);
  padding: 2px;
  max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  text-align: center;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
}

.splash-inner::-webkit-scrollbar {
  display: none;
}

.splash-inner.is-mounted {
  animation: splashContentIn var(--dur) var(--ease-out) forwards;
}

.splash-screen.is-leaving .splash-inner {
  animation: splashContentOut 320ms var(--ease-out) forwards;
}

/* P2：拆开应用幕布时给聊天屏一个 V4 入场 */
body:not(.splash-open) .chat-app.app-behind-splash {
  animation: screenIn var(--dur) var(--ease-out);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.splash-mark {
  margin: 0 auto;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(var(--veil-rgb), 0.62);
  border: 1px solid rgba(var(--veil-rgb), 0.86);
  box-shadow: 0 18px 40px rgba(58, 42, 48, 0.12);
  color: var(--sage-deep);
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.splash-eyebrow {
  margin: 0;
  color: var(--soft);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.splash-title {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: clamp(28px, 7vw, 34px);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.splash-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.splash-quote {
  box-sizing: border-box;
  max-width: 100%;
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(var(--veil-rgb), 0.76);
  background: rgba(var(--veil-rgb), 0.48);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  font-style: italic;
  overflow-wrap: anywhere;
}

.splash-quote span {
  display: block;
  margin-bottom: 4px;
  color: var(--sage-deep);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.splash-privacy {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.splash-privacy li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(var(--veil-rgb), 0.42);
  border: 1px solid rgba(var(--veil-rgb), 0.7);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.splash-privacy i[data-lucide] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
  color: var(--sage-deep);
}

.auth-channel-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.26);
}

.auth-channel-tab {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.auth-channel-tab.is-active {
  background: var(--glass-strong);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(58, 42, 48, 0.08);
}

.auth-channel-tab i[data-lucide] {
  width: 16px;
  height: 16px;
}

.auth-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(var(--veil-rgb), 0.76);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.48);
  box-shadow: 0 12px 26px rgba(58, 42, 48, 0.08);
  text-align: left;
}

.auth-status-card i[data-lucide] {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--sage-deep);
}

.auth-status-card div {
  min-width: 0;
}

.auth-status-card strong,
.auth-status-card span {
  display: block;
}

.auth-status-card strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.auth-status-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.auth-status-card--account {
  background: rgba(var(--veil-rgb), 0.54);
}

.auth-helper,
.auth-countdown,
.auth-dev-hint {
  margin: -2px 2px 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}

.login-consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(var(--veil-rgb), 0.66);
  border-radius: 16px;
  background: rgba(var(--veil-rgb), 0.34);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}

.login-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--sage-deep);
}

.login-consent a {
  color: var(--sage-deep);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-code-input {
  min-height: 58px;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}

.auth-code-row .auth-countdown {
  margin: 0;
}

.auth-resend-btn {
  min-height: 34px;
  margin-top: 0;
  padding: 0 4px;
  flex: 0 0 auto;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.auth-resend-btn:disabled {
  opacity: 0.48;
}

.auth-dev-hint {
  padding: 8px 10px;
  border: 1px dashed rgba(124, 74, 88, 0.3);
  border-radius: 12px;
  background: rgba(var(--veil-rgb), 0.38);
  color: var(--sage-deep);
}

.auth-dev-hint strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.auth-flow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-flow-steps li {
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid rgba(var(--veil-rgb), 0.62);
  border-radius: 12px;
  background: rgba(var(--veil-rgb), 0.28);
  color: var(--soft);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
}

.auth-flow-steps li.is-current {
  color: var(--sage-deep);
  background: rgba(var(--veil-rgb), 0.58);
}

.auth-flow-steps li.is-done {
  color: var(--ink);
  background: rgba(176, 133, 147, 0.22);
}

.auth-invite-input {
  text-transform: uppercase;
  font-family: var(--mono);
  letter-spacing: 0.05em;
}

.splash-link-btn {
  margin-top: 10px;
  background: transparent;
  color: var(--sage-deep);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.splash-form--nested {
  margin-top: 10px;
}

.splash-enter--secondary {
  background: rgba(var(--veil-rgb), 0.55);
  color: var(--ink);
}

.splash-disclosure--compact {
  margin-top: 16px;
}

.splash-form {
  display: grid;
  gap: 10px;
  text-align: left;
}

.splash-error {
  min-height: 18px;
  margin: -3px 2px 0;
  color: var(--wine);
  font-size: 12px;
  line-height: 1.5;
}

.splash-error[hidden] {
  display: none;
}

.glass-input.has-error {
  border-color: rgba(124, 74, 88, 0.72);
  background: rgba(var(--veil-rgb), 0.85);
  box-shadow: 0 0 0 3px rgba(124, 74, 88, 0.1);
}

.splash-disclosure {
  text-align: left;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 16px;
  background: rgba(var(--veil-rgb), 0.38);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.splash-disclosure summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 11px 13px;
  color: var(--sage-deep);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

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

.splash-disclosure p {
  margin: 0 13px 12px;
  padding-top: 2px;
  text-align: left;
  line-height: 1.6;
}

.splash-hint {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.splash-enter {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  background: linear-gradient(135deg, #9c6e7c, var(--wine));
  color: #fdfaf4;
  font-weight: 500;
  box-shadow: 0 16px 32px rgba(124, 74, 88, 0.28);
}

.splash-enter.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}

.splash-enter:disabled {
  opacity: 0.65;
  box-shadow: none;
}

.splash-inner.splash-inner--consent {
  width: min(100%, 390px);
  max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
}

.beta-consent-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.beta-consent-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 16px;
  background: rgba(var(--veil-rgb), 0.45);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.beta-consent-list i[data-lucide] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: var(--sage-deep);
}

.consent-check {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(124, 74, 88, 0.22);
  border-radius: 16px;
  background: rgba(var(--veil-rgb), 0.62);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}

.consent-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--sage-deep);
}

.consent-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  font-size: 12px;
}

.consent-links a,
.splash-disclosure a {
  color: var(--sage-deep);
  font-weight: 500;
}

.splash-inner.splash-inner--relationship {
  width: min(100%, 380px);
  max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  text-align: center;
}

.relationship-setup-grid {
  display: grid;
  gap: 9px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.relationship-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  min-height: 94px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.46);
  color: var(--ink);
  text-align: left;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.08);
}

.relationship-card-tag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 22px;
  margin: 0;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(176, 133, 147, 0.2);
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.relationship-card-title {
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.35;
}

.relationship-card-desc {
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.relationship-card.is-selected {
  border-color: rgba(124, 74, 88, 0.44);
  background: rgba(176, 133, 147, 0.24);
  box-shadow: 0 14px 30px rgba(124, 74, 88, 0.15);
}

.relationship-card-headline {
  display: none;
  margin: 2px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(124, 74, 88, 0.16);
  color: var(--sage-deep);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
}

.relationship-card.is-selected .relationship-card-headline {
  display: block;
}

.splash-inner.splash-inner--opening {
  width: min(100%, 420px);
  height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: hidden;
  gap: 0;
  padding: 0;
  text-align: left;
  border-radius: 22px;
  border: 1px solid rgba(var(--veil-rgb), 0.78);
  background: rgba(var(--veil-rgb), 0.42);
  box-shadow: 0 22px 52px rgba(58, 42, 48, 0.14);
}

.opening-preview-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.opening-preview-header {
  flex-shrink: 0;
  padding: 16px 16px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(var(--veil-rgb), 0.62);
}

.opening-preview-title {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.opening-preview-headline {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 500;
}

.opening-preview-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.opening-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.opening-preview-meta span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(176, 133, 147, 0.18);
  color: var(--sage-deep);
  font-size: 11px;
  line-height: 1.3;
}

.opening-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.opening-tag {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  background: rgba(var(--veil-rgb), 0.5);
  color: var(--muted);
  font-size: 11px;
}

.opening-preview-progress {
  flex-shrink: 0;
  height: 3px;
  background: rgba(124, 74, 88, 0.14);
}

.opening-preview-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--rose), var(--wine));
  transition: width 100ms linear;
}

.opening-preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-padding-bottom: 28px;
  padding: 14px 16px 20px;
  touch-action: pan-y;
}

.opening-preview-scroll:focus-visible {
  outline: 2px solid rgba(124, 74, 88, 0.35);
  outline-offset: -2px;
}

.opening-beat--narration {
  margin: 0 0 1em;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.78;
  letter-spacing: 0.02em;
  text-align: justify;
  text-justify: inter-ideograph;
}

.opening-beat--quote {
  margin: 0 0 1em;
  padding: 0;
  border: 0;
  background: transparent;
}

.opening-beat--quote p {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.78;
  letter-spacing: 0.02em;
}

.opening-beat--quote p:last-child {
  margin-bottom: 0;
}

.opening-beat--entry {
  margin: 8px 0 0;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, #3a323e, #2e2a30);
  color: #f5efe6;
  box-shadow: 0 14px 28px rgba(32, 24, 30, 0.22);
}

/* P2：夜色下深卡接 surface-warm 系，避免与暗背景糊成一片 */
html.night .opening-beat--entry {
  border: 1px solid var(--hairline-strong);
  background: linear-gradient(145deg, var(--surface-warm), var(--surface));
  color: var(--ink);
  box-shadow: var(--shadow-low);
}

html.night .opening-entry-label {
  color: var(--rose);
}

.opening-entry-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(245, 239, 230, 0.72);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.opening-beat--entry p {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
}

.opening-preview-hint {
  flex-shrink: 0;
  margin: 0;
  padding: 0 16px 6px;
  text-align: center;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.4;
}

.opening-preview-hint[hidden] {
  display: none;
}

.opening-preview-footer {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(var(--veil-rgb), 0.62);
  background: rgba(var(--veil-rgb), 0.9);
  backdrop-filter: blur(8px);
}

.opening-preview-footer .splash-hint {
  text-align: center;
}

@media (max-width: 420px) {
  .splash-inner.splash-inner--opening {
    width: 100%;
    height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 18px;
  }

  .opening-preview-header {
    padding: 14px 14px 10px;
  }

  .opening-preview-scroll {
    padding: 12px 14px 18px;
  }

  .opening-beat--narration {
    font-size: 15px;
    line-height: 1.76;
  }
}

body.splash-open {
  overflow: hidden;
}

body:not(.splash-open) .splash-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.chat-app.app-behind-splash {
  visibility: hidden;
}

body:not(.splash-open) .chat-app.app-behind-splash {
  visibility: visible;
}

.chat-app {
  position: relative;
  display: grid;
  /* 热修批 L：显式锁列宽=容器宽。隐式列会被子元素 min-content 撑宽（顶栏加第 5 枚图标后
     建议 chips 等行的 min-content 可超窄屏视口，导致整列 416px、右缘全裁）。 */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  height: 100dvh;
  overflow: hidden;
  padding: max(8px, env(safe-area-inset-top)) 0 112px;
  background: var(--paper);
  transition: background-color 600ms ease;
}

/* 陪伴 = 日光从顶部渗入 */
.chat-app.amb-companion {
  background: linear-gradient(180deg, var(--surface-warm), var(--paper) 32%);
}

/* 探索 = 世界色从顶部渗入 */
.chat-app.amb-explore {
  background:
    linear-gradient(180deg, var(--world-tint, var(--sage-soft)), transparent 30%),
    var(--paper);
}

.app-topbar,
.conversation-head,
.drawer-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-topbar {
  margin-bottom: 7px;
}

.app-topbar--compact h1 {
  font-size: 20px;
}

.conversation-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

/* V4：搜索条走实心纸面 */
.search-box {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 13px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper);
  color: var(--soft);
  box-shadow: none;
  transition: border-color 160ms ease, background-color 600ms ease;
}

.search-box:focus-within {
  border-color: var(--rose);
}

.search-box--hidden {
  display: none;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.search-box input::placeholder {
  color: var(--soft);
}

.app-topbar p,
.drawer-panel header p {
  margin: 0 0 3px;
  color: var(--sage-deep);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.05;
  font-weight: 400;
}

h2 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(var(--veil-rgb), 0.74);
  border-radius: 50%;
  background: var(--glass);
  color: var(--sage-deep);
  box-shadow: 0 12px 28px rgba(58, 42, 48, 0.1);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
}

.icon-button.soft {
  background: rgba(var(--veil-rgb), 0.38);
  box-shadow: none;
}

.unread-badge {
  position: absolute;
  top: 5px;
  right: 8px;
  z-index: 3;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border: 2px solid rgba(var(--veil-rgb), 0.9);
  border-radius: 999px;
  background: var(--mauve);
  color: white;
  font-size: 11px;
  font-weight: 500;
}

.unread-dot {
  position: absolute;
  top: 12px;
  right: 13px;
  z-index: 3;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(var(--veil-rgb), 0.9);
  border-radius: 50%;
  background: var(--mauve);
  box-shadow: 0 0 0 4px rgba(176, 133, 147, 0.12);
}

.online-dot.muted {
  background: #c8bfc2;
  box-shadow: none;
}

/* ─── 世界构建向导 ─── */

.wb-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.wb-option-card {
  display: grid;
  gap: 4px;
  padding: 12px 10px;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 16px;
  background: rgba(var(--veil-rgb), 0.48);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.wb-option-card.selected {
  border-color: var(--sage-deep);
  background: rgba(var(--veil-rgb), 0.72);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(58, 42, 48, 0.1);
}

.wb-option-card strong {
  font-size: 14px;
  font-weight: 500;
}

.wb-option-card em {
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
}

.wb-details {
  margin-top: 18px;
  border: 1px solid rgba(var(--veil-rgb), 0.6);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(var(--veil-rgb), 0.32);
}

.wb-details-summary {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  color: var(--sage-deep);
}

.wb-details[open] .wb-details-summary {
  margin-bottom: 12px;
}

.wb-details textarea {
  margin-bottom: 10px;
}

.wb-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.wb-actions .splash-link-btn {
  background: none;
  border: none;
  color: var(--soft);
  cursor: pointer;
  font-size: 13px;
  padding: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── 模板广场 ─── */

.wb-template-grid {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 2px;
}

.wb-template-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 14px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.52);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.wb-template-card:active {
  background: rgba(var(--veil-rgb), 0.7);
  border-color: var(--sage-deep);
  transform: scale(0.98);
}

.wb-template-card strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  grid-column: 1;
}

.wb-template-card .wb-template-meta {
  grid-column: 1;
  font-size: 12px;
  color: var(--muted);
}

.wb-template-card .wb-template-versions {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 11px;
  color: var(--soft);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.5);
}

.wb-template-card em {
  grid-column: 1 / -1;
  font-size: 13px;
  font-style: normal;
  color: var(--sage-deep);
}

/* ─── 聊天内世界设定面板 ─── */

.world-panel {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: var(--radius-panel);
  background: rgba(var(--veil-rgb), 0.5);
}

.world-panel h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.world-panel .world-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.world-panel .world-meta span {
  font-size: 12px;
  color: var(--muted);
}

.world-panel .world-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.world-summary {
  display: grid;
  gap: 8px;
  margin: 2px 0 0;
}

.world-summary div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.world-summary dt,
.world-summary dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.world-summary dt {
  color: var(--sage-deep);
  font-weight: 600;
}

.world-summary dd {
  color: var(--ink);
}

.world-panel .world-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.world-panel .world-actions button {
  flex: 1;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(var(--veil-rgb), 0.7);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.6);
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.world-panel .world-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink);
}

.world-panel .world-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--sage-deep);
}

/* V4：会话区去卡片化，消息流直接落在纸面上 */
.conversation-card {
  position: relative;
  z-index: 1;
  display: grid;
  /* P3：memory-note / mode-return / clueCard / todayCard / messages */
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.identity img {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(var(--veil-rgb), 0.9);
  border-radius: 50%;
  object-fit: cover;
}

.identity p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.memory-note {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  margin: 8px 0;
  padding: 9px;
  border: 1px solid rgba(var(--veil-rgb), 0.62);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.52);
  color: var(--sage-deep);
}

.memory-note[hidden] {
  display: none !important;
}

.memory-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mode-return {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 0;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-inner);
  background: var(--surface);
  color: var(--sage-deep);
  font-size: 12px;
  line-height: 1.35;
}

.mode-return[hidden] {
  display: none !important;
}

.mode-return span {
  /* 2026-06-15：标签撑满，把「自由世界」「模式切换」两钮挤到右侧成组、彼此靠近 */
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}

/* 两个右侧按钮之间更紧凑些（覆盖 .mode-return 的 8px gap） */
.mode-return #worldSwitchBtn {
  margin-right: -2px;
}

.mode-return button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  background: rgba(124, 74, 88, 0.14);
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 500;
}

.mode-return button[hidden] {
  display: none !important;
}

.inline-pill {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(var(--veil-rgb), 0.7);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.42);
  color: var(--sage-deep);
  font-size: 12px;
}

.messages {
  display: grid;
  max-height: none;
  min-height: 0;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 0 1px 8px;
  -webkit-overflow-scrolling: touch;
}

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

/* V4：辅助卡走实心面 + 发丝边；剧情卡接金调（夜色补足边界） */
.mode-assist {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 8px;
  margin: 2px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.mode-assist-companion {
  background: var(--surface-warm);
}

.mode-assist-explore {
  background: var(--surface);
}

.mode-assist-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mode-assist-bar strong,
.mode-assist-bar span,
.mode-assist-kicker {
  display: block;
}

.mode-assist-kicker {
  margin: 0 0 3px;
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.mode-assist-bar strong {
  font-size: 15px;
  line-height: 1.3;
}

.mode-assist-bar span {
  margin-top: 3px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.4;
}

.mode-assist-trigger {
  position: relative;
  z-index: 3;
  min-width: 88px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(var(--veil-rgb), 0.76);
  border-radius: var(--radius-control);
  background: rgba(var(--veil-rgb), 0.76);
  color: var(--sage-deep);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(58, 42, 48, 0.08);
}

.mode-assist-panel {
  display: grid;
  gap: 8px;
}

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

.mode-assist-grid article {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: var(--radius-inner);
  background: rgba(var(--veil-rgb), 0.52);
}

.mode-assist-grid h3 {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--sage-deep);
}

.mode-assist-grid p,
.life-strip {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
}

.life-strip {
  padding: 9px 12px;
  border-radius: 16px;
  background: var(--sage-soft);
  color: var(--sage-ink);
  font-weight: 400;
}

.chat-scroll-jump {
  position: absolute;
  right: 14px;
  bottom: calc(108px + env(safe-area-inset-bottom));
  z-index: 4;
}

.chat-scroll-jump--collapsed .scroll-jump-actions {
  display: none;
}

.chat-scroll-jump:not(.chat-scroll-jump--collapsed) .scroll-jump-toggle {
  display: none;
}

.scroll-jump-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 50%;
  background: rgba(var(--veil-rgb), 0.72);
  color: var(--sage-deep);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.scroll-jump-toggle i[data-lucide] {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.scroll-jump-actions {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.72);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.scroll-jump-actions button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.56);
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.scroll-jump-actions i[data-lucide] {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

/* ───── 批 K · 首测反馈常驻折叠按钮（V4：hairline + 玻璃面，交互语言同滚动跳转钮） ───── */
.chat-feedback {
  /* 批 K 落位改造（用户亲定）：入口在头部图标行。
     热修批 L：absolute 锚在滚动内容上，聊天滚到下方时面板开在屏外（点了"没反应"）——
     改 fixed 贴视口顶栏下方，任何滚动位置都在手边。 */
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  top: calc(max(8px, env(safe-area-inset-top)) + 56px);
  z-index: 30;
  display: flex;
  justify-content: flex-end;
}

.chat-feedback--collapsed .feedback-dock-panel {
  display: none;
}

.chat-feedback:not(.chat-feedback--collapsed) .feedback-dock-toggle {
  display: none;
}

.feedback-dock-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 50%;
  background: rgba(var(--veil-rgb), 0.72);
  color: var(--sage-deep);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.feedback-dock-toggle i[data-lucide] {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.feedback-dock-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(264px, calc(100vw - 56px));
  padding: 12px 13px;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.78);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.feedback-dock-kicker {
  margin: 0;
  color: var(--soft);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.feedback-dock-panel textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 12px;
  background: rgba(var(--veil-rgb), 0.5);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
}

.feedback-dock-panel textarea:focus {
  outline: none;
  border-color: rgba(var(--veil-rgb), 0.92);
}

#feedbackDockSubmit {
  align-self: flex-end;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.56);
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.feedback-dock-hint {
  margin: 0;
  color: var(--soft);
  font-size: 11px;
}

.date-divider {
  justify-self: center;
  margin: 0 0 2px;
  padding: 3px 9px;
  border: 1px solid rgba(var(--veil-rgb), 0.62);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.42);
  color: var(--soft);
  font-size: 11px;
}

.empty-thread {
  align-self: center;
  justify-self: center;
  max-width: 220px;
  margin-top: 38px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--veil-rgb), 0.62);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.38);
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.bubble {
  max-width: 82%;
  padding: 12px 15px;
  line-height: 1.75;
  font-size: 14.5px;
}

/* 仅打字指示新插入时入场（renderMessages 全量重绘，气泡不整体重播动画） */
.typing-bubble {
  animation: msgIn 360ms var(--ease-out);
}

.bubble p {
  margin: 0;
}

/* V4：A 实心暖白锚定面 · 3-16-16-16 */
.bubble.ai {
  border: 1px solid var(--hairline);
  border-radius: 12px 24px 24px 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-low);
}

html.night .bubble.ai {
  box-shadow: 0 0 0 1px rgba(201, 144, 159, 0.1), 0 8px 22px rgba(0, 0, 0, 0.4);
}

/* V4：用户玫瑰气泡 · 16-3-16-16 */
.bubble.user {
  justify-self: end;
  border: 1px solid rgba(176, 133, 147, 0.32);
  border-radius: 24px 12px 24px 24px;
  background: linear-gradient(150deg, var(--rose-soft), rgba(176, 133, 147, 0.08));
  color: var(--ink);
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.message-action {
  display: block;
  margin: 8px 0 -3px auto;
  padding: 4px 8px;
  border: 1px solid rgba(124, 74, 88, 0.18);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.52);
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.message-action.compact {
  display: inline-flex;
  margin: 0;
  padding: 4px 7px;
  font-size: 10.5px;
}

.message-action:active {
  transform: translateY(1px);
}

.reaction-button:active {
  transform: translateY(1px);
}

.ai-message-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.quote-message-action {
  color: var(--sage-ink);
}

.regenerate-message-action {
  color: var(--gold-ink);
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(124, 74, 88, 0.18);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.46);
  color: var(--sage-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.reaction-button.like {
  border-color: rgba(201, 67, 82, 0.22);
  color: #c94352;
}

.reaction-button.dislike {
  border-color: rgba(31, 36, 34, 0.2);
  color: #202423;
}

.reaction-button.like.active {
  border-color: rgba(201, 67, 82, 0.28);
  background: rgba(201, 67, 82, 0.16);
  color: #c94352;
}

.reaction-button.dislike.active {
  border-color: rgba(31, 36, 34, 0.38);
  background: rgba(31, 36, 34, 0.12);
  color: #202423;
}

/* P2：点踩墨色在夜色下走可读的米墨 */
html.night .reaction-button.dislike {
  border-color: var(--hairline-strong);
  color: var(--ink-soft);
}

html.night .reaction-button.dislike.active {
  border-color: var(--hairline-strong);
  background: rgba(236, 228, 217, 0.16);
  color: var(--ink);
}

.ai-thought-details {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px dashed rgba(124, 74, 88, 0.24);
  border-radius: 11px;
  background: rgba(var(--veil-rgb), 0.42);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-thought-details summary {
  cursor: pointer;
  color: var(--sage-ink);
  font-size: 11px;
  font-weight: 500;
}

.ai-thought-details p {
  margin-top: 6px;
  white-space: pre-wrap;
}

.ai-edited-mark {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(127, 143, 131, 0.13);
  color: var(--sage-ink);
  font-size: 10px;
  font-weight: 500;
}

.session-notice-bubble {
  max-width: 100%;
  border-style: dashed;
  background: rgba(var(--veil-rgb), 0.4);
  color: var(--muted);
  box-shadow: none;
}

.session-notice-bubble p {
  font-size: 11px;
  line-height: 1.45;
}

/* V4：开篇块去卡片化，回到「信纸排版」 */
.opening-thread-block {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 6px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.opening-thread-kicker {
  margin: 0;
  color: var(--soft);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.opening-thread-title {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.opening-thread-headline {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 500;
}

.opening-thread-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.opening-thread-meta {
  margin: 8px 0 0;
  color: var(--sage-deep);
  font-size: 11px;
  line-height: 1.4;
}

/* V4：narration 衬线两端对齐 */
.opening-thread-narration {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 2;
  text-align: justify;
  text-justify: inter-ideograph;
}

.opening-thread-divider {
  margin: 6px 0 2px;
}

/* V4：composer 实心锚定面 */
.composer {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: 40px 1fr 44px;
  align-items: end;
  gap: 8px;
  width: min(430px, 100vw);
  padding: 9px 12px max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--hairline);
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  transition: background-color 600ms ease;
}

.composer-mode {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 3px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.composer-mode button {
  min-height: 36px;
  border-radius: 13px;
  background: transparent;
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 500;
}

.composer-mode button.active,
.composer-mode button[aria-pressed="true"] {
  background: rgba(var(--veil-rgb), 0.84);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(58, 42, 48, 0.1);
}

.composer-mode i[data-lucide] {
  width: 14px;
  height: 14px;
}

.shop-panel-grid {
  display: grid;
  gap: 10px;
}

.shop-card {
  padding: 14px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 22px;
  background: rgba(var(--veil-rgb), 0.56);
}

.shop-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.shop-card-head strong {
  font-size: 16px;
}

.shop-card-head em {
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
}

.shop-card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
}

.shop-card ul {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--ink);
}

.shop-card li {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.45;
}

textarea {
  width: 100%;
  min-height: 44px;
  max-height: 104px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 24px;
  outline: 0;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: var(--shadow-low);
  box-sizing: border-box;
  line-height: 1.45;
  font-size: 15px;
}

#messageInput {
  min-height: 46px;
  padding-top: 12px;
  padding-bottom: 12px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: none;
  transition: border-color 180ms ease, background-color 600ms ease;
}

#messageInput:focus {
  border-color: var(--rose);
}

textarea::placeholder {
  color: var(--soft);
}

/* V4：酒红圆发送钮 */
.send-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  color: #f7ecdf;
  box-shadow: 0 8px 20px rgba(93, 54, 66, 0.32);
}

html.night .send-button {
  color: #1d1320;
}

.send-button:active {
  transform: scale(0.92);
}

.composer.is-sending .send-button {
  background: var(--sage);
  color: #fdfaf4;
  box-shadow: none;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 54px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--soft);
  animation: typingPulse 900ms infinite ease-in-out;
}

.typing i:nth-child(2) {
  animation-delay: 120ms;
}

.typing i:nth-child(3) {
  animation-delay: 240ms;
}

.quick-panel {
  position: fixed;
  left: 50%;
  bottom: 108px;
  z-index: 8;
  display: none;
  gap: 10px;
  width: min(402px, calc(100vw - 28px));
  max-height: min(42dvh, 320px);
  overflow-y: auto;
  padding: 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(var(--veil-rgb), 0.78);
  border-radius: 24px;
  background: rgba(var(--veil-rgb), 0.72);
  box-shadow: 0 18px 42px rgba(58, 42, 48, 0.14);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.quick-panel.open {
  display: grid;
}

.quick-panel-head {
  display: grid;
  gap: 3px;
  padding: 2px 4px 0;
}

.quick-panel-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.quick-panel-head span,
.quick-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.quick-chip-grid button {
  flex-direction: column;
  min-height: 62px;
  padding: 9px 8px;
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.44);
  color: var(--sage-deep);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.quick-chip-grid button i[data-lucide] {
  width: 17px;
  height: 17px;
}

/* ═══ P5：设置抽屉 V4 化 — sheet / sheet-panel / sheet-head 体系（V4 原型 settingsSheet 同构） ═══ */
.settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(20, 14, 18, 0.36);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  touch-action: pan-y;
}

.settings-drawer.open {
  display: flex;
}

.drawer-panel {
  display: flex;
  flex-direction: column;
  width: min(430px, 100vw);
  max-height: min(86dvh, calc(100dvh - 10px - env(safe-area-inset-top)));
  padding: 22px 20px max(16px, env(safe-area-inset-bottom));
  border: 1px solid var(--hairline-strong);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: var(--surface);
  box-shadow: 0 -24px 60px rgba(20, 14, 18, 0.18);
  overflow: hidden;
}

.drawer-panel header {
  flex: 0 0 auto;
  align-items: flex-start;
  margin-bottom: 16px;
}

/* V4 sheet-head：玫瑰 kicker + 衬线大标题 + 细线圆钮 */
.drawer-panel header p {
  margin: 0 0 6px;
  color: var(--rose);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.34em;
}

.drawer-panel header h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.drawer-panel header .icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--hairline);
  background: none;
  color: var(--ink-soft);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.drawer-panel > #drawerBody,
.drawer-panel > #characterDrawerBody,
.drawer-panel > #loreDrawerBody,
.drawer-panel > .settings-detail {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.drawer-footer {
  flex: 0 0 auto;
  padding-top: 8px;
}

.drawer-close-action {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  box-shadow: none;
}

.drawer-close-action:active {
  border-color: var(--rose);
  background: var(--rose-soft);
}

/* V4 menu-row：实心纸面 + 发丝线 + 按压玫瑰 */
.menu-row {
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 9px;
  padding: 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out);
}

.menu-row:active {
  border-color: var(--rose);
  background: var(--rose-soft);
  transform: scale(0.99);
}

.menu-row span {
  margin-right: auto;
}

.menu-row em {
  color: var(--ink-faint);
  font-size: 12px;
  font-style: normal;
}

/* lucide 渲染后 <i> 会被替换为带 data-lucide 的 svg，故用属性选择器 */
.menu-row > [data-lucide]:first-child {
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  stroke-width: 1.6;
}

.menu-row > [data-lucide]:last-child {
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
}

.menu-row--quiet {
  color: var(--ink-soft);
}

.menu-row--quiet span {
  color: inherit;
}

/* 硬核工坊·世界里的角色 多选区（2026-06-14：角色库复用进创世） */
.genesis-char-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 8px;
}
.genesis-char-empty {
  color: var(--ink-faint);
  font-size: 12px;
}

/* 设置抽屉分组标题（2026-06-14：合并同类项 + 分类排列，降低阅读成本） */
.menu-section-label {
  margin: 20px 4px 2px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* V4 info-row：静态信息行 / --edit 点按内联编辑 */
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 9px;
  padding: 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
  text-align: left;
}

.info-row b {
  font-weight: 500;
  color: var(--ink);
}

.info-row i {
  font-style: normal;
  color: var(--ink-faint);
  font-size: 16px;
}

.info-row--tap,
.info-row--edit {
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.info-row--tap:active,
.info-row--edit:active {
  border-color: var(--rose);
  background: var(--rose-soft);
}

.info-row--edit b:empty::before {
  content: "未填写 · 点按填写";
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-faint);
}

.info-row--edit input,
.info-row--edit select {
  width: 56%;
  height: 32px;
  text-align: right;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid var(--rose);
  border-radius: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.info-row--edit select {
  direction: rtl;
}

.info-row--edit select option {
  direction: ltr;
  color: var(--ink);
  background: var(--surface);
}

.sheet-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-faint);
  text-align: center;
}

.sheet-note--top {
  margin: 0 0 4px;
  text-align: left;
}

/* V4 夜色三态（跟随时间 / 恒昼 / 恒夜） */
.toggle-row--boxed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 9px;
  padding: 8px 16px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
}

.night-seg {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-deep);
}

.night-seg button {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink-faint);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.night-seg button + button {
  border-left: 1px solid var(--hairline);
}

.night-seg button[aria-pressed="true"] {
  background: var(--rose);
  color: var(--surface);
}

.night-seg button:active {
  transform: none;
}

/* V4 plan-card：月卡 */
.plan-card {
  margin-top: 9px;
  padding: 22px 20px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  outline: 1px solid var(--hairline);
  outline-offset: 4px;
}

.plan-kicker {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--wine);
}

.plan-title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.plan-perks {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.plan-perks li {
  position: relative;
  padding: 7px 0 7px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
}

.plan-perks li:last-child {
  border-bottom: none;
}

.plan-perks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 14px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose);
}

.plan-buy {
  width: 100%;
  min-height: 46px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--wine);
  background: none;
  border: 1px solid rgba(124, 74, 88, 0.4);
  border-radius: 3px;
  transition: background-color 160ms ease;
}

.plan-buy:active {
  background: var(--rose-soft);
  transform: scale(0.985);
}

/* V4 echo-row：回响包三档 */
.echo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  margin-top: 9px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.echo-row:active {
  border-color: var(--rose);
  background: var(--rose-soft);
  transform: scale(0.99);
}

.echo-row em {
  font-style: normal;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--wine);
  letter-spacing: 0.06em;
}

.settings-detail {
  display: grid;
  gap: 10px;
}

/* P5：抽屉内既有组件统一收紧到 V4 锚定面（方角 + 发丝线 + 实心纸） */
.drawer-panel .notice-card,
.drawer-panel .creator-mini,
.drawer-panel .detail-row,
.drawer-panel .package-row,
.drawer-panel .usage-card,
.drawer-panel .shop-card,
.drawer-panel .safety-card,
.drawer-panel .safety-list,
.drawer-panel .ledger-row,
.drawer-panel .moment-card,
.drawer-panel .toggle-grid button,
.drawer-panel .glass-input,
.drawer-panel .glass-select,
.drawer-panel .lore-textarea {
  border-radius: 3px;
  border-color: var(--hairline);
  background-color: var(--paper);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.drawer-panel .package-row.featured {
  border-color: rgba(124, 74, 88, 0.4);
  background-color: var(--rose-soft);
}

.drawer-panel .toggle-grid button.selected {
  border-color: var(--rose);
  background-color: var(--rose-soft);
}

.drawer-panel .switch-row {
  border-radius: 3px;
  border-color: var(--hairline);
  background-color: var(--paper);
  box-shadow: none;
}

.creator-mini,
.token-card,
.notice-card,
.detail-row,
.package-row {
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.54);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.08);
}

.creator-mini {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px;
}

.creator-dot {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: rgba(176, 133, 147, 0.3);
  color: var(--sage-deep);
  font-weight: 500;
}

.creator-mini strong,
.package-row strong {
  color: var(--ink);
}

.creator-mini p,
.token-card span,
.notice-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.detail-row,
.package-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 14px;
  text-decoration: none;
}

.detail-row.static {
  cursor: default;
}

.detail-row.static:active {
  transform: none;
}

.detail-row span,
.package-row span {
  margin-right: auto;
}

.detail-row em {
  color: var(--soft);
  font-style: normal;
}

.detail-row.danger {
  color: var(--wine);
}

.safety-card,
.safety-list {
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.54);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.08);
}

.safety-card {
  padding: 14px;
}

.safety-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.3;
}

.safety-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.safety-list {
  display: grid;
  overflow: hidden;
}

.safety-row {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
}

.safety-row:first-child {
  border-top: 0;
}

.safety-row strong {
  color: var(--ink);
  font-size: 15px;
}

.safety-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.token-card,
.usage-card,
.notice-card {
  padding: 13px;
}

.token-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.token-card strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
}

.usage-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.54);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.08);
}

.usage-card-head,
.usage-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-card-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 500;
}

.usage-card-head strong {
  color: var(--soft);
  font-size: 22px;
}

.usage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(124, 74, 88, 0.12);
}

.usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sage-deep);
}

.usage-window {
  min-height: 28px;
  color: var(--ink);
}

.usage-window em {
  color: var(--soft);
  font-style: normal;
}

.usage-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.text-metrics-card {
  gap: 10px;
}

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

.text-metrics-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(var(--veil-rgb), 0.44);
  color: var(--muted);
  font-size: 12px;
}

.text-metrics-grid strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
}

.text-metrics-grid em {
  color: var(--soft);
  font-style: normal;
}

.habit-section {
  display: grid;
  gap: 8px;
}

.habit-section > span {
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 500;
}

.habit-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.habit-cloud span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(124, 74, 88, 0.14);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.62);
}

.habit-cloud strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-cloud em {
  color: var(--soft);
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.habit-empty {
  padding: 10px 11px;
  border-radius: 14px;
  background: rgba(var(--veil-rgb), 0.38);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.package-row.featured {
  background: rgba(176, 133, 147, 0.22);
}

.ledger-list {
  display: grid;
  gap: 8px;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid rgba(var(--veil-rgb), 0.68);
  border-radius: 16px;
  background: rgba(var(--veil-rgb), 0.42);
}

.ledger-row span {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 13px;
}

.ledger-row em {
  color: var(--soft);
  font-size: 11px;
  font-style: normal;
}

.ledger-row strong {
  color: var(--sage-deep);
  font-size: 13px;
}

.ledger-row.muted span,
.ledger-row.muted strong {
  color: var(--soft);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.toggle-grid button {
  min-height: 86px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.48);
  color: var(--muted);
}

.toggle-grid button.selected {
  border-color: rgba(124, 74, 88, 0.26);
  background: rgba(176, 133, 147, 0.24);
  color: var(--sage-deep);
}

.model-tier-grid {
  grid-template-columns: repeat(3, 1fr);
}

.model-tier-grid button {
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 14px 8px;
}

.model-tier-grid span,
.model-tier-grid em {
  display: block;
  line-height: 1.25;
}

.model-tier-grid span {
  font-size: 17px;
  font-weight: 500;
}

.model-tier-grid em {
  color: var(--soft);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}

.field-label {
  display: block;
  margin: 4px 2px -3px;
  color: var(--sage-deep);
  font-size: 13px;
  font-weight: 500;
}

.glass-select,
.glass-input,
.lore-textarea {
  width: 100%;
  border: 1px solid rgba(var(--veil-rgb), 0.78);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.58);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-select {
  min-height: 48px;
  padding: 0 13px;
}

.glass-input {
  min-height: 48px;
  padding: 0 13px;
  outline: 0;
}

.glass-input::placeholder {
  color: var(--soft);
}

.invite-form {
  display: grid;
  gap: 9px;
}

.lore-textarea {
  min-height: 104px;
  max-height: 180px;
  padding: 13px;
  resize: vertical;
}

.lore-textarea::placeholder {
  color: var(--soft);
  line-height: 1.55;
}

.lore-soft-hint {
  margin: -4px 2px 8px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

/* 批 M：「给他起个名字」输入行——flex + min-width:0，360 窄屏不溢出（不动批 L 顶栏 grid 列锁） */
.a-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.a-name-row .glass-input {
  flex: 1;
  min-width: 0;
}

.a-name-row .mini-button {
  flex: none;
}

.lore-section-divider {
  height: 1px;
  margin: 14px 0;
  background: rgba(124, 74, 88, 0.16);
}

.lore-archives-empty {
  margin: 0;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(var(--veil-rgb), 0.42);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}

.lore-archives-list {
  display: grid;
  gap: 8px;
}

.lore-archive-row {
  display: grid;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 16px;
  background: rgba(var(--veil-rgb), 0.48);
  text-align: left;
}

.lore-archive-row strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.lore-archive-row em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.lore-archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(124, 74, 88, 0.28);
  background: rgba(176, 133, 147, 0.18);
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 500;
}

.mini-button.soft {
  background: rgba(var(--veil-rgb), 0.55);
  color: var(--muted);
}

.mini-button.danger {
  border-color: rgba(124, 74, 88, 0.22);
  background: rgba(124, 74, 88, 0.08);
  color: var(--wine);
}

.package-row.danger strong {
  color: var(--wine);
}

.lore-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.lore-modal[hidden] {
  display: none;
}

.lore-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 24, 30, 0.36);
  backdrop-filter: blur(3px);
}

.lore-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  padding: 18px 16px 16px;
  border-radius: 20px;
  border: 1px solid rgba(var(--veil-rgb), 0.78);
  background: rgba(var(--veil-rgb), 0.96);
  box-shadow: 0 24px 56px rgba(32, 24, 30, 0.2);
  text-align: left;
}

.lore-modal-panel h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.lore-modal-lead {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.lore-modal-save-row {
  margin: 0 0 10px;
}

.lore-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.update-log-list {
  display: grid;
  gap: 12px;
}

.update-log-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(var(--veil-rgb), 0.78);
  border-radius: 20px;
  background: rgba(var(--veil-rgb), 0.58);
  box-shadow: 0 12px 28px rgba(58, 42, 48, 0.08);
}

.update-log-card header,
.update-log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.update-log-card header span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(127, 143, 131, 0.14);
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 500;
}

.update-log-card header em,
.update-log-meta span {
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
}

.update-log-card h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.35;
}

.update-log-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.update-log-meta strong {
  color: var(--sage-deep);
  font-size: 12px;
}

.update-log-section {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.update-log-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.update-log-section ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.update-log-section li {
  position: relative;
  padding-left: 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.update-log-section li::before {
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(127, 143, 131, 0.72);
  content: "";
}

.update-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.update-modal[hidden] {
  display: none;
}

.update-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 24, 30, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.update-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 370px);
  padding: 18px 16px 16px;
  border: 1px solid rgba(var(--veil-rgb), 0.78);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(var(--veil-rgb), 0.98), rgba(var(--veil-rgb), 0.94) 54%),
    rgba(var(--veil-rgb), 0.96);
  box-shadow: 0 24px 56px rgba(32, 24, 30, 0.24);
  text-align: left;
}

.update-modal-kicker {
  margin: 0 0 6px;
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.update-modal-panel h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
}

.update-modal-lead {
  margin: 9px 0 13px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.update-modal-points {
  display: grid;
  gap: 8px;
  max-height: min(46vh, 340px);
  margin-bottom: 14px;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.update-modal-points p {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(var(--veil-rgb), 0.58);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.update-modal-points i[data-lucide] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--sage-deep);
}

.update-modal-action {
  width: 100%;
  margin: 0;
}

.safety-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
}

.safety-modal[hidden] {
  display: none;
}

.safety-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 24, 30, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.safety-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  padding: 22px 18px 18px;
  border: 1px solid rgba(var(--veil-rgb), 0.82);
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--veil-rgb), 0.98), rgba(var(--veil-rgb), 0.94) 56%),
    rgba(var(--veil-rgb), 0.96);
  box-shadow: 0 26px 68px rgba(32, 24, 30, 0.25);
  text-align: left;
}

.safety-modal-kicker {
  margin: 0 0 7px;
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.safety-modal-panel h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.3;
}

.safety-modal-lead {
  margin: 10px 0 15px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.safety-modal-action {
  width: 100%;
  margin: 0;
}

.feedback-textarea {
  min-height: 132px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.54);
}

.switch-row span {
  display: grid;
  gap: 4px;
}

.switch-row strong {
  color: var(--ink);
}

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

.switch-row input {
  width: 46px;
  height: 28px;
  flex: 0 0 auto;
  accent-color: var(--sage-deep);
}

.moment-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 20px;
  background: rgba(var(--veil-rgb), 0.54);
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.08);
}

.moment-card header,
.moment-card footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.moment-card header img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.moment-card header div {
  display: grid;
  gap: 2px;
}

.moment-card strong {
  color: var(--ink);
}

.moment-card em,
.moment-card footer {
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
}

.moment-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
}

.moment-card footer {
  justify-content: flex-end;
}

.moment-placeholder {
  min-height: 136px;
  border: 1px dashed rgba(124, 74, 88, 0.35);
  border-radius: 18px;
  background:
    linear-gradient(135deg, var(--rose-soft), rgba(181, 145, 90, 0.14)),
    rgba(var(--veil-rgb), 0.32);
}

.avatar-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.avatar-preset {
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.42);
}

.avatar-preset.active {
  border-color: var(--sage-deep);
  background: rgba(var(--veil-rgb), 0.72);
}

.avatar-preset img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}

.avatar-crop-preview {
  display: grid;
  place-items: center;
  margin: 10px 0 14px;
}

.avatar-crop-preview img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--veil-rgb), 0.9);
  box-shadow: 0 10px 20px rgba(58, 42, 48, 0.12);
}

.upload-row {
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
}

.character-manage-list,
.character-sort-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.character-manage-row,
.character-sort-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--veil-rgb), 0.72);
  border-radius: 18px;
  background: rgba(var(--veil-rgb), 0.48);
}

.character-sort-row {
  grid-template-columns: 1fr auto;
}

.character-manage-row img {
  border-radius: 50%;
  object-fit: cover;
}

.character-manage-row strong,
.character-sort-row span {
  color: var(--ink);
  font-size: 14px;
}

.character-manage-row em {
  display: block;
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
}

.sort-actions {
  display: flex;
  gap: 6px;
}

.muted-copy {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 30;
  max-width: min(340px, calc(100vw - 48px));
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(var(--veil-rgb), 0.76);
  border-radius: 999px;
  background: rgba(46, 42, 48, 0.86);
  color: #f5efe6;
  box-shadow: 0 16px 36px rgba(58, 42, 48, 0.18);
  font-size: 13px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.34;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes splashContentIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes splashContentOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.99);
  }
}

@media (max-width: 520px) and (max-height: 860px) {
  .chat-app {
    padding: max(6px, env(safe-area-inset-top)) 0 100px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .search-box {
    grid-template-columns: 18px 1fr;
    min-height: 40px;
    margin-bottom: 5px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 14px;
  }

  .mode-assist {
    padding: 10px;
    border-radius: 20px;
  }

  .mode-assist-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-assist-trigger {
    width: 100%;
  }

  .mode-assist-grid {
    grid-template-columns: 1fr;
  }

  .scroll-jump-toggle {
    width: 26px;
    height: 26px;
  }

  .scroll-jump-actions button {
    right: 10px;
    bottom: calc(118px + env(safe-area-inset-bottom));
  }

  .chat-scroll-jump button {
    min-height: 40px;
  }

  .conversation-card {
    padding: 0;
    border-radius: 0;
  }

  .topbar-id img {
    width: 34px;
    height: 34px;
  }

  .opening-thread-block {
    padding: 10px;
  }

  .composer {
    grid-template-columns: 38px 1fr 42px;
    gap: 6px;
    padding: 6px 10px max(7px, env(safe-area-inset-bottom));
  }

  .composer-mode button {
    min-height: 28px;
    font-size: 12px;
  }

  textarea,
  #messageInput {
    min-height: 42px;
  }

  #messageInput {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .send-button {
    width: 42px;
    height: 42px;
  }

  .quick-panel {
    bottom: 100px;
  }
}

@media (min-width: 760px) {
  body {
    padding: 0;
  }

  .phone-shell {
    height: 100dvh;
    border: 1px solid rgba(var(--veil-rgb), 0.7);
    border-radius: 0;
    overflow: hidden;
  }

  .chat-app {
    height: 100dvh;
  }

  .composer {
    border-radius: 0 0 34px 34px;
  }
}

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

/* ═══════════════════════════════════════════════════════
   P2 · V4 关键屏组件移植（邀请函 / 三入口卡 / 聊天 topbar）
   ═══════════════════════════════════════════════════════ */

/* ───────── 邀请函 · splash-letter ───────── */

.splash-letter {
  width: 100%;
  padding: 40px 28px 28px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--hairline);
  outline: 1px solid var(--hairline);
  outline-offset: 5px;
  box-shadow: var(--shadow-lift);
  transition: background-color 600ms ease;
}

.letter-seal {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 28%, var(--rose), var(--wine) 58%, var(--wine-deep));
  box-shadow:
    0 10px 26px rgba(124, 74, 88, 0.4),
    inset 0 2px 5px rgba(255, 255, 255, 0.32),
    inset 0 -3px 7px rgba(0, 0, 0, 0.28);
  animation: sealIn 900ms var(--ease-out) both;
}

.letter-seal span {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  color: #f7ecdf;
  transform: translateY(-1px);
}

@keyframes sealIn {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }

  60% {
    opacity: 1;
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

.letter-kicker {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--ink-faint);
  animation: riseIn 600ms var(--ease-out) 120ms both;
}

.letter-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.3;
  animation: riseIn 600ms var(--ease-out) 200ms both;
}

.letter-lead {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
  animation: riseIn 600ms var(--ease-out) 280ms both;
}

.letter-quote {
  position: relative;
  margin: 0 0 24px;
  padding: 16px 18px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 2;
  color: var(--ink);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  animation: riseIn 600ms var(--ease-out) 360ms both;
}

.letter-quote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--rose);
}

.letter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: riseIn 600ms var(--ease-out) 440ms both;
}

.letter-code {
  height: 50px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  border-radius: 3px;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease, background-color 600ms ease;
}

.letter-code::placeholder {
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
}

.letter-code:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px var(--rose-soft);
}

.letter-code.has-error {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(124, 74, 88, 0.14);
}

.letter-error {
  margin: 0;
  min-height: 0;
  text-align: center;
}

.letter-enter {
  height: 50px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #f7ecdf;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
  box-shadow: 0 10px 24px rgba(93, 54, 66, 0.3);
}

html.night .letter-enter {
  color: #1d1320;
}

.letter-enter:active {
  transform: scale(0.975);
}

.letter-enter.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}

html.night .letter-enter.is-loading::before {
  border-color: rgba(29, 19, 32, 0.4);
  border-top-color: #1d1320;
}

.letter-reenter {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.letter-privacy {
  margin: 22px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  animation: riseIn 600ms var(--ease-out) 520ms both;
}

.letter-fineprint {
  margin: 10px 0 0;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--ink-faint);
  animation: riseIn 600ms var(--ease-out) 560ms both;
}

.consent-links--letter {
  margin-top: 10px;
  font-size: 11px;
  animation: riseIn 600ms var(--ease-out) 600ms both;
}

.consent-links--letter a {
  color: var(--sage);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* 拆信退场 */
.splash-letter.is-opening {
  animation: letterOpen 560ms var(--ease-out) forwards;
}

@keyframes letterOpen {
  30% {
    transform: scale(1.015);
    opacity: 1;
  }

  100% {
    transform: translateY(-26px) scale(0.96);
    opacity: 0;
  }
}

/* ───────── 三入口卡 ───────── */

.modes-head {
  text-align: left;
  padding-left: 4px;
}

.modes-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}

.modes-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.mode-cards {
  display: grid;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 148px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms ease;
}

.mode-card:active {
  transform: scale(0.982);
}

.mode-card-body {
  display: block;
}

.mode-card-kicker {
  display: block;
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
}

.mode-card-title {
  display: block;
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.mode-card-sub {
  display: block;
  margin: 0;
  font-size: 12px;
  font-style: normal;
  line-height: 1.7;
}

.mode-card-cue {
  position: absolute;
  right: 18px;
  bottom: 18px;
  font-size: 11px;
  letter-spacing: 0.14em;
  opacity: 0.78;
}

.mode-card-headline {
  display: none;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  line-height: 1.6;
}

.mode-card.is-selected .mode-card-headline {
  display: block;
  max-width: calc(100% - 64px);
}

.mode-card.is-selected {
  border-color: var(--wine);
  box-shadow: 0 0 0 1px var(--wine), var(--shadow-lift);
}

/* — 情感陪伴：暖奶油 + 日光节律 — */
.mode-card--companion {
  background: linear-gradient(165deg, var(--surface-warm), var(--paper));
  color: var(--ink);
}

.mode-card--companion .mode-card-kicker {
  color: var(--rose);
}

.mode-card--companion .mode-card-sub {
  color: var(--ink-soft);
}

.mode-card--companion .mode-card-cue {
  color: var(--wine);
}

.mode-card--companion .mode-card-headline {
  color: var(--ink-soft);
}

html.night .mode-card--companion {
  background: linear-gradient(165deg, #2a2433, #201d2b);
}

.daylight-strip {
  position: absolute;
  top: 22px;
  right: 28px;
  width: min(34%, 136px);
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    #b8c4d6 0%, #f0d9a8 22%, #f4e3b8 50%, #e8b88a 74%, #8d7d9b 92%, #4a4560 100%);
  opacity: 0.5;
  pointer-events: none;
}

.daylight-sun {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--wine);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(124, 74, 88, 0.14);
  transition: left 800ms var(--ease-out);
}

/* — 自由探索：留白 + 世界色点 — */
.mode-card--explore {
  background: var(--surface);
  color: var(--ink);
}

.mode-card--explore .mode-card-kicker {
  color: var(--sage);
}

.mode-card--explore .mode-card-sub {
  color: var(--ink-soft);
}

.mode-card--explore .mode-card-cue {
  color: var(--sage);
}

.mode-card--explore .mode-card-headline {
  color: var(--ink-soft);
}

.world-swatches {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 7px;
}

.world-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
}

.world-dot--mist {
  background: linear-gradient(140deg, #9fb3c8, #5a7184);
}

.world-dot--dune {
  background: linear-gradient(140deg, #e0b97e, #9a6b4f);
}

.world-dot--capital {
  background: linear-gradient(140deg, #b56a6a, #5d3a3a);
}

/* ───────── 聊天 topbar（V4 四圆钮位 + 业务钮） ───────── */

.chat-topbar {
  margin-bottom: 0;
  padding: 4px 12px 7px;
  border-bottom: 1px solid var(--hairline);
}

.topbar-hidden-hooks {
  display: none !important;
}

.topbar-id {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.topbar-id img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.topbar-id-text {
  min-width: 0;
}

.topbar-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.chat-topbar .topbar-status {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-topbar .topbar-status[hidden] {
  display: none;
}

.topbar-actions {
  gap: 5px;
}

.icon-button.topbar-btn {
  /* 顶区紧凑化（用户 2026-06-12 红框反馈）：38→32，热区仍 ≥32 可点底线 */
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}

.icon-button.topbar-btn i[data-lucide] {
  width: 15px;
  height: 15px;
}

.icon-button.topbar-btn:active {
  transform: scale(0.9);
  border-color: var(--rose);
  color: var(--wine);
}

.icon-button.topbar-btn:disabled {
  opacity: 0.4;
}

/* ───────── 聊天主体在无侧 padding 下的间距 ───────── */

.search-box {
  margin: 10px 14px 4px;
}

.conversation-card {
  padding: 0 14px;
}

.messages {
  gap: 12px;
  padding: 14px 2px 10px;
}

/* ═══════════════════════════════════════════════════════
   P3 · V4 体验组件（书签 / 信纸 / A 的今天 / 线索 / 灵感条 / 道具）
   ═══════════════════════════════════════════════════════ */

/* ───────── 长按钉书签 ───────── */

/* 长按手势接管 A 气泡：禁选避免触发系统文本菜单（复制走「引用」） */
.bubble.ai {
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.bubble.just-pinned {
  animation: pinFlash 700ms var(--ease-out);
}

@keyframes pinFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(176, 133, 147, 0.55);
  }

  45% {
    box-shadow: 0 0 0 7px rgba(176, 133, 147, 0.18);
    transform: scale(1.015);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(176, 133, 147, 0);
    transform: scale(1);
  }
}

.pin-mark {
  position: absolute;
  top: -8px;
  right: -7px;
  width: 16px;
  height: 22px;
  background: var(--rose);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
  animation: pinFlash 500ms ease;
  pointer-events: none;
}

.pin-mark--still {
  animation: none;
}

/* ───────── 长按消息 · 二级操作菜单（2026-06-15：信纸钮退役后的统一入口） ───────── */
.bubble-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: transparent;
}
.bubble-menu-backdrop.open {
  display: block;
}
.bubble-menu {
  position: fixed;
  z-index: 61;
  display: none;
  min-width: 132px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}
.bubble-menu.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: bubbleMenuIn 120ms ease;
}
@keyframes bubbleMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.bubble-menu-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
}
.bubble-menu-item:hover,
.bubble-menu-item:active {
  background: var(--rose-soft);
}
.bubble-menu-item:disabled {
  color: var(--ink-faint);
  cursor: default;
}

/* ───────── 书签墙 · 他记得的事 ───────── */

.memory-drawer {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 14, 18, 0.36);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.memory-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.memory-panel {
  width: min(430px, 100vw);
  max-height: 72dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--hairline-strong);
  border-radius: 4px 4px 0 0;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(24px);
  transition: transform 380ms var(--ease-out);
}

.memory-drawer.is-open .memory-panel {
  transform: none;
}

.memory-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "kicker close" "title close";
  margin-bottom: 18px;
}

.memory-kicker {
  grid-area: kicker;
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--rose);
}

.memory-title {
  grid-area: title;
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.memory-close {
  grid-area: close;
  align-self: start;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: none;
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
}

.memory-wall {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.memory-wall::-webkit-scrollbar {
  width: 0;
}

/* 书签卡：左侧缎带 */
.memory-card {
  position: relative;
  padding: 14px 16px 14px 22px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  animation: msgIn 360ms var(--ease-out);
}

.memory-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 5px;
  background: linear-gradient(180deg, var(--rose), var(--wine));
}

.memory-card q {
  quotes: none;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink);
  display: block;
}

.memory-card time {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.memory-empty {
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
  padding: 26px 0;
  line-height: 1.8;
  white-space: pre-line;
}

.memory-hint {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--ink-faint);
  text-align: center;
  letter-spacing: 0.06em;
}

/* ───────── 信纸导出 · KEEPSAKE ───────── */

.keepsake-sheet {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 14, 18, 0.36);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.keepsake-sheet.is-open {
  opacity: 1;
  pointer-events: auto;
}

.keepsake-panel {
  width: min(430px, 100vw);
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--hairline-strong);
  border-radius: 4px 4px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(24px);
  transition: transform 380ms var(--ease-out);
}

.keepsake-sheet.is-open .keepsake-panel {
  transform: none;
}

.keepsake-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.keepsake-head-id {
  flex: 1;
}

.keepsake-kicker {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--rose);
}

.keepsake-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.keepsake-close {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: none;
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  position: relative;
  width: 40px;
  height: 23px;
  flex: none;
  border-radius: 999px;
  background: var(--paper-deep);
  border: 1px solid var(--hairline-strong);
  transition: background-color 200ms ease;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  transform: translateY(-50%);
  transition: transform 200ms var(--ease-out);
}

.toggle-row input:checked + .toggle-ui {
  background: var(--rose);
}

.toggle-row input:checked + .toggle-ui::after {
  transform: translate(15px, -50%);
}

.letter-sheet {
  flex: 1;
  overflow-y: auto;
  padding: 26px 22px 20px;
  background:
    radial-gradient(90% 50% at 50% 0%, rgba(176, 133, 147, 0.07), transparent 70%),
    #fdfaf2;
  border: 1px solid var(--hairline);
  outline: 1px solid var(--hairline);
  outline-offset: 4px;
  min-height: 220px;
}

html.night .letter-sheet {
  background: #262232;
}

.letter-sheet-date {
  margin: 0 0 18px;
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--ink-faint);
  text-align: center;
}

.letter-sheet-note {
  margin: 24px 0;
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.8;
}

.letter-line {
  margin-bottom: 13px;
}

.letter-line .who {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--rose);
  margin-bottom: 3px;
}

.letter-line .who--me {
  color: var(--sage);
}

.letter-line .said {
  margin: 0;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink);
}

.letter-sheet-foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.letter-sheet-foot .seal-mini {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 28%, var(--rose), var(--wine-deep) 70%);
  color: #f7ecdf;
  font-family: var(--serif);
  font-style: normal;
  font-size: 13px;
}

.letter-sheet-foot span {
  font-size: 9.5px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
}

.letter-save {
  margin-top: 14px;
  flex: none;
  width: 100%;
  height: 46px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: #f7ecdf;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  border: none;
  border-radius: 3px;
  box-shadow: 0 8px 20px rgba(93, 54, 66, 0.26);
  cursor: pointer;
}

html.night .letter-save {
  color: #1d1320;
}

.letter-save:active {
  transform: scale(0.985);
}

/* ───────── A 的今天（消息流上方固定可折叠卡） ───────── */

.today-card {
  margin: 8px 0 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  overflow: hidden;
  flex: none;
}

.today-card[hidden] {
  display: none !important;
}

.today-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  background: none;
  border: none;
  cursor: pointer;
}

.today-kicker {
  font-size: 10.5px;
  letter-spacing: 0.28em;
  color: var(--rose);
}

.today-fold {
  font-size: 11px;
  color: var(--ink-faint);
}

.today-list {
  list-style: none;
  margin: 0;
  padding: 2px 15px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 132px;
  overflow-y: auto;
}

.today-list::-webkit-scrollbar {
  width: 0;
}

.today-card.is-folded .today-list,
.today-card.is-folded .today-body {
  display: none;
}

.today-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.today-item time {
  flex: none;
  width: 44px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.today-item.is-now {
  color: var(--ink);
}

.today-item.is-now time {
  color: var(--wine);
}

.today-item.is-now::after {
  content: "现在";
  flex: none;
  align-self: center;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--wine);
  border: 1px solid rgba(124, 74, 88, 0.4);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: auto;
}

/* 批 O：你们的约定（聊天达成的当日安排）——时间左侧细微玫瑰点（落在 15px 内边距里，
   不挤占 time 的 44px 定宽），其余样式同全局条 */
.today-item.is-personal {
  position: relative;
}

.today-item.is-personal::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose);
}

/* 批 O：渐进显示氛围提示（存在未到点条目时出现在卡尾） */
.today-hint {
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  font-style: italic;
  padding-left: 56px;
}

/* 修复批C-2：世界规则（自由探索）：鼠尾草调，结构同今日卡 */
.world-card {
  border-color: rgba(127, 143, 131, 0.4);
  background: rgba(238, 244, 239, 0.9);
}

html.night .world-card {
  background: #1d211e;
  border-color: rgba(127, 143, 131, 0.34);
}

.world-card .today-kicker {
  color: var(--sage-ink);
}

html.night .world-card .today-kicker {
  color: var(--sage);
}

.world-list .today-item time {
  width: 48px;
  color: var(--sage-ink);
}

html.night .world-list .today-item time {
  color: var(--sage);
}

html.night .world-card .today-item {
  color: rgba(213, 226, 216, 0.74);
}

html.night .world-card .today-fold {
  color: rgba(213, 226, 216, 0.45);
}

/* 修复批C-1：设置抽屉「更新日志」未读红点（替代首轮强弹） */
.menu-row .menu-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: #c25e5e;
  vertical-align: 2px;
}

html.night .menu-row .menu-unread-dot {
  background: #d77f7f;
}

/* ───────── 灵感快捷条（composer 内第一行） ───────── */

.chip-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding: 0 0 2px;
  overflow-x: auto;
  flex: none;
}

.chip-row:empty {
  display: none;
}

.chip-row::-webkit-scrollbar {
  height: 0;
}

.chip-row button {
  flex: none;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.chip-row button:active {
  transform: scale(0.95);
  border-color: var(--rose);
  color: var(--ink);
}

/* composer 多了一行 chips：给消息流和滚动钮让出高度 */
.chat-app.v4-has-chips {
  padding-bottom: 168px;
}

.chat-app.v4-has-chips .chat-scroll-jump {
  bottom: calc(164px + env(safe-area-inset-bottom));
}

.chat-app.v4-has-chips .quick-panel {
  bottom: 164px;
}

.prop-lightbox {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(16, 12, 10, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
  cursor: zoom-out;
}

.prop-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.prop-lightbox img {
  max-width: min(430px, 100%);
  max-height: 86%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.prop-lightbox-hint {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(236, 226, 208, 0.55);
}

/* ───────── 内测提示条：首次后自动收起为一行 ───────── */

.session-notice-fold {
  display: block;
  margin: 6px 0 -2px auto;
  padding: 2px 8px;
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: 10.5px;
  cursor: pointer;
}

.session-notice-bubble--collapsed {
  padding: 0;
  border: none;
  background: none;
  justify-self: center;
  max-width: 100%;
}

.session-notice-expand {
  padding: 5px 12px;
  border: 1px dashed var(--hairline);
  border-radius: 999px;
  background: rgba(var(--veil-rgb), 0.3);
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   P4 · V4 探索创世：「起一个新世界」答题器 + 故事集市占位
   （V4 screen-explore 同构；渲染在 splash 层 .splash-inner--explore 内）
   ═══════════════════════════════════════════════════════════ */

.splash-inner.splash-inner--explore {
  display: block;
  width: min(100%, 420px);
  max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  text-align: left;
}

.explore-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 4px 12px;
  border-bottom: 1px solid var(--hairline);
}

.explore-back {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: none;
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.explore-back:active {
  transform: scale(0.9);
  border-color: var(--hairline-strong);
  color: var(--ink);
}

.explore-kicker {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--sage);
  margin-bottom: 3px;
}

.explore-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.explore-scroll {
  padding: 22px 4px 28px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* — 四题答题器 — */
.builder {
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  outline: 1px solid var(--hairline);
  outline-offset: 4px;
}

.builder-progress {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.builder-progress span { color: var(--wine); }

.builder-q {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  min-height: 2.6em;
  color: var(--ink);
}

.builder-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 12px;
}

.builder-opt {
  padding: 13px 12px;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.builder-opt:active {
  transform: scale(0.98);
  border-color: var(--rose);
}

.builder-opt.is-on {
  border-color: var(--wine);
  background: var(--rose-soft);
  color: var(--ink);
  font-weight: 500;
}

.builder-free {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  outline: none;
  border-radius: 0;
  transition: border-color 160ms ease;
}

.builder-free:focus { border-color: var(--wine); }
.builder-free::placeholder { color: var(--ink-faint); }

.builder-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.builder-nav .ghost-link {
  background: none;
  border: none;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 8px 14px;
}

.builder-nav .ghost-link:active { color: var(--ink-soft); }

/* 全局 button { display:inline-flex } 会盖掉 UA 的 [hidden]，这里补回 */
.builder-nav .ghost-link[hidden] { display: none; }

.builder-next {
  margin-left: auto;
  height: 44px;
  padding: 0 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #f7ecdf;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 160ms ease, transform 150ms ease;
  box-shadow: 0 8px 20px rgba(93, 54, 66, 0.26);
}

html.night .builder-next { color: #1d1320; }

.builder-next:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.builder-next:not(:disabled):active { transform: scale(0.975); }

.builder-crumbs {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-faint);
  min-height: 1em;
}

.builder-crumbs em {
  font-style: normal;
  color: var(--rose);
}

/* — 故事集市 — */
.market-head { margin-bottom: 14px; }

.market-kicker {
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--sage);
  margin-bottom: 6px;
}

.market-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
  color: var(--ink);
}

.market-sub {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

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

.market-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px 15px 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease, border-color 200ms ease;
}

.market-card:active { transform: scale(0.985); }
.market-card:focus-visible { border-color: var(--hairline-strong); outline: none; }

.market-spine {
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 5px;
}

.market-spine--mist { background: linear-gradient(180deg, #9fb3c8, #5a7184); }
.market-spine--dune { background: linear-gradient(180deg, #e0b97e, #9a6b4f); }
.market-spine--capital { background: linear-gradient(180deg, #b56a6a, #5d3a3a); }

.market-card-body {
  flex: 1;
  min-width: 0;
}

.market-card-body h4 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: var(--ink);
}

.market-card-body p {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.market-card-body .market-meta {
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.market-card-body .market-meta::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rose);
  margin-right: 6px;
  vertical-align: 2px;
}

.market-take {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--wine);
  border: 1px solid rgba(124, 74, 88, 0.4);
  border-radius: 999px;
  padding: 7px 14px;
  transition: background-color 160ms ease, color 160ms ease;
}

.market-card:active .market-take { background: var(--rose-soft); }

/* — 集市锁定占位：即将开放 — */
.market-lock-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--wine);
  border: 1px solid rgba(124, 74, 88, 0.34);
  border-radius: 999px;
  vertical-align: 1px;
}

.market.is-locked .market-list { pointer-events: none; }

.market.is-locked .market-card {
  opacity: 0.5;
  cursor: default;
}

.market.is-locked .market-card:active,
.market.is-locked .market-card:focus-visible {
  transform: none;
  box-shadow: none;
  border-color: var(--hairline);
}

.market.is-locked .market-take {
  color: var(--ink-faint);
  border-color: var(--hairline);
}

/* — 集市开闸态（market_enabled）：动态卡片 + 书架 + 今日上新 — */
.market-new-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--wine);
  background: var(--rose-soft);
  border: 1px solid rgba(124, 74, 88, 0.34);
  border-radius: 999px;
  vertical-align: 1px;
}

.market-new-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: var(--wine);
  background: var(--rose-soft);
  border-radius: 999px;
  vertical-align: 2px;
}

.market-card--live .market-spine {
  background: linear-gradient(180deg, #9fb3c8, #5a7184);
}

.market-card-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.market-save {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.market-save:hover { color: var(--wine); border-color: rgba(124, 74, 88, 0.4); }

.market-save.is-saved {
  color: var(--wine);
  border-color: rgba(124, 74, 88, 0.4);
  background: var(--rose-soft);
}

.market-empty {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding: 14px 2px;
}

.market-more {
  align-self: center;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  background: none;
  border: 1px dashed var(--hairline-strong);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.market-more:hover { color: var(--wine); border-color: rgba(124, 74, 88, 0.4); }

html.night .market-new-pill,
html.night .market-new-badge {
  background: rgba(124, 74, 88, 0.24);
}

/* ─── 朗读按钮：声波三杠（2026-06-11 用户反馈：替换 emoji 喇叭） ─── */
.speak-message-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.speak-message-action svg { display: block; }
.speak-message-action.is-loading svg { animation: speakLoading 1s ease-in-out infinite; }
@keyframes speakLoading {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}
.speak-message-action.is-playing .sb1 { animation: speakBar 0.9s ease-in-out infinite; }
.speak-message-action.is-playing .sb2 { animation: speakBar 0.9s ease-in-out 0.15s infinite; }
.speak-message-action.is-playing .sb3 { animation: speakBar 0.9s ease-in-out 0.3s infinite; }
@keyframes speakBar {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1.15); }
}
.speak-message-action.is-playing .sb1,
.speak-message-action.is-playing .sb2,
.speak-message-action.is-playing .sb3 { transform-origin: center; transform-box: fill-box; }
.ai-message-tools--opening { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) {
  .speak-message-action svg, .speak-message-action .sb1, .speak-message-action .sb2, .speak-message-action .sb3 {
    animation: none !important;
  }
}

/* ═══ 批 G2 · 故事集市书城（开闸态；蓝本 prototype/market-bookcity-2026-06-11） ═══
   全部为新增类（bc-* / md-*），不触碰任何既有选择器；颜色走全局 token，
   html.night 随变量自动换墨色。三列格栅显式 minmax(0,1fr) 锁列（批 L 口径）。 */

.bc { display: block; }

.bc-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bc-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(253, 250, 244, 0.6);
  border: 1px solid var(--hairline);
  border-radius: 99px;
  padding: 8px 14px;
}

.bc-search svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke: var(--ink-faint);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.bc-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
  outline: none;
}

.bc-search input::placeholder { color: var(--ink-faint); }
.bc-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.bc-myshelf {
  flex: none;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 99px;
  background: rgba(253, 250, 244, 0.58);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--wine);
  cursor: pointer;
}

.bc-myshelf.is-on {
  border-color: rgba(124, 74, 88, 0.35);
  background: var(--rose-soft);
}

.bc-myshelf em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-faint);
}

.bc-chips {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bc-chips::-webkit-scrollbar { display: none; }

.bc-chip {
  flex: none;
  font-size: 12px;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid var(--hairline);
  background: rgba(253, 250, 244, 0.55);
  color: var(--ink-soft);
  cursor: pointer;
}

.bc-chip.is-on {
  color: var(--wine);
  border-color: rgba(124, 74, 88, 0.35);
  background: var(--rose-soft);
  font-weight: 500;
}

/* — 头版 · 今日新书 — */
.bc-hero {
  margin-top: 16px;
  display: flex;
  gap: 14px;
  background: linear-gradient(125deg, rgba(181, 145, 90, 0.1), rgba(253, 250, 244, 0.6));
  border: 1px solid var(--gold-faint);
  border-radius: var(--radius-card);
  padding: 14px;
  box-shadow: 0 10px 28px rgba(58, 42, 48, 0.08);
  cursor: pointer;
}

.bc-hero:active { transform: scale(0.99); }

.bc-hero-cov,
img.bc-hero-cov {
  width: 116px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  flex: none;
  box-shadow: 0 8px 20px rgba(58, 42, 48, 0.22);
}

.bc-hero-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bc-hero-kick {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bc-hero-kick i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #e6c187, #d3a868);
  box-shadow: 0 0 8px 1px rgba(211, 168, 104, 0.5);
}

.bc-hero-title {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 7px;
  color: var(--ink);
}

.bc-hero-by {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 3px;
}

.bc-hero-hook {
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bc-hero-cta {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bc-hero-enter {
  flex: none;
  font-size: 12.5px;
  color: #fff;
  background: var(--wine);
  border-radius: 99px;
  padding: 7px 18px;
}

.bc-hero-next {
  font-size: 10.5px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* — 书架（纯陈列，三列封面格栅） — */
.bc-sect {
  display: flex;
  align-items: baseline;
  margin: 22px 0 12px;
}

.bc-sect h3 {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink);
}

.bc-sect span {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-faint);
}

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

.bc-book {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.bc-book:active { transform: scale(0.98); }

.bc-book-covwrap {
  position: relative;
  display: block;
}

.bc-book-cov,
img.bc-book-cov {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(58, 42, 48, 0.16);
  border: 1px solid rgba(72, 58, 62, 0.08);
}

/* 无封面：tint 书脊兜底（书名竖排），不破格栅 */
.bc-cov--tint {
  position: relative;
  background-image: linear-gradient(165deg, rgba(253, 250, 244, 0.85), rgba(236, 226, 210, 0.55));
}

.bc-cov--tint i {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-style: normal;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  max-height: 76%;
  overflow: hidden;
}

.bc-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  padding: 2.5px 7px;
  border-radius: 99px;
  color: #fff;
  background: rgba(124, 74, 88, 0.92);
}

.bc-book h4 {
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bc-book p {
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* — UGC 占位（页尾轻量虚线卡） — */
.bc-ugc {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius-panel);
  padding: 13px 14px;
  background: rgba(250, 243, 233, 0.45);
  cursor: pointer;
  min-width: 0;
}

.bc-ugc-pen {
  width: 34px;
  height: 34px;
  border-radius: 16px;
  background: var(--rose-soft);
  border: 1px solid rgba(176, 133, 147, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  color: var(--wine);
  font-size: 16px;
  flex: none;
}

.bc-ugc-body {
  min-width: 0;
  display: block;
}

.bc-ugc-body b {
  display: block;
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.bc-ugc-body i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.bc-ugc-go {
  margin-left: auto;
  font-size: 12px;
  color: var(--wine);
  flex: none;
}

/* ═══ 书籍详情页（md-*；蓝本 detail-final） ═══ */

.mdetail { padding-bottom: 10px; }

.md-head {
  display: flex;
  gap: 16px;
  min-width: 0;
}

.md-cov,
img.md-cov {
  width: 112px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  flex: none;
  box-shadow: 0 10px 24px rgba(58, 42, 48, 0.22);
}

.md-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.md-title {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.04em;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.md-by {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 5px;
}

.md-by b {
  color: var(--gold-deep);
  font-weight: 500;
}

.md-tags {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.md-tag {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  background: rgba(253, 250, 244, 0.55);
}

.md-stats {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11.5px;
  color: var(--ink-faint);
  flex-wrap: wrap;
}

.md-stats b {
  color: var(--wine);
  font-weight: 500;
}

.md-hook {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 2px solid var(--gold-faint);
  background: rgba(253, 250, 244, 0.55);
  border-radius: 0 12px 12px 0;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.md-cta {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.md-enter {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: #fff;
  background: var(--wine);
  border: 0;
  border-radius: 99px;
  padding: 12px;
  cursor: pointer;
}

.md-enter:active { background: var(--wine-deep); }

.md-like,
.md-save {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: rgba(253, 250, 244, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
}

.md-like svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.6;
  overflow: visible;
  transition: fill 160ms ease, stroke 160ms ease, transform 160ms ease;
}

.md-like.is-on { border-color: rgba(176, 133, 147, 0.45); }

.md-like.is-on svg {
  fill: var(--rose);
  stroke: var(--rose);
  transform: scale(1.08);
}

.md-save svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.8;
  transition: fill 160ms ease, stroke 160ms ease;
}

.md-save.is-on { border-color: rgba(181, 145, 90, 0.5); }

.md-save.is-on svg {
  fill: var(--gold);
  stroke: var(--gold-deep);
}

.md-sect { margin: 26px 0 4px; }

.md-comments { min-height: 40px; }

.md-comment {
  padding: 13px 2px;
  border-bottom: 1px solid var(--hairline);
}

.md-comment-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.md-comment-who {
  font-size: 12px;
  color: var(--wine);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.md-comment-when {
  font-size: 10.5px;
  color: var(--ink-faint);
  flex: none;
}

.md-comment p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink);
  margin-top: 5px;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.md-comment-ops {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.md-report {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 10.5px;
  color: var(--ink-faint);
  cursor: pointer;
}

.md-report:active { color: var(--wine); }

.md-saybar {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.md-saybox {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--hairline);
  border-radius: 99px;
  background: rgba(253, 250, 244, 0.6);
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
}

.md-saybox::placeholder { color: var(--ink-faint); }

.md-send {
  flex: none;
  border: 1px solid rgba(124, 74, 88, 0.35);
  background: var(--rose-soft);
  color: var(--wine);
  font-size: 12.5px;
  border-radius: 99px;
  padding: 10px 18px;
  cursor: pointer;
}

.md-needname {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--gold-deep);
  cursor: pointer;
}

/* — 夜色适配：磨砂浅色面换暗面（变量已换色，这里只调白底残留） — */
html.night .bc-search,
html.night .bc-chip,
html.night .md-tag,
html.night .md-like,
html.night .md-save,
html.night .md-saybox {
  background: rgba(38, 34, 50, 0.6);
}

html.night .bc-hero {
  background: linear-gradient(125deg, rgba(181, 145, 90, 0.12), rgba(38, 34, 50, 0.55));
}

html.night .bc-ugc { background: rgba(38, 34, 50, 0.45); }

html.night .md-hook,
html.night .bc-cov--tint {
  background-image: linear-gradient(165deg, rgba(38, 34, 50, 0.85), rgba(32, 29, 43, 0.6));
}

html.night .bc-hero-enter,
html.night .md-enter { color: var(--paper); }

/* ───── 自由探索门厅（DECISIONS 2026-06-11）：两窗选择屏 ───── */
.hub-doors {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 2px 18px;
}

.hub-worlds {
  margin: 0 0 14px;
  padding: 15px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--glass);
}

.hub-worlds-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.hub-worlds-head p,
.hub-worlds-head span {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.hub-worlds-head p {
  font-weight: 700;
  color: var(--wine);
}

.hub-world-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-inner);
  background: var(--surface);
  text-align: left;
}

.hub-world-row + .hub-world-row {
  margin-top: 8px;
}

.hub-world-row strong,
.hub-world-row em,
.hub-world-row i {
  display: block;
  font-style: normal;
}

.hub-world-row strong {
  font-size: 14px;
  color: var(--ink);
}

.hub-world-row em {
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-faint);
}

.hub-world-row i {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--wine);
}

.hub-world-row.is-current {
  border-color: rgba(124, 74, 88, 0.35);
  background: rgba(124, 74, 88, 0.08);
}

.hub-door {
  display: block;
  width: 100%;
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 24px 22px 22px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--glass-strong);
  box-shadow: var(--shadow-low);
  transition: transform 160ms var(--ease-out), border-color 160ms ease;
}

.hub-door::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
}

.hub-door--custom::before {
  background: linear-gradient(90deg, transparent, var(--sage), transparent);
}

.hub-door--market::before {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hub-door--shelf::before {
  background: linear-gradient(90deg, transparent, var(--wine), transparent);
}

.hub-door:active {
  transform: scale(0.985);
  border-color: var(--rose);
}

.hub-door-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
}

.hub-door h3 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.hub-door-sub {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* ─── 批 J（2026-06-12）：三入口并行会话 UI ───
   ① 聊天页左上角「←」退出（复用 explore-back 视觉，缩进顶栏尺度）
   ② 顶部条「模式切换」三选浮层（当前高亮，零确认）
   ③ 入口屏「进行中状态卡」状态行 */

.chat-exit-btn {
  width: 34px;
  height: 34px;
  font-size: 15px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.chat-exit-btn[hidden] {
  display: none !important;
}

.mode-switch-pop {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -2px 0 8px;
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-inner);
  background: var(--surface);
}

.mode-switch-pop[hidden] {
  display: none !important;
}

.mode-switch-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.mode-switch-option strong {
  font-weight: 500;
  color: var(--ink);
}

.mode-switch-option em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.mode-switch-option:active {
  border-color: var(--hairline-strong);
}

.mode-switch-option.is-current {
  border-color: var(--hairline-strong);
  background: rgba(124, 74, 88, 0.1);
}

.mode-switch-option.is-current strong {
  color: var(--sage-deep);
}

.mode-card-ongoing {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--sage-deep);
  opacity: 0.85;
}

/* 顶区紧凑化：AI 提示 chip 间距收紧、字号 -1 */
.session-notice-bubble { margin: 2px auto 4px; }
.session-notice-bubble p { font-size: 11px; }

/* ─── 批 H（2026-06-12）：创世双轨（简易一句话 / 硬核设定工坊） ───
   像素蓝本 prototype/genesis-dual-2026-06-12/easy.html + pro.html；
   颜色一律走主题变量，日间纸色 / 夜间墨色随 html.night 切换。 */

.genesis-mode {
  display: flex;
  gap: 8px;
  margin: 4px 0 6px;
}

.genesis-mode-tab {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  padding: 8px;
  border-radius: 13px;
  border: 1px solid var(--hairline);
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.genesis-mode-tab.is-on {
  color: var(--ink);
  border-color: var(--rose);
  background: var(--rose-soft);
}

.genesis-mode-tab--pro.is-on {
  border-color: var(--gold-faint);
  background: rgba(211, 168, 104, 0.1);
}

.genesis-q {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 18px 0 10px;
}

.genesis-q small {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin-top: 4px;
}

.genesis-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genesis-chip {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.genesis-chip.is-on {
  color: var(--ink);
  border-color: var(--rose);
  background: var(--rose-soft);
  font-weight: 500;
}

.genesis-chip--sk {
  font-size: 11.5px;
  padding: 5px 11px;
}

.genesis-talk {
  position: relative;
  margin-top: 10px;
}

.genesis-line {
  width: 100%;
  min-height: 108px;
  box-sizing: border-box;
  border: 1px solid var(--hairline-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.9;
  padding: 14px 14px 36px;
  resize: none;
  outline: none;
}

.genesis-line:focus { border-color: var(--wine); }
.genesis-line::placeholder { color: var(--ink-faint); }

.genesis-dice {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11.5px;
  color: var(--gold);
  border: 1px solid var(--gold-faint);
  border-radius: 11px;
  padding: 4px 11px;
  background: rgba(211, 168, 104, 0.07);
  cursor: pointer;
}

.genesis-examples {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.genesis-ex {
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.7;
  margin: 0;
}

.genesis-cta {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.genesis-go {
  text-align: center;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: #f7ecdf;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  border: none;
  border-radius: 16px;
  padding: 13px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(93, 54, 66, 0.26);
  transition: opacity 160ms ease, transform 150ms ease;
}

html.night .genesis-go { color: #1d1320; }

.genesis-go:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.genesis-go:not(:disabled):active { transform: scale(0.975); }

.genesis-alt {
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0;
}

.genesis-alt b {
  font-weight: 400;
  color: var(--gold);
  border-bottom: 1px solid var(--gold-faint);
  padding-bottom: 1px;
}

.genesis-row {
  display: flex;
  gap: 10px;
}

.genesis-soft {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  border-radius: 13px;
  padding: 11px 0;
  background: none;
  cursor: pointer;
}

.genesis-soft:disabled { opacity: 0.5; cursor: default; }

.genesis-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0 18px;
}

.genesis-lead {
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.8;
  margin: 12px 0 14px;
}

.genesis-lead b {
  font-weight: 400;
  color: var(--gold);
}

.genesis-group {
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--gold);
  margin: 18px 0 8px;
}

.genesis-field {
  margin-bottom: 10px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 13px;
}

.genesis-field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.genesis-field label,
.genesis-field-head label {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  line-height: 1.5;
  margin: 0;
}

.genesis-opt {
  font-size: 10px;
  color: var(--ink-faint);
  margin-left: 6px;
}

.genesis-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.7;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  resize: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

.genesis-input::placeholder { color: var(--ink-faint); }

textarea.genesis-input {
  min-height: auto;
  max-height: none;
}

.genesis-ai {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--gold);
  border: 1px solid var(--gold-faint);
  border-radius: 9px;
  padding: 2.5px 9px;
  background: rgba(211, 168, 104, 0.06);
  cursor: pointer;
  line-height: 1.4;
}

.genesis-ai:disabled { opacity: 0.45; cursor: default; }

.genesis-preview {
  margin-top: 18px;
  border: 1px dashed var(--hairline-strong);
  border-radius: 16px;
  padding: 13px 14px;
  background:
    linear-gradient(135deg, var(--genesis-tint, transparent), transparent 62%),
    var(--surface);
}

.genesis-preview-kicker {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--ink-faint);
  margin: 0 0 7px;
}

.genesis-preview h4 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.genesis-preview p {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 5px 0 0;
  line-height: 1.8;
}

.genesis-preview-meta { color: var(--ink-faint); }

.genesis-preview--main { margin-top: 14px; }

.genesis-recap {
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.genesis-recap div { display: flex; gap: 10px; }

.genesis-recap dt {
  flex: 0 0 34px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  padding-top: 2px;
}

.genesis-recap dd {
  flex: 1;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.genesis-cta--pro {
  flex-direction: row;
  align-items: stretch;
  margin-top: 18px;
}

.genesis-cta--pro .genesis-go { flex: 1; }

.genesis-save {
  width: 110px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  border-radius: 99px;
  padding: 13px 0;
  background: none;
  cursor: pointer;
}

/* ── 第四入口占位：直接和 A 对话（即将开放，2026-06-12 预备工作） ── */
.mode-card--direct {
  background:
    radial-gradient(120% 120% at 88% 0%, rgba(124, 74, 88, 0.14), transparent 54%),
    linear-gradient(160deg, #f4eef1, #ece2e7);
  border-color: rgba(124, 74, 88, 0.26);
  color: #463038;
  min-height: 118px;
}

.mode-card--direct .mode-card-kicker {
  color: var(--wine);
}

.mode-card--direct .mode-card-title {
  color: #3d2a32;
}

.mode-card--direct .mode-card-sub {
  color: rgba(70, 48, 56, 0.62);
}

.mode-card--direct .mode-card-cue {
  color: rgba(124, 74, 88, 0.6);
}

.mode-card.is-coming-soon {
  cursor: default;
  opacity: 0.86;
}

.mode-card.is-coming-soon:active {
  transform: none;
}

.mode-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  border: 1px solid rgba(124, 74, 88, 0.32);
  border-radius: 99px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--wine);
  background: rgba(255, 255, 255, 0.55);
}

html.night .mode-card--direct {
  background:
    radial-gradient(120% 110% at 88% 10%, rgba(176, 133, 147, 0.16), transparent 52%),
    linear-gradient(155deg, #242028, #161318);
  border-color: rgba(176, 133, 147, 0.28);
  color: #e6d8de;
}

html.night .mode-card--direct .mode-card-kicker,
html.night .mode-card--direct .mode-card-cue {
  color: #c9a3af;
}

html.night .mode-card--direct .mode-card-title {
  color: #eddfe5;
}

html.night .mode-card--direct .mode-card-sub {
  color: rgba(230, 216, 222, 0.6);
}

html.night .mode-card-badge {
  border-color: rgba(201, 163, 175, 0.4);
  color: #c9a3af;
  background: rgba(22, 19, 24, 0.5);
}

/* ── 直连 A · 一对一私信屏（第四入口实装，2026-06-12；flag 关闸时不可达） ── */
.splash-inner.splash-inner--direct {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: hidden;
}

.direct-sysnote {
  flex: none;
  margin: 10px 6px 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.8;
  color: var(--ink-faint);
}

.direct-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px 4px 14px;
}

.direct-ts {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 2px 0;
}

.direct-empty {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 38px;
  line-height: 1.9;
}

.direct-scroll .bubble {
  margin: 0;
}

.direct-scroll .bubble.user {
  justify-self: end;
}

.direct-pic {
  width: 148px;
  height: 198px;
  border: 1px solid var(--hairline);
  border-radius: 3px 16px 16px 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.direct-pic--user {
  justify-self: end;
  border-radius: 16px 3px 16px 16px;
  border-color: rgba(176, 133, 147, 0.32);
}

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

.direct-pic.is-broken {
  display: flex;
  align-items: center;
  justify-content: center;
}

.direct-pic.is-broken::after {
  content: "图片走丢了";
  font-size: 11px;
  color: var(--ink-faint);
}

.direct-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.direct-voice svg {
  width: 15px;
  height: 18px;
  fill: none;
  stroke: var(--wine);
  stroke-width: 1.8;
  stroke-linecap: round;
  flex: none;
}

.direct-voice.user {
  flex-direction: row-reverse;
}

.direct-voice em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.direct-voice.is-playing svg {
  stroke: var(--rose);
  animation: directVoicePulse 900ms ease-in-out infinite;
}

@keyframes directVoicePulse {
  50% {
    opacity: 0.45;
  }
}

.direct-composer {
  flex: none;
  display: grid;
  grid-template-columns: 40px 1fr 44px;
  align-items: end;
  gap: 8px;
  padding: 9px 2px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: transparent;
}

.direct-cbtn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: rgba(var(--veil-rgb), 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.direct-cbtn svg {
  width: 18px;
  height: 18px;
  stroke: var(--wine);
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.direct-cbtn.is-recording {
  border-color: var(--wine);
  box-shadow: 0 0 0 4px rgba(124, 74, 88, 0.16);
  animation: directVoicePulse 1100ms ease-in-out infinite;
}

.direct-field {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: rgba(236, 226, 210, 0.5);
  padding: 4px 6px 4px 14px;
}

.direct-field textarea {
  flex: 1;
  border: none;
  background: none;
  resize: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  padding: 6px 0;
  max-height: 120px;
  outline: none;
}

.direct-field textarea::placeholder {
  color: var(--ink-faint);
}

.direct-imgbtn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.direct-imgbtn svg {
  width: 17px;
  height: 17px;
  stroke: var(--ink-soft);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.direct-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--wine);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-low);
}

.direct-send svg {
  width: 18px;
  height: 18px;
  stroke: #f7ecef;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.night .direct-field {
  background: rgba(34, 30, 38, 0.6);
}

html.night .direct-cbtn {
  background: rgba(34, 30, 38, 0.6);
}

html.night .direct-voice svg {
  stroke: var(--rose);
}
