@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Echo 前端统一样式 ────────────────────────── */


/* ── CSS 变量 ── */
:root {
  /* 背景系 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F5F1;
  /* 暖奶油色 */
  --bg-card: #FFFFFF;
  --bg-muted: #F0EDE8;

  /* 文字系 */
  --text-primary: #1C1C1E;
  --text-secondary: #6B6868;
  --text-muted: #ABABAB;

  /* 主色：暖朊色 */
  --accent: #F5A623;
  --accent-light: #FEF3E2;
  --accent-dark: #D4870D;

  /* 辅助色 */
  --accent-2: #9D8FE0;
  /* 柔紫 */
  --accent-3: #F4836A;
  /* 珊瑚色 */

  /* 边框 */
  --border: #EDEAE4;
  --border-light: #F3F0EB;

  /* 状态 */
  --success: #4CAF7D;
  --success-light: #E8F7EE;
  --warning: #F5A623;
  --danger: #E05555;
  --danger-light: #FDECEA;

  /* 圆角 */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  /* 阴影 */
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.09);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);

  --transition: all 0.22s ease;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* 渐变 */
  --grad-warm: linear-gradient(135deg, #F5A623, #F4836A);
  --grad-purple: linear-gradient(135deg, #9D8FE0, #7B6EC6);
  --grad-coral: linear-gradient(135deg, #F4836A, #E05FA8);
  --grad-sky: linear-gradient(135deg, #6BB8E8, #5A76D8);
  --grad-nature: linear-gradient(135deg, #56C8A0, #4CAF7D);
  --grad-gold: linear-gradient(135deg, #F9C74F, #F5A623);
  /* 向后兼容别名 */
  --grad-blue: linear-gradient(135deg, #9D8FE0, #7B6EC6);
  --grad-pink: linear-gradient(135deg, #F4836A, #E05FA8);
}

/* ── 全局重置 ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

body.mobile-page {
  background: #F7F4EF;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

.mobile-stage {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-left: 1px solid rgba(0, 0, 0, 0.04);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

body.mobile-page .mobile-stage .navbar {
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  height: auto;
  min-height: 58px;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.98);
}

body.mobile-page .mobile-stage .navbar-brand {
  font-size: 17px;
}

body.mobile-page .mobile-stage .navbar-actions {
  width: 100%;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

body.mobile-page .mobile-stage .btn {
  justify-content: center;
}

body.mobile-page .mobile-stage .container {
  max-width: none;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
}

body.mobile-page .mobile-stage .card,
body.mobile-page .mobile-stage .state-card {
  border-radius: 18px;
}

/* ── 导航栏 ── */
.navbar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.btn-primary {
  background: var(--grad-blue);
  color: #fff;
  box-shadow: 0 3px 12px rgba(67, 97, 238, 0.30);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-dark), #6a4f9a);
  box-shadow: 0 4px 16px rgba(67, 97, 238, 0.40);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-light);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── 容器 ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.page-shell {
  padding-top: 28px;
}

.page-intro {
  margin-bottom: 24px;
}

.page-intro-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.page-title {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.12;
  color: var(--text-primary);
}

.page-subtitle {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.page-notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 14px;
}

.page-notice-error {
  border-color: #f3c6c2;
  background: var(--danger-light);
  color: var(--danger);
}

/* ── 卡片 ── */
.card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.055);
  padding: 20px;
  margin-bottom: 14px;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.card:hover {
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.card-accent {
  border-left: none;
  position: relative;
  overflow: hidden;
}

.card-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--grad-blue);
  border-radius: 4px 0 0 4px;
}

.state-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}

.state-card__body {
  max-width: 680px;
}

.state-card__eyebrow {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.state-card__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.state-card__text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.state-card__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ── 今日总结区 ── */
.today-section {
  margin-bottom: 32px;
}

.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.today-date {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.today-emotion {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}

.today-summary {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.today-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.today-card-label {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.today-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.today-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 16px;
}

.today-overview-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #f8f9ff, #f3f5ff);
  padding: 10px 8px;
  text-align: center;
  transition: var(--transition);
}

.today-overview-item:hover {
  background: var(--accent-light);
  border-color: rgba(67, 97, 238, 0.20);
}

.today-overview-label {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

.today-overview-value {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-align: center;
}

.today-block-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.today-note {
  background: var(--bg-secondary);
  border-left: 3px solid var(--text-muted);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.keywords-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.keyword-tag {
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

/* ── 回忆页：日记化呈现（沿用 Echo 视觉体系，局部增加春日氛围） ── */
.memory-hero {
  position: relative;
  margin: 16px 16px 26px;
  padding: 34px 28px;
  min-height: 188px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 86% 22%, rgba(255, 216, 132, 0.42), transparent 26%),
    radial-gradient(circle at 12% 88%, rgba(141, 196, 137, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(255, 248, 226, 0.92), rgba(239, 250, 235, 0.78));
  box-shadow: 0 18px 42px rgba(88, 113, 80, 0.08);
}

.memory-hero::after {
  content: '';
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 78px;
  height: 34px;
  border: solid rgba(76, 175, 125, .18);
  border-width: 0 0 2px 2px;
  border-radius: 0 0 0 100%;
  transform: rotate(-10deg);
}

.memory-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 300px;
}

.memory-hero-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.memory-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 34px;
  line-height: 1.2;
  font-weight: 800;
}

.memory-hero p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.memory-sun {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(245, 166, 35, .20);
  box-shadow: 0 0 0 18px rgba(245, 166, 35, .06);
}

.memory-section {
  margin: 0 16px 30px;
  padding-top: 2px;
}

.memory-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid rgba(76, 175, 125, .35);
}

.memory-section-title {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.memory-section-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.memory-search-section {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.memory-search {
  display: flex;
  gap: 8px;
  align-items: center;
}

.memory-search input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 15px;
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: #fff;
}

.memory-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.memory-search-hint {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.memory-clear-btn {
  white-space: nowrap;
}

.memory-search-view {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.search-hero {
  position: relative;
  margin: 12px 16px 24px;
  padding: 28px 24px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--border-light);
  background:
    radial-gradient(circle at 88% 18%, rgba(245, 166, 35, .22), transparent 28%),
    radial-gradient(circle at 12% 92%, rgba(76, 175, 125, .12), transparent 34%),
    linear-gradient(135deg, rgba(255, 252, 244, .96), rgba(242, 250, 239, .84));
  box-shadow: var(--shadow);
}

.search-back {
  border: 0;
  padding: 0;
  margin-bottom: 18px;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.search-hero-kicker {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.search-hero h1 {
  margin: 6px 0 8px;
  color: var(--text-primary);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
}

.search-hero p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.search-page-box {
  margin-top: -8px;
}

.search-result-list {
  display: grid;
  gap: 14px;
}

.search-result-card {
  padding: 20px 18px;
  border: 1px solid var(--border-light);
  border-left: 4px solid rgba(76, 175, 125, .36);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 252, 245, .90)),
    var(--bg-card);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.search-result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.search-result-date {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.search-result-quote {
  margin-top: 16px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.65;
}

.search-result-preview {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.85;
}

.search-highlight {
  padding: 0 2px;
  border-radius: 4px;
  color: var(--text-primary);
  background: rgba(245, 166, 35, .22);
}

.memory-feature,
.memory-empty,
.memory-photo-group {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.memory-feature {
  padding: 26px 24px;
  cursor: pointer;
  border-left: 4px solid rgba(76, 175, 125, .42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 252, 245, .9)),
    var(--bg-card);
}

.memory-feature-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.memory-date {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
}

.memory-mood,
.memory-diary-mood {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}

.memory-read-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.memory-quote {
  margin: 24px 0 16px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.68;
}

.memory-preview,
.memory-diary-preview {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.88;
  margin: 0;
}

.memory-keywords {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.memory-quote-grid {
  display: grid;
  gap: 14px;
}

.memory-quote-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(245, 166, 35, .045), transparent 52%),
    var(--bg-card);
  padding: 18px 18px 17px;
  cursor: pointer;
  font-family: var(--font-family);
  box-shadow: var(--shadow);
}

.memory-quote-card::before {
  content: '“';
  display: block;
  width: auto;
  height: auto;
  margin-bottom: 8px;
  color: rgba(245, 166, 35, .55);
  background: transparent;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

.memory-quote-text {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.memory-quote-meta {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.memory-timeline {
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 20px;
}

.memory-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 7px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(245, 166, 35, .34), rgba(76, 175, 125, .22));
}

.memory-diary-item {
  position: relative;
  cursor: pointer;
}

.memory-timeline-dot {
  position: absolute;
  left: -20px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 3px solid rgba(245, 166, 35, .72);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, .10);
}

.memory-diary-card {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.memory-diary-date {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
}

.memory-diary-quote {
  margin-top: 14px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
}

.memory-diary-preview {
  margin-top: 10px;
}

.memory-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.memory-empty {
  padding: 24px 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.memory-empty-title {
  color: var(--text-primary);
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 6px;
}

.memory-empty-text {
  margin-bottom: 14px;
}

.memory-empty-compact {
  padding: 16px;
}

.memory-photo-group {
  padding: 16px;
  margin-bottom: 16px;
  background:
    linear-gradient(180deg, rgba(76, 175, 125, .045), transparent 54%),
    var(--bg-card);
}

.memory-photo-date {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.memory-photo-subsection + .memory-photo-subsection {
  margin-top: 16px;
}

.memory-photo-subtitle {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.memory-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.memory-photo-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  background: var(--bg-secondary);
  cursor: pointer;
}

.memory-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-photo-fallback {
  display: none;
}

.memory-photo-item.is-broken {
  background: #f4f1eb;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  place-items: center;
}

.memory-photo-item.is-broken .memory-photo-fallback {
  display: grid;
  position: absolute;
  inset: 0;
  padding: 10px;
  text-align: center;
  line-height: 1.4;
  background: transparent;
  color: var(--text-muted);
  white-space: normal;
}

.memory-photo-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  color: #fff;
  font-size: 10px;
  line-height: 1.35;
  padding: 16px 5px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ── 折叠面板（今日子数据） ── */
.collapse-section {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.collapse-header {
  padding: 10px 16px;
  background: var(--bg-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.collapse-header:hover {
  background: var(--border-light);
}

.collapse-body {
  padding: 12px 16px;
  display: none;
  font-size: 14px;
}

.collapse-body.open {
  display: block;
}

.collapse-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
}

.collapse-item:last-child {
  border-bottom: none;
}

/* ════════════════════════════════════════════════════════
   ── 正文编辑区（Path A）──────────────────────────────
   ════════════════════════════════════════════════════════ */

.body-edit-panel {
  border-left: 4px solid #667eea;
}

.body-edit-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.body-edit-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.body-edit-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.body-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font-family);
  color: var(--text-primary);
  line-height: 1.8;
  resize: vertical;
  min-height: 160px;
  transition: var(--transition);
  background: var(--bg-secondary);
}

.body-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: var(--bg-primary);
}

.body-edit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════
   ── AI 补充对话区（Path B）──────────────────────────
   ════════════════════════════════════════════════════════ */

.supplement-panel {
  border-left: 4px solid var(--success);
}

.supplement-header {
  margin-bottom: 16px;
}

.supplement-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* AI 提示语 */
.supplement-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #e8f8f0 0%, #e8edff 100%);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.supplement-prompt-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.supplement-prompt-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* 消息列表 */
.supplement-messages {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supplement-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.supplement-msg-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.supplement-msg-content {
  font-size: 14px;
  line-height: 1.7;
  padding: 10px 14px;
  border-radius: var(--radius);
  max-width: 85%;
  word-break: break-word;
}

/* 用户消息 */
.supplement-msg-user {
  flex-direction: row-reverse;
}

.supplement-msg-user .supplement-msg-content {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 2px;
}

/* AI 消息 */
.supplement-msg-ai .supplement-msg-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}

/* 系统/错误消息 */
.supplement-msg-system .supplement-msg-content {
  background: var(--danger-light);
  color: var(--danger);
  font-size: 13px;
}

/* 输入行 */
.supplement-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.supplement-input-row input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-family);
  transition: var(--transition);
}

.supplement-input-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.supplement-input-row input:disabled {
  background: var(--bg-secondary);
  opacity: 0.7;
}

/* 保存行 */
.supplement-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

/* ── 状态提示 ── */
.status-box {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.status-box .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.status-box .text {
  font-size: 16px;
  margin-bottom: 16px;
}

.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 分割线 ── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── 筛选栏 ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.filter-bar input[type="date"] {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--text-primary);
}

/* ── Tab 局部筛选面板 ── */
.tab-filter {
  display: none;
  border: 1px solid var(--border);
  border-top: none;
  background: var(--bg-secondary);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.tab-filter.visible {
  display: block;
}

.tab-filter-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
}

.tab-filter-inner label {
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tab-filter-inner input[type="text"],
.tab-filter-inner input[type="number"] {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-family);
  width: 100px;
  color: var(--text-primary);
  transition: var(--transition);
}

.tab-filter-inner input[type="text"] {
  width: 140px;
}

.tab-filter-inner input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

/* ── Tab 栏 ── */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 5px 5px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}

.tab-item {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  user-select: none;
  text-align: center;
  white-space: nowrap;
}

.tab-item:hover {
  color: var(--accent);
  background: rgba(67, 97, 238, 0.06);
}

.tab-item.active {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.14);
  font-weight: 700;
}

/* ── 表格 ── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--accent-light);
}

.data-table tbody tr:nth-child(even) {
  background: var(--bg-secondary);
}

.data-table tbody tr:nth-child(even):hover {
  background: var(--accent-light);
}

.date-link {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.content-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 来源标签 ── */
.source-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.source-ai {
  background: var(--accent-light);
  color: var(--accent);
}

.source-user {
  background: var(--success-light);
  color: var(--success);
}

/* ── 确认状态 ── */
.confirmed-yes {
  font-size: 14px;
}

.confirmed-no {
  font-size: 14px;
  opacity: 0.4;
}

/* ── 情绪星星 ── */
.intensity-stars {
  color: var(--warning);
  font-size: 14px;
  letter-spacing: 1px;
}

/* ── 金额 ── */
.amount-cell {
  font-weight: 600;
  color: var(--danger);
  white-space: nowrap;
}

/* ── 分页 ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.pagination-info {}

.pagination-actions {
  display: flex;
  gap: 8px;
}

/* ── 搜索栏（详情页） ── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-family);
  transition: var(--transition);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ── 高亮匹配 ── */
mark {
  background: #fff3cd;
  color: var(--text-primary);
  padding: 1px 2px;
  border-radius: 2px;
}

/* ── 详情卡片列表 ── */
.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section-count {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
  background: var(--bg-primary);
  transition: var(--transition);
}

.detail-item:hover {
  border-color: var(--accent);
}

.detail-item-main {
  flex: 1;
}

.detail-empty {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
  padding: 12px 0;
}

body.mobile-page .mobile-stage .page-title {
  font-size: 28px;
}

body.mobile-page .mobile-stage .page-subtitle {
  font-size: 14px;
}

body.mobile-page .mobile-stage .today-card-head,
body.mobile-page .mobile-stage .chat-layout__header {
  flex-direction: column;
  align-items: flex-start;
}

body.mobile-page .mobile-stage .today-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.mobile-page .mobile-stage .filter-bar {
  flex-direction: column;
  align-items: stretch;
}

body.mobile-page .mobile-stage .supplement-input-row,
body.mobile-page .mobile-stage .body-edit-actions,
body.mobile-page .mobile-stage .edit-actions,
body.mobile-page .mobile-stage .pagination {
  flex-direction: column;
  align-items: stretch;
}

body.mobile-page .mobile-stage .tab-bar {
  overflow-x: auto;
  scrollbar-width: none;
}

body.mobile-page .mobile-stage .tab-bar::-webkit-scrollbar {
  display: none;
}

body.mobile-page .mobile-stage .tab-item {
  white-space: nowrap;
}

body.mobile-page .mobile-stage .search-bar {
  flex-direction: column;
}

body.mobile-page .mobile-stage .chat-card {
  display: flex;
  flex-direction: column;
}

body.mobile-page .mobile-stage .chat-messages {
  min-height: 320px;
  max-height: none;
  height: calc(100vh - 360px);
}

body.mobile-page .mobile-stage .chat-message {
  max-width: 88%;
}

body.mobile-page .mobile-stage .chat-actions,
body.mobile-page .mobile-stage .state-card__actions {
  flex-direction: column;
}

body.mobile-page .mobile-stage .chat-actions .btn,
body.mobile-page .mobile-stage .state-card__actions .btn {
  width: 100%;
}

/* ── 今日记录页 / 聊天页 ── */
.chat-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-layout__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.chat-layout__eyebrow {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-layout__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.chat-layout__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
}

.chat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-messages {
  padding: 20px;
  background: #fbfcfe;
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-empty {
  margin: auto 0;
  text-align: center;
  color: var(--text-secondary);
}

.chat-empty__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.chat-empty__text {
  margin: 0;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 76%;
}

.chat-message-user {
  align-self: flex-end;
  text-align: left;
}

.chat-message-ai {
  align-self: flex-start;
}

.chat-message__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.chat-message__bubble {
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.8;
  font-size: 14px;
  word-break: break-word;
}

.chat-message-user .chat-message__bubble {
  background: #eef4ff;
  color: #264466;
  border-bottom-right-radius: 4px;
}

.chat-message-ai .chat-message__bubble {
  background: #f1f4f7;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-input-panel {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.chat-input-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.chat-input-panel textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-family);
  transition: var(--transition);
}

.chat-input-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.chat-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ── 登录页 ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(67, 97, 238, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(46, 204, 113, 0.08), transparent 30%),
    linear-gradient(180deg, #fafbfd 0%, #f2f5f8 100%);
}

.login-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-brand {
  text-align: center;
}

.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 34px;
  margin-bottom: 14px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-light);
  font-size: 15px;
  font-weight: 800;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-secondary);
}

.auth-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  color: var(--text-secondary);
  background: transparent;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.auth-tab.active {
  color: var(--accent);
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-family);
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  margin-top: 8px;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.text-link {
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.debug-actions {
  display: grid;
  gap: 10px;
}

.debug-actions a {
  text-align: center;
  text-decoration: none;
}

body.mobile-page--login .mobile-stage {
  display: flex;
  align-items: stretch;
}

body.mobile-page--login .login-page {
  width: 100%;
}

body.mobile-page--login .login-card {
  border-radius: 28px;
  padding: 36px 24px;
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .mobile-stage {
    width: 100%;
    box-shadow: none;
    border-left: none;
    border-right: none;
  }

  .container {
    padding: 16px;
  }

  .navbar {
    padding: 0 16px;
  }

  .tab-item {
    padding: 10px 14px;
    font-size: 13px;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-card {
    margin: 16px;
    padding: 24px;
  }

  .body-textarea {
    min-height: 120px;
    font-size: 14px;
  }

  .supplement-msg-content {
    max-width: 90%;
  }

  .supplement-input-row {
    flex-direction: column;
  }

  .supplement-input-row input {
    width: 100%;
  }

  .today-card-head,
  .chat-layout__header {
    flex-direction: column;
  }

  .today-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-message {
    max-width: 92%;
  }

  .chat-actions,
  .state-card__actions {
    flex-direction: column;
  }
}

/* ── 历史详情页轻量编辑面板 ── */
.edit-panel {
  margin-top: 8px;
}

.edit-panel-header {
  margin-bottom: 20px;
}

.edit-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.edit-group {
  margin-bottom: 18px;
}

.edit-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.edit-group .hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
}

.edit-group textarea,
.edit-group input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--text-primary);
  transition: var(--transition);
}

.edit-group textarea {
  resize: vertical;
}

.edit-group textarea:focus,
.edit-group input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* 当前标签行 */
.edit-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  align-items: center;
}

/* 可删标签胶囊 */
.edit-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 8px 3px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

/* 待删除状态：灰色 + 删除线 */
.edit-tag.edit-tag-pending {
  background: var(--bg-secondary);
  color: var(--text-muted);
  text-decoration: line-through;
}

.edit-tag-del {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.6;
  transition: var(--transition);
}

.edit-tag-del:hover {
  opacity: 1;
}

/* 操作区 */
.edit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.edit-status {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.edit-status.success {
  color: var(--success);
}

.edit-status.error {
  color: var(--danger);
}

/* ════════════════════════════════════════════════════════
   ── 内联备注/关键词编辑 ──────────────────────────────
   ════════════════════════════════════════════════════════ */

.today-note--clickable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.today-note--clickable:hover {
  background: var(--accent-light);
}

.note-edit-icon {
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s;
  margin-left: auto;
}

.today-note--clickable:hover .note-edit-icon {
  opacity: 1;
}

.note-kw-form {
  display: none;
  padding: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 4px 0 8px;
}

.note-kw-form textarea,
.note-kw-form input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: var(--transition);
  margin-bottom: 8px;
}

.note-kw-form textarea {
  resize: vertical;
  min-height: 64px;
}

.note-kw-form textarea:focus,
.note-kw-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.note-kw-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.note-kw-label .hint {
  font-weight: 400;
  color: var(--text-muted);
}

.note-kw-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════
   ── 折叠区头部内联编辑按钮 ──────────────────────────
   ════════════════════════════════════════════════════════ */

.collapse-header {
  display: flex;
  align-items: center;
}

.section-inline-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  opacity: 0.5;
  transition: var(--transition);
  line-height: 1;
  display: flex;
  align-items: center;
}

.section-inline-edit-btn:hover {
  opacity: 1;
  background: var(--accent-light);
}

/* ════════════════════════════════════════════════════════
   ── 标签内联编辑 ─────────────────────────────────────
   ════════════════════════════════════════════════════════ */

.inline-tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}

.inline-tags-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
  min-height: 36px;
}

.tag-add-row {
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  margin-top: 4px;
}

.tag-add-input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: var(--transition);
  margin-bottom: 8px;
}

.tag-add-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
  background: var(--bg-primary);
}

.tag-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════
   ── APP SHELL：底部导航 ──────────────────────────────
   ════════════════════════════════════════════════════════ */

/* 页面底部预留空间 */
.has-bottom-nav {
  padding-bottom: 84px !important;
}

/* 底部导航栏 */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw, 430px);
  height: 64px;
  padding: 0 12px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(67, 97, 238, 0.10);
  display: flex;
  align-items: center;
  z-index: 9999;
  box-shadow: 0 -6px 28px rgba(67, 97, 238, 0.09);
}

.app-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  text-decoration: none;
  padding: 7px 6px;
  border-radius: 14px;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app-nav-item:hover {
  background: rgba(67, 97, 238, 0.07);
}

.app-nav-icon {
  font-size: 21px;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  transition: color 0.18s ease;
}

.app-nav-item.active {
  background: var(--accent-light);
}

.app-nav-item.active .app-nav-icon {
  transform: scale(1.18) translateY(-1px);
}

.app-nav-item.active .app-nav-label {
  color: var(--accent);
  font-weight: 700;
}

.app-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: var(--grad-blue);
}

/* ── App 顶栏（轻量替代 navbar）── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header-logo {
  font-size: 22px;
  font-weight: 800;
  background: var(--grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.app-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ════════════════════════════════════════════════════════
   ── 希冀页 (Hope Page) ────────────────────────────────
   ════════════════════════════════════════════════════════ */

/* Hero Banner */
.hope-hero {
  margin: 0 16px 20px;
  padding: 24px 22px;
  border-radius: var(--radius-xl);
  background: var(--grad-blue);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hope-hero::before {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
}

.hope-hero::after {
  content: '';
  position: absolute;
  right: 20px;
  bottom: -40px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.hope-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 6px;
}

.hope-hero-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.hope-hero-sub {
  font-size: 13px;
  opacity: 0.80;
  line-height: 1.5;
}

/* 连续打卡 Streak */
.streak-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 20px;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--grad-warm);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(248, 150, 30, 0.30);
}

.streak-days-row {
  display: flex;
  gap: 5px;
  flex: 1;
  justify-content: flex-end;
}

.streak-day {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  transition: var(--transition);
}

.streak-day.done {
  background: linear-gradient(135deg, #4caf50, #2ecc71);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.30);
}

.streak-day.today {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* 打卡习惯 Habit Cards */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-action {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--accent-light);
  background: var(--accent-light);
  text-decoration: none;
  transition: var(--transition);
}

.section-action:hover {
  background: var(--accent);
  color: #fff;
}

.habit-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: 0 16px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.habit-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.habit-ring-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.habit-ring-svg {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.habit-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 5;
}

.habit-ring-fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.habit-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.habit-info {
  flex: 1;
}

.habit-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.habit-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.habit-check-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
  flex-shrink: 0;
}

.habit-check-btn.done {
  background: linear-gradient(135deg, #4caf50, #2ecc71);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(46, 204, 113, 0.35);
}

.habit-check-btn:hover:not(.done) {
  border-color: var(--accent);
  color: var(--accent);
}

/* 目标卡片 Goal Cards */
.goal-card {
  margin: 0 16px 10px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}

.goal-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.goal-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.goal-pct {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.goal-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.goal-progress-track {
  height: 7px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.goal-deadline {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* 新增按钮 */
.add-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 16px 16px;
  padding: 12px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: none;
  width: calc(100% - 32px);
}

.add-item-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ════════════════════════════════════════════════════════
   ── 我的 (Profile Page) ──────────────────────────────
   ════════════════════════════════════════════════════════ */

.profile-hero {
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--grad-blue);
  margin: 0;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  left: -40px;
  bottom: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.profile-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 3px solid rgba(255, 255, 255, 0.50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 1;
}

.profile-name {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  z-index: 1;
}

.profile-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  z-index: 1;
}

.profile-stats {
  display: flex;
  gap: 0;
  margin: -1px 0 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}

.profile-stat {
  flex: 1;
  padding: 16px 8px;
  text-align: center;
  border-right: 1px solid var(--border-light);
}

.profile-stat:last-child {
  border-right: none;
}

.profile-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.profile-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.profile-section {
  margin: 16px 16px 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-section-title {
  padding: 12px 16px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.profile-row:hover {
  background: var(--bg-secondary);
}

.profile-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.profile-row-text {
  flex: 1;
}

.profile-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-row-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.profile-row-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

.profile-row-value {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.profile-toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.profile-toggle input {
  display: none;
}

.profile-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: var(--transition);
  cursor: pointer;
}

.profile-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.profile-toggle input:checked+.profile-toggle-slider {
  background: var(--accent);
}

.profile-toggle input:checked+.profile-toggle-slider::after {
  transform: translateX(20px);
}

.profile-logout {
  margin: 20px 16px 8px;
  width: calc(100% - 32px);
  padding: 14px;
  background: var(--danger-light);
  color: var(--danger);
  border: 1.5px solid rgba(231, 76, 60, 0.20);
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── 移动端响应式补充 ── */
@media (max-width: 430px) {
  .app-bottom-nav {
    padding: 0 4px;
  }

  .hope-hero {
    margin: 0 12px 20px;
  }
}

/* ════════════════════════════════════════════════════════
   ── 暖色主题覆盖层（匹配参考设计风格）───────────────
   ════════════════════════════════════════════════════════ */

/* ── App Logo 暖橙渐变 ── */
.app-header-logo {
  font-size: 22px;
  font-weight: 800;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* ── App 顶栏背景 ── */
.app-header {
  background: var(--bg-secondary);
}

/* ── 底部导航：暖橙激活态 ── */
.app-bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
}

.app-nav-item.active {
  background: var(--accent-light);
}

.app-nav-item.active .app-nav-label {
  color: var(--accent);
}

.app-nav-item.active::after {
  background: var(--grad-warm);
}

.app-nav-item:hover {
  background: rgba(245, 166, 35, 0.08);
}

/* ── 问候区 ── */
.greeting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}

.greeting-text {
  flex: 1;
}

.greeting-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.greeting-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.6px;
}

.greeting-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad-warm);
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.greeting-avatar:hover {
  transform: scale(1.05);
}

/* ── 横向日期条 ── */
.date-strip {
  display: flex;
  gap: 8px;
  padding: 18px 20px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.date-strip::-webkit-scrollbar {
  display: none;
}

.date-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 40px;
  cursor: pointer;
}

.date-day-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.date-day-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.date-day-num:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.date-day.today .date-day-num {
  background: var(--grad-warm);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.40);
  border-color: transparent;
}

.date-day.today .date-day-label {
  color: var(--accent);
}

.date-day.has-record .date-day-num {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── 栏目标题（区块 Header） ── */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 10px;
}

.section-row-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.section-row-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: opacity 0.2s;
}

.section-row-action:hover {
  opacity: 0.7;
}

/* ── 今日日记大横幅卡片 ── */
.journal-banner {
  margin: 0 16px 14px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  transition: transform 0.22s ease;
}

.journal-banner:hover {
  transform: scale(1.01);
}

.journal-banner-bg {
  position: absolute;
  inset: 0;
  background: var(--grad-warm);
}

.journal-banner-deco {
  position: absolute;
  right: -10px;
  top: -20px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
}

.journal-banner-deco2 {
  position: absolute;
  right: 30px;
  bottom: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}

.journal-banner-content {
  position: relative;
  z-index: 2;
  padding: 20px 24px 22px;
  color: #fff;
}

.journal-banner-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  backdrop-filter: blur(4px);
}

.journal-banner-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.journal-banner-sub {
  font-size: 13px;
  opacity: 0.85;
}

/* ── 快速记录 Chip ── */
.quick-chips {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-chips::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  flex-shrink: 0;
  width: 150px;
  padding: 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.quick-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.quick-chip-1 {
  background: #FEF0E2;
}

.quick-chip-2 {
  background: #EDE8FD;
}

.quick-chip-3 {
  background: #E2F4EC;
}

.quick-chip-4 {
  background: #E2F4FD;
}

.quick-chip-5 {
  background: #FDECEA;
}

.quick-chip-6 {
  background: #F9F9F0;
}

.quick-chip-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-chip-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.quick-chip-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.quick-chip-1 .quick-chip-tag {
  background: #F5A623;
  color: #fff;
}

.quick-chip-2 .quick-chip-tag {
  background: #9D8FE0;
  color: #fff;
}

.quick-chip-3 .quick-chip-tag {
  background: #4CAF7D;
  color: #fff;
}

.quick-chip-4 .quick-chip-tag {
  background: #5A76D8;
  color: #fff;
}

.quick-chip-5 .quick-chip-tag {
  background: #E05FA8;
  color: #fff;
}

.quick-chip-6 .quick-chip-tag {
  background: #F5A623;
  color: #fff;
}

/* ── 暖调 Tab 栏 ── */
.tab-bar {
  background: var(--bg-muted, #F0EDE8);
  border: 1px solid var(--border-light);
}

.tab-item.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ── 分割线暖调 ── */
.section-divider {
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ── 希冀页 Hero 暖调更新 ── */
.hope-hero {
  background: var(--grad-warm);
}

.streak-badge {
  background: var(--grad-gold);
}

/* ── Profile Hero 暖调 ── */
.profile-hero {
  background: var(--grad-warm);
}

/* ── 今日卡片 card-accent 暖左边 ── */
.card-accent::before {
  background: var(--grad-warm);
}

/* ── 表单输入框暖调 ── */
.body-textarea:focus,
.supplement-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ── 标签暖调 ── */
.keyword-tag {
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* ── 今日概览格子 ── */
.today-overview-item {
  background: var(--bg-secondary);
  border-color: var(--border-light);
}

.today-overview-item:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.today-overview-value {
  color: var(--accent);
}

/* ════════════════════════════════════════════════════════
   ── 寻迹页面 (.xj-*) ─────────────────────────────────
   ════════════════════════════════════════════════════════ */

/* ── Hero 区 ── */
.xj-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 12px;
}

.xj-hero-left {
  flex: 1;
}

.xj-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.xj-page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.xj-page-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.xj-hero-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.30);
  animation: xj-orb-float 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes xj-orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ── 时间范围选择器 ── */
.xj-range-tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 14px;
}

.xj-range-tab {
  flex: 1;
  padding: 7px 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
}

.xj-range-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.30);
}

.xj-range-tab:hover:not(.active) {
  background: var(--bg-muted);
  border-color: var(--border);
}

/* ── 通用卡片 ── */
.xj-section-wrap {
  padding: 0 16px;
  margin-bottom: 12px;
}

.xj-card {
  position: relative;
  padding-top: 16px;
  overflow: hidden;
}

.xj-accent-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 22px 22px 0 0;
}

.xj-accent-warm   { background: var(--grad-warm); }
.xj-accent-purple { background: var(--grad-purple); }
.xj-accent-sky    { background: var(--grad-sky); }
.xj-accent-coral  { background: var(--grad-coral); }

.xj-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.xj-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.xj-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.xj-card-loading {
  text-align: center;
  padding: 14px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.xj-card-empty {
  text-align: center;
  padding: 20px 0 10px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
}

/* ── 收支 Tab ── */
.xj-expense-tabs {
  display: flex;
  gap: 4px;
}

.xj-expense-tab {
  padding: 3px 9px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
}

.xj-expense-tab.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.xj-expense-pane {
  min-height: 100px;
}

/* 概览 */
.xj-exp-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.xj-exp-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.xj-exp-hero {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.xj-exp-top-badge {
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 120px;
}

/* Mini bars (概览) */
.xj-mini-bars { display: flex; flex-direction: column; gap: 5px; }

.xj-mini-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xj-mini-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 48px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xj-mini-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-muted);
  border-radius: 3px;
  overflow: hidden;
}

.xj-mini-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width 0.6s ease;
}

.xj-mini-bar-pct {
  font-size: 11px;
  color: var(--text-muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* 分类 bars */
.xj-cat-bars { display: flex; flex-direction: column; gap: 8px; }

.xj-cat-bar-row { display: flex; flex-direction: column; }

.xj-cat-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 2px;
}

.xj-cat-bar-name { color: var(--text-primary); font-weight: 500; }
.xj-cat-bar-amt  { color: var(--text-secondary); }

/* 明细列表 */
.xj-ledger-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 220px;
  overflow-y: auto;
}

.xj-ledger-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}

.xj-ledger-row:hover { background: var(--bg-secondary); }
.xj-ledger-row:last-child { border-bottom: none; }

.xj-ledger-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.xj-ledger-desc {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xj-ledger-amt {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  flex-shrink: 0;
}

/* ── 情绪 Sparkline ── */
.xj-spark-wrap {
  margin-bottom: 12px;
  height: 60px;
}

.xj-spark-svg {
  width: 100%;
  height: 60px;
  display: block;
}

/* 情绪 chips */
.xj-emotion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.xj-emotion-chip {
  display: inline-flex;
  align-items: baseline;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
  line-height: 1.4;
  transition: transform 0.15s ease;
}

.xj-emotion-chip:hover { transform: scale(1.06); }

/* ── 事件流水区 ── */
.xj-stream-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 10px;
}

.xj-stream {
  height: 180px;
  margin: 0 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #D6EDFA 0%, #B8DDF5 45%, #99CCF0 100%);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* 双层水波纹 */
.xj-stream::before,
.xj-stream::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 50px;
  top: 15px;
  left: -50%;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  animation: xj-wave 4.5s ease-in-out infinite;
  pointer-events: none;
}

.xj-stream::after {
  top: 32px;
  animation-delay: -2.2s;
  background: rgba(255, 255, 255, 0.12);
  animation-duration: 6s;
}

@keyframes xj-wave {
  0%, 100% { transform: translateX(0) scaleY(1); }
  50%       { transform: translateX(6%) scaleY(0.75); }
}

/* 漂浮文字 */
.xj-float-word {
  position: absolute;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: rgba(20, 70, 120, 0.72);
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.55);
  animation: xj-float-up var(--xj-dur, 9s) linear var(--xj-delay, 0s) infinite;
}

@keyframes xj-float-up {
  0%   { transform: translateY(190px) translateX(0);                opacity: 0; }
  8%   { opacity: 0.85; }
  88%  { opacity: 0.7; }
  100% { transform: translateY(-30px) translateX(var(--xj-drift, 0px)); opacity: 0; }
}

.xj-stream-loading,
.xj-stream-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(30, 80, 130, 0.55);
  font-size: 13px;
  line-height: 1.7;
  pointer-events: none;
}

/* ── 地点足迹 ── */
.xj-place-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.xj-place-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.15s ease;
}

/* ── Chat Layout Mode Themes ── */
.chat-layout.theme-expense {
  --chat-accent: #F5A623;
  --chat-bg-light: #F9F9F0;
}
.chat-layout.theme-inspiration {
  --chat-accent: #5A76D8;
  --chat-bg-light: #E2F4FD;
}
.chat-layout.theme-learning {
  --chat-accent: #4CAF7D;
  --chat-bg-light: #E2F4EC;
}
.chat-layout.theme-chat {
  --chat-accent: #9D8FE0;
  --chat-bg-light: #EDE8FD;
}

.chat-layout[class*="theme-"] .chat-layout__header {
  background: var(--chat-bg-light);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  margin: -20px -20px 20px;
  padding: 24px 20px 16px;
  border-radius: 20px 20px 0 0;
}

.chat-layout[class*="theme-"] .chat-layout__title {
  color: var(--chat-accent);
}

.chat-layout[class*="theme-"] .chat-input-label {
  color: var(--chat-accent);
  font-weight: 700;
}

.chat-layout[class*="theme-"] .chat-meta-pill {
  background: #fff;
  color: var(--chat-accent);
  border: 1px solid var(--chat-bg-light);
}

.chat-layout[class*="theme-"] textarea:focus {
  border-color: var(--chat-accent);
  box-shadow: 0 0 0 3px rgba(var(--chat-accent), 0.1);
}

.chat-layout[class*="theme-"] .btn-primary {
  background: var(--chat-accent);
  border-color: var(--chat-accent);
}

/* ── 快速记录弹层 (Modal) ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  width: min(100%, 430px);
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: var(--bg-secondary);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mode-badge {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-textarea {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  font-size: 16px;
  font-family: var(--font-family);
  background: var(--bg-secondary);
  resize: none;
}

.modal-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 16px;
}

.xj-place-chip:hover { transform: scale(1.04); }

/* ── 灵感集 ── */
.xj-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.xj-tag-item {
  display: inline-block;
  color: var(--accent-3);
  font-weight: 600;
  text-decoration: none;
  padding: 1px 2px;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1.5;
}

.xj-tag-item:hover {
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}
