/* ==========================================================
 * LYJK · 编辑级视觉系统
 * 奶油 + 暖棕 + 胭脂，衬线字体，大面积留白
 * ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

:root {
  /* 色 */
  --bg:          #F7F2EB;         /* 奶油底 */
  --bg-soft:     #EEE6DB;
  --surface:     #FFFFFF;
  --surface-2:   #FBF7F1;
  --ink:         #1D1814;         /* 深棕墨 */
  --ink-2:       #3B322B;
  --soft:        #78706A;
  --softer:      #A8A098;
  --line:        rgba(29, 24, 20, 0.08);
  --line-2:      rgba(29, 24, 20, 0.14);
  --primary:     #B85C57;         /* 朱砂 / 胭脂 */
  --primary-2:   #D4756F;
  --primary-soft:rgba(184, 92, 87, 0.10);
  --accent:      #8B7355;         /* 暖褐 */
  --accent-soft: rgba(139, 115, 85, 0.10);
  --cream:       #E8DCC4;

  /* 字体 */
  --serif:    'Noto Serif SC', 'Songti SC', 'STSong', 'Source Han Serif SC', 'Hiragino Mincho ProN', Georgia, serif;
  --num:      'Cormorant Garamond', 'Baskerville', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --body:     'PingFang SC', -apple-system, 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(29, 24, 20, 0.04);
  --shadow-sm: 0 4px 12px rgba(29, 24, 20, 0.05);
  --shadow-md: 0 14px 34px rgba(29, 24, 20, 0.08);

  /* 形 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt" 1;  /* 中文标点挤压 */
  min-height: 100vh;
}

body::before {
  /* 微妙的纸张纹理 */
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(212, 118, 111, 0.06), transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(139, 115, 85, 0.05), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--ink); }

/* ---------------------------------------------------------
 * Topbar · 编辑级
 * --------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 14px) 22px 14px;
  background: rgba(247, 242, 235, 0.82);
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  font-family: var(--num);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 6px;
  color: var(--ink);
}
.topbar .nav {
  display: flex;
  gap: 2px;
}
.topbar .nav a {
  position: relative;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--soft);
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color .18s;
}
.topbar .nav a.active {
  color: var(--ink);
}
.topbar .nav a.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: -2px;
  height: 1px;
  background: var(--primary);
}
.topbar .secret {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--softer);
  opacity: 0.4;
  font-size: 14px;
  transition: opacity .18s, color .18s;
}
.topbar .secret:hover, .topbar .secret:active { opacity: 0.9; color: var(--primary); }

/* ---------------------------------------------------------
 * 首页 Hero · 编辑级
 * --------------------------------------------------------- */
.home-hero {
  position: relative;
  padding: 48px 24px 36px;
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
  z-index: 1;
}
.home-hero .monogram {
  font-family: var(--num);
  font-size: 12px;
  letter-spacing: 8px;
  color: var(--soft);
  margin-bottom: 4px;
}
.home-hero .monogram .amp {
  color: var(--primary);
  margin: 0 6px;
  font-style: italic;
}
.home-hero .year {
  font-family: var(--num);
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--softer);
  margin-bottom: 32px;
}

.days-count {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  margin-bottom: 14px;
}
.days-count .num {
  font-family: var(--num);
  font-size: clamp(108px, 32vw, 164px);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -4px;
  line-height: 0.9;
  font-variant-numeric: oldstyle-nums proportional-nums;
}
.days-count .divider {
  width: 44px;
  height: 1px;
  background: var(--primary);
  margin: 14px 0 10px;
}
.days-count .unit {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 6px;
  color: var(--ink);
  padding-left: 6px;
  font-weight: 500;
}
.days-count .unit .en {
  display: block;
  font-family: var(--num);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--softer);
  margin-top: 6px;
  font-style: italic;
  padding-left: 2px;
}

.home-hero .tagline {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--soft);
  margin: 0 0 32px;
}
.home-hero .tagline .pct {
  font-family: var(--num);
  font-style: italic;
  color: var(--primary);
  font-weight: 500;
  font-size: 17px;
  margin: 0 4px;
  letter-spacing: 0;
}

.home-hero .settings-btn {
  position: absolute;
  top: 16px; right: 18px;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--soft);
  opacity: 0.5;
  transition: opacity .2s, background .2s;
}
.home-hero .settings-btn:hover { opacity: 1; background: var(--surface); }

/* 两个小卡片 */
.hero-cards {
  display: grid;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}

.hero-card.progress {
  display: grid;
  gap: 10px;
}
.hero-card .h-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--soft);
  letter-spacing: 0.5px;
}
.hero-card .h-label .val {
  font-family: var(--num);
  font-size: 14px;
  color: var(--soft);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.3px;
}
.hero-card .h-label .val b {
  font-weight: 500;
  color: var(--primary);
  font-size: 26px;
  margin: 0 4px 0 2px;
  font-style: italic;
  letter-spacing: -1px;
}
.progress-track {
  height: 4px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.22, 0.68, 0.32, 1);
}
.progress-legend {
  display: flex;
  justify-content: space-between;
  font-family: var(--num);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--softer);
}

.hero-card.event {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-card.event .dot {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--primary-soft);
  flex-shrink: 0;
}
.hero-card.event .ev-info { flex: 1; min-width: 0; }
.hero-card.event .ev-label {
  font-size: 11px;
  color: var(--soft);
  letter-spacing: 1.5px;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 500;
}
.hero-card.event .ev-title {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-card.event .ev-count {
  font-family: var(--num);
  font-size: 24px;
  color: var(--primary);
  font-style: italic;
  font-weight: 500;
  flex-shrink: 0;
}
.hero-card.event .ev-count small {
  font-size: 11px;
  color: var(--soft);
  font-style: normal;
  letter-spacing: 2px;
  margin-left: 2px;
}

/* ---------------------------------------------------------
 * Timeline · 单列 · 按月分组
 * --------------------------------------------------------- */
.timeline {
  max-width: 540px;
  margin: 0 auto;
  padding: 48px 20px calc(120px + var(--safe-bottom));
  position: relative;
  z-index: 1;
}

.tl-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.tl-heading .line {
  flex: 1;
  height: 1px;
  background: var(--line-2);
}
.tl-heading h2 {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 8px;
  color: var(--ink);
  margin: 0;
  padding-left: 8px;
}

.tl-month {
  position: sticky;
  top: calc(var(--safe-top) + 52px);
  z-index: 5;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 18px;
  padding: 22px 0 20px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(247, 242, 235, 0));
}
.tl-month .year {
  font-family: var(--num);
  font-size: 40px;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -1px;
  line-height: 1;
}
.tl-month .mon {
  font-family: var(--num);
  font-size: 13px;
  letter-spacing: 5px;
  color: var(--soft);
  text-transform: uppercase;
}

.tl-item {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 32px;
  animation: tlIn .5s cubic-bezier(.2,.7,.2,1) backwards;
}
@keyframes tlIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.tl-item .tl-date {
  flex-shrink: 0;
  width: 46px;
  text-align: center;
  padding-top: 8px;
  position: relative;
}
.tl-item .tl-date::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--primary-soft);
  z-index: 2;
}
.tl-item .tl-date::after {
  content: '';
  position: absolute;
  top: 26px;
  bottom: -32px;
  left: 50%;
  width: 1px;
  background: var(--line-2);
}
.tl-item.tl-last .tl-date::after { bottom: 0; opacity: .5; }

.tl-item .tl-date .day {
  font-family: var(--num);
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  font-weight: 500;
  margin-top: 22px;
  letter-spacing: -0.5px;
}
.tl-item .tl-date .dow {
  font-family: var(--num);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--softer);
  margin-top: 4px;
  text-transform: uppercase;
}

.tl-card {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--line);
  position: relative;
  transition: box-shadow .3s, transform .3s;
}
.tl-card:active { transform: scale(0.995); }
.tl-item:hover .tl-card { box-shadow: var(--shadow-sm); }

.tl-cover {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cream), #d8c8a6);
}
.tl-cover img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4/3;
}
.tl-cover.no-img {
  aspect-ratio: 21/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-cover.no-img::after { display: none; }
.tl-cover.no-img .quote {
  position: static;
  color: var(--ink);
  text-shadow: none;
  text-align: center;
  font-size: 17px;
  line-height: 1.55;
  padding: 32px 24px;
  font-weight: 500;
}
.tl-cover.no-img .quote::before, .tl-cover.no-img .quote::after {
  color: var(--primary);
}

/* 封面色板轮播（没图也好看） */
.tl-item:nth-of-type(4n+1) .tl-cover.no-img { background: linear-gradient(135deg, #F3E9D3 0%, #E3CFA0 100%); }
.tl-item:nth-of-type(4n+2) .tl-cover.no-img { background: linear-gradient(135deg, #F0DCE0 0%, #D4A8AD 100%); }
.tl-item:nth-of-type(4n+3) .tl-cover.no-img { background: linear-gradient(135deg, #E6E0D0 0%, #B9B09B 100%); }
.tl-item:nth-of-type(4n+4) .tl-cover.no-img { background: linear-gradient(135deg, #DFE3DC 0%, #A5B0A3 100%); }
.tl-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(29,24,20,0.45) 100%);
  pointer-events: none;
}
.tl-cover .quote {
  position: absolute;
  left: 20px; right: 20px; bottom: 18px;
  color: #fff;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.5px;
  font-weight: 400;
  text-shadow: 0 2px 14px rgba(0,0,0,0.4);
  z-index: 1;
}
.tl-cover .quote::before {
  content: '「';
  color: var(--primary-2);
  margin-right: 2px;
  font-weight: 500;
}
.tl-cover .quote::after {
  content: '」';
  color: var(--primary-2);
  margin-left: 2px;
  font-weight: 500;
}

.tl-body {
  padding: 16px 20px 18px;
}
.tl-body h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: 0.5px;
  line-height: 1.45;
}
.tl-body p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0;
  white-space: pre-wrap;
  letter-spacing: 0.3px;
}
.tl-body .tag {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  font-size: 10px;
  letter-spacing: 2px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 500;
}

.tl-actions {
  position: absolute;
  top: 10px; right: 10px;
  display: none;
  gap: 6px;
  z-index: 2;
}
.tl-item.editable .tl-actions { display: flex; }
.tl-actions button {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ---------------------------------------------------------
 * 空状态
 * --------------------------------------------------------- */
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--soft);
}
.empty .icon { font-size: 40px; margin-bottom: 12px; opacity: .6; }
.empty .hint { font-family: var(--serif); font-size: 14px; line-height: 1.7; }
.empty .sub { font-size: 12px; margin-top: 6px; color: var(--softer); }

/* ---------------------------------------------------------
 * 按钮
 * --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  transition: transform .12s, box-shadow .25s, background .2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--ink); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn.ghost:hover { border-color: var(--ink); }
.btn.small {
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.btn:disabled { opacity: .4; pointer-events: none; }

/* Floating Action Button */
.fab {
  position: fixed;
  right: 22px;
  bottom: calc(26px + var(--safe-bottom));
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 24px;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 36px rgba(29, 24, 20, 0.25);
  z-index: 40;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform .15s, box-shadow .25s;
}
.fab:active { transform: scale(0.93); }
.fab:hover { box-shadow: 0 18px 42px rgba(29, 24, 20, 0.32); }

/* ---------------------------------------------------------
 * Modal · 编辑级
 * --------------------------------------------------------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(29, 24, 20, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeIn .2s ease-out;
}
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px 24px 22px;
  box-shadow: 0 40px 80px rgba(29, 24, 20, 0.25);
  animation: modalIn .25s cubic-bezier(.2, .8, .3, 1);
}
.modal h3 {
  font-family: var(--serif);
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.modal .sub {
  color: var(--soft);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.55;
}
.modal .row { display: flex; gap: 10px; margin-top: 16px; }
.modal .row .btn { flex: 1; }

.field { display: block; margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 11px;
  color: var(--soft);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.field input[type="text"],
.field input[type="date"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s, background .15s;
  font-size: 14px;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
  background: var(--surface);
}
.field .hint { font-size: 11px; color: var(--soft); margin-top: 6px; }

.upload-area {
  display: block;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 24px;
  text-align: center;
  color: var(--soft);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface-2);
  font-size: 13px;
  letter-spacing: 0.5px;
}
.upload-area:hover { border-color: var(--primary); color: var(--ink); }
.upload-area input { display: none; }
.upload-area img {
  max-height: 220px;
  margin: 10px auto 0;
  border-radius: var(--r-sm);
}

/* ---------------------------------------------------------
 * Toast
 * --------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%; top: 18%;
  transform: translateX(-50%);
  background: rgba(29, 24, 20, 0.92);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.5px;
  z-index: 200;
  animation: toastIn .18s ease-out;
  backdrop-filter: blur(10px);
}

/* ---------------------------------------------------------
 * 日历页 · 精简
 * --------------------------------------------------------- */
.hero {
  position: relative;
  padding: calc(var(--safe-top) + 40px) 24px 44px;
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
  z-index: 1;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: 2px;
}
.hero p {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--soft);
  margin: 0;
  font-family: var(--serif);
}
.hero::before {
  content: '— ·  · —';
  display: block;
  font-family: var(--num);
  font-size: 13px;
  color: var(--primary);
  letter-spacing: 5px;
  margin-bottom: 16px;
}

.cal-wrap {
  padding: 8px 20px calc(100px + var(--safe-bottom));
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.cal-stat {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 12px 14px;
  box-shadow: var(--shadow-xs);
  text-align: center;
}
.stat-card .num {
  font-family: var(--num);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  font-style: italic;
  letter-spacing: -0.5px;
  line-height: 1;
}
.stat-card .label {
  font-size: 10px;
  color: var(--soft);
  letter-spacing: 2px;
  margin-top: 6px;
  text-transform: uppercase;
}
.stat-card .delta {
  font-family: var(--num);
  font-size: 11px;
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: 1px;
}
.delta.up { color: var(--primary); }
.delta.down { color: #6A8FC4; }
.delta.flat { color: var(--softer); }

.cal-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px 16px 20px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.cal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 2px 6px 16px;
}
.cal-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
}
.cal-head .nav-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--soft);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.cal-head .nav-btn:hover { background: var(--surface-2); color: var(--primary); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
.cal-grid .dow {
  text-align: center;
  font-family: var(--num);
  font-size: 10px;
  color: var(--softer);
  padding: 2px 0 8px;
  font-weight: 500;
  letter-spacing: 2px;
  min-width: 0;
  text-transform: uppercase;
}
.cal-cell {
  position: relative;
  aspect-ratio: 1 / 1.08;
  min-width: 0;
  width: 100%;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--num);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform .12s, box-shadow .18s;
  border: 1px solid transparent;
}
.cal-cell:hover { box-shadow: var(--shadow-xs); }
.cal-cell:active { transform: scale(0.94); }
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.today {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.cal-cell .icon { font-size: 16px; line-height: 1; margin-bottom: 2px; }
.cal-cell .num  { font-size: 11px; opacity: 0.9; font-family: var(--num); font-weight: 500; font-style: italic; }
.cal-cell.has-anniv::after {
  content: '';
  position: absolute; right: 5px; top: 5px;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
}
.cal-cell.predicted { opacity: 0.58; }
.cal-cell.predicted::before {
  content: '';
  position: absolute; left: 5px; top: 5px;
  width: 4px; height: 4px;
  background: var(--primary-2);
  border-radius: 50%;
}

.weather-sunny     { background: linear-gradient(160deg, #FBE8B6, #F3CE78); color: #5A3D0C; }
.weather-cloudy    { background: linear-gradient(160deg, #E8E4F0, #C9C2DC); color: #4A3E6B; }
.weather-lightRain { background: linear-gradient(160deg, #CFE2F2, #99BDE0); color: #234566; }
.weather-storm     { background: linear-gradient(160deg, #94A0B8, #566278); color: #fff; }

.legend {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
  font-size: 11px;
  color: var(--softer);
  justify-content: center;
  letter-spacing: 1px;
}
.legend span {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
}

.predict-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
  width: 100%;
}
.predict-list .cal-cell { aspect-ratio: 1 / 1.3; font-size: 10px; }

.day-detail .events { margin-top: 12px; }
.day-detail .ev {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  margin-bottom: 6px;
  font-size: 13px;
  border: 1px solid var(--line);
}
.day-detail .ev .stars { font-size: 12px; color: var(--primary); flex-shrink: 0; margin-left: 8px; font-family: var(--num); }
.day-detail .ev .stars.bad { color: #6A8FC4; }
.day-detail .ev .del {
  color: var(--softer);
  font-size: 12px; padding: 0 0 0 8px;
}

.anniv-list { display: grid; gap: 8px; }
.anniv-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.anniv-item .ic { font-size: 22px; }
.anniv-item .info { flex: 1; min-width: 0; }
.anniv-item .info .t {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.anniv-item .info .d { font-size: 11px; color: var(--soft); margin-top: 2px; letter-spacing: 0.5px; }
.anniv-item .countdown {
  font-family: var(--num);
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  color: var(--primary);
  text-align: right;
}
.anniv-item .countdown small {
  font-size: 9px;
  color: var(--softer);
  display: block;
  font-style: normal;
  letter-spacing: 1.5px;
  margin-top: 2px;
  text-transform: uppercase;
}
.anniv-item .del { color: var(--softer); padding: 4px 8px; font-size: 14px; }

.mood-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 8px 0 6px;
}
.mood-grid button {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 0;
  font-family: var(--num);
  font-size: 15px;
  font-weight: 500;
  transition: background .15s, border-color .15s;
}
.mood-grid.good button { color: #8C5B1A; }
.mood-grid.bad  button { color: #3F5E8A; }
.mood-grid button.active.good { background: linear-gradient(135deg, #FBE8B6, #F3CE78); border-color: #F3CE78; color: #5A3D0C; }
.mood-grid button.active.bad  { background: linear-gradient(135deg, #CFE2F2, #99BDE0); border-color: #99BDE0; color: #234566; }

.tabs {
  display: flex; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin: 18px 0 20px;
}
.tabs button {
  flex: 1;
  padding: 9px 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--soft);
  letter-spacing: 1px;
  transition: background .18s, color .18s;
}
.tabs button.active {
  background: var(--ink);
  color: var(--bg);
}

.ly-list { display: grid; gap: 8px; padding-bottom: 100px; }
.ly-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s;
}
.ly-item:hover { box-shadow: var(--shadow-sm); }
.ly-item.done { opacity: 0.4; }
.ly-item.done .body .t { text-decoration: line-through; }
.ly-item .body { flex: 1; min-width: 0; }
.ly-item .body .t {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.3px;
  color: var(--ink);
}
.ly-item .body .meta { font-size: 11px; color: var(--soft); margin-top: 3px; letter-spacing: 0.5px; }
.ly-item .body .note { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.65; white-space: pre-wrap; }
.ly-item .due { font-family: var(--num); font-size: 12px; font-style: italic; color: var(--primary); font-weight: 500; }
.ly-item .due.over { color: #B5434B; }
.ly-item .due.soon { color: #B07B2C; }
.ly-item .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--line-2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: transparent;
  margin-top: 3px;
  transition: background .15s, border-color .15s;
}
.ly-item.done .check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.ly-item .actions { display: flex; gap: 4px; }
.ly-item .actions button {
  padding: 4px 8px;
  font-size: 12px;
  color: var(--softer);
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.ly-item .actions button:hover { color: var(--ink); background: var(--surface-2); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: transform .12s;
}
.chip:active { transform: scale(0.96); }
.chip.like { background: rgba(92, 137, 92, 0.10); color: #3A6B3A; border-color: transparent; }
.chip.dis  { background: rgba(181, 67, 75, 0.10); color: #8B2A32; border-color: transparent; }

.section-h {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 22px 4px 12px;
}
.section-h h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--ink);
}
.section-h .more { font-size: 11px; color: var(--soft); letter-spacing: 1px; }

/* secret menu */
.secret-menu {
  position: absolute;
  top: 44px; right: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px;
  border-radius: var(--r-sm);
  font-size: 14px;
  z-index: 60;
  display: none;
  animation: modalIn .18s;
  box-shadow: var(--shadow-md);
}
.secret-menu.show { display: block; }
.secret-menu button {
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 6px;
  transition: background .12s;
}
.secret-menu button:hover { background: var(--surface-2); }

/* ---------------------------------------------------------
 * animations
 * --------------------------------------------------------- */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translateX(-50%); } }
