:root {
  --paper: #f6f1e6;
  --paper-2: #fbf8f0;
  --paper-3: #efe8d9;
  --ink: #241f1b;
  --ink-2: #4a423a;
  --ink-3: #857a6c;
  --ink-4: #b5aa9a;
  --cinnabar: #a32d2d;
  --cinnabar-2: #c2493a;
  --cinnabar-soft: #e8cfc7;
  --gold: #9a7b4f;
  --line: rgba(36, 31, 27, 0.14);
  --line-2: rgba(36, 31, 27, 0.28);
  --shadow: 0 1px 2px rgba(36, 31, 27, 0.04), 0 8px 28px rgba(36, 31, 27, 0.06);
  --font-kai: "KaiTi", "STKaiti", "楷体", "Kaiti SC", "Noto Serif SC", serif;
  --font-song: "Songti SC", "SimSun", "宋体", "Source Han Serif SC", "Noto Serif SC", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-song);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(154, 123, 79, 0.055) 0, transparent 42%),
    radial-gradient(circle at 88% 72%, rgba(163, 45, 45, 0.035) 0, transparent 46%),
    repeating-linear-gradient(96deg, rgba(36, 31, 27, 0.014) 0 1px, transparent 1px 3px);
}

/* 宣纸纤维：极淡噪点铺底，不改变可读性 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23p)' opacity='0.05'/%3E%3C/svg%3E");
}

.stage {
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 16px 60px;
  position: relative;
  z-index: 1;
}

/* 水墨远山 */
.ink-hill {
  display: block;
  width: calc(100% + 52px);
  height: 60px;
  margin: 28px -26px 16px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: rise 0.42s ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll {
  position: relative;
  border-radius: 10px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.scroll::before,
.scroll::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  height: 15px;
  background: linear-gradient(180deg, #8d6746 0%, #6b4a32 42%, #4e3722 100%);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 246, 230, 0.28);
}

.scroll::before { top: -9px; }
.scroll::after { bottom: -9px; }

.scroll-in {
  padding: 46px 26px 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.brand-mark {
  width: 20px;
  height: 20px;
  border: 1px solid var(--cinnabar);
  border-radius: 50%;
  color: var(--cinnabar);
  font-family: var(--font-kai);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.title-block {
  margin: 26px 0 6px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.vert-title {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-kai);
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: 0.14em;
  margin: 0;
  font-weight: 400;
  color: var(--ink);
}

.vert-sub {
  writing-mode: vertical-rl;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--ink-3);
  padding-top: 6px;
}

.seal {
  margin-left: auto;
  width: 46px;
  height: 46px;
  flex: none;
  background: var(--cinnabar);
  color: #fdf6ea;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-kai);
  font-size: 24px;
  line-height: 1;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 1px rgba(253, 246, 234, 0.35);
  opacity: 0.92;
}

.seal.small {
  width: 34px;
  height: 34px;
  font-size: 17px;
}

/* 四字号印：竖排 */
.seal-name {
  width: 44px;
  height: 118px;
  font-size: 18px;
  writing-mode: vertical-rl;
  letter-spacing: 4px;
  padding-top: 6px;
}

.rule {
  height: 1px;
  background: var(--line);
  margin: 26px 0;
  position: relative;
}

.rule::after {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 42px;
  height: 3px;
  background: var(--cinnabar);
  opacity: 0.7;
}

.intro-lede {
  font-family: var(--font-kai);
  font-size: 17px;
  line-height: 2;
  color: var(--ink-2);
  margin: 0 0 18px;
}

.intro-note {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.9;
  margin: 0 0 26px;
}

.intro-note b {
  color: var(--ink-2);
  font-weight: 400;
  border-bottom: 1px solid var(--cinnabar-soft);
}

.field {
  margin-bottom: 22px;
}

.field label {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  padding: 8px 2px;
  font-family: var(--font-kai);
  font-size: 19px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-bottom-color: var(--cinnabar);
}

.field input::placeholder {
  color: var(--ink-4);
}

.btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-kai);
  font-size: 18px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  cursor: pointer;
  transition: all 0.22s ease;
  border-radius: 2px;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper-2);
}

.btn-cinnabar {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
}

.btn-cinnabar:hover {
  background: var(--cinnabar);
  color: #fdf6ea;
}

.btn-ghost {
  border-color: var(--line-2);
  color: var(--ink-3);
  font-size: 15px;
  letter-spacing: 0.2em;
}

.btn-ghost:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.btn-row .btn {
  flex: 1;
}

.intro-share {
  margin-top: 26px;
  padding: 11px 14px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border: 1px solid rgba(163, 45, 45, 0.26);
  border-radius: 4px;
  background: rgba(163, 45, 45, 0.045);
}

.intro-share a,
.intro-share b {
  color: #a32d2d;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.foot-mark {
  margin-top: 22px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.1em;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.progress-head .cur {
  font-family: var(--font-kai);
  font-size: 20px;
  color: var(--ink);
}

.progress-track {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 34px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--cinnabar);
  transition: width 0.36s ease;
}

.q-text {
  font-family: var(--font-kai);
  font-size: 20px;
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 26px;
  min-height: 72px;
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.6);
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
  text-align: left;
  font-family: var(--font-song);
  position: relative;
  box-shadow: 0 1px 2px rgba(36, 31, 27, 0.03);
}

.opt:hover {
  border-color: var(--line-2);
  background: var(--paper-3);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(36, 31, 27, 0.07);
}

.opt.picked {
  border-color: var(--cinnabar);
  background: var(--cinnabar-soft);
  color: var(--ink);
}

.opt.picked::after {
  content: "";
  position: absolute;
  left: 0;
  top: 14%;
  bottom: 14%;
  width: 2px;
  background: var(--cinnabar);
}

.opt-key {
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--cinnabar);
  border: 1px solid var(--cinnabar-soft);
  width: 22px;
  height: 22px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.opt.picked .opt-key {
  background: var(--cinnabar);
  color: #fdf6ea;
  border-color: var(--cinnabar);
}

.opt-multi .opt-key {
  border-radius: 6px;
}

.opt-none {
  font-style: italic;
  font-size: 0.9em;
  color: var(--ink-3);
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-head {
  padding: 18px 20px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.hero {
  padding: 6px 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.hero-body {
  flex: 1;
  min-width: 0;
}

.hero-kicker {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.hero-name {
  font-family: var(--font-kai);
  font-size: 27px;
  line-height: 1.3;
  color: var(--cinnabar);
  margin: 0 0 6px;
  letter-spacing: 0.04em;
}

.hero-meta {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin: 0 0 11px;
}

.hero-desc {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
  margin: 0 0 12px;
}

.hero-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
  margin: 0 0 10px;
}

.hero-sub b {
  color: var(--cinnabar);
  font-weight: 400;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-sans);
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.hero-figure {
  width: 96px;
  flex: none;
  align-self: flex-start;
}

.hero-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.block {
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
}

.block:last-child {
  border-bottom: none;
}

.block-title {
  font-family: var(--font-kai);
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 16px;
  letter-spacing: 0.06em;
}

.block-title .en {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-4);
  margin-left: 8px;
}

.power {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.power-label {
  font-family: var(--font-kai);
  font-size: 16px;
  color: var(--ink-2);
}

.power-num {
  font-family: var(--font-sans);
  font-size: 40px;
  line-height: 1;
  font-weight: 500;
  color: var(--cinnabar);
  letter-spacing: -0.02em;
}

.power-note {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0 0 6px;
}

.radar-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.dim-list {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.dim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.dim-row:last-child {
  border-bottom: none;
}

.dim-name {
  width: 76px;
  flex: none;
  color: var(--ink-2);
  font-family: var(--font-kai);
  font-size: 14px;
}

.dim-bar {
  flex: 1;
  height: 4px;
  background: var(--paper-3);
  border-radius: 2px;
  overflow: hidden;
}

.dim-bar i {
  display: block;
  height: 100%;
  background: var(--ink-2);
  border-radius: 2px;
}

.dim-row.top .dim-name {
  color: var(--cinnabar);
}

.dim-row.top .dim-bar i {
  background: var(--cinnabar);
}

.dim-val {
  width: 30px;
  flex: none;
  text-align: right;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-3);
}

.quote {
  font-family: var(--font-kai);
  font-size: 15px;
  line-height: 2;
  color: var(--ink-2);
  margin: 0 0 8px;
  padding-left: 14px;
  border-left: 2px solid var(--cinnabar-soft);
}

.quote-src {
  font-size: 11.5px;
  color: var(--ink-3);
  padding-left: 16px;
  letter-spacing: 0.04em;
}

.report-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 20px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.report-foot .who {
  font-family: var(--font-kai);
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.report-foot .no {
  color: var(--cinnabar);
  letter-spacing: 0.1em;
}

.report-foot .hint {
  margin-top: 5px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}

.tip-bar {
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px dashed var(--line-2);
  border-radius: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper-2);
  padding: 10px 20px;
  border-radius: 2px;
  font-size: 13px;
  font-family: var(--font-sans);
  opacity: 0;
  pointer-events: none;
  transition: all 0.26s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 选卷 / 生年 屏 ---------- */
.select-title {
  font-family: var(--font-kai);
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.1em;
  margin: 30px 0 8px;
}

.select-lede {
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-3);
  text-align: center;
  margin: 0 0 24px;
}

.set-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.set-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 18px 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  font-family: var(--font-song);
}

.set-card:hover {
  border-color: var(--cinnabar);
  background: var(--cinnabar-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(36, 31, 27, 0.07);
}

.set-card::after {
  content: "›";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--ink-4);
}

.set-glyph {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--cinnabar);
  color: #fdf6ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-kai);
  font-size: 22px;
  margin-bottom: 4px;
}

.set-name {
  font-family: var(--font-kai);
  font-size: 20px;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.set-whom {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.7;
}

.set-note {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

.set-extra {
  font-size: 11.5px;
  color: var(--cinnabar);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.field-b {
  flex: 1;
  margin-bottom: 0;
}

.field-b input {
  text-align: center;
  font-size: 22px;
}

/* ---------- 八属块 ---------- */
.baxing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  margin-top: 6px;
}

.bx {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.bx-k {
  flex: none;
  width: 58px;
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--ink-3);
}

.bx-v {
  color: var(--ink-2);
  font-family: var(--font-kai);
  font-size: 14.5px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .stage { padding: 18px 12px 48px; }
  .scroll-in { padding: 42px 20px 34px; }
  .vert-title { font-size: 30px; }
  .hero-name { font-size: 24px; }
  .hero-figure { width: 84px; }
  .q-text { font-size: 19px; min-height: 64px; }
  .power-num { font-size: 36px; }
  .intro-lede { font-size: 16px; }
  .ink-hill { width: 100%; margin: 24px 0 14px; }
}

@media (max-width: 480px) {
  .scroll-in { padding: 38px 16px 30px; }
  .vert-title { font-size: 26px; }
  .title-block { gap: 12px; }
  .hero-name { font-size: 22px; }
  .q-text { font-size: 18px; }
  .power-num { font-size: 34px; }
  .opt { padding: 14px 14px; }
  .block { padding: 20px 16px; }
}

@media (max-width: 380px) {
  .scroll-in { padding: 32px 14px 26px; }
  .baxing-grid { grid-template-columns: 1fr; }
  .vert-title { font-size: 23px; }
  .title-block { gap: 10px; }
  .hero { flex-direction: column-reverse; align-items: center; gap: 14px; text-align: center; }
  .hero-body { text-align: center; }
  .hero-tags { justify-content: center; }
  .hero-name { font-size: 20px; }
  .q-text { font-size: 17px; min-height: 58px; }
  .dim-name { width: 64px; font-size: 13px; }
  .opt-key { width: 20px; height: 20px; font-size: 13px; }
  .power-num { font-size: 32px; }
}

@media print {
  .btn, .btn-row, .tip-bar, .wentian-bar { display: none !important; }
}

.wentian-bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  padding: 14px 16px 0;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.wentian-bar a {
  color: var(--cinnabar);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.wentian-bar a:hover {
  border-bottom-color: var(--cinnabar-soft);
}
