/* ===== 三套主题 ===== */
/* 默认：宣纸（暖米黄） */
:root,
:root[data-theme="paper"] {
  --red-primary: #8B0000;
  --red-light: #B22222;
  --red-deep: #660000;
  --paper-bg: #F5EBD8;
  --paper-card: #FBF5E6;
  --paper-shadow: rgba(139, 0, 0, 0.15);
  --ink: #2C1810;
  --ink-soft: #5C4A3A;
  --gold: #C9A961;
  --gold-light: #E8D4A2;
  --border-red: rgba(139, 0, 0, 0.25);
  --shadow-soft: 0 2px 12px rgba(139, 0, 0, 0.08);
  --shadow-deep: 0 6px 24px rgba(139, 0, 0, 0.18);
  --font-serif: "Noto Serif SC", "STSong", "宋体", "SimSun", serif;
  --font-kai: "Ma Shan Zheng", "STKaiti", "楷体", "KaiTi", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* 明面（纯白） */
:root[data-theme="light"] {
  --red-primary: #C41E3A;
  --red-light: #E63946;
  --red-deep: #8B0000;
  --paper-bg: #FAFAF7;
  --paper-card: #FFFFFF;
  --paper-shadow: rgba(196, 30, 58, 0.12);
  --ink: #1A1A1A;
  --ink-soft: #5C5C5C;
  --gold: #D4A56A;
  --gold-light: #F0DCB6;
  --border-red: rgba(196, 30, 58, 0.18);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-deep: 0 6px 24px rgba(0, 0, 0, 0.12);
}

/* 暗夜（墨黑） */
:root[data-theme="dark"] {
  --red-primary: #D8484F;
  --red-light: #FF6B6B;
  --red-deep: #8B0000;
  --paper-bg: #0E0A08;
  --paper-card: #1A1410;
  --paper-shadow: rgba(216, 72, 79, 0.2);
  --ink: #E8D4A2;
  --ink-soft: #A89878;
  --gold: #E8D4A2;
  --gold-light: #F5E8C8;
  --border-red: rgba(216, 72, 79, 0.3);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-deep: 0 6px 24px rgba(0, 0, 0, 0.6);
}

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

html, body {
  font-family: var(--font-serif);
  background: var(--paper-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse at top left, rgba(201, 169, 97, 0.18), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(139, 0, 0, 0.06), transparent 50%),
    var(--paper-bg);
  background-attachment: fixed;
  padding-bottom: 80px;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ===== 顶部 hero ===== */
.hero {
  position: relative;
  color: var(--paper-card);
  padding: 14px 18px 18px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-deep);
  isolation: isolate;
  animation: heroFade 0.6s ease-out;
}
@keyframes heroFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-bg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1;
  background:
    linear-gradient(135deg, var(--red-deep) 0%, var(--red-primary) 50%, var(--red-light) 100%);
}
.hero-bg::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(232, 212, 162, 0.25) 0%, transparent 18%),
    radial-gradient(circle at 88% 78%, rgba(232, 212, 162, 0.18) 0%, transparent 16%);
  pointer-events: none;
}
.hero-bg::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='none' stroke='%23E8D4A2' stroke-width='0.5' opacity='0.18'><path d='M0 40 Q20 20 40 40 T80 40'/><path d='M0 60 Q20 40 40 60 T80 60'/></g></svg>");
  opacity: 0.6;
  pointer-events: none;
  animation: waterDrift 20s linear infinite;
}
@keyframes waterDrift {
  from { background-position: 0 0; }
  to { background-position: 80px 80px; }
}
.hero-deco { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 0; }
.seal-corner {
  position: absolute;
  width: 60px; height: 60px;
  left: 10px; top: 50px;
  opacity: 0.6;
}
.seal-corner.seal-tr {
  left: auto; right: 10px; top: 50px;
  transform: scaleX(-1);
}

.hero-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 6px;
  position: relative;
  z-index: 1;
}
.brand {
  font-family: var(--font-kai);
  font-size: 26px; font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-light);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.subtitle {
  font-size: 11px; opacity: 0.8; margin-top: 2px;
  font-family: var(--font-serif); letter-spacing: 1px;
}

.hero-main {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin: 4px 0 12px;
  position: relative; z-index: 1;
}
.hero-left { line-height: 1; }
.solaryear { font-size: 16px; opacity: 0.9; font-family: var(--font-serif); letter-spacing: 2px; }
.solarmonth { font-size: 14px; opacity: 0.8; margin-top: 2px; }
.solarday-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-top: 2px;
}
.solarday {
  font-family: var(--font-kai);
  font-size: 84px; font-weight: 700;
  color: var(--paper-card);
  line-height: 1;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
  letter-spacing: -2px;
  transition: transform 0.3s;
}
.solarday.bump { animation: numberBump 0.4s; }
@keyframes numberBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--gold-light); }
  100% { transform: scale(1); }
}
.moon-phase {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--paper-card);
  position: relative;
  box-shadow: 0 0 12px rgba(232, 212, 162, 0.4);
  overflow: hidden;
  flex-shrink: 0;
}
.moon-phase::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--red-deep);
  border-radius: 50%;
  /* 默认：满月（不显示阴影） */
  box-shadow: inset 0 0 0 0 transparent;
}
.moon-phase.m0::after { box-shadow: inset 18px 0 0 0 var(--red-deep); } /* 新月 */
.moon-phase.m1::after { box-shadow: inset -10px 0 0 0 var(--red-deep); } /* 蛾眉 */
.moon-phase.m2::after { box-shadow: inset -15px 0 0 0 var(--red-deep); } /* 上弦前 */
.moon-phase.m3::after { box-shadow: inset -18px 0 0 0 var(--red-deep); } /* 上弦 */
.moon-phase.m4::after { box-shadow: inset -15px 0 0 0 var(--red-deep); } /* 盈凸 */
.moon-phase.m5::after { box-shadow: inset 0 0 0 0 transparent; } /* 满月 */
.moon-phase.m6::after { box-shadow: inset 10px 0 0 0 var(--red-deep); } /* 亏凸 */
.moon-phase.m7::after { box-shadow: inset 18px 0 0 0 var(--red-deep); } /* 下弦 */
.moon-phase.m8::after { box-shadow: inset 15px 0 0 0 var(--red-deep); } /* 下弦后 */
.moon-phase.m9::after { box-shadow: inset 10px 0 0 0 var(--red-deep); } /* 残月 */
.weekday {
  font-family: var(--font-kai);
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
  letter-spacing: 2px;
}
.hero-right {
  text-align: right;
  font-size: 13px;
  font-family: var(--font-serif);
  line-height: 1.7;
  padding-top: 6px;
  min-width: 130px;
}
.lunar-line { color: var(--gold-light); font-size: 15px; font-weight: 600; }
.lunar-shengxiao { opacity: 0.85; font-size: 12px; }
.lunar-gz { opacity: 0.85; font-size: 12px; font-family: var(--font-kai); letter-spacing: 1px; }
.yiji {
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 3px;
  text-align: right;
}
.yiji-row {
  font-size: 11px;
  font-family: var(--font-kai);
  letter-spacing: 1px;
  display: flex; justify-content: flex-end; gap: 4px;
  align-items: baseline;
}
.yiji-tag {
  background: rgba(232, 212, 162, 0.2);
  padding: 0 4px;
  border-radius: 3px;
  color: var(--gold-light);
  font-weight: 700;
  font-size: 11px;
}
.yiji-good .yiji-tag { color: #FFD700; }
.yiji-bad .yiji-tag { color: #B0B0B0; }
.yiji-text { opacity: 0.85; font-size: 11px; }

.ghost-btn {
  background: rgba(251, 245, 230, 0.12);
  color: var(--paper-card);
  border: 1px solid rgba(251, 245, 230, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 14px;
  font-family: var(--font-kai);
  transition: all 0.18s;
  min-width: 36px;
}
.ghost-btn:hover { background: rgba(251, 245, 230, 0.22); }
.ghost-btn:active { transform: scale(0.96); }

.hero-weather {
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  position: relative; z-index: 1;
  border: 1px solid rgba(251, 245, 230, 0.2);
}
.weather-empty { opacity: 0.7; }
.weather-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.weather-temp { font-size: 22px; font-weight: 700; color: var(--gold-light); }
.weather-cond { font-size: 14px; }
.weather-detail { font-size: 12px; opacity: 0.85; margin-top: 4px; }

/* ===== 月份切换 ===== */
.month-nav {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 16px 8px;
  position: sticky; top: 0; z-index: 10;
  background: rgba(245, 235, 216, 0.95); /* fallback (no backdrop-filter) */
  background: linear-gradient(var(--paper-bg) 80%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.nav-btn {
  font-family: var(--font-kai);
  font-size: 22px; font-weight: 700;
  color: var(--red-primary);
  background: var(--paper-card);
  border: 1px solid var(--border-red);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: all 0.15s;
}
.nav-btn.small { font-size: 13px; width: auto; padding: 0 12px; border-radius: var(--radius-md); }
.nav-btn:hover { background: var(--red-primary); color: var(--paper-card); }
.nav-btn:active { transform: scale(0.92); }
.month-title {
  font-family: var(--font-kai);
  font-size: 20px;
  color: var(--red-primary);
  font-weight: 600;
  min-width: 160px;
  text-align: center;
  letter-spacing: 2px;
}

/* ===== 日历 ===== */
.calendar-wrap {
  margin: 0 12px;
  background: var(--paper-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-red);
  overflow: hidden;
}
.weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: rgba(139, 0, 0, 0.06);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-red);
}
.weekdays span {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--font-kai);
  letter-spacing: 2px;
}
.weekdays span:first-child { color: var(--red-primary); font-weight: 700; }
.weekdays span:last-child { color: var(--red-primary); font-weight: 700; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; padding: 1px; }
.day {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 110%; /* fallback for HarmonyOS / old WebView (aspect-ratio not supported) */
  aspect-ratio: 1 / 1.1;
  background: var(--paper-card);
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  cursor: pointer;
  padding-top: 4px;
  padding-left: 2px;
  padding-right: 2px;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  overflow: hidden;
  animation: dayFade 0.3s ease-out;
}
@keyframes dayFade {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
.day:hover { background: rgba(201, 169, 97, 0.18); transform: scale(1.04); z-index: 2; }
.day:active { transform: scale(0.94); }
.day.out { opacity: 0.25; }
.day.out:hover { opacity: 0.5; }
.day.today {
  background: linear-gradient(135deg, var(--red-primary), var(--red-light));
  color: var(--paper-card);
  box-shadow: inset 0 0 0 2px var(--gold-light), 0 2px 8px rgba(139,0,0,0.3);
}
.day.today::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 14px 14px 0 0;
  border-color: var(--gold-light) transparent transparent transparent;
  opacity: 0.7;
}
.day.selected {
  border: 2px solid var(--gold);
  background: rgba(201, 169, 97, 0.32);
  box-shadow: 0 0 0 1px var(--red-primary), 0 2px 8px rgba(139,0,0,0.15);
  transform: scale(1.02);
  z-index: 1;
}
.day.selected .day-solar { color: var(--red-primary); font-weight: 700; }
.day-solar { font-size: 16px; font-weight: 500; line-height: 1.1; transition: color 0.2s; }
.day-lunar { font-size: 10px; color: var(--ink-soft); margin-top: 2px; line-height: 1.1; min-height: 12px; transition: color 0.2s; }
.day.today .day-lunar { color: var(--gold-light); }
.day.has-event::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red-primary);
  box-shadow: 0 0 4px var(--red-primary);
}
.day.today.has-event::after { background: var(--gold-light); box-shadow: 0 0 4px var(--gold-light); }
.day.holiday .day-solar { color: var(--red-primary); font-weight: 700; }
.day.weekend .day-solar { color: var(--red-light); }
.day.jieqi .day-lunar { color: var(--red-primary); font-weight: 600; }
.day.jieqi .day-solar { color: var(--red-primary); }
.day.festival-major {
  background: linear-gradient(135deg, rgba(201, 169, 97, 0.25), rgba(139, 0, 0, 0.08));
}
.day.festival-major .day-solar {
  color: var(--red-primary);
  font-weight: 700;
}
.day.festival-major .day-lunar {
  color: var(--red-primary);
  font-weight: 600;
}

/* 节日角标 */
.day-badge {
  position: absolute;
  top: 2px; right: 2px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red-primary);
  box-shadow: 0 0 6px rgba(139, 0, 0, 0.5);
}
.day-badge.gold { background: var(--gold); box-shadow: 0 0 6px rgba(201, 169, 97, 0.6); }

/* ===== 选中日期详情 ===== */
.day-detail {
  margin: 12px;
  padding: 14px;
  background: var(--paper-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-red);
  box-shadow: var(--shadow-soft);
  min-height: 100px;
}
.detail-empty { text-align: center; color: var(--ink-soft); padding: 30px 0; font-size: 14px; }
.detail-header {
  display: flex; align-items: baseline; gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-red);
  margin-bottom: 10px;
}
.detail-solar { font-family: var(--font-kai); font-size: 22px; color: var(--red-primary); font-weight: 700; }
.detail-lunar { font-size: 13px; color: var(--ink-soft); }
.detail-row { display: flex; gap: 8px; padding: 6px 0; font-size: 14px; align-items: flex-start; }
.detail-row .label { color: var(--ink-soft); min-width: 60px; flex-shrink: 0; font-family: var(--font-kai); }
.detail-row .value { color: var(--ink); flex: 1; }
.detail-row.tag .value { color: var(--red-primary); font-weight: 600; }
.detail-event-pill {
  display: inline-block;
  background: var(--red-primary);
  color: var(--paper-card);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 4px;
  font-family: var(--font-kai);
}

/* ===== 纪念日列表 ===== */
.events-section {
  margin: 16px 12px;
  padding: 14px;
  background: var(--paper-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-red);
  box-shadow: var(--shadow-soft);
}
.section-title {
  font-family: var(--font-kai);
  font-size: 18px;
  color: var(--red-primary);
  margin-bottom: 10px;
  letter-spacing: 2px;
  text-align: center;
  position: relative;
  padding-bottom: 8px;
}
.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 6px auto 0;
}
.events-list { display: flex; flex-direction: column; gap: 8px; }
.fest-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(201, 169, 97, 0.25), rgba(201, 169, 97, 0.12));
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.fest-banner::before {
  content: "";
  position: absolute;
  top: 0; right: -20px;
  width: 60px; height: 100%;
  background: linear-gradient(135deg, transparent 30%, rgba(201, 169, 97, 0.3) 50%, transparent 70%);
  animation: shimmer 3s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-40px); }
  100% { transform: translateX(80px); }
}
.fest-banner:hover { background: linear-gradient(135deg, rgba(201, 169, 97, 0.35), rgba(201, 169, 97, 0.18)); }
.fest-banner-tag {
  background: var(--red-primary);
  color: var(--gold-light);
  font-family: var(--font-kai);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
  flex-shrink: 0;
}
.fest-banner-name {
  font-family: var(--font-kai);
  font-size: 16px;
  color: var(--red-primary);
  font-weight: 700;
  flex: 1;
}
.fest-banner-date {
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
}
.fest-banner-count {
  font-family: var(--font-kai);
  font-size: 13px;
  color: var(--red-primary);
  font-weight: 600;
  background: var(--paper-card);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.event-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: rgba(201, 169, 97, 0.12);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--red-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.event-item:hover { background: rgba(201, 169, 97, 0.22); }
.event-item.memorial { border-left-color: #4a4a4a; }
.event-item.birthday { border-left-color: var(--gold); }
.event-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--red-primary);
  color: var(--paper-card);
  font-family: var(--font-kai);
  flex-shrink: 0;
}
.event-item.memorial .event-tag { background: #4a4a4a; }
.event-item.birthday .event-tag { background: var(--gold); color: var(--ink); }
.event-body { flex: 1; min-width: 0; }
.event-name { font-weight: 600; font-size: 14px; }
.event-meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.event-countdown {
  font-family: var(--font-kai);
  font-size: 13px;
  color: var(--red-primary);
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}
.event-empty { text-align: center; color: var(--ink-soft); padding: 16px 0; font-size: 13px; }
.add-btn {
  display: block;
  margin: 12px auto 0;
  background: var(--red-primary);
  color: var(--paper-card);
  font-family: var(--font-kai);
  padding: 8px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  letter-spacing: 2px;
  box-shadow: var(--shadow-soft);
  transition: all 0.15s;
}
.add-btn:hover { background: var(--red-deep); }
.add-btn:active { transform: scale(0.96); }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.2s;
}
.modal[hidden] {
  display: none !important;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--paper-card);
  border-radius: var(--radius-md);
  width: 100%; max-width: 400px;
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  border: 2px solid var(--red-primary);
  box-shadow: var(--shadow-deep);
  animation: slideUp 0.25s;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--red-primary);
  color: var(--paper-card);
  font-family: var(--font-kai);
}
.modal-header h3 { font-size: 18px; letter-spacing: 2px; }
.close-btn {
  background: rgba(251, 245, 230, 0.15);
  color: var(--paper-card);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: rgba(251, 245, 230, 0.3); }
.modal-body { padding: 16px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border-red);
  background: rgba(201, 169, 97, 0.08);
}
.spacer { flex: 1; }
.field { display: block; margin-bottom: 12px; }
.field > span {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
  font-family: var(--font-kai);
  letter-spacing: 1px;
}
.field input, .field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-red);
  border-radius: var(--radius-sm);
  background: var(--paper-card);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: all 0.15s;
}
.field input:focus, .field select:focus { border-color: var(--red-primary); box-shadow: 0 0 0 3px rgba(139,0,0,0.1); }
.row-fields { display: grid; grid-template-columns: 1fr 0.7fr 0.7fr; gap: 8px; }
.row-fields .field { margin-bottom: 0; }
.divider { border: none; border-top: 1px dashed var(--border-red); margin: 12px 0; }
.hint { font-size: 12px; color: var(--ink-soft); }
.primary-btn {
  background: var(--red-primary);
  color: var(--paper-card);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-kai);
  font-size: 14px;
  letter-spacing: 1px;
  transition: all 0.15s;
}
.primary-btn:hover { background: var(--red-deep); }
.primary-btn:active { transform: scale(0.96); }
.primary-btn.danger { background: #4a4a4a; }

.city-results {
  margin-top: 4px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-red);
  border-radius: var(--radius-sm);
  background: var(--paper-card);
}
.city-results:empty { display: none; }
.city-result {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid rgba(139,0,0,0.08);
}
.city-result:last-child { border-bottom: none; }
.city-result:hover { background: rgba(201, 169, 97, 0.18); }
.city-result .city-name { color: var(--ink); font-weight: 500; }
.city-result .city-code { color: var(--ink-soft); font-size: 11px; margin-left: 6px; }

/* ===== 底部 ===== */
.foot {
  text-align: center;
  padding: 20px 0 10px;
  color: var(--ink-soft);
  font-size: 11px;
  font-family: var(--font-kai);
  letter-spacing: 1px;
}

/* ===== iOS safe area ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .hero { padding-top: calc(14px + env(safe-area-inset-top)); }
}

/* ===== 暗色模式（系统偏好，主题未指定时） ===== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --red-primary: #D8484F;
    --red-light: #FF6B6B;
    --red-deep: #8B0000;
    --paper-bg: #0E0A08;
    --paper-card: #1A1410;
    --paper-shadow: rgba(216, 72, 79, 0.2);
    --ink: #E8D4A2;
    --ink-soft: #A89878;
    --gold: #E8D4A2;
    --gold-light: #F5E8C8;
    --border-red: rgba(216, 72, 79, 0.3);
    --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-deep: 0 6px 24px rgba(0, 0, 0, 0.6);
  }
}

/* ===== 节气插画 ===== */
.jieqi-icon {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--red-primary);
  flex-shrink: 0;
}
.jieqi-icon svg {
  width: 100%; height: 100%;
  fill: currentColor;
}
.jieqi-icon.lg {
  width: 80px; height: 80px;
  margin: 0 auto;
  filter: drop-shadow(0 2px 4px var(--paper-shadow));
}
.jieqi-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(201, 169, 97, 0.2), rgba(232, 212, 162, 0.1));
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 12px 0;
  text-align: left;
}
.jieqi-banner .jieqi-icon {
  width: 44px; height: 44px;
  color: var(--red-primary);
}
.jieqi-banner-info { flex: 1; }
.jieqi-banner-name {
  font-family: var(--font-kai);
  font-size: 18px;
  color: var(--red-primary);
  font-weight: 700;
  letter-spacing: 2px;
}
.jieqi-banner-desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  font-family: var(--font-serif);
}

/* ===== 语音按钮 ===== */
.voice-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--red-primary), var(--red-light));
  color: var(--paper-card);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  font-family: var(--font-kai);
  font-size: 13px;
  letter-spacing: 1px;
  transition: all 0.2s;
  box-shadow: var(--shadow-soft);
}
.voice-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-deep); }
.voice-btn:active { transform: scale(0.98); }
.voice-btn.recording {
  background: linear-gradient(135deg, #B22222, #FF6B6B);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(196, 30, 58, 0); }
}
.voice-btn .voice-icon { font-size: 16px; }
.voice-btn .voice-hint { flex: 1; text-align: left; }
.voice-btn.recording .voice-hint::after { content: " ● 录音中…"; color: var(--gold-light); }

/* ===== 主题切换 mini 标识 ===== */
.theme-pill {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--paper-bg);
  border-radius: 100px;
  border: 1px solid var(--border-red);
}
.theme-pill button {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}
.theme-pill button.active {
  background: var(--red-primary);
  color: var(--paper-card);
  box-shadow: 0 0 8px rgba(139, 0, 0, 0.3);
}
