:root {
  --ink: #2b2420;
  --ink-soft: #4d443d;
  --paper: #f6f1e7;
  --paper-deep: #ece4d3;
  --cinnabar: #9c1f1f;
  --cinnabar-dark: #7c1717;
  --gold: #b8860b;
  --gold-bright: #d4a72c;
  --jade: #2f6b4f;
  --line: #ddd2bd;
  --white: #fffdf8;
  --shadow: 0 10px 30px rgba(43, 36, 32, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: 0 0 0.6em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin: 1.6em 0 0.6em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 0.5em; }

a { color: var(--cinnabar); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cinnabar-dark); }

p { margin: 0 0 1em; }

img { max-width: 100%; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .seal {
  display: inline-flex;
  width: 30px; height: 30px;
  background: var(--cinnabar);
  color: #fff;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
}
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px 0;
}
.nav a:hover { color: var(--cinnabar); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 56px 20px 40px;
  background:
    radial-gradient(circle at 15% 20%, rgba(212,167,44,0.12), transparent 42%),
    radial-gradient(circle at 85% 15%, rgba(156,31,31,0.08), transparent 42%),
    var(--paper);
}
.hero .kicker {
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}
.hero p.lede {
  max-width: 640px;
  margin: 0 auto 8px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.hero .sub { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Cards & panels ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 24px 0;
}
.panel h2 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.feature-list { list-style: none; padding: 0; margin: 0 0 1em; }
.feature-list li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px dashed var(--line); }
.feature-list li:last-child { border-bottom: 0; }
.feature-list li::before {
  content: "◆";
  position: absolute;
  left: 4px;
  color: var(--gold);
  font-size: 0.8rem;
  top: 12px;
}

/* ---------- Form ---------- */
.calc-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 1rem;
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--gold-bright);
  outline-offset: 1px;
  border-color: var(--gold);
}
.form-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: 12px; }

.btn {
  display: inline-block;
  background: var(--cinnabar);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--cinnabar-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #9a7407; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--cinnabar); }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }

/* ---------- Chart result ---------- */
.result-hidden { display: none; }
#result { scroll-margin-top: 90px; }

.chart-table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; }
.chart-table th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.chart-table td {
  text-align: center;
  padding: 10px 6px;
  border-bottom: 1px dashed var(--line);
  vertical-align: middle;
}
.pillar-char {
  font-size: 2rem;
  font-family: "KaiTi", "STKaiti", "Noto Serif SC", "Songti SC", "SimSun", serif;
  line-height: 1.1;
}
.pillar-en { font-size: 0.82rem; color: var(--ink-soft); }
.element-chip {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  margin: 2px;
}
.el-Wood { background: #3f7d4e; }
.el-Fire { background: #b8432f; }
.el-Earth { background: #8a6d3b; }
.el-Metal { background: #6c6f76; }
.el-Water { background: #2f5f8a; }

.zodiac-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--paper-deep);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 14px 0;
}
.zodiac-banner .animal { font-size: 2.4rem; }

.bar-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.bar-label { width: 74px; font-size: 0.88rem; color: var(--ink-soft); }
.bar-track { flex: 1; height: 10px; background: var(--paper-deep); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.bar-count { width: 40px; font-size: 0.85rem; color: var(--ink-soft); text-align: right; }

.share-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
.action-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Paywall ---------- */
.paywall {
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #fffaf0, var(--white));
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 20px 0;
}
.paywall h3 { margin-top: 0; }
.price-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.price-table td { padding: 10px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.price-table td:first-child { font-weight: 600; }
.price-table .price { white-space: nowrap; color: var(--cinnabar); font-weight: 700; }
.price-table .note { font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- Science & culture ---------- */
.science-box {
  background: #f2f6f0;
  border: 1px solid #cfe0d2;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 18px 0;
}
.science-box h3 { color: var(--jade); margin-top: 0; }
.science-box .pillar { margin: 10px 0; }
.science-box .pillar strong { color: var(--jade); }

.disclaimer {
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 20px;
  font-style: italic;
}

/* ---------- Daily fortune ---------- */
.fortune-card { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.fortune-main { flex: 1 1 280px; }
.fortune-side { flex: 1 1 260px; background: var(--paper-deep); border-radius: 10px; padding: 16px; }
.fortune-side ul { margin: 8px 0 0; padding-left: 20px; }

/* ---------- Solar terms ---------- */
.terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.term-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
}
.term-card .cn { font-family: "KaiTi", "STKaiti", "SimSun", serif; font-size: 1.2rem; color: var(--cinnabar); }
.term-card .en { font-weight: 700; }
.term-card .date { font-size: 0.82rem; color: var(--ink-soft); }
.term-card p { font-size: 0.9rem; margin: 6px 0 0; }

/* ---------- Blog ---------- */
.blog-list article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 18px 0;
}
.blog-list h3 { margin-top: 0; }
.blog-meta { font-size: 0.82rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
article.post p { margin-bottom: 1.1em; }
article.post blockquote {
  border-left: 4px solid var(--gold);
  margin: 1.2em 0;
  padding: 6px 18px;
  color: var(--ink-soft);
  font-style: italic;
}
article.post figure { margin: 1.4em 0; }
article.post figcaption { font-size: 0.82rem; color: var(--ink-soft); text-align: center; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #d9d0c2;
  margin-top: 48px;
  padding: 34px 20px;
  font-size: 0.9rem;
}
.site-footer a { color: var(--gold-bright); }
.footer-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.footer-note { max-width: 1040px; margin: 18px auto 0; font-size: 0.8rem; opacity: 0.75; }

/* ---------- Misc ---------- */
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 28px; }
.tag {
  display: inline-block;
  background: var(--paper-deep);
  color: var(--ink-soft);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 3px 12px;
  margin: 2px 4px 2px 0;
}
.callout {
  background: #fdf3e2;
  border: 1px solid #ecd9ae;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.95rem;
}
.hidden { display: none !important; }

@media (max-width: 620px) {
  .header-inner { flex-wrap: wrap; }
  .nav { width: 100%; justify-content: flex-start; gap: 14px; }
  .panel { padding: 20px; }
}

/* ---------- Mobile optimizations ---------- */
@media (max-width: 640px) {
  .hero { padding: 38px 16px 30px; }
  .container { padding: 0 14px; }
  .calc-form { grid-template-columns: 1fr; gap: 14px; }
  .field input, .field select { font-size: 16px; padding: 12px 14px; }
  .btn { width: 100%; text-align: center; padding: 14px 20px; }
  .share-actions .btn, .action-row .btn { width: 100%; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .chart-table { min-width: 480px; }
  .zodiac-banner { flex-direction: column; text-align: center; gap: 6px; }
  .paywall { padding: 16px 14px; }
  .grid-2 { gap: 16px; }
  h1 { font-size: 1.65rem; }
  .bar-label { width: 62px; font-size: 0.8rem; }
  .form-note { font-size: 0.78rem; }
}
