/* ================================================
   Pocket · 個人理財管家
   活潑漸層設計 — 果汁品牌風格
   ================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 主色 — 亮綠 hero */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  /* 粉 / 珊瑚 */
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-300: #f9a8d4;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --coral: #fb7185;
  --coral-600: #f43f5e;
  --coral-700: #e11d48;

  /* 暖色 */
  --yellow: #fde047;
  --yellow-100: #fef9c3;
  --orange: #fb923c;

  /* 冷色 */
  --teal: #5eead4;
  --teal-100: #ccfbf1;
  --lavender: #c4b5fd;
  --lavender-100: #ede9fe;

  /* 中性 */
  --cream: #fff7ed;
  --bg: #fafafa;
  --white: #ffffff;
  --text: #18181b;
  --text-soft: #52525b;
  --text-faint: #a1a1aa;
  --border: #e4e4e7;

  /* 圓角 */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;
  --r-full: 999px;

  /* 陰影 */
  --shadow-sm: 0 1px 2px rgba(24,24,27,0.05);
  --shadow-md: 0 6px 24px rgba(24,24,27,0.06);
  --shadow-lg: 0 16px 48px rgba(24,24,27,0.08);
  --shadow-pop: 0 10px 30px rgba(34,197,94,0.25);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Microsoft JhengHei", "Noto Sans TC", Roboto, "Inter", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 96px 0; position: relative; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--text);
  margin-top: 8px;
}
.section-title-light { color: #fff; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 1px;
}
.eyebrow-light { color: rgba(255,255,255,0.9); }

/* ================== 按鈕 ================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-light {
  background: #fff;
  color: var(--green-700);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.btn-ghost-light {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.25); }
.btn-coral {
  background: var(--coral-600);
  color: #fff;
  box-shadow: 0 8px 20px rgba(244,63,94,0.35);
}
.btn-coral:hover { background: var(--coral-700); transform: translateY(-2px); }
.btn-ghost {
  background: rgba(255,255,255,0.7);
  color: var(--text-soft);
  border: 1px solid rgba(255,255,255,0.6);
}
.btn-ghost:hover { background: #fff; }
.btn-block { width: 100%; }
.btn-text {
  color: var(--text-soft);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.btn-text:hover { color: var(--coral-600); background: var(--pink-50); }

/* ================== HERO ================== */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse at top right, #fde047 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, #86efac 0%, transparent 50%),
    linear-gradient(135deg, #dcfce7 0%, #bbf7d0 30%, #86efac 60%, #4ade80 100%);
  padding-bottom: 120px;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}
.blob-1 { width: 400px; height: 400px; background: #fde047; top: -100px; left: -100px; }
.blob-2 { width: 500px; height: 500px; background: #f9a8d4; top: 200px; right: -150px; }
.blob-3 { width: 350px; height: 350px; background: #5eead4; bottom: -100px; left: 30%; }

.nav { padding: 24px 0; position: relative; z-index: 5; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.nav-links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a { color: var(--text); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--green-700); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  background: var(--text);
  color: #fff;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease, transform 0.05s ease;
}
.nav-cta:hover { background: var(--green-700); }
.nav-cta:active { transform: translateY(1px); }
.nav-burger { display: none; font-size: 24px; padding: 8px; }

.hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  padding-top: 80px;
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(10px);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--green-700);
  margin-bottom: 24px;
}
.hero-text h1 {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 24px;
}
.hero-text .accent {
  color: var(--green-700);
  position: relative;
  display: inline-block;
}
.hero-text .accent::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 100%;
  height: 12px;
  background: var(--yellow);
  z-index: -1;
  border-radius: 4px;
  opacity: 0.7;
}
.hero-desc {
  font-size: 17px;
  color: var(--text-soft);
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-card-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.balance-card {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06) inset;
  position: relative;
  overflow: hidden;
  transform: rotate(-2deg);
  transition: transform 0.3s ease;
}
.balance-card:hover { transform: rotate(0deg) translateY(-4px); }
.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(253,224,71,0.3) 0%, transparent 70%);
  pointer-events: none;
}
.balance-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  font-size: 13px;
  font-weight: 500;
}
.balance-chip {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  padding: 6px 12px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.balance-status {
  color: var(--green-300);
  font-weight: 600;
}
.balance-card-mid { margin-bottom: 28px; position: relative; z-index: 1; }
.balance-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.balance-amount {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.balance-card-bot {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.floating-deco {
  position: absolute;
  font-size: 32px;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1));
}
.d1 { top: -10%; left: 0; animation-delay: 0s; }
.d2 { top: 60%; right: 5%; animation-delay: 1s; font-size: 40px; }
.d3 { bottom: -5%; left: 15%; animation-delay: 2s; }
.d4 { top: 20%; right: 30%; animation-delay: 1.5s; font-size: 20px; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(8deg); }
}

/* ================== FEATURES BENTO ================== */
.features-section { background: var(--pink-50); }
.features-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: center;
}
.features-text .section-title { margin-bottom: 24px; }
.features-text p {
  color: var(--text-soft);
  font-size: 16px;
  margin-bottom: 16px;
  line-height: 1.7;
}
.features-bullets { margin-top: 24px; }
.features-bullets li {
  padding: 8px 0;
  color: var(--text-soft);
  font-size: 15px;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.bento-card {
  padding: 24px;
  border-radius: var(--r-md);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0,0,0,0.04);
}
.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}
.bento-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.bento-card p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}
.bc-green { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); }
.bc-green .bento-icon { background: var(--green-500); color: #fff; }
.bc-yellow { background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%); }
.bc-yellow .bento-icon { background: var(--yellow); }
.bc-pink { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.bc-pink .bento-icon { background: var(--pink-400); color: #fff; }
.bc-coral { background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%); }
.bc-coral .bento-icon { background: var(--coral-600); color: #fff; }
.bc-teal { background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); }
.bc-teal .bento-icon { background: var(--teal); }
.bc-lavender { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); }
.bc-lavender .bento-icon { background: var(--lavender); }

/* ================== SUMMARY ================== */
.summary-section { background: var(--cream); }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stat-card {
  position: relative;
  padding: 28px;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.stat-balance { border-top: 4px solid var(--green-500); }
.stat-balance .stat-icon { background: var(--green-100); }
.stat-income { border-top: 4px solid var(--coral-600); }
.stat-income .stat-icon { background: var(--pink-100); }
.stat-expense { border-top: 4px solid var(--text); }
.stat-expense .stat-icon { background: #f4f4f5; }
.stat-info { flex: 1; min-width: 0; }
.stat-label {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 4px;
  font-weight: 500;
}
.stat-amount {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-balance .stat-amount { color: var(--green-700); }
.stat-income .stat-amount { color: var(--coral-600); }
.stat-expense .stat-amount { color: var(--text); }
.stat-shape {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.15;
}
.stat-balance .stat-shape { background: var(--green-400); }
.stat-income .stat-shape { background: var(--coral); }
.stat-expense .stat-shape { background: var(--text); }

/* ================== CHARTS ================== */
.charts-section { background: #fff; }
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.chart-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chart-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}
.donut-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut { width: 100%; height: 100%; overflow: visible; }
.donut-slice {
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  transform-origin: 0 0;
  cursor: default;
}
.donut-slice:hover { transform: scale(1.04); filter: brightness(1.08); }
.donut-slice.dimmed { opacity: 0.3; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}
.donut-total {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.donut-label {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
}
.donut-empty {
  position: absolute;
  inset: 25px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
  background: var(--bg);
  border-radius: 50%;
  pointer-events: none;
}
.donut-empty.show { display: flex; }

.chart-legend {
  width: 100%;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 10px;
  transition: background 0.15s ease;
  cursor: default;
}
.legend-item:hover, .legend-item.highlighted { background: #fff; }
.legend-dot { width: 12px; height: 12px; border-radius: 4px; }
.legend-name { color: var(--text); font-weight: 500; }
.legend-pct { color: var(--text-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.legend-amount { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

@keyframes donutGrow {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
.donut-slice { animation: donutGrow 0.45s ease-out backwards; }

/* ================== ADD SECTION (CTA) ================== */
.add-section {
  background:
    radial-gradient(ellipse at top left, rgba(251,113,133,0.4) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(244,114,182,0.4) 0%, transparent 50%),
    linear-gradient(135deg, #ec4899 0%, #f43f5e 50%, #e11d48 100%);
  color: #fff;
}
.add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.add-text p {
  font-size: 16px;
  color: rgba(255,255,255,0.92);
  margin: 16px 0 24px;
  line-height: 1.7;
}
.add-tips li {
  padding: 8px 0;
  color: rgba(255,255,255,0.95);
  font-size: 15px;
}

.record-form {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
  color: var(--text);
}
.type-toggle {
  display: inline-flex;
  background: var(--bg);
  padding: 6px;
  border-radius: var(--r-full);
  margin-bottom: 24px;
  width: 100%;
}
.type-option { flex: 1; position: relative; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: var(--r-full);
  transition: all 0.2s ease;
}
.type-option input:checked + span {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.type-option input[value="income"]:checked + span { color: var(--coral-600); }
.type-option input[value="expense"]:checked + span { color: var(--text); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
}
.form-group input,
.form-group select {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--coral-600);
  box-shadow: 0 0 0 3px rgba(244,63,94,0.12);
}
.form-group input::placeholder { color: var(--text-faint); }
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* ================== RECORDS ================== */
.records-section { background: var(--bg); }
.records-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.records-head .section-head { margin-bottom: 0; text-align: left; }
.filter-group {
  display: inline-flex;
  background: #fff;
  padding: 6px;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.filter-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: var(--r-full);
  transition: all 0.2s ease;
}
.filter-btn.active {
  background: var(--text);
  color: #fff;
}
.filter-btn:not(.active):hover { background: var(--bg); }

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}
.record-count {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.record-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.record-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.record-item.editing {
  background: var(--pink-50);
  border-color: var(--coral);
}
.record-badge {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 20px;
  flex-shrink: 0;
}
.record-badge.income { background: var(--pink-100); }
.record-badge.expense { background: #f4f4f5; }
.record-info { min-width: 0; }
.record-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  flex-wrap: wrap;
}
.record-category {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--bg);
  color: var(--text-soft);
  font-weight: 600;
}
.record-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}
.record-amount {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.record-amount.income { color: var(--coral-600); }
.record-amount.expense { color: var(--text); }
.record-actions {
  display: flex;
  gap: 4px;
}
.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-faint);
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 14px;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn[data-action="delete"]:hover { background: var(--pink-100); color: var(--coral-600); }

.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-faint);
  text-align: center;
  background: #fff;
  border-radius: var(--r-md);
  border: 2px dashed var(--border);
}
.empty-state.show { display: flex; }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ================== FOOTER ================== */
.footer {
  background: var(--pink-50);
  padding: 64px 0 32px;
  border-top: 1px solid var(--pink-100);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 14px;
  max-width: 280px;
  line-height: 1.6;
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.footer-col ul li { padding: 6px 0; }
.footer-col a {
  color: var(--text-soft);
  font-size: 14px;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--coral-600); }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  font-size: 16px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.footer-social a:hover { background: var(--coral); color: #fff; transform: translateY(-2px); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--pink-100);
  font-size: 13px;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 12px;
}

/* ================== CALENDAR ================== */
.calendar-section { background: var(--cream); }
.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}
.section-head-left { text-align: left; margin-bottom: 0; }
.section-desc {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 8px;
}

.view-toggle {
  display: inline-flex;
  background: #fff;
  padding: 5px;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.view-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: var(--r-full);
  transition: all 0.2s ease;
}
.view-btn.active {
  background: var(--text);
  color: #fff;
}
.view-btn:not(.active):hover { background: var(--bg); }

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: var(--r-md);
  padding: 12px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-nav-btn:hover { background: var(--green-100); }
.cal-nav-btn:active { transform: scale(0.95); }
.cal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  min-width: 200px;
  text-align: center;
}
.today-btn {
  padding: 8px 18px;
  background: var(--green-100);
  color: var(--green-700);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
}
.today-btn:hover { background: var(--green-300); color: var(--green-700); }

.calendar-view {
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 16px;
  min-height: 400px;
}

/* ---------- YEAR VIEW ---------- */
.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.mini-month {
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mini-month:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mini-month-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.mini-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 10px;
}
.mini-dow {
  text-align: center;
  color: var(--text-faint);
  font-weight: 600;
  padding: 2px 0;
}
.mini-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: background 0.1s ease;
  font-size: 11px;
}
.mini-day:hover { background: var(--green-100); }
.mini-day.outside { color: var(--text-faint); opacity: 0.4; }
.mini-day.has-income { background: var(--pink-100); color: var(--coral-600); font-weight: 700; }
.mini-day.has-expense { background: var(--green-100); color: var(--green-700); font-weight: 700; }
.mini-day.has-both { background: linear-gradient(135deg, var(--pink-100) 50%, var(--green-100) 50%); color: var(--text); font-weight: 700; }
.mini-day.today { box-shadow: inset 0 0 0 2px var(--green-500); }

/* ---------- MONTH VIEW ---------- */
.month-dow-row,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.month-dow-row { margin-bottom: 8px; }
.month-dow {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.month-dow.weekend { color: var(--coral-600); }

.month-grid { gap: 4px; }
.day-cell {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 96px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.15s ease;
}
.day-cell:hover {
  border-color: var(--green-400);
  background: var(--green-50);
  transform: translateY(-2px);
}
.day-cell.outside {
  background: var(--bg);
  opacity: 0.5;
}
.day-cell.today {
  background: var(--yellow-100);
  border-color: var(--yellow);
}
.day-cell.selected {
  background: var(--green-100);
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}
.day-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.day-cell.outside .day-num { color: var(--text-faint); }
.day-totals {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.day-total-income { color: var(--coral-600); }
.day-total-expense { color: var(--text-soft); }
.day-dots {
  margin-top: auto;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.day-add-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--green-600);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.day-cell { position: relative; }
.day-cell:hover .day-add-hint { opacity: 0.5; }

/* ---------- WEEK VIEW ---------- */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.week-day {
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 12px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
}
.week-day-header {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.week-day-header:hover { color: var(--green-700); }
.week-day-name { font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; }
.week-day-num { font-size: 22px; font-weight: 800; line-height: 1.1; }
.week-day-num.is-today { color: var(--coral-600); }
.week-day-records {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 240px;
}
.week-record {
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
  line-height: 1.3;
}
.week-record:hover { transform: translateX(2px); filter: brightness(0.95); }
.week-record.income { background: var(--pink-100); color: var(--coral-700); }
.week-record.expense { background: #fff; color: var(--text); }
.week-record-title { font-weight: 600; display: flex; align-items: center; gap: 4px; }
.week-record-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.week-empty {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  padding: 12px 0;
  opacity: 0.6;
}
.week-day-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.week-day-total.income { color: var(--coral-600); }
.week-day-total.expense { color: var(--text); }

/* ================== MODAL ================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24,24,27,0.5);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  animation: slideUp 0.25s ease;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-head h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-soft);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: var(--pink-100); color: var(--coral-600); }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-form-row:has(.form-group-full) { grid-template-columns: 1fr; }
.form-group-full { grid-column: span 1; }
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.modal-actions .btn { flex: 1; padding: 12px; }

/* ================== AUTH ================== */
.modal-auth {
  max-width: 420px;
}
.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-full);
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: var(--r-full);
  transition: all 0.2s ease;
}
.auth-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.auth-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin: 4px 0 0;
  line-height: 1.5;
}

/* nav-auth 登入後狀態 */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  max-width: 220px;
  backdrop-filter: blur(8px);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-500);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-logout {
  padding: 8px 14px;
  background: rgba(255,255,255,0.5);
  color: var(--text-soft);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn-logout:hover {
  background: var(--pink-100);
  color: var(--coral-600);
  border-color: var(--pink-200);
}

/* 鎖定畫面(未登入) */
.locked {
  position: relative;
  pointer-events: none;
  opacity: 0.5;
  filter: grayscale(0.5);
}
.locked::after {
  content: "🔒 登入後解鎖";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
  white-space: nowrap;
}

/* ================== 響應式 ================== */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; gap: 48px; text-align: center; }
  .hero-text .accent::after { left: 50%; transform: translateX(-50%); }
  .hero-actions { justify-content: center; }
  .features-layout { grid-template-columns: 1fr; gap: 48px; }
  .add-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section-title { font-size: 30px; }
  .container { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-cta { padding: 8px 16px; font-size: 13px; }
  .hero { padding-bottom: 80px; }
  .hero-content { padding-top: 48px; }
  .summary-grid, .charts-grid { grid-template-columns: 1fr; }
  .bento-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .bento-card { padding: 18px; }
  .bento-card h3 { font-size: 14px; }
  .bento-card p { font-size: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .record-item {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 14px;
  }
  .record-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: 4px;
  }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .chart-block { padding: 24px; }
  .donut-wrap { width: 180px; height: 180px; }
  .calendar-head { flex-direction: column; align-items: flex-start; }
  .cal-title { font-size: 16px; min-width: 0; }
  .year-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mini-month { padding: 10px; }
  .day-cell { min-height: 64px; padding: 4px; }
  .day-num { font-size: 12px; }
  .day-totals { font-size: 9px; }
  .week-grid { grid-template-columns: 1fr; gap: 12px; }
  .week-day { min-height: 0; }
  .week-day-records { max-height: 120px; }
  .modal-form-row { grid-template-columns: 1fr; }
  .modal { padding: 24px; }
}

@media (max-width: 480px) {
  .bento-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 20px; }
  .stat-amount { font-size: 22px; }
  .balance-amount { font-size: 28px; }
  .balance-card { padding: 22px; }
  .record-form { padding: 24px; }
}
