/* =========================================================
   潮汐 TIDE · 情绪舒缓开始页
   背景为原始设计稿（仅移除右上角「登录」），
   新增内容均为半透明轻量浮层。
   ========================================================= */

:root {
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --ink: #123f5c;
  --ink-2: #1f4f6c;
  --ink-3: #5f8399;
  --ink-4: #7c9caf;
  --line: rgba(18, 63, 92, .12);
  --line-light: rgba(255, 255, 255, .55);
  --accent: #2c6a90;
  --accent-deep: #1f5578;
  --sea: #276897;
  --sea-deep: #1b4a6c;
  --glass-hi: rgba(255, 255, 255, .50);
  --glass-lo: rgba(240, 250, 255, .22);
  --poster-h: 62.5vw;
  --radius: 22px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--sea);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.locked { overflow: hidden; }

button, input, textarea { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }

::selection { background: rgba(90, 150, 185, .28); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .9);
  outline-offset: 3px;
}

/* ---------- 画布与背景 ---------- */

.canvas {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: clip;
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(255, 255, 255, .10), transparent 62%),
    radial-gradient(70% 40% at 12% 62%, rgba(146, 205, 235, .22), transparent 72%),
    radial-gradient(80% 46% at 88% 78%, rgba(126, 190, 222, .16), transparent 74%),
    linear-gradient(180deg, #2a6a97 0%, #276897 16%, #245f88 52%, #1d4f73 100%);
}

.poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--poster-h);
  background-color: var(--sea);
  background-image: image-set(
    url("../assets/bg-tide.webp") type("image/webp"),
    url("../assets/bg-tide.jpg") type("image/jpeg")
  );
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
  z-index: 0;
  pointer-events: none;
}

/* ---------- 手机端轻量页头 ---------- */

.mobile-head {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
  color: #174c6b;
}

.m-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.m-brand .mark { width: 30px; height: 30px; }

.m-brand-cn {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .06em;
}

.m-brand-en {
  margin-top: 3px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .26em;
  opacity: .58;
}

.m-record {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .66);
  box-shadow: 0 8px 22px rgba(19, 65, 94, .12);
  color: #1d587c;
  font-size: 12px;
  letter-spacing: .03em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background .25s var(--ease), transform .25s var(--ease);
}

.m-record svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.m-record:hover { background: rgba(255, 255, 255, .88); }
.m-record:active { transform: scale(.97); }

/* ---------- 内容层 ---------- */

.ui {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: calc(var(--poster-h) - 28px) 16px calc(42px + env(safe-area-inset-bottom));
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.glass {
  position: relative;
  border: 1px solid var(--line-light);
  border-radius: 24px;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, .44) 0%, rgba(248, 253, 255, .26) 42%, rgba(226, 246, 255, .14) 100%),
    rgba(186, 223, 242, .18);
  box-shadow:
    0 26px 64px rgba(9, 42, 66, .26),
    0 4px 14px rgba(9, 42, 66, .10),
    inset 0 1px 0 rgba(255, 255, 255, .68);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  backdrop-filter: blur(22px) saturate(1.18);
  color: var(--ink);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 28%);
  opacity: .6;
}

/* ---------- 聊天区 ---------- */

.chat {
  display: flex;
  flex-direction: column;
  height: clamp(470px, 66vh, 600px);
  padding: 18px 16px 14px;
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 13px;
  border-bottom: 1px solid var(--line);
}

.chat-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #306f94;
  background: rgba(255, 255, 255, .56);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 4px 12px rgba(20, 66, 94, .08);
}

.chat-avatar svg { width: 30px; height: 30px; }

.chat-id { min-width: 0; }

.chat-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: .06em;
  color: #103e5b;
}

.chat-sub {
  margin: 3px 0 0;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: #4c7790;
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .34);
  font-size: 10px;
  letter-spacing: .05em;
  color: #2d6a8d;
  white-space: nowrap;
}

.chat-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #53ad91;
  box-shadow: 0 0 0 3px rgba(83, 173, 145, .16);
  animation: pulseDot 2.8s ease-in-out infinite;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 2px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 63, 92, .22) transparent;
}

.chat-scroll::-webkit-scrollbar { width: 5px; }
.chat-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(18, 63, 92, .18);
}

.msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bubble {
  max-width: 92%;
  padding: 10px 13px;
  border-radius: 4px 16px 16px 16px;
  border: 1px solid rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .56);
  box-shadow: 0 7px 18px rgba(17, 58, 84, .06);
  font-size: 13.8px;
  line-height: 1.85;
  letter-spacing: .01em;
  color: #1b4a68;
  overflow-wrap: anywhere;
  animation: msgIn .45s var(--ease) both;
}

.bubble p { margin: 0; }
.bubble p + p { margin-top: 5px; }

.msg.user { justify-content: flex-end; }

.msg.user .bubble {
  border-radius: 16px 4px 16px 16px;
  border-color: rgba(255, 255, 255, .18);
  background: #2f6e94;
  box-shadow: 0 10px 24px rgba(15, 52, 78, .20);
  color: #f7fcff;
}

.msg.typing .bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 14px;
}

.msg.typing .bubble i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5d8ba4;
  animation: typingDot 1.3s ease-in-out infinite;
}

.msg.typing .bubble i:nth-child(2) { animation-delay: .16s; }
.msg.typing .bubble i:nth-child(3) { animation-delay: .32s; }

.chat-whisper {
  margin: auto 0;
  padding: 8px 0;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .14em;
  text-align: center;
  color: rgba(44, 91, 120, .54);
}

.chat-whisper::before,
.chat-whisper::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 1px;
  margin: 0 10px;
  vertical-align: middle;
  background: rgba(44, 91, 120, .22);
}

.starters {
  margin-top: 0;
  padding-top: 4px;
}

.starter-label {
  margin: 0 0 8px;
  font-size: 10.5px;
  letter-spacing: .05em;
  color: #3f6f8b;
}

.starter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.starter {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .40);
  color: #285f80;
  font-size: 11.5px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .25s var(--ease), transform .2s var(--ease);
}

.starter:hover { background: rgba(255, 255, 255, .66); }
.starter:active { transform: scale(.97); }

.composer {
  flex: none;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}

.input-row { display: flex; gap: 8px; }

.input-row input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .66);
  background: rgba(255, 255, 255, .54);
  box-shadow: inset 0 1px 2px rgba(18, 63, 92, .04);
  color: #123f5c;
  font-size: 13.5px;
  letter-spacing: .01em;
  outline: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}

.input-row input::placeholder { color: #587f95; }

.input-row input:focus {
  border-color: rgba(44, 106, 144, .45);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 0 0 3px rgba(44, 106, 144, .11), inset 0 1px 2px rgba(18, 63, 92, .03);
}

.send-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #2c6a90;
  color: #f6fcff;
  cursor: pointer;
  box-shadow: 0 9px 20px rgba(18, 63, 92, .22);
  transition: background .25s var(--ease), transform .2s var(--ease), opacity .2s;
}

.send-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-btn:hover { background: #245b7d; transform: translateY(-1px); }
.send-btn:active { transform: translateY(0) scale(.97); }
.send-btn:disabled { opacity: .45; cursor: default; transform: none; }

.quiet-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px auto 0;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #245b7d;
  font-size: 11.5px;
  letter-spacing: .03em;
  cursor: pointer;
  opacity: .95;
  transition: background .25s var(--ease), opacity .25s var(--ease);
}

.quiet-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.quiet-btn:hover { background: rgba(255, 255, 255, .36); opacity: 1; }

/* ---------- 「它眼中的你」 ---------- */

.side {
  display: flex;
  flex-direction: column;
  padding: 18px 16px 12px;
}

.side-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 13px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .24em;
  color: #4f7d96;
}

.side-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .06em;
  color: #103e5b;
}

.record-entry {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .70);
  background: rgba(255, 255, 255, .50);
  box-shadow: 0 5px 14px rgba(18, 63, 92, .07);
  color: #1f587b;
  font-size: 11px;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .25s var(--ease), transform .2s var(--ease);
}

.record-entry svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.record-entry:hover { background: rgba(255, 255, 255, .74); }
.record-entry:active { transform: scale(.97); }

.side-scroll {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 14px 2px 10px;
  min-height: 0;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.block-head h3 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #3c6d8a;
}

.block-meta {
  font-size: 9.5px;
  letter-spacing: .02em;
  color: #557d93;
  white-space: nowrap;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mood-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 9px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .58);
  background:
    linear-gradient(158deg, rgba(255, 255, 255, .56), rgba(255, 255, 255, .26)),
    var(--mood-soft, rgba(255, 255, 255, .2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
  overflow: hidden;
}

.mood-card::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mood, #9dc6da);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .26);
}

.mood-emoji {
  font-size: 17px;
  line-height: 1.25;
}

.mood-name {
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #1c4d6b;
}

.mood-date {
  padding-right: 15px;
  font-size: 9.5px;
  letter-spacing: .02em;
  color: #6f93a8;
}

/* 删除单条记录：极轻的半透明 ×，落在右下角，不抢视觉 */
.mood-del {
  position: absolute;
  right: 2px;
  bottom: 1px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #3f7fa6;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  opacity: .34;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .18s ease, background-color .18s ease, color .18s ease;
}

.mood-del:hover,
.mood-del:focus-visible {
  opacity: .92;
  background: rgba(255, 255, 255, .62);
  color: #17435e;
  outline: none;
}

.mood-del:focus-visible {
  box-shadow: 0 0 0 2px rgba(63, 127, 166, .32);
}

.mood-del:active {
  transform: scale(.92);
}

@media (hover: none) {
  .mood-del { opacity: .46; }
}

@media (prefers-reduced-motion: reduce) {
  .mood-del { transition: none; }
}

.memory {
  position: relative;
  margin: 0;
  padding-left: 13px;
  border-left: 2px solid rgba(44, 106, 144, .26);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: .01em;
  color: #1f4c68;
}

.memory::before {
  content: "“";
  position: absolute;
  left: 6px;
  top: -8px;
  font-size: 22px;
  line-height: 1;
  color: rgba(44, 106, 144, .26);
}

.memory.is-empty {
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-3);
  border-left-color: rgba(44, 106, 144, .16);
}

.memory.is-empty::before { content: none; }

/* 「最近我们聊到」：比正文更轻一行，最多两行，不抢记忆正文的位置 */
.memory-talk {
  margin: 8px 0 0;
  padding-left: 15px;
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: .02em;
  color: #6d90a4;
  opacity: .85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trend { width: 100%; }

.trend-plot {
  position: relative;
  width: 100%;
  aspect-ratio: 320 / 132;
}

.trend-plot svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trend-emoji {
  position: absolute;
  transform: translate(-50%, -96%);
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, .45));
}

.trend-date {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 9.5px;
  letter-spacing: .02em;
  color: #2f5d7a;
  white-space: nowrap;
}

.trend-empty {
  padding: 16px 0 8px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--ink-3);
}

.side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 10px 2px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: .02em;
  color: #356b88;
}

.storage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.storage span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4eab90;
  box-shadow: 0 0 0 3px rgba(78, 171, 144, .14);
}

.dot.preview {
  background: #d0a05e;
  box-shadow: 0 0 0 3px rgba(208, 160, 94, .16);
}

.link-btn {
  flex: none;
  padding: 2px;
  border: 0;
  background: none;
  color: #2f6484;
  font-size: 10px;
  letter-spacing: .02em;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(47, 100, 132, .38);
  cursor: pointer;
}

.link-btn:hover { color: #245b7d; }

/* ---------- 背景热区（仅桌面） ---------- */

.hotspot,
.poster-cta,
.poster-learn {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 3;
  border-radius: 12px;
  transition: background .25s var(--ease), box-shadow .25s var(--ease);
}

.hotspot { display: none; }

.hotspot:hover {
  background: rgba(255, 255, 255, .10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .30);
}

.hotspot:focus-visible,
.poster-cta:focus-visible,
.poster-learn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .9);
  outline-offset: 3px;
}

.poster-cta,
.poster-learn {
  display: block;
  top: calc(var(--poster-h) * .752);
  height: calc(var(--poster-h) * .059);
  border-radius: 999px;
}

.poster-cta { left: 37.7%; width: 13.5%; }
.poster-learn { left: 52.3%; width: 9.8%; }

.poster-cta:hover,
.poster-learn:hover {
  background: rgba(255, 255, 255, .10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .26);
}

/* ---------- 安静模式 ---------- */

.quiet-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  background:
    radial-gradient(58% 46% at 50% 50%, rgba(7, 32, 51, .48), rgba(4, 23, 40, .76) 100%);
  -webkit-backdrop-filter: blur(6px) saturate(.9);
  backdrop-filter: blur(6px) saturate(.9);
  transition: opacity 1.1s var(--ease), visibility 1.1s;
}

.quiet-layer.open { opacity: 1; visibility: visible; }

.quiet-glow {
  position: absolute;
  width: min(62vmin, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(232, 250, 255, .62) 0%, rgba(176, 226, 248, .30) 34%, rgba(130, 198, 230, .10) 56%, rgba(120, 190, 225, 0) 72%);
  filter: blur(8px);
  mix-blend-mode: screen;
  animation: breatheGlow 9s ease-in-out infinite;
}

.quiet-ring {
  position: absolute;
  width: min(46vmin, 460px);
  aspect-ratio: 1;
  border: 1px solid rgba(228, 247, 255, .16);
  border-radius: 50%;
  animation: breatheRing 9s ease-in-out infinite;
}

.quiet-ring.r2 {
  width: min(58vmin, 580px);
  border-color: rgba(228, 247, 255, .08);
  animation-delay: 1.4s;
}

.quiet-line {
  position: absolute;
  top: 63%;
  margin: 0;
  padding: 0 24px;
  font-family: var(--serif);
  font-size: clamp(23px, 3.2vw, 34px);
  font-weight: 400;
  letter-spacing: .14em;
  line-height: 1.8;
  text-align: center;
  color: #f5fcff;
  text-shadow:
    0 2px 30px rgba(4, 34, 56, .55),
    0 0 60px rgba(180, 230, 255, .32);
}

.quiet-exit {
  position: absolute;
  bottom: calc(8% + env(safe-area-inset-bottom));
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .20);
  background: rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(242, 251, 255, .62);
  font-size: 11px;
  letter-spacing: .16em;
  cursor: pointer;
  opacity: 0;
  transition: color .25s, background .25s;
}

.quiet-exit:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

/* ---------- 呼吸练习 ---------- */

.breath-layer {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  background:
    radial-gradient(62% 54% at 50% 44%, rgba(10, 46, 73, .64), rgba(3, 17, 30, .92) 100%);
  -webkit-backdrop-filter: blur(7px) saturate(.9);
  backdrop-filter: blur(7px) saturate(.9);
  color: #f4fbff;
  transition: opacity .8s var(--ease), visibility .8s;
}

.breath-layer.open { opacity: 1; visibility: visible; }

.breath-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(20px + env(safe-area-inset-top)) 26px 16px;
  font-size: 12px;
  letter-spacing: .12em;
  color: rgba(242, 251, 255, .70);
}

.breath-close {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: rgba(242, 251, 255, .82);
  font-size: 11px;
  letter-spacing: .1em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .25s;
}

.breath-close:hover { background: rgba(255, 255, 255, .13); }

/* 进呼吸层会自动聚焦「结束」，默认的白色焦点环太重，换成同一套浅蓝 */
.breath-close:focus-visible {
  outline: 2px solid rgba(190, 232, 255, .6);
  outline-offset: 2px;
}

/* 头部右侧的两个按钮：伴音在左、结束在右，间距 8px */
.breath-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 环境音切换：和「结束」同一套胶囊 + 毛玻璃，只是更安静一点 */
.breath-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: rgba(242, 251, 255, .82);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .1em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .25s, color .25s, border-color .25s;
}

.breath-audio:hover { background: rgba(255, 255, 255, .13); }

.breath-audio:focus-visible {
  outline: 2px solid rgba(190, 232, 255, .6);
  outline-offset: 2px;
}

.breath-audio.is-playing {
  border-color: rgba(190, 232, 255, .34);
  background: rgba(255, 255, 255, .1);
  color: rgba(246, 253, 255, .92);
}

/* 播放时字后面多一个很轻的呼吸点，2s 一轮 */
.breath-audio.is-playing::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: audioPulse 2s ease-in-out infinite;
}

@keyframes audioPulse {
  0%, 100% { opacity: .22; transform: scale(.86); }
  50% { opacity: .9; transform: scale(1); }
}

/* 窄屏：标题 + 两个按钮要挤在一行，把内边距收一点 */
@media (max-width: 359px) {
  .breath-head { padding-left: 16px; padding-right: 16px; }
  .breath-audio,
  .breath-close { padding: 8px 12px; letter-spacing: .06em; }
}

.breath-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(58vmin, 480px);
  aspect-ratio: 1;
}

.breath-stage::before {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176, 226, 248, .16), transparent 66%);
  filter: blur(18px);
}

.breath-orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(240, 253, 255, .86) 0%, rgba(178, 230, 252, .44) 34%, rgba(120, 190, 225, .12) 62%, rgba(120, 190, 225, 0) 74%);
  filter: blur(2px);
  box-shadow:
    0 0 90px rgba(158, 220, 248, .22),
    inset 0 0 70px rgba(210, 243, 255, .22);
  animation: breatheOrb 12s ease-in-out infinite;
}

.breath-orb i {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(232, 250, 255, .32);
}

.breath-orb i:nth-child(1) { inset: 8%; }
.breath-orb i:nth-child(2) { inset: 18%; border-color: rgba(228, 248, 255, .18); }
.breath-orb i:nth-child(3) { inset: 30%; border-color: rgba(228, 248, 255, .10); }

.breath-layer.paused .breath-orb { animation-play-state: paused; }

.breath-phase {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3.8vw, 32px);
  letter-spacing: .34em;
  text-indent: .34em;
  color: #f7fdff;
  text-shadow: 0 2px 30px rgba(3, 30, 50, .55);
}

.breath-timer {
  position: absolute;
  top: 64%;
  z-index: 2;
  margin: 0;
  font-size: 13px;
  letter-spacing: .24em;
  font-variant-numeric: tabular-nums;
  color: rgba(240, 251, 255, .68);
}

.breath-controls { margin-top: 8px; }

.breath-pause {
  padding: 10px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .30);
  background: rgba(255, 255, 255, .12);
  color: rgba(246, 253, 255, .86);
  font-size: 11px;
  letter-spacing: .16em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .25s, color .25s;
}

.breath-pause:hover { background: rgba(255, 255, 255, .20); color: #fff; }

.breath-note {
  position: absolute;
  bottom: calc(6.5% + env(safe-area-inset-bottom));
  margin: 0;
  padding: 0 24px;
  font-size: 11px;
  letter-spacing: .06em;
  text-align: center;
  color: rgba(236, 249, 255, .62);
}

/* ---------- 弹层 ---------- */

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}

.sheet-wrap.open { opacity: 1; visibility: visible; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 30, 49, .46);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 780px);
  max-height: min(88dvh, 780px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 24px 20px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, .82);
  background:
    linear-gradient(168deg, rgba(252, 254, 255, .96), rgba(238, 249, 255, .94));
  box-shadow:
    0 44px 110px rgba(5, 28, 46, .44),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  color: var(--ink);
  transform: translateY(14px) scale(.986);
  transition: transform .36s var(--ease);
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 63, 92, .2) transparent;
}

.sheet-wrap.open .sheet { transform: none; }

.sheet::-webkit-scrollbar { width: 6px; }
.sheet::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(18, 63, 92, .16); }

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.sheet-title {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #103e5b;
}

.sheet-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1px solid rgba(18, 63, 92, .12);
  background: rgba(255, 255, 255, .6);
  color: #4a7892;
  cursor: pointer;
  transition: background .25s, color .25s, transform .2s;
}

.sheet-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.sheet-close:hover { background: #fff; color: #1f4d6a; }
.sheet-close:active { transform: scale(.94); }

.sheet-body { margin-top: 14px; }

.sheet-lead {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.85;
  letter-spacing: .01em;
  color: #4c7892;
}

.field { margin-top: 16px; }
.field:first-of-type { margin-top: 0; }

.field > label,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: #48748e;
}

.field-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-inline > label { margin: 0; white-space: nowrap; }

.field-inline input {
  width: 170px;
  height: 40px;
  padding: 0 11px;
  border-radius: 11px;
  border: 1px solid rgba(24, 76, 106, .16);
  background: rgba(255, 255, 255, .72);
  color: #164a69;
  font-size: 12.5px;
  outline: none;
  color-scheme: light;
}

.field > input,
.field > textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(24, 76, 106, .16);
  background: rgba(255, 255, 255, .72);
  color: #164a69;
  font-size: 12.5px;
  line-height: 1.7;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}

.field > textarea {
  height: auto;
  min-height: 66px;
  padding: 10px 12px;
  resize: vertical;
}

.field > input::placeholder,
.field > textarea::placeholder { color: #83a1b3; }

.field > input:focus,
.field > textarea:focus,
.field-inline input:focus {
  border-color: rgba(44, 106, 144, .45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(44, 106, 144, .10);
}

.mood-picker,
.comfort-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mood-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(24, 76, 106, .14);
  background: rgba(255, 255, 255, .62);
  color: #2a5c78;
  font-size: 12px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .22s, border-color .22s, color .22s, transform .18s;
}

.mood-option span { font-size: 13px; line-height: 1; }

.mood-option:hover { background: rgba(255, 255, 255, .92); }

.mood-option.selected {
  border-color: transparent;
  background: #2b668b;
  color: #f7fcff;
  box-shadow: 0 8px 18px rgba(25, 74, 103, .22);
}

.comfort-option {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(24, 76, 106, .13);
  background: rgba(255, 255, 255, .56);
  color: #35647f;
  font-size: 11.5px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .22s, border-color .22s, color .22s;
}

.comfort-option:hover { background: rgba(255, 255, 255, .9); }

.comfort-option.selected {
  border-color: rgba(44, 106, 144, .42);
  background: rgba(207, 234, 247, .66);
  color: #1c5578;
}

.field-hint {
  margin: 7px 0 0;
  font-size: 10.5px;
  color: #b46d4d;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed rgba(24, 76, 106, .16);
}

.form-note {
  margin: 0;
  max-width: 310px;
  font-size: 9.5px;
  line-height: 1.7;
  color: #7191a3;
}

.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }

.primary-btn {
  flex: none;
  height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #245e83;
  color: #f8fdff;
  font-size: 12.5px;
  letter-spacing: .06em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(20, 62, 89, .24);
  transition: background .25s, transform .2s, opacity .2s;
}

.primary-btn:hover { background: #1d4f70; transform: translateY(-1px); }
.primary-btn:active { transform: translateY(0) scale(.98); }
.primary-btn:disabled { opacity: .55; cursor: default; transform: none; }

.practice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.practice {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(24, 76, 106, .12);
  background: rgba(255, 255, 255, .60);
  text-align: left;
  cursor: pointer;
  transition: background .22s, transform .2s, border-color .22s;
}

.practice:hover {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(44, 106, 144, .24);
  transform: translateX(2px);
}

.p-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(196, 228, 243, .48);
  color: #2a6a90;
  font-size: 17px;
}

.p-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.p-text { min-width: 0; }

.p-text b {
  display: block;
  margin-bottom: 2px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #174a69;
}

.p-text small {
  display: block;
  font-size: 10.5px;
  letter-spacing: .01em;
  color: #6d90a4;
}

.p-time {
  margin-left: auto;
  padding-left: 10px;
  font-size: 10px;
  letter-spacing: .04em;
  color: #7a9cb0;
  font-variant-numeric: tabular-nums;
}

.sheet-footnote {
  margin: 16px 0 0;
  font-size: 9.5px;
  line-height: 1.7;
  color: #83a0b1;
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.about-item {
  display: flex;
  gap: 13px;
}

.about-num {
  flex: none;
  padding-top: 2px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: .06em;
  color: #7fa3b7;
}

.about-item h4,
.about-h {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .03em;
  color: #174a69;
}

.about-item p,
.about-p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.85;
  letter-spacing: .01em;
  color: #4c7791;
}

.about-h { margin: 24px 0 8px; font-size: 15px; }

.about-p { margin-bottom: 4px; }

.about-quote {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 2px solid #9fc7da;
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, .56);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.85;
  letter-spacing: .02em;
  color: #2c5d78;
}

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 90;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(15, 52, 78, .90);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(5, 28, 46, .34);
  color: #f2fbff;
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 状态切换 ---------- */

body.quieting .composer { opacity: 0; transform: translateY(8px); pointer-events: none; }

body.quiet .layout,
body.breathing .layout {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

body.quiet .hotspot,
body.breathing .hotspot,
body.quiet .poster-cta,
body.breathing .poster-cta,
body.quiet .poster-learn,
body.breathing .poster-learn,
body.quiet .mobile-head,
body.breathing .mobile-head {
  opacity: 0;
  pointer-events: none;
}

/* ---------- 动画 ---------- */

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@keyframes typingDot {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

@keyframes pulseDot {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@keyframes breatheGlow {
  0% { transform: scale(.80); opacity: .45; }
  33% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1); opacity: .80; }
  100% { transform: scale(.80); opacity: .45; }
}

@keyframes breatheRing {
  0% { transform: scale(.86); opacity: .30; }
  33% { transform: scale(1.02); opacity: .70; }
  50% { transform: scale(1.02); opacity: .60; }
  100% { transform: scale(.86); opacity: .30; }
}

@keyframes breatheOrb {
  0% { transform: scale(.74); opacity: .55; }
  33.33% { transform: scale(1); opacity: .95; }
  50% { transform: scale(1); opacity: .90; }
  100% { transform: scale(.74); opacity: .55; }
}

@keyframes lineIn {
  from { opacity: 0; transform: translateY(10px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes softIn { to { opacity: 1; } }

/* =========================================================
   平板 / 手机横屏的小屏适配
   ========================================================= */

@media (min-width: 541px) {
  :root { --poster-h: 62.5vw; }
  .poster { height: 62.5vw; background-size: 100% auto; }
  .mobile-head { display: none; }
  .poster-cta { left: 37.7%; width: 13.5%; }
  .poster-learn { left: 52.3%; width: 9.8%; }
}

@media (max-width: 540px) {
  :root { --poster-h: 125vw; }
  .poster {
    height: 125vw;
    background-size: 200% auto;
    background-position: center top;
  }
  .poster-cta { left: 25.4%; width: 26.9%; }
  .poster-learn { left: 54.6%; width: 19.6%; }

  /* 让首屏就能看见输入框：聊天卡与海报底部轻微叠压 */
  .ui { padding-top: calc(var(--poster-h) - 64px); }
  .chat { height: 408px; }
  .chat-whisper { display: none; }
}

/* =========================================================
   桌面：1440×900 设计稿等比铺满（高度不足时只裁掉底部水纹）
   ========================================================= */

@media (min-width: 1180px) and (min-aspect-ratio: 6/5) {
  html, body { height: 100%; }

  body {
    overflow: hidden;
    background:
      linear-gradient(180deg, var(--sea) 0, var(--sea) 62.5vw, var(--sea-deep) 100%);
  }

  .canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 1440px;
    height: 900px;
    min-height: 0;
    overflow: hidden;
    transform: scale(var(--s, 1));
    transform-origin: top left;
    background: var(--sea);
  }

  .poster {
    height: 100%;
    background-size: 100% 100%;
    background-position: center center;
  }

  .ui {
    position: absolute;
    inset: 0;
    padding: 0;
  }

  .layout {
    position: absolute;
    inset: 0;
    display: block;
    max-width: none;
    margin: 0;
  }

  .chat {
    position: absolute;
    left: 32px;
    top: 108px;
    width: 356px;
    height: 584px;
    padding: 20px 18px 14px;
  }

  .side {
    position: absolute;
    right: 32px;
    top: 108px;
    width: 356px;
    height: 584px;
    padding: 20px 18px 12px;
  }

  .side-scroll {
    flex: 1;
    justify-content: space-between;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(18, 63, 92, .18) transparent;
  }

  .side-scroll::-webkit-scrollbar { width: 4px; }
  .side-scroll::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: rgba(18, 63, 92, .16);
  }

  .mobile-head { display: none; }
  .poster-cta, .poster-learn { display: none; }

  .hotspot { display: block; }

  .hs-brand { left: 42px; top: 36px; width: 178px; height: 54px; border-radius: 16px; }
  .hs-library { left: 1126px; top: 30px; width: 80px; height: 54px; }
  .hs-about { left: 1206px; top: 30px; width: 90px; height: 54px; }
  .hs-start { left: 536px; top: 664px; width: 206px; height: 78px; border-radius: 999px; }
  .hs-learn { left: 748px; top: 664px; width: 154px; height: 78px; border-radius: 999px; }
  .hs-scroll { left: 1146px; top: 802px; width: 258px; height: 52px; }

  .chat-name { font-size: 22px; }
  .chat-sub { font-size: 11px; }
  .bubble { font-size: 14.5px; }
  .input-row input { font-size: 14px; }
  .side-title { font-size: 22px; }
  .memory { font-size: 14.5px; }
  .mood-name { font-size: 13px; }
}

/* 极端窄屏 */
@media (max-width: 359px) {
  .ui { padding-left: 12px; padding-right: 12px; }
  .chat { padding-left: 13px; padding-right: 13px; }
  .side { padding-left: 13px; padding-right: 13px; }
  .chat-status { display: none; }
  .mood-card { padding: 8px 7px; }
  .mood-name { font-size: 12px; }
}

/* 降低动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .quiet-glow, .quiet-ring, .breath-orb { opacity: .7; transform: none; }
}

/* ---------- 追加：系统消息 / 空状态 / 状态动画 ---------- */

.layout { transition: opacity .7s var(--ease), transform .7s var(--ease); }

body.quiet .layout,
body.breathing .layout {
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.msg.system { justify-content: center; }

.msg.system .bubble {
  padding: 4px 12px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .28);
  box-shadow: none;
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: .03em;
  color: #5b8097;
}

.system-line { display: inline-block; }

.mood-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .24);
  color: #426f89;
  font-size: 11px;
  line-height: 1.7;
  text-align: left;
  cursor: pointer;
}

.mood-empty b {
  display: block;
  margin-bottom: 2px;
  font-size: 12.5px;
  color: #1c4d6b;
}

.trend-empty {
  margin: 0;
  padding: 14px 0 6px;
  font-size: 10.5px;
  line-height: 1.8;
  color: #5f8399;
}

.side.just-updated { animation: sidePulse 1.5s var(--ease); }

@keyframes sidePulse {
  0% {
    box-shadow: 0 26px 64px rgba(9, 42, 66, .26), 0 0 0 0 rgba(255, 255, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .62);
  }
  40% {
    box-shadow: 0 26px 64px rgba(9, 42, 66, .26), 0 0 0 8px rgba(255, 255, 255, .18), inset 0 1px 0 rgba(255, 255, 255, .62);
  }
  100% {
    box-shadow: 0 26px 64px rgba(9, 42, 66, .26), 0 0 0 0 rgba(255, 255, 255, 0), inset 0 1px 0 rgba(255, 255, 255, .62);
  }
}

.quiet-layer.open .quiet-line { animation: lineIn 2.4s var(--ease) both; }
.quiet-layer.open .quiet-exit { animation: softIn 1s 1.2s var(--ease) forwards; }

.breath-layer.finished .breath-orb {
  animation: none;
  opacity: .32;
  transform: scale(1.06);
  transition: opacity 1.4s var(--ease), transform 1.6s var(--ease);
}

.breath-layer.finished .breath-stage::before { opacity: .3; transition: opacity 1.2s; }

.mood-picker.shake { animation: shake .42s var(--ease); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  45% { transform: translateX(3px); }
  70% { transform: translateX(-2px); }
}

.sheet :focus-visible {
  outline: 2px solid rgba(44, 106, 144, .55);
  outline-offset: 2px;
}

.mobile-head,
.hotspot,
.poster-cta,
.poster-learn {
  transition: opacity .5s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .quiet-layer.open .quiet-line { animation: none; opacity: 1; }
  .quiet-layer.open .quiet-exit { animation: none; opacity: 1; }
}

/* =========================================================
   情绪气泡云（开始第一次呼吸前的拦截弹层）
   液体质感：半透明磨砂胶囊 + 各自错相位的上下浮动
   ========================================================= */

/* 阶段一：气泡云 */
.bubble-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 8px 2px 12px;
  transition: opacity .34s var(--ease), transform .34s var(--ease);
}

.bubble-cloud.is-out {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

/* display:flex 会盖掉浏览器默认的 [hidden]，这里补回来 */
.bubble-cloud[hidden] { display: none; }

.mood-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(18, 63, 92, .08);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1;
  letter-spacing: .03em;
  cursor: pointer;
  /* 用 translate 做浮动、用 scale 做悬停，两者互不覆盖 */
  translate: 0 0;
  animation: bubble-float 5.4s ease-in-out infinite;
  transition: scale .28s var(--ease), background .28s var(--ease),
              box-shadow .28s var(--ease), border-color .28s var(--ease);
}

.mood-bubble .b-emoji {
  font-size: 15px;
  line-height: 1;
}

.mood-bubble:hover,
.mood-bubble:focus-visible {
  scale: 1.06;
  background: rgba(255, 255, 255, .78);
  border-color: #fff;
  box-shadow: 0 8px 20px rgba(18, 63, 92, .14);
}

.mood-bubble:active { scale: .98; }

@keyframes bubble-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

/* 阶段二：气泡淡出，只留一句劝导（占住气泡原来的高度，卡片不会突然缩一下） */
.soothe-advice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 6px;
  text-align: center;
  animation: soothe-in .52s var(--ease) both;
}

.soothe-advice[hidden] { display: none; }

.soothe-text {
  max-width: 27em;
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
  text-align: center;
  letter-spacing: .02em;
  color: var(--ink-2);
}

.soothe-go {
  height: 42px;
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  background: #245e83;
  color: #f8fdff;
  font-size: 12.5px;
  letter-spacing: .06em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(20, 62, 89, .24);
  transition: background .25s, transform .2s;
}

.soothe-go:hover { background: #1d4f70; transform: translateY(-1px); }
.soothe-go:active { transform: translateY(0) scale(.98); }

@keyframes soothe-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* 阶段二时收起标题，只留右上角关闭，让文案独占视觉 */
.sheet.soothe-mode .sheet-head > div {
  max-height: 160px;
  opacity: 1;
  overflow: hidden;
  transition: max-height .42s var(--ease), opacity .3s var(--ease), transform .42s var(--ease);
}

.sheet.soothe-mode .sheet-title {
  font-size: 20px;
  line-height: 1.65;
  letter-spacing: .04em;
}

.sheet.soothe-mode.soothe-stage2 .sheet-head > div {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.sheet.soothe-mode.soothe-stage2 .sheet-body { margin-top: 6px; }

/* 375px 窄屏：缩一点内边距，保证一行至少能放下两个气泡 */
@media (max-width: 420px) {
  .bubble-cloud { gap: 10px; padding: 6px 0 10px; }
  .mood-bubble { padding: 9px 14px; font-size: 13px; }
  .sheet.soothe-mode .sheet-title { font-size: 17px; line-height: 1.7; }
  .soothe-text { font-size: 15.5px; line-height: 1.95; }
  .soothe-go { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mood-bubble { animation: none; }
  .soothe-advice { animation: none; }
  .bubble-cloud,
  .sheet.soothe-mode .sheet-head > div { transition: none; }
}

/* =========================================================
   悬浮点 + 点击弹出的轻聊窗
   - 聊天区移出 .layout，改为 position: fixed
   - 不锁 body 滚动：它只是一个浮窗
   - 层级：悬浮点 40 < 聊天窗 45 < 安静/呼吸 60 < 弹层 70
          < toast 90 < 危机遮罩 96
   ========================================================= */

/* 悬浮点 */
.chat-fab {
  position: fixed;
  left: 32px;
  bottom: 40px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow:
    0 10px 26px rgba(9, 42, 66, .22),
    inset 0 1px 0 rgba(255, 255, 255, .72);
  color: #1d587d;
  cursor: pointer;
  /* 浮动用 translate、放大用 scale，两者互不覆盖 */
  translate: 0 0;
  scale: 1;
  animation: fabFloat 3s ease-in-out infinite;
  transition: opacity .26s var(--ease), scale .26s var(--ease);
}

.chat-fab svg { width: 30px; height: 30px; }

.chat-fab:hover { scale: 1.08; }
.chat-fab:active { scale: .96; }

/* 展开后悬浮点淡出，不再占焦点 */
.chat-fab.is-hidden {
  opacity: 0;
  scale: .88;
  pointer-events: none;
}

@keyframes fabFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

/* 聊天窗：默认收起 */
.chat {
  position: fixed;
  left: 16px;
  right: 16px;
  top: auto;
  bottom: calc(16px + var(--kb, 0px));
  width: auto;
  max-width: 430px;
  margin-inline: auto;
  height: 70vh;
  max-height: min(600px, calc(100dvh - 24px - var(--kb, 0px)));
  z-index: 45;
  transform-origin: bottom center;
  opacity: 0;
  transform: translateY(20px) scale(.95);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .26s var(--ease), transform .32s var(--ease),
              visibility 0s linear .32s;
}

.chat.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  transition: opacity .26s var(--ease), transform .32s var(--ease),
              visibility 0s linear 0s;
}

/* 桌面：左下角浮窗，保持 356 × 584 */
@media (min-width: 1180px) and (min-aspect-ratio: 6/5) {
  .chat {
    left: 32px;
    right: auto;
    top: auto;
    bottom: 110px;
    width: 356px;
    height: 584px;
    max-width: none;
    margin-inline: 0;
    max-height: none;
  }
}

/* 手机：底部抽屉，左右留 16px */
@media (max-width: 540px) {
  .chat-fab {
    left: auto;
    right: 20px;
    bottom: calc(30px + env(safe-area-inset-bottom));
  }

  .chat {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom) + var(--kb, 0px));
    height: 70vh;
    max-height: min(600px, calc(100vh - 32px - var(--kb, 0px)));
    border-radius: 22px;
  }
}

/* 头部关闭按钮：极小、极低调 */
.chat-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: -4px -4px -4px 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #2d6a8d;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: .42;
  transition: opacity .22s var(--ease), background .22s var(--ease);
}

.chat-close:hover,
.chat-close:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, .55);
}

/* 安静 / 呼吸模式里，浮窗与悬浮点一起退场 */
body.quiet .chat,
body.quiet .chat.is-open,
body.breathing .chat,
body.breathing .chat.is-open {
  opacity: 0;
  pointer-events: none;
}

body.quiet .chat-fab,
body.breathing .chat-fab {
  opacity: 0;
  pointer-events: none;
}

/* 极窄屏：气泡贴着屏幕边 */
@media (max-width: 359px) {
  .chat { left: 12px; right: 12px; }
  .chat-fab { right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-fab { animation: none; }
}

/* =========================================================
   浮窗右侧的手记：三股水流 → 「让我们开启一段对话吧」
   - 只在桌面左侧停靠形态下出现（1180px+ / 够宽够高才有空地）
   - 纯装饰：pointer-events: none，不进 Tab 序列
   - 竖向锚点跟着浮窗顶部走：110(底) + 584(高) = 694
   ========================================================= */

.chat-note {
  position: fixed;
  left: 392px;                          /* 浮窗 left 32 + width 356 + 4 */
  top: calc(100vh - 694px + 48px);
  z-index: 44;                          /* 略低于浮窗 45，永不抢焦点 */
  display: none;
  align-items: center;
  gap: 10px;
  color: rgba(24, 74, 106, .62);         /* 这片水面是浅的，用墨色而不是白色 */
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}

.chat-note-wave {
  flex: none;
  display: block;
  width: 104px;
  height: 64px;
  overflow: visible;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, .5));
}

.chat-note-wave path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset .3s var(--ease);
}

.chat-note-wave path:nth-of-type(2) { stroke-width: 1.25; opacity: .78; }
.chat-note-wave path:nth-of-type(3) { stroke-width: 1; opacity: .55; }

.chat-note-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.95;
  letter-spacing: .14em;
  color: rgba(18, 65, 97, .88);
  text-shadow: 0 1px 10px rgba(255, 255, 255, .62);
  transform: rotate(-1.6deg) translateX(-6px);
  transform-origin: left center;
  opacity: 0;
  transition: opacity .26s var(--ease), transform .26s var(--ease);
}

/* 收起态：贴到悬浮点右上角。这里已经是深水，颜色反过来用浅色 */
.chat-note--fab {
  left: 96px;                           /* 悬浮点 left 32 + 56 + 8 */
  top: auto;
  bottom: 88px;                         /* 让开海报底部那行「已陪伴 128,000 次深呼吸」 */
  z-index: 39;                          /* 略低于悬浮点 40 */
  color: rgba(240, 250, 255, .9);
}

.chat-note--fab .chat-note-wave {
  filter: drop-shadow(0 1px 3px rgba(6, 34, 54, .45));
}

.chat-note--fab .chat-note-text {
  color: rgba(245, 252, 255, .95);
  text-shadow: 0 1px 12px rgba(6, 34, 54, .55);
}

/* 有空地的桌面才铺这一段 */
@media (min-width: 1180px) and (min-aspect-ratio: 6/5) and (min-height: 700px) {
  .chat-note { display: flex; }

  #chatPanel.is-open + .chat-note { opacity: 1; }

  #chatPanel.is-open + .chat-note .chat-note-wave path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset .7s var(--ease) .06s;
  }

  #chatPanel.is-open + .chat-note .chat-note-wave path:nth-of-type(2) {
    transition-delay: .2s;
  }

  #chatPanel.is-open + .chat-note .chat-note-wave path:nth-of-type(3) {
    transition-delay: .34s;
  }

  #chatPanel.is-open + .chat-note .chat-note-text {
    opacity: 1;
    transform: rotate(-1.6deg) translateX(0);
    transition: opacity .5s var(--ease) .46s, transform .5s var(--ease) .46s;
  }

  /* 收起态：悬浮点还在场时才出现，浮窗一开就跟着淡出 */
  #chatFab:not(.is-hidden) + .chat-note--fab { opacity: 1; }

  #chatFab:not(.is-hidden) + .chat-note--fab .chat-note-wave path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset .7s var(--ease) .06s;
  }

  #chatFab:not(.is-hidden) + .chat-note--fab .chat-note-wave path:nth-of-type(2) {
    transition-delay: .2s;
  }

  #chatFab:not(.is-hidden) + .chat-note--fab .chat-note-wave path:nth-of-type(3) {
    transition-delay: .34s;
  }

  #chatFab:not(.is-hidden) + .chat-note--fab .chat-note-text {
    opacity: 1;
    transform: rotate(-1.6deg) translateX(0);
    transition: opacity .5s var(--ease) .46s, transform .5s var(--ease) .46s;
  }
}

/* 安静 / 呼吸模式里，连这一笔也一起退场 */
body.quiet .chat-note,
body.breathing .chat-note {
  opacity: 0 !important;
  visibility: hidden;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .chat-note,
  .chat-note-wave path,
  .chat-note-text { transition: none !important; }
}

/* =========================================================
   呼吸练习的一周记录：一行小字，压在周报按钮上方
   ========================================================= */

.practice-tally {
  margin: 10px 2px 0;
  padding: 0;
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: .02em;
  color: #4f7d96;
  text-align: left;
}

.practice-tally[hidden] { display: none; }

/* =========================================================
   周报：侧栏入口（微弱水光 + 很慢的呼吸）
   - 贴在 .side-foot 上方；两个动画分工：自己呼吸 box-shadow，
     ::before 扫一道水光，互不抢 transform，hover 才敢用位移
   ========================================================= */

.weekly-report-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 12px 0 0;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid rgba(18, 63, 92, .14);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .36), rgba(214, 240, 255, .2));
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: #2f6484;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .05em;
  cursor: pointer;
  animation: weeklyBreath 5.6s ease-in-out infinite;
  transition:
    color .3s var(--ease),
    border-color .3s var(--ease),
    background .3s var(--ease),
    transform .25s var(--ease);
}

/* 一道很慢的水光从左扫到右，像潮水漫上来又退回去 */
.weekly-report-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(102deg, transparent 16%, rgba(255, 255, 255, .66) 48%, transparent 80%);
  transform: translateX(-118%);
  animation: weeklyShimmer 6.8s var(--ease) infinite;
  pointer-events: none;
}

.weekly-report-btn:hover {
  color: #1f5473;
  border-color: rgba(18, 63, 92, .24);
  background: linear-gradient(180deg, rgba(255, 255, 255, .54), rgba(210, 239, 255, .3));
  transform: translateY(-1px);
}

.weekly-report-btn:active { transform: translateY(0) scale(.994); }

.weekly-report-btn:focus-visible {
  outline: 2px solid rgba(47, 100, 132, .5);
  outline-offset: 2px;
}

@keyframes weeklyBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(90, 165, 200, 0); }
  50% { box-shadow: 0 0 0 3px rgba(90, 165, 200, .1); }
}

@keyframes weeklyShimmer {
  0% { transform: translateX(-118%); }
  44%, 100% { transform: translateX(118%); }
}

/* ---------- 弹层里的一封信 ---------- */

.weekly { padding: 24px; }

.weekly-range {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .22em;
  color: rgba(60, 110, 140, .72);
}

/* 行距拉到 2.2，一句话一行也不挤 */
.weekly-content {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 2.2;
  letter-spacing: .06em;
  color: #1b4864;
}

.weekly-content p {
  margin: 0;
  animation: weeklyIn .7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * .24s);
}

.weekly-content p + p { margin-top: 18px; }

.weekly-empty {
  color: #4c7892;
  letter-spacing: .05em;
}

.weekly-sign {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-align: right;
  color: rgba(60, 110, 140, .8);
}

.weekly-foot {
  margin: 20px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.85;
  letter-spacing: .02em;
  color: var(--ink-3);
}

/* 加载态：三个点和正文同字体，换内容时不跳字 */
.weekly-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .08em;
  color: #4c7892;
}

.weekly-loading p { margin: 0; }

.weekly-dots {
  display: inline-flex;
  gap: 4px;
}

.weekly-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .25;
  animation: weeklyDot 1.5s var(--ease) infinite;
}

.weekly-dots i:nth-child(2) { animation-delay: .18s; }
.weekly-dots i:nth-child(3) { animation-delay: .36s; }

@keyframes weeklyDot {
  0%, 100% { opacity: .22; transform: translateY(0); }
  45% { opacity: .85; transform: translateY(-3px); }
}

@keyframes weeklyIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* 手机上弹层左右本来就窄，这一层的 24px 再叠上去就成一列字了 */
@media (max-width: 540px) {
  .weekly { padding: 8px 2px 0; }
  .weekly-content { font-size: 15px; line-height: 2.15; }
}

@media (prefers-reduced-motion: reduce) {
  .weekly-report-btn,
  .weekly-report-btn::before,
  .weekly-dots i,
  .weekly-content p {
    animation: none !important;
  }
}
