@font-face {
  font-family: 'InstrumentSans';
  src: url('../_shared/fonts/InstrumentSans-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'InstrumentSans';
  src: url('../_shared/fonts/InstrumentSans-Bold.ttf') format('truetype');
  font-weight: 700;
}
@font-face {
  font-family: 'JetBrainsMono';
  src: url('../_shared/fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
}

:root {
  /* ===== 马卡龙色板 ===== */
  --pink: #F8BBD0;
  --pink-soft: #FDE7EF;
  --orange: #FFCC80;
  --orange-soft: #FFF3E0;
  --yellow: #FFF59D;
  --yellow-soft: #FFFDE7;
  --blue: #90CAF9;
  --blue-soft: #E3F2FD;
  --purple: #CE93D8;
  --purple-soft: #F3E5F5;
  --lime: #A5D6A7;
  --lime-soft: #E8F5E9;
  --coral: #FFAB91;
  --coral-soft: #FBE9E7;
  --cyan: #80DEEA;
  --cyan-soft: #E0F7FA;
  /* 基础色 */
  --bg: #FFF8FA;
  --bg2: #FFFFFF;
  --ink: #2D1B3D;
  --muted: #7A6A80;
  --rule: #F0E8F0;
  /* 功能色 */
  --accent: #F48FB1;
  --accent-hover: #EC407A;
  --accent-soft: #FDE7EF;
  --accent-text: #4A1942;
  --success: #A5D6A7;
  --success-soft: #E8F5E9;
  --warning: #FFCC80;
  --warning-soft: #FFF3E0;
  --danger: #FFAB91;
  --danger-soft: #FBE9E7;
  --font: 'InstrumentSans', "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrainsMono', ui-monospace, monospace;
  --max: 800px;
  --shadow: 0 4px 16px rgba(248, 187, 208, 0.15);
  --shadow-hover: 0 8px 28px rgba(248, 187, 208, 0.22);
  --shadow-colorful: 0 6px 20px rgba(255, 204, 128, 0.12);
}

[data-theme="dark"] {
  --bg: #2A1F2D;
  --bg2: #3D2F42;
  --ink: #F0E6F5;
  --muted: #C0B0C8;
  --rule: #4D3F55;
  --accent: #F48FB1;
  --accent-hover: #F8BBD0;
  --accent-soft: rgba(244, 143, 177, 0.15);
  --accent-text: #F8BBD0;
  --success: #A5D6A7;
  --success-soft: rgba(165, 214, 167, 0.12);
  --warning: #FFCC80;
  --warning-soft: rgba(255, 204, 128, 0.12);
  --danger: #FFAB91;
  --danger-soft: rgba(255, 171, 145, 0.12);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-colorful: 0 6px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2A1F2D;
    --bg2: #3D2F42;
    --ink: #F0E6F5;
    --muted: #C0B0C8;
    --rule: #4D3F55;
    --accent: #F48FB1;
    --accent-hover: #F8BBD0;
    --accent-soft: rgba(244, 143, 177, 0.15);
    --accent-text: #F8BBD0;
    --success: #A5D6A7;
    --success-soft: rgba(165, 214, 167, 0.12);
    --warning: #FFCC80;
    --warning-soft: rgba(255, 204, 128, 0.12);
    --danger: #FFAB91;
    --danger-soft: rgba(255, 171, 145, 0.12);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-colorful: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

/* ===== 马卡龙柔和背景 ===== */
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 10% 0%, rgba(253, 231, 239, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(255, 243, 224, 0.4) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 80%, rgba(227, 242, 253, 0.35) 0%, transparent 45%),
    radial-gradient(ellipse at 20% 90%, rgba(243, 229, 245, 0.35) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 253, 231, 0.3) 0%, transparent 60%);
  background-attachment: fixed;
}

.page {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}

/* =====  Header - 活泼大标题 ===== */
.page-header {
  text-align: center;
  padding: 2rem 0 1.25rem;
  position: relative;
}
.page-header::before {
  content: '✨';
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  font-size: 1.4rem;
  animation: float 2.5s ease-in-out infinite;
}
.page-header::after {
  content: '🌈';
  position: absolute;
  top: 0.3rem;
  right: 1rem;
  font-size: 1.3rem;
  animation: float 3s ease-in-out infinite 0.5s;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}
.page-header h1 {
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(135deg, #CE93D8, #F48FB1, #FFAB91);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  text-shadow: none;
}
.page-header .subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

/* Theme toggle */
.theme-toggle {
  position: absolute;
  top: 0.8rem;
  right: 3.2rem;
  background: var(--bg2);
  border: 2px solid var(--accent);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 3px 12px rgba(248, 187, 208, 0.2);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-toggle:hover {
  transform: scale(1.15) rotate(15deg);
  box-shadow: 0 5px 18px rgba(248, 187, 208, 0.3);
}
.theme-toggle .dark { display: none; }
[data-theme="dark"] .theme-toggle .dark { display: inline; }
[data-theme="dark"] .theme-toggle .light { display: none; }
[data-theme="dark"] .theme-toggle {
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(244, 143, 177, 0.25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .dark { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .light { display: none; }
}

/* ===== Tabs - 左侧竖排 ===== */
.main-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.tab-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
  width: 5.5rem;
  position: sticky;
  top: 1rem;
}
.tab-btn {
  display: block;
  width: 100%;
  padding: 0.65rem 0.5rem;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--bg2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  text-align: center;
}
.tab-btn:hover {
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(248, 187, 208, 0.15);
  color: var(--accent);
  border-color: var(--accent-soft);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--coral));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(248, 187, 208, 0.3);
  transform: translateX(3px);
}
.tab-btn.active:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 22px rgba(248, 187, 208, 0.4);
}

/* Tab panels */
.tab-panels {
  flex: 1;
  min-width: 0;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 手机端：窄屏时 tab 恢复横排 */
@media (max-width: 600px) {
  .main-layout {
    flex-direction: column;
  }
  .tab-bar {
    flex-direction: row;
    width: auto;
    position: static;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn {
    flex-shrink: 0;
    width: auto;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
  }
  .tab-btn:hover,
  .tab-btn.active,
  .tab-btn.active:hover {
    transform: translateY(-2px);
  }
  .tab-panels {
    width: 100%;
  }
}

/* ===== Cards - 圆润活泼卡片 ===== */
.card {
  background: var(--bg2);
  border: none;
  border-radius: 24px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow), var(--lime), var(--blue), var(--purple));
  border-radius: 24px 24px 0 0;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-text);
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title::before {
  content: '';
  width: 6px;
  height: 20px;
  background: linear-gradient(180deg, var(--pink), var(--orange));
  border-radius: 999px;
}

/* ===== Progress Stats - 彩色统计球 ===== */
.progress-summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stat-box {
  flex: 1;
  background: var(--bg2);
  border: none;
  border-radius: 20px;
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
  position: relative;
}
.stat-box:nth-child(1) { border-top: 4px solid var(--pink); }
.stat-box:nth-child(2) { border-top: 4px solid var(--orange); }
.stat-box:nth-child(3) { border-top: 4px solid var(--blue); }
.stat-box:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-hover);
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stat-box:nth-child(2) .stat-value {
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-box:nth-child(3) .stat-value {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 600;
}

/* ===== Task list - 活泼任务项 ===== */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-bottom: 2px dashed var(--rule);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.task-item:hover {
  background: linear-gradient(90deg, var(--pink-soft), transparent);
  border-radius: 14px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  margin: 0 -0.5rem;
  border-bottom-color: transparent;
}
.task-item:last-child { border-bottom: none; padding-bottom: 0; }
.task-item:first-child { padding-top: 0; }
.task-check {
  width: 26px;
  height: 26px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--bg2);
}
.task-item:hover .task-check {
  border-color: var(--accent-hover);
  transform: scale(1.1);
}
.task-check svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}
.task-item.done .task-check {
  background: linear-gradient(135deg, var(--lime), var(--success));
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(165, 214, 167, 0.25);
}
.task-item.done .task-check svg {
  opacity: 1;
  transform: scale(1);
}
.task-body { flex: 1; }
.task-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #E91E8C;
  background: #FDE7EF;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 0.25rem;
}
.task-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s ease;
}
.task-item.done .task-text {
  color: var(--muted);
  text-decoration: line-through;
}
.task-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.45;
}

/* ===== Review prompts - 彩色便签风 ===== */
.prompt-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.prompt-item {
  background: linear-gradient(135deg, var(--pink-soft), var(--orange-soft));
  border-radius: 18px;
  padding: 1rem 1.1rem;
  border: none;
  position: relative;
  transition: all 0.2s ease;
}
.prompt-item:nth-child(2) { background: linear-gradient(135deg, var(--orange-soft), var(--yellow-soft)); }
.prompt-item:nth-child(3) { background: linear-gradient(135deg, var(--yellow-soft), var(--lime-soft)); }
.prompt-item:nth-child(4) { background: linear-gradient(135deg, var(--lime-soft), var(--blue-soft)); }
.prompt-item:nth-child(5) { background: linear-gradient(135deg, var(--blue-soft), var(--purple-soft)); }
.prompt-item:nth-child(6) { background: linear-gradient(135deg, var(--purple-soft), var(--pink-soft)); }
.prompt-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}
.prompt-number {
  font-size: 0.75rem;
  font-weight: 800;
  color: #E91E8C;
  margin-bottom: 0.3rem;
}
.prompt-text {
  font-size: 0.9rem;
  color: var(--accent-text);
  line-height: 1.5;
  font-weight: 500;
}
.textarea {
  width: 100%;
  min-height: 120px;
  border: 2px solid var(--rule);
  border-radius: 18px;
  padding: 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: all 0.2s ease;
  background: var(--bg2);
}
.textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px var(--pink-soft), 0 4px 16px rgba(248, 187, 208, 0.1);
}
.save-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* ===== English lesson - 活泼课程卡片 ===== */
.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.lesson-day {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  padding: 0.3rem 1rem;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(248, 187, 208, 0.25);
}
.lesson-nav {
  display: flex;
  gap: 0.35rem;
}
.lesson-nav button {
  background: var(--bg2);
  border: 2px solid var(--pink-soft);
  color: var(--pink);
  font-size: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(248, 187, 208, 0.1);
}
.lesson-nav button:hover {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(248, 187, 208, 0.3);
}
.lesson-nav button:disabled {
  color: var(--rule);
  border-color: var(--rule);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: var(--bg2);
}
.lesson-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-text);
  margin-bottom: 0.5rem;
}
.lesson-content {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 1rem;
}
.lesson-practice {
  background: linear-gradient(135deg, var(--blue-soft), var(--cyan-soft));
  border-radius: 18px;
  padding: 1.1rem;
  margin-bottom: 1rem;
  border: none;
  position: relative;
}
.lesson-practice::before {
  content: '🎯';
  position: absolute;
  top: -0.6rem;
  right: 1rem;
  font-size: 1.2rem;
}
.lesson-practice-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lesson-practice-text {
  font-size: 0.9rem;
  color: var(--accent-text);
  line-height: 1.5;
  font-weight: 500;
}
.lesson-done-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--pink), var(--orange), var(--purple));
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(248, 187, 208, 0.3);
  position: relative;
  overflow: hidden;
}
.lesson-done-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(248, 187, 208, 0.4);
  background-position: 100% 0;
}
.lesson-done-btn.done {
  background: linear-gradient(135deg, var(--lime), var(--success));
  box-shadow: 0 4px 16px rgba(165, 214, 167, 0.3);
}

/* ===== 5 year plan - 彩虹时间线 ===== */
.timeline {
  position: relative;
  padding-left: 1.75rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 4px;
  background: linear-gradient(180deg, var(--pink), var(--orange), var(--yellow), var(--lime), var(--blue), var(--purple));
  border-radius: 999px;
}
.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -1.55rem;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  border: 3px solid var(--bg2);
  box-shadow: 0 0 0 4px var(--pink-soft), 0 2px 8px rgba(248, 187, 208, 0.2);
}
.timeline-item:nth-child(1) .timeline-dot { background: linear-gradient(135deg, var(--pink), var(--orange)); box-shadow: 0 0 0 4px var(--pink-soft), 0 2px 8px rgba(248, 187, 208, 0.25); }
.timeline-item:nth-child(2) .timeline-dot { background: linear-gradient(135deg, var(--orange), var(--yellow)); box-shadow: 0 0 0 4px var(--orange-soft), 0 2px 8px rgba(255, 204, 128, 0.2); }
.timeline-item:nth-child(3) .timeline-dot { background: linear-gradient(135deg, var(--yellow), var(--lime)); box-shadow: 0 0 0 4px var(--yellow-soft), 0 2px 8px rgba(255, 245, 157, 0.2); }
.timeline-item:nth-child(4) .timeline-dot { background: linear-gradient(135deg, var(--lime), var(--blue)); box-shadow: 0 0 0 4px var(--lime-soft), 0 2px 8px rgba(165, 214, 167, 0.2); }
.timeline-item:nth-child(5) .timeline-dot { background: linear-gradient(135deg, var(--blue), var(--purple)); box-shadow: 0 0 0 4px var(--blue-soft), 0 2px 8px rgba(144, 202, 249, 0.2); }
.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.timeline-year {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-text);
}
.timeline-age {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.timeline-income {
  font-size: 0.88rem;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.timeline-goals {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}
.timeline-goals li {
  font-size: 0.85rem;
  color: var(--ink);
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.5;
  font-weight: 500;
}
.timeline-goals li::before {
  content: '🌟';
  position: absolute;
  left: -0.2rem;
  font-size: 0.7rem;
  top: 0.05rem;
}

/* =============================
   Account book - Category Grid
   ============================= */
.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.account-stat {
  background: var(--bg2);
  border: none;
  border-radius: 20px;
  padding: 0.875rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}
.account-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.account-stat.income { border-top: 4px solid var(--lime); }
.account-stat.expense { border-top: 4px solid var(--coral); }
.account-stat.balance { border-top: 4px solid var(--blue); }
.account-stat.income .stat-value { color: var(--lime); }
.account-stat.expense .stat-value { color: var(--coral); }
.account-stat.balance .stat-value { color: var(--blue); }

/* Category grid - 多巴胺色块 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.category-card {
  background: var(--bg2);
  border: none;
  border-radius: 20px;
  padding: 0.875rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.category-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: var(--shadow-hover);
}
.category-card:active {
  transform: scale(0.95);
}
/* 每个分类卡不同的顶部色条 */
.category-card:nth-child(3n+1)::before,
.category-card:nth-child(3n+2)::before,
.category-card:nth-child(3n+3)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
}
.category-card:nth-child(6n+1)::before { background: linear-gradient(90deg, var(--pink), var(--coral)); }
.category-card:nth-child(6n+2)::before { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.category-card:nth-child(6n+3)::before { background: linear-gradient(90deg, var(--lime), var(--success)); }
.category-card:nth-child(6n+4)::before { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.category-card:nth-child(6n+5)::before { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.category-card:nth-child(6n+6)::before { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.category-card .cat-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.35rem;
  line-height: 1.3;
  transition: transform 0.25s ease;
}
.category-card:hover .cat-icon {
  transform: scale(1.2) rotate(-5deg);
}
.category-card .cat-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 0.2rem;
}
.category-card .cat-amount {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--coral);
  display: block;
}
.category-card .cat-amount.zero {
  color: var(--muted);
}
.category-card .cat-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow));
  border-radius: 0 2px 0 0;
  transition: width 0.3s ease;
}

/* Category detail view */
.category-detail { display: none; }
.category-detail.active { display: block; animation: fadeIn 0.3s ease; }
.category-detail-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--pink-soft), var(--orange-soft));
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.category-detail-back {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--pink);
  box-shadow: 0 2px 10px rgba(248, 187, 208, 0.15);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.category-detail-back:hover {
  transform: translateX(-3px) scale(1.1);
  box-shadow: 0 4px 14px rgba(248, 187, 208, 0.25);
}
.category-detail-info { flex: 1; }
.category-detail-info .cat-icon {
  font-size: 1.4rem;
  margin-right: 0.3rem;
}
.category-detail-info .cat-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-text);
}
.category-detail-info .cat-total {
  font-size: 0.9rem;
  color: var(--coral);
  font-weight: 700;
  margin-top: 0.15rem;
}
.category-detail-info .cat-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* Subcategory list in detail */
.subcategory-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.subcategory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--bg2);
  border: 2px solid var(--rule);
  border-radius: 16px;
  transition: all 0.2s ease;
}
.subcategory-item:hover {
  border-color: var(--pink);
  background: var(--pink-soft);
  transform: translateX(4px);
}
.subcategory-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.subcategory-amount {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--coral);
}
.subcategory-count {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.5rem;
  font-weight: 500;
}

/* Detail transactions */
.detail-transactions { margin-top: 0.5rem; }
.detail-tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 2px dashed var(--rule);
}
.detail-tx-item:last-child { border-bottom: none; }
.detail-tx-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.detail-tx-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}
.detail-tx-note {
  font-size: 0.7rem;
  color: var(--muted);
}
.detail-tx-date {
  font-size: 0.65rem;
  color: var(--muted);
}
.detail-tx-right { text-align: right; }
.detail-tx-amount {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--coral);
}

/* Account table */
.account-table-wrapper { overflow-x: auto; }
.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.account-table th,
.account-table td {
  padding: 0.65rem 0.5rem;
  text-align: left;
  border-bottom: 2px dashed var(--rule);
  white-space: nowrap;
}
.account-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
}
.account-table td { color: var(--ink); }
.account-table .amount-income { color: var(--lime); font-weight: 700; }
.account-table .amount-expense { color: var(--coral); font-weight: 700; }
.account-table .type-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
}
.account-table .type-income {
  background: var(--lime-soft);
  color: #1A8A4A;
}
.account-table .type-expense {
  background: var(--coral-soft);
  color: #C53030;
}
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Manual add form */
.add-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.form-row-full { grid-column: 1 / -1; }
.form-input, .form-select {
  width: 100%;
  padding: 0.7rem 0.875rem;
  border: 2px solid var(--rule);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg2);
  outline: none;
  transition: all 0.2s ease;
}
.form-input:focus, .form-select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px var(--pink-soft);
}
.form-btn {
  padding: 0.8rem;
  background: linear-gradient(135deg, var(--pink), var(--orange), var(--purple));
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(248, 187, 208, 0.25);
}
.form-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(248, 187, 208, 0.35);
  background-position: 100% 0;
}

/* Import area */
.import-area {
  border: 3px dashed var(--pink-soft);
  border-radius: 20px;
  padding: 1.75rem 1rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: all 0.25s ease;
  background: linear-gradient(135deg, var(--pink-soft), var(--orange-soft));
}
.import-area:hover {
  border-color: var(--pink);
  background: linear-gradient(135deg, var(--orange-soft), var(--yellow-soft));
  transform: translateY(-2px);
}
.import-input { display: none; }
.import-btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #fff;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(248, 187, 208, 0.25);
}
.import-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(248, 187, 208, 0.35);
}
.import-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
  font-weight: 500;
}

/* Helper text - 彩色便签 */
.helper-card {
  background: linear-gradient(135deg, var(--yellow-soft), var(--orange-soft));
  border-radius: 20px;
  padding: 1.1rem 1.25rem;
  margin-top: 1.5rem;
  position: relative;
  box-shadow: var(--shadow);
}
.helper-card::before {
  content: '📌';
  position: absolute;
  top: -0.7rem;
  right: 1.5rem;
  font-size: 1.3rem;
  transform: rotate(15deg);
}
.helper-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-text);
  margin-bottom: 0.6rem;
}
.helper-list {
  list-style: none;
  font-size: 0.85rem;
  color: var(--accent-text);
  line-height: 1.8;
  font-weight: 500;
}
.helper-list li {
  padding-left: 1.2rem;
  position: relative;
}
.helper-list li::before {
  content: '💖';
  position: absolute;
  left: -0.2rem;
  font-size: 0.7rem;
  top: 0.05rem;
}

/* Footer */
.footer-actions {
  text-align: center;
  margin-top: 2.5rem;
}
.reset-btn {
  font-size: 0.78rem;
  color: var(--muted);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.5rem;
  transition: all 0.15s ease;
  font-weight: 500;
}
.reset-btn:hover {
  color: var(--coral);
  transform: scale(1.05);
}

/* Subcategory selector in form */
.subcategory-select { display: none; }
.subcategory-select.active { display: block; }

/* Transaction subcategory badge */
.tx-sub-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--accent-text);
  margin-left: 0.25rem;
  font-weight: 700;
}

/* =============================
   Daily Work Tasks - 多巴胺工作区
   ============================= */
.work-task-list {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.875rem;
}
.work-task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem;
  background: var(--bg2);
  border: 2px solid var(--rule);
  border-radius: 18px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.work-task-item:hover {
  border-color: var(--pink);
  box-shadow: 0 4px 16px rgba(248, 187, 208, 0.12);
  transform: translateY(-2px);
}
.work-task-item.done {
  opacity: 0.65;
  background: var(--lime-soft);
  border-color: var(--lime);
  border-style: dashed;
}
.work-task-item .work-check {
  width: 24px;
  height: 24px;
  border: 3px solid var(--pink-soft);
  border-radius: 8px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--bg2);
}
.work-task-item:hover .work-check {
  border-color: var(--pink);
  transform: scale(1.15);
}
.work-task-item.done .work-check {
  background: linear-gradient(135deg, var(--lime), var(--success));
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(165, 214, 167, 0.3);
}
.work-task-item.done .work-check::after {
  content: '✓';
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}
.work-task-body { flex: 1; min-width: 0; }
.work-task-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.work-task-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s ease;
}
.work-task-item.done .work-task-title {
  text-decoration: line-through;
  color: var(--muted);
}
.work-task-priority {
  font-size: 0.68rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 800;
  flex-shrink: 0;
}
.work-task-priority.high {
  background: linear-gradient(135deg, var(--coral), var(--pink));
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 171, 145, 0.2);
}
.work-task-priority.medium {
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 204, 128, 0.2);
}
.work-task-priority.low {
  background: linear-gradient(135deg, var(--lime), var(--success));
  color: #fff;
  box-shadow: 0 2px 8px rgba(165, 214, 167, 0.2);
}
.work-task-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 500;
}
.work-task-estimated {
  font-family: var(--font-mono);
}
.work-task-tag {
  font-size: 0.68rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue-soft), var(--purple-soft));
  color: var(--purple);
  font-weight: 700;
}
.work-task-delete {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: all 0.2s ease;
}
.work-task-item:hover .work-task-delete {
  opacity: 1;
}
.work-task-delete:hover {
  background: var(--coral-soft);
  color: var(--coral);
  transform: scale(1.15) rotate(90deg);
}

/* Add work task */
.work-add-btn {
  width: 100%;
  padding: 0.875rem;
  background: none;
  border: 3px dashed var(--pink-soft);
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--pink);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.work-add-btn:hover {
  border-color: var(--pink);
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(248, 187, 208, 0.2);
}

/* Inline add work task form */
.work-add-form {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--pink-soft), var(--orange-soft));
  border-radius: 18px;
  border: 2px solid var(--pink);
  margin-bottom: 0.875rem;
  animation: slideDown 0.25s ease;
  box-shadow: 0 4px 16px rgba(248, 187, 208, 0.12);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.work-add-form input,
.work-add-form select {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 2px solid var(--rule);
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--bg2);
  outline: none;
  transition: all 0.2s ease;
}
.work-add-form input:focus,
.work-add-form select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px var(--pink-soft);
}
.work-add-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.work-add-form-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}
.work-add-form-actions button {
  padding: 0.5rem 1.1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.work-add-save {
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #fff;
  box-shadow: 0 3px 12px rgba(248, 187, 208, 0.2);
}
.work-add-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(248, 187, 208, 0.3);
}
.work-add-cancel {
  background: var(--bg2);
  color: var(--muted);
  border: 2px solid var(--rule);
}
.work-add-cancel:hover {
  border-color: var(--pink);
  color: var(--pink);
  transform: translateY(-2px);
}

/* =============================
   Account Book - New Stats
   ============================= */

/* Month overview */
.month-overview {
  margin-bottom: 1.25rem;
}
.month-overview .account-stat {
  position: relative;
  overflow: hidden;
}
.month-overview .account-stat::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.month-overview .account-stat.income::after { background: linear-gradient(90deg, var(--lime), var(--success)); }
.month-overview .account-stat.expense::after { background: linear-gradient(90deg, var(--coral), var(--pink)); }
.month-overview .account-stat.balance::after { background: linear-gradient(90deg, var(--blue), var(--purple)); }

/* Section header with toggle */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.section-header .card-title {
  margin-bottom: 0;
}
.chart-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
}
.toggle-btn {
  padding: 0.35rem 0.75rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.toggle-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #fff;
  box-shadow: 0 2px 8px rgba(248, 187, 208, 0.25);
}

/* Chart containers */
.chart-container {
  width: 100%;
  min-height: 180px;
  overflow-x: auto;
  overflow-y: hidden;
}
.chart-container svg {
  display: block;
  width: 100%;
  font-family: var(--font);
}
.empty-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--bg);
  border-radius: 14px;
}
.chart-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: -0.25rem 0 0.75rem;
}
.chart-bar-group {
  transition: opacity 0.2s ease;
}
.chart-bar-group:hover {
  opacity: 0.8;
}

/* Category rank list */
.stat-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.875rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border-radius: 12px;
}
.stat-header-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.stat-header-label strong {
  color: var(--ink);
  font-weight: 700;
  margin-left: 0.25rem;
}
.category-rank-list {
  display: grid;
  gap: 0.75rem;
}
.category-rank-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
}
.category-rank-item:hover {
  background: var(--bg);
  border-radius: 12px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin: 0 -0.5rem;
}
.rank-index {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rank-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.rank-body {
  flex: 1;
  min-width: 0;
}
.rank-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.rank-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}
.rank-percent {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.rank-amount {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--coral);
}
.rank-bar-bg {
  height: 8px;
  background: var(--rule);
  border-radius: 999px;
  overflow: hidden;
}
.rank-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Stat tables */
.table-responsive {
  overflow-x: auto;
  margin: -0.5rem 0;
}
.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.stat-table th,
.stat-table td {
  padding: 0.7rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.stat-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
}
.stat-table td {
  color: var(--ink);
}
.stat-table tr:last-child td {
  border-bottom: none;
}
.stat-table .amount-income { color: var(--lime); font-weight: 700; }
.stat-table .amount-expense { color: var(--coral); font-weight: 700; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal.active {
  display: flex;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}
.modal-content {
  position: relative;
  width: 100%;
  max-width: var(--max);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 1.25rem;
  animation: slideUp 0.25s ease;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-text);
}
.modal-icon {
  font-size: 1.3rem;
}
.modal-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.25rem;
}
.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg2);
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.modal-close:hover {
  background: var(--coral-soft);
  color: var(--coral);
  transform: rotate(90deg);
}
.modal-body {
  display: grid;
  gap: 1rem;
}

/* Account table income/expense colors update */
.account-table .amount-income { color: var(--lime); font-weight: 700; }
.account-table .amount-expense { color: var(--coral); font-weight: 700; }
.account-table .type-income {
  background: var(--lime-soft);
  color: #1A8A4A;
}
.account-table .type-expense {
  background: var(--coral-soft);
  color: #C53030;
}

/* Account stat value colors */
.account-stat.income .stat-value { color: var(--lime); }
.account-stat.expense .stat-value { color: var(--coral); }
.account-stat.balance .stat-value { color: var(--blue); }

/* 三级分类支出表单 */
.expense-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.expense-row .form-row-full {
  grid-column: 1 / -1;
}

/* 图表图例 */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: center;
  margin-top: 0.75rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 预算警告 */
.budget-warning {
  margin-top: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.budget-warning.success {
  background: var(--success-soft);
  color: var(--success);
}
.budget-warning::before {
  content: '⚠️';
  font-size: 1rem;
  line-height: 1.3;
  flex-shrink: 0;
}
.budget-warning.success::before {
  content: '✅';
}

/* Responsive */
@media (max-width: 380px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .chart-toggle {
    align-self: flex-start;
  }
}

/* =============================
   可编辑任务
   ============================= */
.task-edit-input {
  border: none;
  background: transparent;
  font-family: var(--font);
  color: var(--ink);
  outline: none;
  width: 100%;
  padding: 0;
  cursor: text;
  transition: all 0.2s ease;
}
.task-edit-input:focus {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 0.15rem 0.4rem;
}
.task-edit-input.task-time-edit {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pink);
  max-width: 120px;
}
.task-edit-input.task-title-edit {
  font-size: 0.95rem;
  font-weight: 700;
}
.task-edit-input.task-note-edit {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.task-edit-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--accent-text);
  opacity: 0;
  transition: all 0.2s ease;
}
.task-item:hover .task-edit-btn,
.task-item .task-edit-btn:focus {
  opacity: 1;
}
.task-edit-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

/* =============================
   TTS 发音区域
   ============================= */
.tts-area {
  margin-bottom: 1rem;
}
.tts-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.tts-content {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.8;
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.tts-content .tts-word {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  margin: 0.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 700;
  border: 2px solid transparent;
}
.tts-content .tts-word:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(1.05);
}
.tts-content .tts-word:active {
  transform: scale(0.95);
}
.tts-content .tts-sentence {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin: 0.15rem 0.25rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px dashed var(--rule);
  font-weight: 600;
}
.tts-content .tts-sentence:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: solid;
}
.tts-content .tts-sentence:active {
  transform: scale(0.95);
}
.tts-practice {
  font-size: 0.9rem;
  color: var(--accent-text);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}
.tts-practice .tts-sentence {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin: 0.15rem 0.25rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px dashed var(--rule);
  font-weight: 600;
  color: var(--ink);
}
.tts-practice .tts-sentence:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: solid;
}

/* ====================}=========
   教学视频
   ============================= */
.video-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.video-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 2px solid var(--rule);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.video-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(4px);
}
.video-item:active {
  transform: scale(0.98);
}
.video-thumb {
  width: 80px;
  height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pink-soft), var(--purple-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.4rem;
}
.video-info {
  flex: 1;
  min-width: 0;
}
.video-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-url {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}
.video-delete {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--coral-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--coral);
  flex-shrink: 0;
  transition: all 0.2s ease;
  opacity: 0;
}
.video-item:hover .video-delete {
  opacity: 1;
}
.video-delete:hover {
  background: var(--coral);
  color: #fff;
  transform: scale(1.1);
}
.video-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  display: none;
}
.video-empty.show {
  display: block;
}
.video-add-btn {
  padding: 0.4rem 0.9rem;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 2px solid var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.video-add-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}
.video-add-form {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}
.video-add-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.video-add-cancel, .video-add-save {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.video-add-cancel {
  background: var(--bg);
  color: var(--muted);
  border: 2px solid var(--rule);
}
.video-add-cancel:hover {
  border-color: var(--coral);
  color: var(--coral);
}
.video-add-save {
  background: linear-gradient(135deg, var(--accent), var(--orange));
  color: #fff;
  box-shadow: 0 2px 10px rgba(248, 187, 208, 0.3);
}
.video-add-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(248, 187, 208, 0.4);
}
.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== 可编辑任务 ===== */
.task-edit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.task-edit-btn {
  background: var(--accent-soft);
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  opacity: 0.6;
}
.task-edit-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  background: var(--accent);
}
.task-item:hover .task-edit-btn {
  opacity: 0.85;
}
.task-time[title],
.task-text[title],
.task-note[title] {
  cursor: pointer;
}
.task-time[title]:hover,
.task-text[title]:hover,
.task-note[title]:hover {
  background: var(--accent-soft);
  border-radius: 6px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: 0.3rem;
  margin-top: 0.75rem;
}
.form-label:first-child {
  margin-top: 0;
}
.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
}

