/* ========== 基础变量 ========== */
:root {
  --bg-deep: #1A2B4A;
  --bg-ink:  #2C3E50;
  --bg-soft: #1F3550;
  --text:    #FFFFFF;
  --text-2:  #B0BEC5;
  --text-3:  #7F8FA1;
  --accent:  #5DADE2;
  --accent-2:#85C1E9;
  --accent-3:#3C8AC2;
  --line:    rgba(255,255,255,0.08);
  --line-2:  rgba(255,255,255,0.14);
  --card:    rgba(255,255,255,0.04);
  --card-2:  rgba(255,255,255,0.07);

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;

  /* 三类色块 */
  --treasure:   #B7E5A4;   /* 珍藏：轻盈的绿，活气、留存 */
  --treasure-2: #FFD3B6;   /* 珍藏的彩色瓶里的暖色 */
  --treasure-3: #DDD6F3;   /* 珍藏的彩色瓶里的紫调 */
  --treasure-4: #FFE5A0;   /* 珍藏的彩色瓶里的淡黄 */
  --treasure-5: #B8E0F6;   /* 珍藏的彩色瓶里的天蓝 */
  --treasure-6: #FFAAA5;   /* 珍藏的彩色瓶里的珊瑚 */
  --pending:    #7FA8C9;   /* 我考虑一下：烟雾蓝，停留、未决 */
  --released:   #6E7785;   /* 放下：灰，已经流走 */

  --ease: cubic-bezier(.4,.2,.2,1);
  --ease-water: cubic-bezier(.55,.05,.45,.95);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Inter", "SF Pro Rounded", "Segoe UI", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}
body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

textarea, input {
  font-family: inherit;
  -webkit-user-select: text;
  user-select: text;
}

/* ========== 背景水波 ========== */
.bg {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(93,173,226,0.10), transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, rgba(44,62,80,0.55), transparent 60%),
    linear-gradient(180deg, #1A2B4A 0%, #16243F 60%, #0E1B30 100%);
}
.wave {
  position: absolute; left: -10%; right: -10%;
  height: 220px; opacity: .12;
  background: radial-gradient(ellipse at center, var(--accent) 0%, transparent 60%);
  filter: blur(40px);
  animation: float 14s ease-in-out infinite;
}
.wave-1 { top: 8%; }
.wave-2 { top: 45%; opacity: .08; animation-duration: 22s; animation-direction: reverse; }
.wave-3 { top: 75%; opacity: .10; animation-duration: 18s; }
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(0, -30px, 0) scale(1.05); }
}

/* ========== 视图切换 ========== */
.view {
  position: fixed; inset: 0;
  z-index: 1;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 6vw 32px;
}
.view.active {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}

/* ========== 主页 ========== */
.home-header {
  padding-top: 6vh;
  text-align: center;
}
.title {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text);
  margin: 0;
  opacity: 0.85;
}
.home-main {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7vh;
}
.bigbtn {
  width: min(360px, 80vw);
  aspect-ratio: 1.5 / 1;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(93,173,226,0.18), rgba(93,173,226,0.06));
  border: 1px solid rgba(93,173,226,0.30);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  color: var(--text);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.18em;
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform .25s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.bigbtn:active {
  transform: scale(0.98);
  background: linear-gradient(160deg, rgba(93,173,226,0.28), rgba(93,173,226,0.10));
}
.bigbtn-plus {
  font-size: 44px; font-weight: 200;
  color: var(--accent-2);
  line-height: 1;
}
.bigbtn::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.10), transparent 50%);
  pointer-events: none;
}

.home-hint {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.pool {
  position: relative;
  width: 120px; height: 160px;
  border-radius: 60px 60px 20px 20px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.12);
  overflow: hidden;
  box-shadow: inset 0 -10px 30px rgba(0,0,0,0.25), 0 8px 24px -10px rgba(0,0,0,0.6);
}
.pool-water {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(93,173,226,0.55), rgba(31,111,168,0.85));
  transition: height 1.2s var(--ease-water);
  height: 0%;
}
.pool-water::before, .pool-water::after {
  content: '';
  position: absolute; left: -50%; right: -50%;
  top: -10px; height: 20px;
  background: radial-gradient(circle, var(--accent-2) 6px, transparent 7px) repeat-x;
  background-size: 28px 20px;
  opacity: .6;
  animation: ripple 6s linear infinite;
}
.pool-water::after { top: -6px; opacity: .35; animation-duration: 9s; animation-direction: reverse; }
@keyframes ripple {
  from { transform: translateX(0); }
  to   { transform: translateX(28px); }
}
.pool-glass {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), transparent 30%, transparent 80%, rgba(0,0,0,0.20));
  pointer-events: none;
}
.pool-count {
  position: absolute; left: 0; right: 0; bottom: -28px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.1em;
}

.home-footer {
  padding-bottom: 4vh;
  text-align: center;
}
.link {
  color: var(--text-2);
  background: transparent;
  font-size: 15px;
  letter-spacing: 0.15em;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0.7;
}
.link:active { opacity: 1; background: rgba(255,255,255,0.04); }
.link-soft { display: block; margin: 18px auto 0; }
.link-tight { padding: 6px 10px; font-size: 14px; }

/* 主页"回头看看"按钮：胶囊状，比小链接显眼，但仍比"我想说"克制 */
.lookback-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0.22em;
  box-shadow: 0 6px 20px -10px rgba(0,0,0,0.5);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.lookback-btn:active {
  transform: scale(0.97);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border-color: rgba(93,173,226,0.35);
}
.lookback-ico { font-size: 18px; opacity: 0.85; }
.lookback-arrow {
  color: var(--accent-2);
  font-size: 18px;
  transition: transform .25s var(--ease);
}
.lookback-btn:active .lookback-arrow { transform: translateX(4px); }

/* ========== 顶部 bar ========== */
.bar {
  display: flex; align-items: center;
  gap: 12px;
  padding: 8px 0 22px;
  min-height: 56px;
}
.bar-title {
  flex: 1; text-align: center;
  font-weight: 300; font-size: 19px;
  letter-spacing: 0.22em;
  margin: 0;
  opacity: 0.85;
}
.bar-spacer { width: 56px; }
.back {
  width: 44px; height: 44px;
  border-radius: 22px;
  font-size: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.back:active { background: var(--card-2); }
.bar-tabs {
  flex: 1;
  display: flex; justify-content: center; gap: 6px;
}
.tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  letter-spacing: 0.05em;
}
.tab.active {
  background: rgba(93,173,226,0.14);
  border-color: rgba(93,173,226,0.35);
  color: var(--text);
}

/* ========== 记录页 ========== */
.record-main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 64px;
}
.field { display: block; margin-bottom: 26px; }
.field-label {
  display: block;
  font-size: 15px;
  letter-spacing: 0.15em;
  color: var(--text-2);
  margin-bottom: 10px;
  font-weight: 300;
}
.field-label small {
  font-size: 12px; color: var(--text-3); margin-left: 6px;
  letter-spacing: 0.1em;
}
textarea, .sheet-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 16px 18px;
  font-size: 17px;
  line-height: 1.7;
  resize: none;
  outline: none;
  transition: border-color .2s, background .2s;
}
textarea:focus, .sheet-input:focus {
  border-color: rgba(93,173,226,0.45);
  background: var(--card-2);
}

/* chips */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px 8px;
}
.chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.04em;
  transition: background .2s, border-color .2s, transform .15s;
}
.chip:active { transform: scale(0.96); }
.chip.selected {
  background: rgba(93,173,226,0.18);
  border-color: rgba(93,173,226,0.55);
  color: var(--text);
}
.chip-add { color: var(--text-3); }
.emotions .chip { padding: 10px 14px; }

/* 模式切换 */
.mode { display: none; margin-bottom: 26px; }
.mode.active { display: block; }

/* 画板 */
.canvas-wrap {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: none;
}
#canvas { display: block; width: 100%; height: 100%; background: #0E1B30; }
.draw-tools {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
.colors, .sizes { display: flex; gap: 8px; align-items: center; }
.color {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  padding: 0;
}
.color.active { border-color: var(--accent-2); transform: scale(1.12); }
.size {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.size span { display: block; background: #FFF; border-radius: 50%; }
.size.active { border-color: var(--accent); background: rgba(93,173,226,0.10); }
.tool-btn {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.06em;
}
.tool-btn:active { background: var(--card-2); }

/* 录音 */
.audio-wrap {
  padding: 30px 0;
  text-align: center;
}
.rec-btn {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(93,173,226,0.30), rgba(93,173,226,0.10));
  border: 1.5px solid rgba(93,173,226,0.35);
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0.15em;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  transition: transform .2s, background .25s;
  margin: 0 auto;
}
.rec-btn.recording {
  background: radial-gradient(circle at 50% 40%, rgba(93,173,226,0.55), rgba(31,111,168,0.20));
  animation: rec-pulse 1.6s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(93,173,226,0.35); }
  50%      { box-shadow: 0 0 0 24px rgba(93,173,226,0.0); }
}
.rec-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent-2);
}
.rec-btn.recording .rec-dot { background: #ff7b7b; }
.rec-time {
  margin-top: 16px;
  color: var(--text-2);
  letter-spacing: 0.2em;
  font-size: 16px;
}
#audio-preview {
  display: block;
  margin: 18px auto 0;
  width: 100%; max-width: 360px;
}

/* 三个动作按钮：珍藏 / 放下 / 我考虑一下 */
.action-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 20px 10px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  color: var(--text);
  letter-spacing: 0.18em;
  transition: transform .18s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.action-btn:active { transform: scale(0.98); }
.action-ico { font-size: 26px; line-height: 1; }
.action-text { font-size: 18px; font-weight: 300; }
.action-sub { font-size: 12px; opacity: 0.7; letter-spacing: 0.1em; }

.action-treasure {
  background: linear-gradient(160deg, rgba(183,229,164,0.30), rgba(168,230,207,0.10));
  border-color: rgba(183,229,164,0.45);
  box-shadow: 0 10px 30px -16px rgba(183,229,164,0.55), inset 0 1px 0 rgba(255,255,255,0.10);
}
.action-drop {
  background: linear-gradient(180deg, rgba(93,173,226,0.55), rgba(31,111,168,0.90));
  border-color: rgba(93,173,226,0.50);
  box-shadow: 0 14px 40px -16px rgba(93,173,226,0.65), inset 0 1px 0 rgba(255,255,255,0.20);
}
.action-pending {
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border-color: var(--line-2);
}

@media (max-width: 540px) {
  .action-row { grid-template-columns: 1fr; }
  .action-btn { flex-direction: row; gap: 14px; justify-content: flex-start; padding: 16px 22px; }
  .action-sub { margin-left: auto; }
}

/* ========== 历史：两色块 ========== */
.list {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 40px;
}

.block {
  position: relative;
  border-radius: var(--r-lg);
  padding: 18px 16px 14px;
  margin-bottom: 22px;
  border: 1px solid;
  transition: opacity .25s;
  overflow: hidden;
}

/* 珍藏：轻盈的绿，瓶身彩色装饰 */
.block.treasured {
  background: linear-gradient(160deg, rgba(183,229,164,0.18), rgba(168,230,207,0.04));
  border-color: rgba(183,229,164,0.40);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 6px 22px -16px rgba(183,229,164,0.45);
}
.block.treasured .block-title { color: #E8F5DC; }

/* 彩色瓶子装饰：右上角悬浮（历史页迷你瓶） */
.bottle {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 56px;
  pointer-events: none;
  opacity: 0.95;
}

/* 珍藏入口卡片：可点击进入专属瓶子页 */
.treasure-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 18px 22px;
  transition: background .2s, border-color .2s, transform .15s;
}
.treasure-card .bottle {
  position: static;
  width: 46px; height: 66px;
  flex-shrink: 0;
}
.treasure-card-body {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.treasure-card .block-ico {
  font-size: 22px;
  display: inline-block;
  margin-right: 6px;
}
.treasure-card .block-title {
  font-size: 17px;
  letter-spacing: 0.22em;
  display: inline-block;
}
.treasure-card-meta {
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.08em;
}
.treasure-card-arrow {
  font-size: 22px;
  color: var(--treasure);
  opacity: 0.85;
  transition: transform .25s var(--ease);
  flex-shrink: 0;
}
.treasure-card:active {
  transform: scale(0.99);
  background: linear-gradient(160deg, rgba(183,229,164,0.26), rgba(168,230,207,0.08));
}
.treasure-card:active .treasure-card-arrow { transform: translateX(4px); }

/* 我考虑一下：烟雾蓝 */
.block.pending {
  background: linear-gradient(160deg, rgba(127,168,201,0.14), rgba(110,148,180,0.04));
  border-color: rgba(127,168,201,0.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 22px -16px rgba(127,168,201,0.30);
}

/* 放下：灰，已经流走 */
.block.released {
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.08);
  opacity: 0.85;
}
.block.released .block-title { color: var(--text-3); }
.block.released .block-ico   { opacity: 0.6; filter: grayscale(1); }
.block.released .item {
  background: rgba(255,255,255,0.015);
  border-color: rgba(255,255,255,0.05);
  opacity: 0.6;
}
.block.released .item-line {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: rgba(176, 190, 197, 0.55);
  text-decoration-thickness: 1.5px;
}
.block.released .item-ico { filter: grayscale(0.8); opacity: 0.55; }
.block.released .item-status { display: none; }

/* "其他" 兜底（极少出现） */
.block.other {
  background: var(--card);
  border-color: var(--line-2);
}

.block-head {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 14px;
  margin-bottom: 4px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.block-ico { font-size: 22px; }
.block-title {
  flex: 1;
  font-size: 16px;
  letter-spacing: 0.22em;
  color: var(--text);
  font-weight: 300;
}
.block-count {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.12em;
}
.block-empty {
  text-align: center;
  color: var(--text-3);
  padding: 18px 14px 10px;
  font-size: 13px;
  letter-spacing: 0.14em;
  opacity: 0.7;
}

.item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px;
  margin: 8px 0 0;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background .2s, border-color .2s, transform .15s;
  width: 100%;
  text-align: left;
}
.item:first-of-type { margin-top: 10px; }
.item:active {
  background: rgba(255,255,255,0.09);
  transform: scale(0.995);
}
.item-ico { font-size: 22px; opacity: 0.85; flex-shrink: 0; }
.item-body { flex: 1; min-width: 0; }
.item-line {
  font-size: 16px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.08em;
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  align-items: center;
}
.item-emos { display: inline-flex; gap: 3px; font-size: 13px; }
.item-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--text-3);
  border: 1px solid var(--line-2);
  flex-shrink: 0;
}
.item-status.released { color: var(--accent-2); border-color: rgba(93,173,226,0.4); }

.list-empty {
  text-align: center;
  color: var(--text-3);
  padding: 80px 20px;
  letter-spacing: 0.15em;
  font-size: 14px;
}

/* ========== 珍藏专属页 ========== */
.treasures-main {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 0 30px;
  position: relative;
}
.bottle-stage {
  width: min(80vw, 480px);
  max-height: 72vh;
  display: flex;
  align-items: center; justify-content: center;
}
.bottle-stage svg.big-bottle {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,0.45));
}
.bottle-stage .bead {
  cursor: pointer;
  transition: transform .25s var(--ease), filter .25s var(--ease);
  transform-box: fill-box;
  transform-origin: center;
}
.bottle-stage .bead:hover,
.bottle-stage .bead:focus,
.bottle-stage .bead.touched {
  transform: scale(1.25);
  filter: brightness(1.15) drop-shadow(0 0 6px rgba(255,255,255,0.4));
}
.bottle-stage .bead-shine {
  pointer-events: none;
}
.treasures-caption {
  margin-top: 18px;
  font-size: 14px;
  letter-spacing: 0.25em;
  color: var(--text-3);
  text-align: center;
  min-height: 1.6em;
}
.treasures-caption.has-pick {
  color: var(--text);
  opacity: 0.95;
}
.treasures-empty {
  margin-top: 14px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  letter-spacing: 0.18em;
  line-height: 1.9;
}

/* ========== 详情 ========== */
.detail-main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 48px;
}
.detail-meta {
  color: var(--text-3); font-size: 13px; letter-spacing: 0.12em;
  margin-bottom: 18px;
}
.detail-body {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 18px;
  font-size: 17px;
  line-height: 1.85;
  white-space: pre-wrap;
}
.detail-img {
  width: 100%; height: auto;
  border-radius: var(--r-md);
  margin-bottom: 18px;
  background: #0E1B30;
}
.detail-audio {
  width: 100%;
  margin-bottom: 18px;
}
.detail-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 22px;
}
.detail-tag {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.detail-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
}

/* ===== 复盘（仅"我考虑一下"详情页可见） ===== */
.reflections {
  margin-bottom: 22px;
}
.reflections-head {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--text-2);
  margin: 0 4px 12px;
  font-weight: 300;
  opacity: 0.9;
}
.reflection-item {
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(221,214,243,0.10), rgba(221,214,243,0.02));
  border: 1px solid rgba(221,214,243,0.20);
  margin-bottom: 8px;
  position: relative;
}
.reflection-item::before {
  content: '';
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: rgba(221,214,243,0.55);
}
.reflection-time {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.14em;
}
.reflection-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}

.reflection-wrap {
  margin-bottom: 22px;
}
.reflection-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  padding: 20px 24px;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(221,214,243,0.22), rgba(221,214,243,0.06));
  border: 1.5px solid rgba(221,214,243,0.40);
  color: var(--text);
  font-size: 17px;
  letter-spacing: 0.22em;
  box-shadow: 0 8px 24px -14px rgba(221,214,243,0.40), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.reflection-btn:active {
  transform: scale(0.99);
  background: linear-gradient(160deg, rgba(221,214,243,0.30), rgba(221,214,243,0.10));
  border-color: rgba(221,214,243,0.60);
}
.reflection-ico { font-size: 22px; line-height: 1; }
.reflection-btn-text { line-height: 1; }

.reflection-form {
  display: none;
}
.reflection-form.open {
  display: block;
  animation: refl-open .28s var(--ease);
}
@keyframes refl-open {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reflection-input {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: rgba(221,214,243,0.10);
  border: 1.5px solid rgba(221,214,243,0.40);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
  resize: none;
  outline: none;
  transition: border-color .2s, background .2s;
}
.reflection-input:focus {
  border-color: rgba(221,214,243,0.65);
  background: rgba(221,214,243,0.14);
}
.reflection-form-actions {
  display: flex; gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}
.btn-secondary {
  padding: 14px 24px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.1em;
}
.btn-secondary:active { background: var(--card-2); }
.btn-primary {
  padding: 14px 24px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(93,173,226,0.55), rgba(31,111,168,0.90));
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.1em;
}
.btn-danger {
  padding: 14px 24px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 14px;
  letter-spacing: 0.1em;
}

/* ========== 月度回顾 ========== */
.monthly-main {
  flex: 1;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 0 60px;
  display: flex; flex-direction: column; gap: 20px;
}
.stat-card {
  padding: 32px 28px;
  background: linear-gradient(160deg, rgba(93,173,226,0.18), rgba(93,173,226,0.05));
  border: 1px solid rgba(93,173,226,0.25);
  border-radius: var(--r-lg);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.stat-card.stat-soft {
  background: var(--card);
  border-color: var(--line);
}
.stat-card.stat-treasure {
  background: linear-gradient(160deg, rgba(183,229,164,0.20), rgba(168,230,207,0.05));
  border-color: rgba(183,229,164,0.35);
}
.stat-card.stat-treasure .stat-num { color: var(--treasure); }
.stat-num {
  font-size: 64px;
  font-weight: 200;
  color: var(--accent-2);
  line-height: 1;
  letter-spacing: 0.02em;
}
.stat-label {
  color: var(--text-2);
  font-size: 14px;
  letter-spacing: 0.2em;
  margin-top: 8px;
}
.stat-suffix {
  color: var(--text-2);
  font-size: 14px;
  letter-spacing: 0.2em;
}
.monthly-hint {
  text-align: center; color: var(--text-3);
  letter-spacing: 0.3em; font-size: 14px;
  margin-top: 6px;
}

/* ========== 放下动画 ========== */
.drop-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 30%, rgba(31,111,168,0.85), rgba(14,27,48,0.98));
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease);
}
.drop-overlay.show {
  opacity: 1; pointer-events: auto;
}
.drop-blob {
  position: absolute;
  top: 30%; left: 50%;
  width: 120px; height: 120px;
  margin-left: -60px; margin-top: -60px;
  background: linear-gradient(180deg, #85C1E9, #1F6FA8);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 20px 60px rgba(93,173,226,0.5), inset 0 -10px 20px rgba(0,0,0,0.20);
  opacity: 0;
}
.drop-overlay.show .drop-blob {
  animation: drop-fall 2.2s var(--ease-water) forwards;
}
@keyframes drop-fall {
  0%   { opacity: 0; transform: translateY(-100px) scale(0.6); border-radius: 50%; }
  15%  { opacity: 1; transform: translateY(0) scale(1);        border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
  45%  { opacity: 1; transform: translateY(180px) scale(1.05, 1.20); border-radius: 45% 45% 55% 55% / 55% 55% 45% 45%; }
  75%  { opacity: 0.6; transform: translateY(420px) scale(1.3, 0.6); border-radius: 60% 60% 40% 40% / 30% 30% 70% 70%; }
  100% { opacity: 0; transform: translateY(620px) scale(2.0, 0.2); border-radius: 60% 60% 40% 40%; }
}
.drop-ripple {
  position: absolute;
  top: 75%; left: 50%;
  width: 40px; height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  border: 2px solid rgba(133,193,233,0.7);
  opacity: 0;
}
.drop-overlay.show .drop-ripple {
  animation: ripple-out 2.2s var(--ease-water) forwards;
}
@keyframes ripple-out {
  0%, 60% { opacity: 0; transform: scale(1); }
  70%     { opacity: 0.9; transform: scale(1); }
  100%    { opacity: 0; transform: scale(14); }
}
.drop-trail {
  position: absolute;
  top: 30%; left: 50%;
  width: 3px; height: 0;
  margin-left: -1.5px;
  background: linear-gradient(180deg, rgba(133,193,233,0.0), rgba(133,193,233,0.65), rgba(133,193,233,0));
  opacity: 0;
}
.drop-overlay.show .drop-trail {
  animation: trail 2.2s var(--ease-water) forwards;
}
@keyframes trail {
  0%   { opacity: 0; height: 0; }
  25%  { opacity: 0.7; height: 200px; }
  70%  { opacity: 0.4; height: 360px; }
  100% { opacity: 0; height: 400px; }
}
.drop-tip {
  position: absolute;
  bottom: 14%;
  font-size: 15px;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.65);
  opacity: 0;
}
.drop-overlay.show .drop-tip {
  animation: tip-show 2.2s ease forwards;
}
@keyframes tip-show {
  0%, 100% { opacity: 0; transform: translateY(10px); }
  30%, 75% { opacity: 1; transform: translateY(0); }
}

/* ========== 珍藏动画 ========== */
.treasure-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 50%, rgba(183,229,164,0.40), rgba(20,40,30,0.95) 70%);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease);
}
.treasure-overlay.show { opacity: 1; pointer-events: auto; }

.treasure-gem {
  width: 120px; height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #FFFFFF 0%, transparent 30%),
    conic-gradient(
      from 0deg,
      #A8E6CF, #FFE5A0, #FFD3B6, #FFAAA5,
      #DDD6F3, #B8E0F6, #A8E6CF
    );
  box-shadow:
    0 0 60px 20px rgba(183,229,164,0.5),
    inset 0 -10px 20px rgba(0,0,0,0.15);
  opacity: 0;
}
.treasure-overlay.show .treasure-gem {
  animation: gem-rise 2.0s var(--ease) forwards;
}
@keyframes gem-rise {
  0%   { opacity: 0; transform: scale(0.2) rotate(0deg); }
  25%  { opacity: 1; transform: scale(1.0) rotate(45deg); }
  60%  { opacity: 1; transform: scale(1.05) rotate(180deg); }
  100% { opacity: 0; transform: scale(0.6) rotate(360deg) translateY(-180px); }
}

.treasure-sparks {
  position: absolute;
  width: 320px; height: 320px;
  pointer-events: none;
}
.treasure-sparks span {
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  opacity: 0;
}
.treasure-sparks span:nth-child(1) { background: var(--treasure);   }
.treasure-sparks span:nth-child(2) { background: var(--treasure-2); }
.treasure-sparks span:nth-child(3) { background: var(--treasure-3); }
.treasure-sparks span:nth-child(4) { background: var(--treasure-4); }
.treasure-sparks span:nth-child(5) { background: var(--treasure-5); }
.treasure-sparks span:nth-child(6) { background: var(--treasure-6); }
.treasure-sparks span:nth-child(7) { background: #FFFFFF; }
.treasure-sparks span:nth-child(8) { background: var(--accent-2); }
.treasure-overlay.show .treasure-sparks span {
  animation: spark 2.0s var(--ease) forwards;
}
.treasure-overlay.show .treasure-sparks span:nth-child(1) { --tx:  140px; --ty:  -60px; animation-delay: 0.05s; }
.treasure-overlay.show .treasure-sparks span:nth-child(2) { --tx:  100px; --ty:   90px; animation-delay: 0.10s; }
.treasure-overlay.show .treasure-sparks span:nth-child(3) { --tx:  -60px; --ty:  140px; animation-delay: 0.15s; }
.treasure-overlay.show .treasure-sparks span:nth-child(4) { --tx: -140px; --ty:   30px; animation-delay: 0.05s; }
.treasure-overlay.show .treasure-sparks span:nth-child(5) { --tx: -100px; --ty: -110px; animation-delay: 0.18s; }
.treasure-overlay.show .treasure-sparks span:nth-child(6) { --tx:   20px; --ty: -150px; animation-delay: 0.12s; }
.treasure-overlay.show .treasure-sparks span:nth-child(7) { --tx:  160px; --ty:   40px; animation-delay: 0.20s; }
.treasure-overlay.show .treasure-sparks span:nth-child(8) { --tx:  -50px; --ty:  -80px; animation-delay: 0.08s; }
@keyframes spark {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.4); }
  30%  { opacity: 1; transform: translate(calc(var(--tx) * 0.3), calc(var(--ty) * 0.3)) scale(1.2); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.6); }
}

.treasure-tip {
  position: absolute;
  bottom: 14%;
  font-size: 15px;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.85);
  opacity: 0;
}
.treasure-overlay.show .treasure-tip {
  animation: tip-show 2.0s ease forwards;
}

/* ========== toast ========== */
.toast {
  position: fixed;
  bottom: 8vh; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(14,27,48,0.92);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ========== 主页右上设置入口 ========== */
.home-settings {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 20px);
  right: 5vw;
  z-index: 5;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  opacity: 0.55;
  transition: opacity .2s, background .2s;
}
.home-settings:active { opacity: 1; background: rgba(255,255,255,0.10); }

/* ========== 设置页 ========== */
.settings-main {
  flex: 1;
  max-width: 720px; width: 100%;
  margin: 0 auto;
  padding-bottom: 40px;
}
.settings-block {
  margin-bottom: 28px;
  padding: 20px 22px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line);
}
.settings-h {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--text);
  font-weight: 300;
}
.settings-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.7;
  letter-spacing: 0.05em;
}
.settings-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.recipients-edit .chip {
  position: relative;
  padding-right: 30px;
}
.recipients-edit .chip-x {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 12px;
  color: var(--text-3);
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.recipients-edit .chip-x:active { background: rgba(255,255,255,0.15); color: var(--text); }
.recipients-edit .chip-add { padding-right: 14px; }

/* ========== 锁屏 ========== */
.lock-screen {
  position: fixed; inset: 0;
  z-index: 500;
  background: linear-gradient(180deg, #1A2B4A 0%, #0E1B30 100%);
  display: none;
  align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 6vw env(safe-area-inset-bottom);
}
.lock-screen.show { display: flex; }
.lock-inner {
  width: 100%; max-width: 360px;
  text-align: center;
}
.lock-ico {
  font-size: 48px;
  margin-bottom: 22px;
  opacity: 0.85;
}
.lock-title {
  margin: 0 0 34px;
  font-size: 17px;
  letter-spacing: 0.4em;
  color: var(--text);
  font-weight: 300;
  opacity: 0.9;
}
.lock-cells {
  display: flex; gap: 14px;
  justify-content: center;
  margin-bottom: 24px;
}
.lock-cell {
  width: 50px; height: 60px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.lock-cell.filled {
  background: rgba(93,173,226,0.10);
  border-color: rgba(93,173,226,0.45);
}
.lock-cell.filled::after {
  content: '·';
  font-size: 48px;
  line-height: 0;
  margin-top: -6px;
  color: var(--accent-2);
}
.lock-input {
  position: absolute;
  opacity: 0;
  pointer-events: auto;
  width: 1px; height: 1px;
  margin-left: -1px; margin-top: -1px;
  border: 0;
}
.lock-cells.shake {
  animation: lock-shake .45s ease;
}
@keyframes lock-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.lock-forgot {
  margin-top: 18px;
  color: var(--text-3);
  font-size: 13px;
  letter-spacing: 0.18em;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0.7;
}
.lock-forgot:active { opacity: 1; background: rgba(255,255,255,0.04); }

.lock-setup-quote {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: var(--text-2);
  background: rgba(93,173,226,0.06);
  border-left: 3px solid rgba(93,173,226,0.40);
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
}
.lock-setup-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 22px;
}
.lock-setup-hint {
  margin: 10px 0 0;
  min-height: 1.4em;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-align: center;
}
.lock-setup-hint.error { color: #E89A9A; }
.lock-setup-hint.ok    { color: var(--accent-2); }

/* ========== sheet ========== */
.sheet {
  position: fixed; inset: 0;
  background: rgba(14,27,48,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 150;
  display: flex; align-items: center; justify-content: center;
  padding: 5vw;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
}
.sheet.show { opacity: 1; pointer-events: auto; }
/* askInput 弹层始终在其他 sheet（picker 等）之上，防止层叠冲突 */
#sheet.show { z-index: 160; }
.sheet-card {
  width: 100%; max-width: 360px;
  background: var(--bg-ink);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 24px;
}
.sheet-card-wide { max-width: 440px; }
.picker-chips { margin-bottom: 4px; }
.sheet-title {
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: 0.2em;
  color: var(--text-2);
}
.sheet-actions {
  display: flex; gap: 10px; margin-top: 16px;
}
.sheet-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.15em;
}
.sheet-ok {
  background: linear-gradient(180deg, rgba(93,173,226,0.45), rgba(31,111,168,0.80));
  border-color: rgba(93,173,226,0.4);
}

/* ========== iPad / 大屏 ========== */
@media (min-width: 768px) {
  .view { padding: 32px 8vw 40px; }
  body { font-size: 18px; }
  .title { font-size: 36px; }
  .bigbtn { width: 380px; font-size: 30px; }
  .record-main, .detail-main, .list { max-width: 760px; }
  .bar-tabs .tab { font-size: 16px; padding: 10px 20px; }
}
@media (min-width: 1024px) {
  .view { padding: 40px 10vw 48px; }
  .record-main, .detail-main, .list { max-width: 820px; }
  .pool { width: 140px; height: 180px; }
}
@media (orientation: landscape) and (min-width: 900px) {
  .home-header { padding-top: 4vh; }
  .home-main { gap: 6vh; }
}
