/* ============ 择吉 · 暖金红传统黄历 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --paper: #fdf6e3;        /* 古纸米黄 */
  --paper-deep: #f7ead0;
  --ink: #4a2e1a;          /* 深褐 */
  --ink-dim: #8a6f52;
  --gold: #c8952c;         /* 暖金 */
  --gold-light: #e8c96a;
  --red: #b03a2e;          /* 朱红 */
  --red-deep: #8f2d22;
}

html, body {
  font-family: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', 'STKaiti', 'KaiTi', serif;
  background: linear-gradient(180deg, #fbf2dd 0%, #f3e3c0 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50% 35% at 85% 8%, rgba(200, 149, 44, 0.12), transparent 70%),
    radial-gradient(60% 40% at 10% 90%, rgba(176, 58, 46, 0.08), transparent 70%);
}

a { text-decoration: none; color: inherit; }

.container {
  position: relative; z-index: 1;
  max-width: 520px; margin: 0 auto; padding: 20px 20px 48px;
}

/* 顶部返回 */
.top-bar { padding: 6px 0 0; border-bottom: 1.5px solid var(--gold); }
.top-bar .back-link {
  display: inline-block; font-size: 13px; color: var(--ink-dim);
  letter-spacing: 1px; padding: 6px 10px;
}
.top-bar .back-link:active { color: var(--red); }

/* 头部 */
.hero { text-align: center; padding: 24px 0 18px; }
.logo { font-size: 40px; filter: drop-shadow(0 4px 8px rgba(200, 149, 44, 0.4)); }
.hero h1 {
  font-size: 32px; letter-spacing: 10px; margin-top: 4px;
  color: var(--red);
}
.hero .sub { font-size: 13px; color: var(--ink-dim); margin-top: 6px; letter-spacing: 3px; }
.hero .intro {
  font-size: 13px; color: var(--ink); line-height: 1.9; margin-top: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(200, 149, 44, 0.5);
  border-radius: 8px; padding: 10px 14px;
}
.disclaimer {
  display: inline-block; margin-top: 12px; padding: 4px 12px;
  font-size: 12px; color: var(--red);
  border: 1px solid rgba(176, 58, 46, 0.5); border-radius: 20px;
}

.section-title {
  text-align: center; color: var(--red); font-size: 15px;
  letter-spacing: 6px; margin: 22px 0 14px;
}

/* 日历 */
.cal-box {
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  padding: 14px 14px 16px;
  box-shadow: 0 4px 14px rgba(200, 149, 44, 0.18);
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 10px;
}
.cal-nav {
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 20px; color: var(--red);
  background: rgba(200, 149, 44, 0.15);
  border: 1px solid rgba(200, 149, 44, 0.5);
  cursor: pointer; transition: transform 0.15s;
}
.cal-nav:active { transform: scale(0.9); }
.cal-ym { font-size: 17px; letter-spacing: 3px; color: var(--ink); font-weight: 600; }
.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 12px; color: var(--ink-dim);
  padding: 6px 0; border-top: 1px solid rgba(200, 149, 44, 0.35);
  border-bottom: 1px solid rgba(200, 149, 44, 0.35);
}
.cal-week span:first-child, .cal-week span:last-child { color: var(--red); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding-top: 8px; }
.cal-day {
  position: relative; text-align: center;
  padding: 8px 0 6px; border-radius: 8px;
  font-size: 14px; color: var(--ink);
  cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.cal-day:active { transform: scale(0.92); }
.cal-day.empty { visibility: hidden; }
.cal-day.other-month { color: #c9b896; }
.cal-day.today::after {
  content: '今'; position: absolute; top: 1px; right: 4px;
  font-size: 9px; color: var(--red);
}
.cal-day.selected {
  background: linear-gradient(160deg, var(--red), var(--red-deep));
  color: #fff;
  box-shadow: 0 3px 8px rgba(176, 58, 46, 0.35);
}

/* 结果卡 */
.screen-result { animation: fadeUp 0.5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.almanac-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--gold);
  border-radius: 12px; padding: 16px;
}
.almanac-date { text-align: center; }
.ad-g { display: block; font-size: 17px; letter-spacing: 1px; color: var(--ink); }
.ad-l { display: block; font-size: 13px; color: var(--red); margin-top: 4px; letter-spacing: 1px; }
.almanac-ganzhi {
  display: flex; justify-content: center; gap: 8px; margin-top: 12px;
}
.gz-chip {
  font-size: 13px; padding: 4px 12px;
  color: var(--red); background: rgba(176, 58, 46, 0.08);
  border: 1px solid rgba(176, 58, 46, 0.4); border-radius: 14px;
}
.jianchu-row {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 14px; padding: 10px 0;
  border-top: 1px dashed rgba(200, 149, 44, 0.5);
  border-bottom: 1px dashed rgba(200, 149, 44, 0.5);
}
.jc-label { font-size: 13px; color: var(--ink-dim); }
.jc-value {
  font-size: 26px; font-weight: 700; color: var(--red);
  border: 2px solid var(--red); border-radius: 8px;
  padding: 2px 14px;
  font-family: 'STKaiti', 'KaiTi', serif;
}
.yi-ji { display: flex; gap: 10px; margin-top: 14px; }
.yi-block, .ji-block { flex: 1; }
.yj-title {
  text-align: center; font-size: 15px; letter-spacing: 3px;
  padding: 4px 0; border-radius: 6px; margin-bottom: 8px;
}
.yi-title { color: var(--red); background: rgba(176, 58, 46, 0.1); border: 1px solid rgba(176, 58, 46, 0.4); }
.ji-title { color: var(--ink-dim); background: rgba(138, 111, 82, 0.1); border: 1px solid rgba(138, 111, 82, 0.35); }
.yj-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.yj-tags span {
  font-size: 12px; padding: 3px 9px; border-radius: 10px;
}
.yi-block .yj-tags span { color: var(--red); background: rgba(176, 58, 46, 0.07); border: 1px solid rgba(176, 58, 46, 0.3); }
.ji-block .yj-tags span { color: var(--ink-dim); background: rgba(138, 111, 82, 0.07); border: 1px solid rgba(138, 111, 82, 0.3); }
.chong-row {
  display: flex; justify-content: center; gap: 10px; margin-top: 14px;
  font-size: 13px;
}
.chong-label { color: var(--ink-dim); }
.chong-value { color: var(--ink); }

.reading-card {
  margin-top: 14px; padding: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(200, 149, 44, 0.5);
  border-radius: 12px;
}
.reading-title {
  font-size: 14px; letter-spacing: 4px; color: var(--red);
  margin-bottom: 8px; text-align: center;
}
.reading-text { font-size: 14px; line-height: 2; color: var(--ink); }
.caveat { text-align: center; font-size: 11px; color: var(--ink-dim); margin-top: 12px; }

.footer {
  text-align: center; font-size: 11px; color: var(--ink-dim);
  line-height: 1.8; margin-top: 28px; padding-top: 14px;
  border-top: 1px solid rgba(200, 149, 44, 0.5);
}