:root {
  --paper: #f7f1e6;
  --paper-2: #fbf7ee;
  --ink: #2b2620;
  --ink-soft: #5c5346;
  --seal: #b23b2e;
  --seal-deep: #8f2b21;
  --gold: #b8934a;
  --gold-soft: #d8bd82;
  --line: #e2d6bf;
  --shadow: 0 24px 60px -30px rgba(90, 60, 20, 0.5);
  --maxw: 880px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #fdfaf2 0%, transparent 60%),
    var(--paper);
  background-attachment: fixed;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- top ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 22px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .seal {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--seal); color: #fff;
  font-family: "Ma Shan Zheng", cursive; font-size: 1.5rem;
  box-shadow: 0 6px 16px -6px var(--seal);
}
.brand b { font-size: 1.3rem; letter-spacing: 0.12em; font-weight: 700; }
.back { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.back:hover { color: var(--seal); }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 40px 24px 30px;
  position: relative;
}
.hero .kicker {
  letter-spacing: 0.5em; color: var(--gold);
  font-size: 0.8rem; margin-bottom: 26px; padding-left: 0.5em;
}
.name-big {
  font-family: "Ma Shan Zheng", "Noto Serif SC", cursive;
  font-size: clamp(4.5rem, 18vw, 9rem);
  line-height: 1;
  color: var(--ink);
  display: inline-flex; gap: 0.1em;
}
.name-big span {
  display: inline-block;
  background: linear-gradient(180deg, #3a332a, #6b5a3e);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pinyin { letter-spacing: 0.35em; color: var(--ink-soft); margin-top: 18px; font-size: 1.1rem; padding-left: 0.35em; }
.one-line {
  max-width: 560px; margin: 22px auto 0;
  color: var(--ink-soft); font-size: 1.12rem;
}
.tags { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.tag {
  border: 1px solid var(--gold-soft);
  color: var(--gold); background: #fff8ea;
  padding: 6px 15px; border-radius: 999px; font-size: 0.88rem;
}
.divider {
  width: 60px; height: 3px; margin: 40px auto;
  background: var(--seal); border-radius: 3px; position: relative;
}
.divider::before, .divider::after {
  content: ""; position: absolute; top: 0; width: 3px; height: 3px; background: var(--gold);
}
.divider::before { left: -14px; } .divider::after { right: -14px; }

/* ---------- sections ---------- */
section { padding: 30px 0; }
.sec-title {
  font-size: 1.7rem; font-weight: 700; letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.sec-title::before {
  content: ""; width: 8px; height: 26px; border-radius: 2px;
  background: linear-gradient(var(--seal), var(--gold));
}
.sec-sub { color: var(--ink-soft); margin-bottom: 22px; }
p.body { color: var(--ink-soft); margin: 14px 0; font-size: 1.05rem; }
p.body b { color: var(--ink); }

/* ---------- character cards ---------- */
.chars { display: grid; gap: 20px; }
.char-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  align-items: start;
}
.glyph {
  text-align: center;
}
.glyph .big {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 5rem; line-height: 1; color: var(--seal);
}
.glyph .py { color: var(--ink-soft); letter-spacing: 0.2em; margin-top: 8px; font-size: 0.95rem; }
.glyph .strokes { color: var(--gold); font-size: 0.82rem; margin-top: 4px; }
.char-body h3 { font-size: 1.15rem; margin-bottom: 6px; }
.char-body .field { margin: 10px 0; }
.char-body .label {
  color: var(--seal); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.1em; display: block; margin-bottom: 2px;
}
.char-body .val { color: var(--ink-soft); }

/* ---------- poems ---------- */
.poem {
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, #fff9ec, transparent);
  padding: 18px 22px; margin: 18px 0; border-radius: 0 12px 12px 0;
}
.poem .lines { font-size: 1.18rem; color: var(--ink); line-height: 2; }
.poem .src { color: var(--gold); margin-top: 8px; font-size: 0.92rem; }
.poem .note { color: var(--ink-soft); margin-top: 6px; font-size: 0.95rem; }

/* ---------- callout ---------- */
.callout {
  background: linear-gradient(135deg, var(--seal), var(--seal-deep));
  color: #fdf3e6; border-radius: 18px; padding: 34px;
  text-align: center; box-shadow: var(--shadow);
}
.callout h3 { font-size: 1.5rem; margin-bottom: 12px; letter-spacing: 0.06em; }
.callout p { opacity: 0.92; font-size: 1.05rem; max-width: 560px; margin: 0 auto; }
.callout .seal-stamp {
  font-family: "Ma Shan Zheng", cursive; font-size: 1.4rem;
  border: 2px solid #fdf3e6; display: inline-block;
  padding: 8px 12px; border-radius: 8px; margin-top: 18px;
  transform: rotate(-4deg);
}

/* ---------- 生辰八字 ---------- */
.bazi-meta { color: var(--ink-soft); margin-bottom: 20px; font-size: 1.02rem; }
.bazi-meta b { color: var(--ink); }

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 8px 0 20px;
}
.pillar {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.pillar .role { color: var(--gold); font-size: 0.8rem; letter-spacing: 0.18em; margin-bottom: 12px; }
.pillar .gz {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 2.6rem; line-height: 1.05; color: var(--seal);
}
.pillar .gz small { display: block; font-size: 2.6rem; }
.pillar .wx { color: var(--ink-soft); font-size: 0.82rem; margin-top: 10px; }
.pillar.empty .gz { color: var(--gold-soft); }
.pillar.self { border-color: var(--seal); }
.pillar.self .role { color: var(--seal); }

.wx-bar { display: grid; gap: 10px; margin: 6px 0 20px; }
.wx-row { display: grid; grid-template-columns: 60px 1fr 40px; align-items: center; gap: 12px; }
.wx-row .nm { color: var(--ink); font-weight: 700; }
.wx-track { background: var(--line); border-radius: 999px; height: 12px; overflow: hidden; }
.wx-fill { height: 100%; border-radius: 999px; }
.wx-row .ct { color: var(--ink-soft); font-size: 0.9rem; text-align: right; }
.wx-jin { background: linear-gradient(90deg,#c9a24b,#e6c874); }
.wx-mu  { background: linear-gradient(90deg,#4f8f5a,#7cc088); }
.wx-shui{ background: linear-gradient(90deg,#3f7fa8,#6fb1d6); }
.wx-huo { background: linear-gradient(90deg,#c0483a,#e07a52); }
.wx-tu  { background: linear-gradient(90deg,#a8823f,#cbab6a); }

.hint {
  background: #fff8ea; border: 1px dashed var(--gold-soft);
  border-radius: 12px; padding: 16px 18px; color: var(--ink-soft);
  font-size: 0.96rem; margin-top: 8px;
}
.hint b { color: var(--seal); }

@media (max-width: 560px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- footer ---------- */
.footer {
  text-align: center; color: var(--ink-soft);
  padding: 50px 24px 40px; margin-top: 30px;
  border-top: 1px solid var(--line); font-size: 0.9rem;
}

@media (max-width: 560px) {
  .char-card { grid-template-columns: 1fr; text-align: center; }
  .glyph .big { font-size: 4rem; }
}
