@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }

/* === THEME VARIABLES === */
:root {
  --bg: #0a0a0f;
  --bg-grad: #1a1a2e;
  --primary: #c9a8e8;
  --secondary: #7eb8da;
  --text: #e8e0d8;
  --text-sub: #b8b0c0;
  --text-dim: #8a8290;
  --text-faint: #5a5260;
  --card: rgba(255,255,255,0.03);
  --card-border: rgba(201,168,232,0.12);
  --card-hover: rgba(201,168,232,0.25);
  --nav-bg: rgba(10,10,15,0.95);
  --tag-bg: rgba(201,168,232,0.12);
  --star-color: white;
  --mode: dark;
}

/* Mon - 薰衣草紫 (dark) */
[data-theme="mon"] {
  --bg: #0a0a0f; --bg-grad: #1a1a2e;
  --primary: #c9a8e8; --secondary: #7eb8da;
  --text: #e8e0d8; --text-sub: #b8b0c0; --text-dim: #8a8290; --text-faint: #5a5260;
  --card: rgba(255,255,255,0.03); --card-border: rgba(201,168,232,0.12); --card-hover: rgba(201,168,232,0.25);
  --nav-bg: rgba(10,10,15,0.95); --tag-bg: rgba(201,168,232,0.12); --star-color: white; --mode: dark;
}

/* Tue - 樱花粉 (light) */
[data-theme="tue"] {
  --bg: #fdf5f3; --bg-grad: #f8e8e4;
  --primary: #d4849a; --secondary: #c07a90;
  --text: #3d2b2e; --text-sub: #6b5055; --text-dim: #9a7e83; --text-faint: #c4adb1;
  --card: rgba(212,132,154,0.06); --card-border: rgba(212,132,154,0.15); --card-hover: rgba(212,132,154,0.25);
  --nav-bg: rgba(253,245,243,0.95); --tag-bg: rgba(212,132,154,0.1); --star-color: rgba(212,132,154,0.3); --mode: light;
}

/* Wed - 薄荷绿 (light) */
[data-theme="wed"] {
  --bg: #f3faf6; --bg-grad: #e4f2ec;
  --primary: #5a9e7e; --secondary: #4a8e6e;
  --text: #2b3d33; --text-sub: #506b5c; --text-dim: #7e9a8a; --text-faint: #adc4b6;
  --card: rgba(90,158,126,0.05); --card-border: rgba(90,158,126,0.12); --card-hover: rgba(90,158,126,0.22);
  --nav-bg: rgba(243,250,246,0.95); --tag-bg: rgba(90,158,126,0.1); --star-color: rgba(90,158,126,0.25); --mode: light;
}

/* Thu - 琥珀暖 (dark) */
[data-theme="thu"] {
  --bg: #0f0d0a; --bg-grad: #2e261a;
  --primary: #e8c88a; --secondary: #d4a862;
  --text: #e8e0d0; --text-sub: #c0b8a0; --text-dim: #908870; --text-faint: #605840;
  --card: rgba(232,200,138,0.04); --card-border: rgba(232,200,138,0.12); --card-hover: rgba(232,200,138,0.25);
  --nav-bg: rgba(15,13,10,0.95); --tag-bg: rgba(232,200,138,0.1); --star-color: #ffe8a0; --mode: dark;
}

/* Fri - 天际蓝 (dark) */
[data-theme="fri"] {
  --bg: #080c12; --bg-grad: #142030;
  --primary: #88b8e0; --secondary: #6a9ec8;
  --text: #d8e4f0; --text-sub: #a0b8d0; --text-dim: #7088a8; --text-faint: #405868;
  --card: rgba(136,184,224,0.04); --card-border: rgba(136,184,224,0.12); --card-hover: rgba(136,184,224,0.25);
  --nav-bg: rgba(8,12,18,0.95); --tag-bg: rgba(136,184,224,0.1); --star-color: #b0d0f0; --mode: dark;
}

/* Sat - 暖茶棕 (light) */
[data-theme="sat"] {
  --bg: #faf6f1; --bg-grad: #f0e8de;
  --primary: #a0805a; --secondary: #8a6a44;
  --text: #3d3028; --text-sub: #6b5a48; --text-dim: #9a8878; --text-faint: #c4b8a8;
  --card: rgba(160,128,90,0.05); --card-border: rgba(160,128,90,0.12); --card-hover: rgba(160,128,90,0.22);
  --nav-bg: rgba(250,246,241,0.95); --tag-bg: rgba(160,128,90,0.1); --star-color: rgba(160,128,90,0.25); --mode: light;
}

/* Sun - 月光银 (dark) */
[data-theme="sun"] {
  --bg: #0c0c10; --bg-grad: #1a1a22;
  --primary: #c8c8d8; --secondary: #a8a8c0;
  --text: #e0e0e8; --text-sub: #b0b0c0; --text-dim: #808090; --text-faint: #505060;
  --card: rgba(200,200,216,0.04); --card-border: rgba(200,200,216,0.1); --card-hover: rgba(200,200,216,0.2);
  --nav-bg: rgba(12,12,16,0.95); --tag-bg: rgba(200,200,216,0.1); --star-color: #d8d8e8; --mode: dark;
}

body {
  font-family: 'Noto Serif SC', serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
.stars {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at bottom, var(--bg-grad) 0%, var(--bg) 100%);
  z-index: 0;
}
.star {
  position: absolute; border-radius: 50%; background: var(--star-color);
  animation: twinkle var(--duration) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: var(--base-opacity); }
  50% { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes flutter {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(5deg); }
  75% { transform: translateY(3px) rotate(-3deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.container {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto; padding: 40px 24px 80px;
}
.nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  z-index: 100; padding: 8px 0;
  display: flex; justify-content: center;
}
.nav-inner {
  display: flex; gap: 4px; max-width: 720px;
  overflow-x: auto; padding: 0 12px;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--text-dim);
  font-size: 0.65em; padding: 6px 10px;
  border-radius: 12px; transition: all 0.3s;
  white-space: nowrap; min-width: 52px;
}
.nav a:hover, .nav a.active {
  color: var(--primary);
  background: var(--tag-bg);
}
.nav a .icon { font-size: 1.6em; margin-bottom: 2px; }
.page-header {
  text-align: center; margin-bottom: 40px; padding-top: 20px;
}
.page-header h1 {
  font-size: 1.8em; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 6s ease infinite;
  margin-bottom: 8px;
}
.page-header .subtitle {
  font-size: 0.85em; color: var(--text-dim); letter-spacing: 2px;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px; padding: 28px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}
.card:hover {
  border-color: var(--card-hover);
  box-shadow: 0 0 30px var(--card-border);
}
.card h2 {
  font-size: 1.1em; color: var(--primary);
  margin-bottom: 16px;
}
.timeline-item {
  padding: 14px 0 14px 20px;
  border-left: 2px solid var(--card-border);
  position: relative; font-size: 0.9em;
  line-height: 1.7; color: var(--text-sub);
}
.timeline-item::before {
  content: '';
  position: absolute; left: -5px; top: 20px;
  width: 8px; height: 8px;
  background: var(--primary); border-radius: 50%;
}
.timeline-date { color: var(--secondary); font-size: 0.82em; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
  text-align: center; padding: 18px 12px;
  background: var(--tag-bg);
  border-radius: 12px;
}
.stat-number { font-size: 1.6em; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.75em; color: var(--text-dim); margin-top: 4px; }
.empty { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty .icon { font-size: 3em; margin-bottom: 16px; display: block; }
.empty p { font-size: 0.9em; line-height: 1.8; }
.diary-entry {
  padding: 20px 0;
  border-bottom: 1px solid var(--card-border);
}
.diary-entry:last-child { border-bottom: none; }
.diary-date { color: var(--secondary); font-size: 0.82em; margin-bottom: 8px; }
.diary-mood { font-size: 1.2em; margin-left: 8px; }
.diary-content { font-size: 0.9em; color: var(--text-sub); line-height: 1.8; }
.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gallery-item {
  border-radius: 12px; overflow: hidden;
  aspect-ratio: 1; background: var(--tag-bg);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--card-border);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.message {
  padding: 20px;
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--card-hover);
}
.message-author { color: var(--primary); font-size: 0.82em; margin-bottom: 6px; }
.message-text { font-size: 0.9em; color: var(--text-sub); line-height: 1.7; }
.message-time { color: var(--text-faint); font-size: 0.75em; margin-top: 8px; }
.finance-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.finance-card { text-align: center; padding: 20px; background: var(--tag-bg); border-radius: 12px; }
.finance-amount { font-size: 1.5em; font-weight: 700; color: var(--primary); }
.finance-label { font-size: 0.75em; color: var(--text-dim); margin-top: 4px; }
.ledger-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--card-border); font-size: 0.88em;
}
.ledger-item:last-child { border-bottom: none; }
.ledger-desc { color: var(--text-sub); }
.ledger-date { color: var(--text-faint); font-size: 0.8em; }
.ledger-amount { color: #e88a8a; font-weight: 700; }
.ledger-amount.income { color: #8ae8a8; }
.contract-seal { text-align: center; padding: 40px; margin: 20px 0; }
.seal {
  display: inline-block; width: 120px; height: 120px;
  border: 3px solid var(--card-hover);
  border-radius: 50%;
  font-size: 2em; color: var(--primary);
  animation: float 4s ease-in-out infinite;
  margin: 0 auto; line-height: 120px;
}
.contract-text {
  font-size: 0.92em; color: var(--text-sub);
  line-height: 2; text-align: center; padding: 20px;
}
.butterfly-nav { display: inline-block; animation: flutter 3s ease-in-out infinite; }
.footer {
  text-align: center; padding: 30px 0 90px;
  color: var(--text-faint); font-size: 0.75em;
}
