/* ============================================================
   情绪星轨 · Emotion Orbit
   设计系统：淡紫 + 奶白 + 浅灰，柔和阴影，圆角，细腻动效
   ============================================================ */

/* ---------- 1. 变量 ---------- */
:root {
  /* 色彩 */
  --lav-50:  #F7F4FF;
  --lav-100: #EFE9FF;
  --lav-200: #E0D6FF;
  --lav-300: #C9B8FB;
  --lav-400: #AE97F2;
  --lav-500: #8E73E4;
  --lav-600: #7357CE;

  --cream:   #FFFCF7;
  --cream-2: #FBF7F0;
  --gray-1:  #F4F2F7;
  --gray-2:  #E9E6F0;

  --ink:     #2E2946;
  --ink-2:   #565073;
  --ink-3:   #8B85A4;
  --ink-4:   #B4AFC5;

  --line:    rgba(120, 105, 160, 0.13);
  --line-2:  rgba(120, 105, 160, 0.07);

  /* 情绪色 */
  --m-happy:   #FFC46B;
  --m-calm:    #96D2C6;
  --m-tired:   #B9A8E8;
  --m-anxious: #F2A0A0;
  --m-excited: #FF9E7A;
  --m-low:     #9AA9C9;

  /* 形状 */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* 阴影：柔和不脏 */
  --sh-xs: 0 2px 6px rgba(92, 74, 150, 0.05);
  --sh-sm: 0 6px 16px -8px rgba(92, 74, 150, 0.18), 0 1px 3px rgba(92, 74, 150, 0.04);
  --sh-md: 0 18px 36px -22px rgba(92, 74, 150, 0.34), 0 2px 8px rgba(92, 74, 150, 0.05);
  --sh-lg: 0 32px 64px -36px rgba(92, 74, 150, 0.42), 0 4px 14px rgba(92, 74, 150, 0.06);
  --sh-glow: 0 0 0 6px rgba(174, 151, 242, 0.14);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI",
          "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.65;
  overflow-x: hidden;
}

/* ---------- 2. 背景氛围 ---------- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 700px at 12% -10%, #F0E9FF 0%, rgba(240, 233, 255, 0) 62%),
    radial-gradient(900px 600px at 92% 4%, #FFF3E4 0%, rgba(255, 243, 228, 0) 58%),
    radial-gradient(1000px 800px at 78% 96%, #EFEAFF 0%, rgba(239, 234, 255, 0) 60%),
    linear-gradient(168deg, var(--cream) 0%, var(--cream-2) 46%, #F6F3FB 100%);
}

.atmosphere::after {
  /* 细腻颗粒，避免渐变过平 */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* 漂浮光斑 */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
  animation: float 22s var(--ease-soft) infinite alternate;
}
.orb-1 { width: 380px; height: 380px; left: -120px; top: 8%;  background: rgba(201, 184, 251, 0.55); }
.orb-2 { width: 300px; height: 300px; right: -80px; top: 42%; background: rgba(255, 205, 160, 0.4); animation-delay: -7s; }
.orb-3 { width: 340px; height: 340px; left: 46%; bottom: -140px; background: rgba(174, 151, 242, 0.36); animation-delay: -13s; }

@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(24px, -34px, 0) scale(1.08); }
}

/* ---------- 3. 布局 ---------- */
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 34px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-left: 6px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #C6B4FB, #9C86EE);
  box-shadow: 0 10px 22px -12px rgba(115, 87, 206, 0.9), inset 0 1px 0 rgba(255,255,255,0.5);
  flex: none;
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ink-4);
  text-transform: uppercase;
  margin-top: -3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 15px;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
              transform 0.3s var(--ease), border-color 0.3s var(--ease);
  user-select: none;
}

.nav-item svg { flex: none; opacity: 0.72; transition: opacity 0.3s var(--ease); }

.nav-item:hover {
  background: rgba(255, 255, 255, 0.62);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(247,244,255,0.9));
  border-color: rgba(174, 151, 242, 0.28);
  color: var(--lav-600);
  font-weight: 550;
  box-shadow: var(--sh-sm);
}
.nav-item.active svg { opacity: 1; }

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 2px;
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--lav-400), var(--lav-300));
  transform: translateX(0);
}

.rail-foot {
  margin-top: auto;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--ink-4);
  padding-left: 8px;
  letter-spacing: 0.02em;
}

.app {
  min-width: 0;
  padding: 40px 46px 120px 18px;
  max-width: 1120px;
  width: 100%;
}

/* ---------- 4. 视图切换 ---------- */
.view { display: none; }
.view.active { display: block; animation: viewIn 0.5s var(--ease) both; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 5. 文字 ---------- */
.page-head { margin-bottom: 26px; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--lav-500);
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 550;
}

.title-xl {
  font-size: clamp(26px, 3.1vw, 36px);
  line-height: 1.28;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
}

.title-xl .grad {
  background: linear-gradient(100deg, #8E73E4 0%, #B39BF0 40%, #F0A98C 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: 14.5px;
  color: var(--ink-3);
  max-width: 46em;
  margin: 0;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.section-title .count {
  font-size: 12px;
  color: var(--ink-4);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ---------- 6. 卡片 ---------- */
.card {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  padding: 26px 28px;
  position: relative;
}

.card::before {
  /* 顶部内高光，增强质感 */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95), transparent);
  border-radius: inherit;
}

.card-soft {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--sh-sm);
}

/* ---------- 7. 首页：情绪选择 ---------- */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 4px;
}

.mood-btn {
  position: relative;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  padding: 16px 6px 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  transition: transform 0.36s var(--ease), background 0.36s var(--ease),
              box-shadow 0.36s var(--ease), border-color 0.36s var(--ease);
  font-family: inherit;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.mood-btn svg { width: 44px; height: 44px; transition: transform 0.4s var(--ease); }

.mood-btn:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--sh-sm);
}
.mood-btn:hover svg { transform: scale(1.06) rotate(-2deg); }

.mood-btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(174, 151, 242, 0.42);
  box-shadow: var(--sh-md), var(--sh-glow);
  color: var(--ink);
  font-weight: 600;
  transform: translateY(-2px);
}

.mood-btn[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--lav-400) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15'%3E%3Cpath d='M4 7.6l2.3 2.3L11 5.3' stroke='white' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/15px no-repeat;
  animation: pop 0.36s var(--ease) both;
}

@keyframes pop {
  from { transform: scale(0.2); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* 日期行 */
.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.chip-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: var(--r-pill);
  background: rgba(239, 233, 255, 0.7);
  border: 1px solid rgba(174, 151, 242, 0.2);
  color: var(--lav-600);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  font-family: inherit;
}
.chip-date:hover { background: rgba(239, 233, 255, 1); transform: translateY(-1px); }

.date-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--lav-600);
  font-weight: 550;
  outline: none;
  cursor: pointer;
  width: 128px;
}

.hint {
  font-size: 12px;
  color: var(--ink-4);
  margin-left: auto;
  letter-spacing: 0.02em;
}

/* ---------- 8. 编辑器 ---------- */
.editor { margin-top: 20px; }

.editor-box {
  position: relative;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.editor-box:focus-within {
  border-color: rgba(174, 151, 242, 0.55);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(174, 151, 242, 0.1);
}

.editor textarea {
  width: 100%;
  min-height: 132px;
  max-height: 420px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  padding: 18px 20px 8px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink);
}

.editor textarea::placeholder { color: var(--ink-4); }

.editor-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 12px;
  flex-wrap: wrap;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.26s var(--ease);
}
.tool-btn:hover { background: rgba(239, 233, 255, 0.8); color: var(--lav-600); }
.tool-btn.rec {
  background: rgba(242, 160, 160, 0.16);
  color: #C46A6A;
  border-color: rgba(242, 160, 160, 0.34);
  animation: pulseRec 1.4s ease-in-out infinite;
}
@keyframes pulseRec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242,160,160,0.3); }
  50%      { box-shadow: 0 0 0 7px rgba(242,160,160,0); }
}

.counter { margin-left: auto; font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

/* 图片预览 */
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  animation: pop 0.4s var(--ease) both;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(46, 41, 70, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.24s var(--ease);
}
.thumb:hover .thumb-del { opacity: 1; }

/* 标签输入 */
.tag-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: rgba(239, 233, 255, 0.9);
  color: var(--lav-600);
  font-size: 12px;
  border: 1px solid rgba(174, 151, 242, 0.18);
  transition: all 0.26s var(--ease);
  animation: pop 0.32s var(--ease) both;
}
.tag button {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  opacity: 0.6;
}
.tag button:hover { opacity: 1; }

.tag-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 5px 2px;
  min-width: 96px;
}
.tag-input::placeholder { color: var(--ink-4); }

/* 提交 */
.submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.btn-primary {
  position: relative;
  border: none;
  border-radius: var(--r-pill);
  padding: 13px 30px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(120deg, #A98FF0 0%, #8E73E4 52%, #B49AF2 100%);
  background-size: 160% 100%;
  box-shadow: 0 16px 30px -16px rgba(115, 87, 206, 0.75);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-position 0.6s var(--ease);
  overflow: hidden;
}
.btn-primary:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 20px 36px -16px rgba(115, 87, 206, 0.85);
}
.btn-primary:active { transform: translateY(0) scale(0.985); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-2);
  border-radius: var(--r-pill);
  padding: 11px 20px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.26s var(--ease);
}
.btn-ghost:hover { background: #fff; border-color: rgba(174,151,242,0.4); color: var(--lav-600); }

/* ---------- 9. 记录卡片 ---------- */
.records { display: grid; gap: 14px; }

.rec-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: transform 0.36s var(--ease), box-shadow 0.36s var(--ease), background 0.36s var(--ease);
  animation: cardIn 0.5s var(--ease) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.rec-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  background: rgba(255, 255, 255, 0.94);
}

.rec-icon { width: 52px; height: 52px; }

.rec-body { min-width: 0; }

.rec-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.rec-mood { font-size: 13.5px; font-weight: 650; letter-spacing: 0.02em; }

.rec-date { font-size: 12px; color: var(--ink-4); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.rec-fav { margin-left: auto; color: #E7B24B; font-size: 13px; }

.rec-text {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.rec-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.rec-tags .tag { font-size: 11px; padding: 3px 10px; background: rgba(244, 242, 247, 0.95); color: var(--ink-3); border-color: var(--line-2); }

.rec-imgs { display: flex; gap: 7px; margin-top: 10px; }
.rec-imgs img {
  width: 54px; height: 54px; object-fit: cover; border-radius: 11px;
  box-shadow: var(--sh-xs);
  transition: transform 0.3s var(--ease);
}
.rec-card:hover .rec-imgs img { transform: scale(1.03); }
.rec-imgs .more {
  width: 54px; height: 54px; border-radius: 11px;
  background: rgba(239, 233, 255, 0.85);
  color: var(--lav-500);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-4);
  font-size: 13.5px;
}
.empty svg { opacity: 0.5; margin-bottom: 14px; }

/* ---------- 10. 筛选 ---------- */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--sh-xs);
  margin-bottom: 18px;
}

.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-label { font-size: 11.5px; color: var(--ink-4); letter-spacing: 0.2em; margin-right: 4px; min-width: 42px; }

.chip {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.28s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover { border-color: rgba(174,151,242,0.4); color: var(--lav-600); transform: translateY(-1px); }
.chip.on {
  background: linear-gradient(135deg, rgba(233,224,255,1), rgba(245,241,255,1));
  border-color: rgba(174, 151, 242, 0.45);
  color: var(--lav-600);
  font-weight: 600;
  box-shadow: 0 4px 12px -8px rgba(115,87,206,0.6);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  flex: 1;
  min-width: 180px;
  transition: all 0.3s var(--ease);
}
.search-box:focus-within { border-color: rgba(174,151,242,0.5); box-shadow: 0 0 0 4px rgba(174,151,242,0.08); }
.search-box input {
  border: none; background: none; outline: none; width: 100%;
  font-family: inherit; font-size: 13px; color: var(--ink);
}
.search-box input::placeholder { color: var(--ink-4); }

/* ---------- 11. 统计 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }

.stat-card {
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--sh-sm);
  transition: transform 0.36s var(--ease), box-shadow 0.36s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

.stat-label { font-size: 11.5px; color: var(--ink-4); letter-spacing: 0.16em; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.stat-foot { font-size: 12px; color: var(--ink-4); margin-top: 6px; }

/* 热力图 */
.heatmap-wrap { padding: 24px 26px; }
.heat-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }

.heat-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 34px);
  grid-auto-columns: 34px;
  gap: 6px;
  justify-content: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.heat-cell {
  width: 34px;
  height: 34px;
  min-width: 30px;
  border-radius: 9px;
  background: rgba(244, 242, 247, 0.9);
  border: 1px solid var(--line-2);
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease);
  position: relative;
  cursor: default;
}
.heat-cell.has { cursor: pointer; }
.heat-cell.has:hover { transform: scale(1.14); box-shadow: var(--sh-sm); z-index: 2; }

.heat-months { display: flex; gap: 6px; margin-top: 10px; font-size: 11px; color: var(--ink-4); }

.legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-4); margin-top: 16px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }

/* 折线图 */
.chart-wrap { padding: 24px 26px; }
.line-svg { width: 100%; height: auto; overflow: visible; }
.line-path { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.line-dot { fill: #fff; stroke-width: 2.4; transition: r 0.24s var(--ease); cursor: pointer; }
.line-dot:hover { r: 6; }

/* 情绪分布 */
.dist-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dist-name { width: 54px; font-size: 12.5px; color: var(--ink-2); flex: none; }
.dist-bar { display: block; flex: 1; height: 10px; border-radius: 6px; background: rgba(244,242,247,0.95); overflow: hidden; }
.dist-fill { display: block; height: 100%; border-radius: 6px; width: 0; transition: width 0.9s var(--ease); }
.dist-val { width: 34px; text-align: right; font-size: 12px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

/* ---------- 12. 设置 ---------- */
.setting-block {
  padding: 22px 24px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--sh-sm);
  margin-bottom: 14px;
}
.setting-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.setting-desc { font-size: 12.5px; color: var(--ink-4); margin-bottom: 16px; line-height: 1.8; }

.field {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  transition: border-color 0.3s var(--ease);
}
.field:focus-within { border-color: rgba(174,151,242,0.5); }
.field input {
  border: none; background: none; outline: none; width: 100%;
  font-family: inherit; font-size: 13px; color: var(--ink);
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.danger { color: #C96A6A; border-color: rgba(201,106,106,0.3) !important; }
.danger:hover { background: rgba(201,106,106,0.08) !important; color: #B14F4F !important; }

/* ---------- 13. 弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(46, 41, 70, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
  animation: fadeIn 0.3s var(--ease) both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(640px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  border-radius: var(--r-xl);
  background: linear-gradient(170deg, rgba(255,255,255,0.98), rgba(250,247,255,0.96));
  box-shadow: 0 40px 90px -40px rgba(46, 41, 70, 0.5);
  padding: 30px 32px 26px;
  animation: modalIn 0.42s var(--ease) both;
  position: relative;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(244, 242, 247, 0.9);
  color: var(--ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.26s var(--ease);
}
.modal-close:hover { background: var(--gray-2); color: var(--ink); transform: rotate(90deg); }

.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.detail-head svg { width: 62px; height: 62px; }
.detail-date { font-size: 13px; color: var(--ink-4); letter-spacing: 0.04em; }
.detail-mood { font-size: 20px; font-weight: 650; }

.detail-text {
  font-size: 14.5px;
  line-height: 2;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: rgba(247, 244, 255, 0.6);
  border: 1px solid var(--line-2);
}

.detail-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 14px; }
.detail-imgs img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px;
  box-shadow: var(--sh-sm); cursor: zoom-in;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.detail-imgs img:hover { transform: scale(1.02); box-shadow: var(--sh-md); }

.detail-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* 图片灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30, 26, 48, 0.82);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  padding: 40px;
  animation: fadeIn 0.26s var(--ease) both;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 92vw; max-height: 86vh;
  border-radius: 18px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6);
  animation: modalIn 0.34s var(--ease) both;
}

/* ---------- 14. Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: rgba(46, 41, 70, 0.92);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.03em;
  box-shadow: 0 18px 40px -18px rgba(46,41,70,0.7);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s var(--ease);
  z-index: 300;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 15. 移动端 ---------- */
.tabbar { display: none; }

@media (max-width: 1020px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .app { padding: 26px 18px 108px; max-width: 100%; }
  .mood-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
  .stats-grid { grid-template-columns: 1fr; }
  .card { padding: 22px 18px; border-radius: 24px; }

  .tabbar {
    display: flex;
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    gap: 4px;
    padding: 7px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255,255,255,0.95);
    box-shadow: 0 18px 40px -20px rgba(92,74,150,0.5);
    backdrop-filter: blur(18px);
    z-index: 60;
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 13px; border-radius: 16px; min-width: 60px;
    font-size: 10px; letter-spacing: .02em; white-space: nowrap;
    color: var(--ink-4); cursor: pointer;
    transition: all 0.28s var(--ease);
  }
  .tab-item svg { width: 18px; height: 18px; }
  .tab-item.active { background: rgba(239,233,255,0.95); color: var(--lav-600); font-weight: 600; }

  .heat-cell { width: 26px; height: 26px; }
  .title-xl { font-size: 25px; }
  .modal { padding: 24px 20px 20px; }
}

@media (max-width: 560px) {
  .mood-btn { padding: 12px 4px 10px; border-radius: 17px; }
  .mood-btn svg { width: 36px; height: 36px; }
  .mood-btn { font-size: 12px; }
  .rec-card { grid-template-columns: 46px minmax(0,1fr); padding: 16px; gap: 12px; }
  .rec-icon { width: 42px; height: 42px; }
  .editor textarea { font-size: 14px; min-height: 112px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(174, 151, 242, 0.3);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(174, 151, 242, 0.55); background-clip: content-box; }


/* ---------- 16. 热力图补充 ---------- */
.heat-body { display: flex; gap: 10px; align-items: flex-start; }

.heat-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 34px);
  gap: 7px;
  font-size: 10.5px;
  color: var(--ink-4);
  text-align: right;
  min-width: 18px;
  padding-top: 1px;
}
.heat-weekdays span { display: flex; align-items: center; justify-content: flex-end; }

.heat-cell.blank { background: transparent; border-color: rgba(120,105,160,.06); }

.heat-caption {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: .04em;
}

@media (max-width: 560px) {
  .heat-weekdays { grid-template-rows: repeat(7, 26px); }
}


/* ---------- 17. 热力图右侧小结 ---------- */
.heat-summary {
  flex: 1;
  min-width: 210px;
  margin-left: 12px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.hs-title {
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--ink-4);
  margin-bottom: 2px;
}
.hs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-3);
}
.hs-row b { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.hs-note {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-3);
  background: rgba(247,244,255,.7);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 10px 13px;
}

@media (max-width: 720px) {
  .heat-summary {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 8px;
    min-width: 100%;
  }
}


/* ---------- 18. 移动端筛选紧凑化 ---------- */
@media (max-width: 720px) {
  .filters { padding: 14px 12px; gap: 8px; min-width: 0; width: 100%; box-sizing: border-box; }
  .filter-row { min-width: 0; max-width: 100%; }
  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 3px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row > * { flex: none; }
  .filter-label { position: sticky; left: 0; background: rgba(255,255,255,.92); padding-right: 6px; z-index: 1; border-radius: 6px; }
  .search-box { flex: 1 1 auto; min-width: 0; }
  .search-box input { min-width: 0; }
  #filterTagRow { flex-wrap: nowrap !important; }
  .editor-tools .counter { font-size: 11px; }
  .page-head { margin-bottom: 18px; }
  .section-title { font-size: 14px; }
}


/* ---------- 19. 快捷短语 ---------- */
.quick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.quick-label { font-size: 11.5px; color: var(--ink-4); letter-spacing: .02em; }
.quick {
  border: 1px dashed rgba(174,151,242,.38);
  background: rgba(247,244,255,.6);
  color: var(--lav-500);
  border-radius: var(--r-pill);
  padding: 5px 13px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all .26s var(--ease);
}
.quick:hover {
  background: #fff;
  border-style: solid;
  color: var(--lav-600);
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}

/* 语音附件 */
.audio-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.audio-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(239, 233, 255, .55);
  border: 1px solid rgba(142, 115, 228, .18);
  border-radius: 12px; padding: 8px 12px;
  font-size: 12.5px; color: var(--ink-3, #6b6480);
}
.audio-play {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  border: none; background: var(--lav-500, #8E73E4); color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.audio-chip audio { display: none; }
.audio-del { margin-left: auto; background: none; border: none; color: var(--ink-4, #9a93ab); cursor: pointer; font-size: 12px; }
.rec-audio { margin-top: 8px; font-size: 12px; color: var(--lav-600, #6f5ab8); }
.detail-audio { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.detail-audio audio { width: 100%; }
