:root {
  --rose: #e8b4b8;
  --rose-deep: #c97b84;
  --cream: #fff8f3;
  --ink: #3a2f32;
  --ink-soft: #6b5e62;
  --card: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 50px rgba(58, 47, 50, 0.12);
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", "Songti SC", serif;
  color: var(--ink);
  background: var(--cream);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("/hearts-bg.svg"),
    radial-gradient(
      1200px 600px at 10% -10%,
      rgba(232, 180, 184, 0.45),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 90% 10%,
      rgba(255, 220, 200, 0.55),
      transparent 55%
    ),
    linear-gradient(180deg, #fff8f3, #fdeee8);
  background-size: 120px 120px, auto, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-position: 0 0, center, center, center;
}

.heart-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.heart-decor img {
  position: absolute;
  width: 30px;
  height: 30px;
  object-fit: contain;
  opacity: 0.5;
  will-change: transform;
}

.heart-decor[data-mode="relaxed"] img {
  opacity: 0.32;
}

/* 窄屏宽松落点时，标题区可能靠近装饰心形 */
body.hearts-near-hero .hero h1,
body.hearts-near-hero .hero .lede {
  text-shadow:
    0 0 14px rgba(255, 248, 243, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.75);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 600;
  color: var(--ink);
}

.lede {
  margin: 0 auto;
  max-width: 52ch;
  line-height: 1.7;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.chat {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 20px;
}

.log {
  min-height: 200px;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding: 8px 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bubble {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.65;
  font-size: 1.05rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #f9e3e5, #fce8e0);
  border: 1px solid rgba(201, 123, 132, 0.25);
}

.bubble.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(232, 180, 184, 0.35);
}

.bubble .label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--rose-deep);
  margin-bottom: 6px;
  opacity: 0.9;
}

.bubble.pending {
  opacity: 0.75;
}

.composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(58, 47, 50, 0.12);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer textarea:focus {
  border-color: rgba(201, 123, 132, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.35);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  align-items: center;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--rose-deep), #b5656e);
  color: #fff;
  box-shadow: 0 10px 24px rgba(181, 101, 110, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease;
}

button:hover {
  filter: brightness(1.03);
}

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

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(58, 47, 50, 0.18);
  box-shadow: none;
}

button.mic-btn.is-listening {
  color: var(--rose-deep);
  border-color: rgba(201, 123, 132, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.35);
}

.foot {
  margin-top: 28px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.foot code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(58, 47, 50, 0.08);
}

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

.err {
  color: #a33;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(163, 51, 51, 0.08);
  border: 1px solid rgba(163, 51, 51, 0.2);
}
