/* ============================================================
   人生清醒 · H5 端样式
   与小程序 `miniprogram/app.wxss` 同一套视觉令牌：
   雾青 #6E9C93 / 暖米 #F7F4EE / 墨灰 #3E4A4A / 柔砂 #C9A98C
   设计口径：低饱和、大留白、轻字重。不引入高饱和橙红、不用阴影和渐变。
   rpx -> px 按 375 屏 1:0.5 换算；字号下限提到 12px 保证可读性。
   ============================================================ */

:root {
  --misty-teal: #6E9C93;
  --misty-teal-soft: #DCEAE6;
  --warm-rice: #F7F4EE;
  --ink-gray: #3E4A4A;
  --soft-sand: #C9A98C;
  --text-muted: #8A9696;
  --text-sub: #6E7A7A;
  --hairline: rgba(62, 74, 74, 0.12);

  --fs-caption: 12px;
  --fs-body: 14px;
  --fs-title: 17px;
  --fs-quote: 20px;

  --sp-1: 8px;
  --sp-2: 12px;
  --sp-3: 16px;
  --sp-4: 24px;
  --radius: 12px;

  --mood-steady: #A8C4B8;
  --mood-wavy: #C9A98C;
  --mood-rough: #B99A9A;
  --bar-empty: #EFECE5;

  --app-max: 480px;
  --tabbar-h: 54px;
  --dock-size: 40px;
}

* { box-sizing: border-box; }

/* hidden 属性优先于任何 display 声明。
   不加这条时，`.music-warn { display: block }` 会把 [hidden] 的 display:none 盖掉，
   导致「没出错也显示错误提示」。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--warm-rice);
  color: var(--ink-gray);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* 桌面端：底色压深一点，让手机形状的容器浮起来；移动端不显示 */
@media (min-width: 560px) {
  body { background-color: #EFEBE3; }
}

button { font: inherit; color: inherit; }

/* ============ 应用容器 ============ */
.app {
  position: relative;
  width: 100%;
  max-width: var(--app-max);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--warm-rice);
  overflow-x: hidden;
}

@media (min-width: 560px) {
  .app {
    min-height: 100vh;
    box-shadow: 0 0 0 1px var(--hairline);
  }
}

/* ============ 屏幕切换 ============ */
.screen {
  display: none;
  padding: var(--sp-2) var(--sp-2) calc(var(--sp-4) + var(--tabbar-h) + 20px + env(safe-area-inset-bottom));
  animation: screen-in 0.24s ease;
}

.screen.is-active {
  display: block;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ 问候区 ============ */
.greeting {
  display: flex;
  flex-direction: column;
  padding: var(--sp-2) var(--sp-1) var(--sp-3);
  /* 给右上角音乐圆点留出位置，避免标题被压 */
  padding-right: calc(var(--dock-size) + var(--sp-3));
}

.greeting-title {
  font-size: 21px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.2px;
  color: var(--ink-gray);
}

.greeting-sub {
  margin-top: 2px;
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

/* ============ 通用卡片 ============ */
.card {
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.section-title {
  font-size: var(--fs-title);
  font-weight: 500;
  color: var(--ink-gray);
  margin: var(--sp-3) 0 var(--sp-2);
  padding-left: var(--sp-1);
}

.muted {
  color: var(--text-muted);
  font-size: var(--fs-caption);
}

.footer-note {
  margin: var(--sp-3) 0 0;
  padding: 0 var(--sp-1);
  font-size: var(--fs-caption);
  line-height: 1.7;
  color: var(--text-muted);
  text-align: center;
}

/* ============ 按钮（克制：无阴影、无渐变） ============ */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border: 1px solid var(--misty-teal);
  border-radius: 999px;
  color: var(--ink-gray);
  background: transparent;
  font-size: var(--fs-body);
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.16s;
}

.btn-ghost:hover,
.btn-ghost:active { background: var(--misty-teal-soft); }

:focus-visible {
  outline: 2px solid var(--misty-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============ 骨架屏 ============ */
.skeleton { min-height: 96px; }

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #F1EDE6 25%, #F8F5F0 37%, #F1EDE6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  margin-bottom: 10px;
}

.skeleton-line.short { width: 55%; margin-bottom: 0; }

@keyframes shimmer {
  from { background-position: 100% 50%; }
  to   { background-position: 0 50%; }
}

/* ============================================================
   今日 · 翻卡
   ============================================================ */
.quote-card {
  background: var(--misty-teal-soft);
  border: 1px solid rgba(110, 156, 147, 0.28);
  border-radius: var(--radius);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
  cursor: pointer;
  transition: opacity 0.16s;
  -webkit-tap-highlight-color: transparent;
}

.quote-card:active { opacity: 0.72; }

.quote-label {
  font-size: var(--fs-caption);
  color: var(--text-sub);
  letter-spacing: 0.4px;
}

.quote-face {
  display: flex;
  flex-direction: column;
  margin-top: var(--sp-1);
  animation: face-in 0.3s ease;
}

@keyframes face-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quote-mark {
  font-size: 28px;
  line-height: 1;
  color: rgba(110, 156, 147, 0.55);
}

.quote-text {
  font-size: var(--fs-quote);
  line-height: 1.65;
  color: var(--ink-gray);
  letter-spacing: 0.2px;
}

.action-label {
  font-size: var(--fs-caption);
  color: var(--text-sub);
  letter-spacing: 0.4px;
}

.action-text {
  margin-top: 6px;
  font-size: var(--fs-title);
  line-height: 1.6;
  color: var(--ink-gray);
}

.quote-hint {
  margin-top: var(--sp-2);
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

/* ============================================================
   情绪温度计
   ============================================================ */
.mood-wrap {
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.mood-head {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--sp-2);
}

.mood-title {
  font-size: var(--fs-body);
  color: var(--ink-gray);
}

.mood-note {
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

.mood-row {
  display: flex;
  gap: var(--sp-1);
}

.mood-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #FFFFFF;
  cursor: pointer;
  transition: background-color 0.16s, border-color 0.16s;
  -webkit-tap-highlight-color: transparent;
}

.mood-item:hover { background: #FBFAF7; }
.mood-item:active { background: var(--misty-teal-soft); }

.mood-item.selected {
  background: var(--misty-teal-soft);
  border-color: var(--misty-teal);
}

.mood-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: transform 0.16s;
}

.mood-item.selected .mood-dot { transform: scale(1.18); }

.tone-steady .mood-dot { background: var(--mood-steady); }
.tone-wavy .mood-dot { background: var(--mood-wavy); }
.tone-rough .mood-dot { background: var(--mood-rough); }

.mood-label {
  font-size: var(--fs-caption);
  line-height: 1.4;
  color: var(--ink-gray);
  text-align: center;
}

.mood-reply {
  margin-top: var(--sp-2);
  padding: 10px var(--sp-2);
  background: var(--warm-rice);
  border-radius: 10px;
  font-size: var(--fs-caption);
  line-height: 1.65;
  color: var(--text-sub);
  animation: face-in 0.3s ease;
}

/* ============================================================
   呼吸引导
   ============================================================ */
.breath-wrap {
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.breath-head {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--sp-2);
}

.breath-title { font-size: var(--fs-body); color: var(--ink-gray); }
.breath-note { font-size: var(--fs-caption); color: var(--text-muted); }

.breath-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
}

.breath-circle {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid rgba(110, 156, 147, 0.5);
  background: var(--misty-teal-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.86);
  transition: transform 1s ease;
}

/* 吸气放大 / 停一下保持 / 呼气缩小；节奏 4s-2s-6s 与小程序一致 */
.breath-circle.phase-inhale { transform: scale(1.16); transition-duration: 4000ms; }
.breath-circle.phase-hold   { transform: scale(1.16); transition-duration: 2000ms; }
.breath-circle.phase-exhale { transform: scale(0.86); transition-duration: 6000ms; }

.breath-phase {
  font-size: var(--fs-caption);
  color: var(--text-sub);
  letter-spacing: 1px;
}

.breath-done {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sp-2);
  text-align: center;
}

.breath-done-text {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text-sub);
}

.breath-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}

.breath-count { font-size: var(--fs-caption); color: var(--text-muted); }

.breath-btn {
  padding: 7px 18px;
  border: 1px solid var(--misty-teal);
  border-radius: 999px;
  font-size: var(--fs-body);
  color: var(--ink-gray);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.16s;
}

.breath-btn:hover,
.breath-btn:active { background: var(--misty-teal-soft); }

/* ============================================================
   入口卡（今日 -> 练习）
   ============================================================ */
.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  cursor: pointer;
  transition: opacity 0.16s;
}

.link-card:active { opacity: 0.68; }

.link-main { display: flex; flex-direction: column; }
.link-title { font-size: var(--fs-body); color: var(--ink-gray); }
.link-desc { font-size: var(--fs-caption); color: var(--text-muted); margin-top: 2px; }
.link-arrow { font-size: var(--fs-body); color: var(--text-muted); }

/* ============================================================
   练习 · 念头记录
   ============================================================ */
.thought-input {
  width: 100%;
  min-height: 88px;
  padding: 10px var(--sp-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #FCFBF8;
  color: var(--ink-gray);
  font-family: inherit;
  font-size: var(--fs-body);
  line-height: 1.75;
  resize: vertical;
}

.thought-input::placeholder { color: #B3BBBB; }

.thought-input:focus {
  outline: none;
  border-color: var(--misty-teal);
  background: #FFFFFF;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: 10px;
}

.save-btn {
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--misty-teal-soft);
  color: var(--ink-gray);
  font-size: var(--fs-body);
  cursor: pointer;
  transition: background-color 0.16s;
}

.save-btn:hover { background: #CFE2DD; }
.save-btn:active { background: #C4DBD5; }

.record { display: flex; flex-direction: column; }

.record-text {
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink-gray);
  white-space: pre-wrap;
  word-break: break-word;
}

.record-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-1);
}

.remove {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
}

.remove:hover { color: var(--ink-gray); }

.empty { text-align: center; }

.empty-text {
  font-size: var(--fs-caption);
  line-height: 1.7;
  color: var(--text-muted);
}

.coming {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--fs-body);
  color: var(--text-sub);
  padding: 3px 0;
}

.coming-dot { color: var(--misty-teal); }

.coming-note {
  display: block;
  margin-top: var(--sp-1);
}

/* ============================================================
   阅读 · 筛选与列表
   ============================================================ */
.filter-bar {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  padding: 0 var(--sp-1) var(--sp-2);
  margin: 0 calc(var(--sp-2) * -1);
  padding-left: var(--sp-2);
  padding-right: var(--sp-2);
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-item {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #FFFFFF;
  font-size: var(--fs-caption);
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s, border-color 0.16s, color 0.16s;
}

.filter-item:hover { background: #FBFAF7; }
.filter-item:active { background: var(--misty-teal-soft); }

.filter-item.active {
  background: var(--misty-teal-soft);
  border-color: var(--misty-teal);
  color: var(--ink-gray);
}

.article-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: opacity 0.16s;
}

.article-card:active { opacity: 0.68; }

.article-title {
  font-size: var(--fs-title);
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-gray);
}

.article-summary {
  margin-top: 6px;
  font-size: var(--fs-caption);
  line-height: 1.7;
  color: var(--text-muted);
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-2);
}

.article-arrow { font-size: var(--fs-caption); color: var(--text-muted); }

/* ============================================================
   文章详情
   ============================================================ */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: var(--sp-1) 0 var(--sp-2);
  padding: 6px 10px 6px 2px;
  font-size: var(--fs-caption);
  color: var(--text-sub);
  cursor: pointer;
  background: none;
  border: none;
}

.detail-col {
  font-size: var(--fs-caption);
  color: var(--misty-teal);
  letter-spacing: 0.4px;
}

.detail-title {
  margin: 6px 0 var(--sp-2);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-gray);
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--hairline);
}

.detail-body p {
  margin: 0 0 var(--sp-2);
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-gray);
}

.fav-btn {
  padding: 5px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: var(--fs-caption);
  color: var(--text-sub);
  background: #FFFFFF;
  cursor: pointer;
  transition: background-color 0.16s, border-color 0.16s, color 0.16s;
}

.fav-btn:hover { background: #FBFAF7; }

.fav-btn.on {
  background: var(--misty-teal-soft);
  border-color: var(--misty-teal);
  color: var(--ink-gray);
}

/* ============================================================
   我的
   ============================================================ */
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.card-title { font-size: var(--fs-body); color: var(--ink-gray); }

.chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 100px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar {
  width: 60%;
  max-width: 22px;
  border-radius: 4px 4px 2px 2px;
  transition: height 0.4s ease;
}

.bar-1 { background: var(--mood-steady); }
.bar-2 { background: var(--mood-wavy); }
.bar-3 { background: var(--mood-rough); }
.bar-empty { background: var(--bar-empty); }

.bar-label { font-size: 11px; color: var(--text-muted); }

.empty-inline { padding: var(--sp-2) 0; text-align: center; }

.stat-row {
  display: flex;
  gap: var(--sp-2);
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--misty-teal);
}

.stat-note {
  display: block;
  margin-top: var(--sp-2);
  text-align: center;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}

.setting-row:last-child { border-bottom: none; }

.setting-main { display: flex; flex-direction: column; gap: 2px; }
.setting-title { font-size: var(--fs-body); color: var(--ink-gray); }

.switch {
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #E5E2DB;
  padding: 3px;
  transition: background-color 0.2s;
}

.switch.on { background: var(--misty-teal); }

.switch-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.2s;
}

.switch.on .switch-dot { transform: translateX(18px); }

.volume-row {
  padding: var(--sp-2) 0 var(--sp-1);
  border-bottom: 1px solid var(--hairline);
}

.volume-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.volume-mute { cursor: pointer; }
.volume-mute:hover { color: var(--ink-gray); }

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: #E7E3DB;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--misty-teal);
  border: 2px solid #FFFFFF;
}

input[type='range']::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: #E7E3DB;
}

input[type='range']::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--misty-teal);
}

input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--misty-teal);
  border: 2px solid #FFFFFF;
}

input[type='range']:disabled { opacity: 0.45; cursor: not-allowed; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--fs-body);
  color: var(--ink-gray);
  cursor: pointer;
}

.list-row:last-child { border-bottom: none; }

.music-warn {
  display: block;
  margin-top: 6px;
  color: #A88A6A;
}

/* ============================================================
   边界与隐私
   ============================================================ */
.sec-title {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink-gray);
  margin-bottom: var(--sp-1);
}

.sec-line {
  display: block;
  font-size: var(--fs-caption);
  line-height: 1.75;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.sec-line:last-child { margin-bottom: 0; }

.help-card { background: #FCFBF8; }

.help-btn {
  display: inline-block;
  margin-top: var(--sp-1);
  padding: 6px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: var(--fs-caption);
  color: var(--text-sub);
  cursor: pointer;
  background: #FFFFFF;
}

.help-btn:hover { background: var(--misty-teal-soft); }

/* ============================================================
   底部 tabBar（四格纯文字，与小程序一致，不设图标）
   ============================================================ */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  width: 100%;
  max-width: var(--app-max);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(247, 244, 238, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hairline);
}

.tab-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: var(--fs-caption);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.16s;
  -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
  color: var(--misty-teal);
  font-weight: 500;
}

/* ============================================================
   音乐控制点（右上角，fixed 不占布局）
   ============================================================ */
.music-dock {
  position: fixed;
  top: var(--sp-2);
  right: max(var(--sp-2), calc((100vw - var(--app-max)) / 2 + var(--sp-2)));
  z-index: 36;
}

.dock-trigger {
  width: var(--dock-size);
  height: var(--dock-size);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(110, 156, 147, 0.32);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.dock-trigger:hover { background: #FFFFFF; }
.dock-trigger:active { background: var(--misty-teal-soft); }

.dock-trigger.is-playing { border-color: var(--misty-teal); }

.wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}

.wave-bar {
  width: 2px;
  border-radius: 1px;
  background: var(--text-muted);
  transition: background-color 0.18s;
}

.dock-trigger.is-playing .wave-bar { background: var(--misty-teal); }

.bar-1, .bar-2, .bar-3 { height: 100%; }

.wave .bar-1 { height: 7px; }
.wave .bar-2 { height: 13px; }
.wave .bar-3 { height: 9px; }

.dock-trigger.is-playing .wave .bar-1 { animation: wave 1.5s ease-in-out infinite; }
.dock-trigger.is-playing .wave .bar-2 { animation: wave 1.2s ease-in-out infinite 0.2s; }
.dock-trigger.is-playing .wave .bar-3 { animation: wave 1.8s ease-in-out infinite 0.4s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.55); }
  50%      { transform: scaleY(1); }
}

.dock-mask {
  position: fixed;
  inset: 0;
  z-index: 34;
  /* 极轻的一层，只为把浮层从内容上「托」起来；再重就压过产品调性了 */
  background: rgba(62, 74, 74, 0.08);
}

.dock-panel {
  position: absolute;
  top: calc(var(--dock-size) + 8px);
  right: 0;
  width: 248px;
  padding: var(--sp-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #FFFFFF;
  z-index: 35;
  animation: panel-in 0.2s ease;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-head { margin-bottom: var(--sp-2); }

.panel-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1);
}

.panel-title { font-size: var(--fs-body); color: var(--ink-gray); }

.panel-state {
  font-size: 11px;
  color: var(--misty-teal);
  letter-spacing: 0.3px;
}

.panel-sub {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-muted);
}

.panel-warn {
  margin-bottom: var(--sp-1);
  padding: 6px 8px;
  border-radius: 8px;
  background: #FBF6EF;
  font-size: 11px;
  line-height: 1.6;
  color: #A88A6A;
}

.panel-actions {
  display: flex;
  gap: 6px;
  margin-bottom: var(--sp-2);
}

.act-btn {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: var(--fs-caption);
  color: var(--text-sub);
  background: #FFFFFF;
  cursor: pointer;
  transition: background-color 0.16s;
}

.act-btn:hover { background: #FBFAF7; }
.act-btn:active { background: var(--misty-teal-soft); }

.act-btn.act-primary {
  background: var(--misty-teal-soft);
  border-color: rgba(110, 156, 147, 0.45);
  color: var(--ink-gray);
}

.panel-volume {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: 6px;
}

.volume-label { font-size: 11px; color: var(--text-muted); flex: 0 0 auto; }
.panel-volume input[type='range'] { flex: 1; }

.volume-value {
  flex: 0 0 34px;
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
}

.panel-foot {
  display: block;
  font-size: 11px;
  line-height: 1.6;
  color: #A7B0B0;
}

/* ============================================================
   Toast 与确认弹层
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 40px);
  transform: translate(-50%, 8px);
  z-index: 60;
  max-width: 78vw;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(62, 74, 74, 0.92);
  color: #FFFFFF;
  font-size: var(--fs-caption);
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
}

.toast.on { opacity: 1; transform: translate(-50%, 0); }

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: rgba(62, 74, 74, 0.32);
}

.modal-mask.on { display: flex; }

.modal {
  width: 100%;
  max-width: 300px;
  padding: var(--sp-3);
  border-radius: var(--radius);
  background: #FFFFFF;
  animation: panel-in 0.2s ease;
}

.modal-title {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink-gray);
}

.modal-text {
  margin: 6px 0 var(--sp-3);
  font-size: var(--fs-caption);
  line-height: 1.7;
  color: var(--text-muted);
}

.modal-actions { display: flex; gap: var(--sp-1); }

.modal-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: var(--fs-caption);
  color: var(--text-sub);
  background: #FFFFFF;
  cursor: pointer;
}

.modal-btn.primary {
  border-color: rgba(110, 156, 147, 0.45);
  background: var(--misty-teal-soft);
  color: var(--ink-gray);
}

/* ============================================================
   减少动效（跟随系统 + 产品内开关，两者取并集）
   ============================================================ */
.reduce-motion .screen,
.reduce-motion .quote-face,
.reduce-motion .mood-reply,
.reduce-motion .dock-panel,
.reduce-motion .modal,
.reduce-motion .bar,
.reduce-motion .switch,
.reduce-motion .switch-dot,
.reduce-motion .mood-dot,
.reduce-motion .breath-circle,
.reduce-motion .skeleton-line {
  animation: none !important;
  transition: none !important;
}

.reduce-motion .wave-bar { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   窄屏（<360px）与大屏微调
   ============================================================ */
@media (max-width: 359px) {
  .mood-row { gap: 4px; }
  .mood-item { padding: 8px 2px; }
  .mood-label { font-size: 11px; }
  .dock-panel { width: 232px; }
  .greeting-title { font-size: 19px; }
}

@media (min-width: 560px) {
  .app { border-radius: 0; }
  .tabbar { border-radius: 0 0 0 0; }
}
