:root {
  --ink: #2a2520;
  --ink-light: #6f6557;
  --paper: #fbf7ee;
  --paper-deep: #f2ebdb;
  --cinnabar: #b3432b;
  --cinnabar-deep: #96351f;
  --gold: #9a7b3f;
  --gold-soft: #c9ab6e;
  --line: #e2d7bd;
  --line-strong: #d3c5a4;
  --shadow-card: 0 1px 2px rgba(80,60,25,.05), 0 6px 24px rgba(80,60,25,.08);
  --shadow-hover: 0 2px 4px rgba(80,60,25,.06), 0 10px 32px rgba(80,60,25,.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  background: #f3ecdc;
  color: var(--ink);
  line-height: 1.8;
  background-image:
    radial-gradient(ellipse 90% 40% at 50% -5%, rgba(179,67,43,.06), transparent),
    radial-gradient(circle at 12% 18%, rgba(154,123,63,.055), transparent 34%),
    radial-gradient(circle at 88% 85%, rgba(122,90,158,.05), transparent 38%),
    radial-gradient(circle at 80% 12%, rgba(58,90,142,.035), transparent 30%);
  background-attachment: fixed;
}
.page { max-width: 760px; margin: 0 auto; padding: 26px 16px 64px; }

/* ===== 卡片 ===== */
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 26px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 30%, var(--cinnabar) 50%, var(--gold-soft) 70%, transparent);
  opacity: .65;
}
.hidden { display: none !important; }

/* ===== 品牌区（仪式感居中） ===== */
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.seal {
  width: 64px; height: 64px; flex: none;
  background: linear-gradient(145deg, #c14e33, #96351f);
  color: #f9f3e6;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; line-height: 1.15; text-align: center;
  writing-mode: vertical-rl; letter-spacing: 3px;
  box-shadow: inset 0 0 0 2px rgba(249,243,230,.4), 0 4px 14px rgba(179,67,43,.3);
}
h1 { font-size: 27px; letter-spacing: 4px; font-weight: 700; }
h2 { font-size: 21px; letter-spacing: 2px; margin-bottom: 6px; }
.sub { color: var(--ink-light); font-size: 13.5px; letter-spacing: 2.5px; }
.sub::before { content: '· '; }
.sub::after { content: ' ·'; }
.intro { text-align: center; font-size: 14px; color: var(--ink-light); line-height: 2; margin: 0 0 4px; letter-spacing: 1px; }
.intro b { color: var(--cinnabar); font-weight: 700; font-size: 17.5px; letter-spacing: 2px; }
.hint { color: var(--ink-light); font-size: 12.5px; margin-top: 6px; }
.fine { color: var(--ink-light); font-size: 12px; margin-top: 18px; line-height: 1.65; }

/* 分隔装饰 */
.orn { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--gold); }
.orn::before, .orn::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.orn span { font-size: 12px; letter-spacing: 4px; color: var(--ink-light); }

/* ===== 表单 ===== */
.fields { display: grid; gap: 16px; margin: 20px 0 24px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 7px; letter-spacing: 1px; }
input, select {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fffdf7; color: var(--ink);
  font-family: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(154,123,63,.14);
}
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; cursor: pointer; border-radius: 8px;
  font-family: inherit; font-size: 16px; letter-spacing: 3px;
  padding: 13px 24px; border: 1px solid transparent; transition: .18s;
}
.btn.primary {
  background: linear-gradient(135deg, #c14e33, #a03a24);
  color: #f9f3e6; width: 100%;
  box-shadow: 0 4px 14px rgba(179,67,43,.28);
}
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(179,67,43,.34); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink-light); border-color: var(--line-strong); width: 100%; margin-top: 10px; }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn.small { font-size: 13.5px; padding: 8px 16px; width: auto; letter-spacing: 2px; }
.btn.small.ghost { width: auto; }

/* ===== 问卷 ===== */
#quiz-list { display: grid; gap: 14px; margin: 20px 0 24px; }
.quiz-item { border: 1px solid var(--line); border-radius: 10px; padding: 15px 16px; background: #fffdf7; transition: box-shadow .15s; }
.quiz-item:hover { box-shadow: 0 2px 10px rgba(80,60,25,.06); }
.quiz-item p.q { font-weight: 700; margin-bottom: 11px; }
.opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.opts label {
  text-align: center; font-size: 13px; cursor: pointer;
  border-radius: 7px;
}
/* 按钮外观放在 span 上：即使 JS 全部失效，仅凭 input:checked + span（CSS2 选择器）也能变色 */
.opts label span {
  display: block; padding: 7px 2px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--paper);
  transition: all .12s;
}
.opts label span:hover { border-color: var(--gold-soft); background: #fdf8ec; }
.opts input { display: none; }
.opts input:checked + span {
  background: #b3432b; color: #f9f3e6; border-color: #b3432b; font-weight: 700;
  box-shadow: 0 2px 8px rgba(179,67,43,.3);
}
.opts label.sel { background: #b3432b; color: #f9f3e6; font-weight: 700; }
.opts label.sel span { background: #b3432b; color: #f9f3e6; border-color: #b3432b; }

/* ===== 工具条 ===== */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }

/* ===== 报告 ===== */
.rep-head {
  position: relative;
  background: linear-gradient(180deg, #fdf9f0, var(--paper));
  border: 1px solid var(--line); border-radius: 14px; padding: 28px 26px; margin-bottom: 16px;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.rep-head::after {
  content: '';
  position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(179,67,43,.07), transparent 70%);
}
.rep-title { display: flex; align-items: center; gap: 14px; }
.rep-title h1 { font-size: 24px; }
.rep-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; margin-top: 18px; font-size: 13.5px; background: rgba(255,253,247,.7); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.rep-meta .k { color: var(--gold); margin-right: 6px; font-weight: 700; }
.tagline { margin-top: 16px; padding: 11px 15px; background: rgba(179,67,43,.055); border-left: 3px solid var(--cinnabar); font-size: 13.5px; border-radius: 0 8px 8px 0; }

.rep-sec { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; margin-bottom: 16px; box-shadow: var(--shadow-card); }
.rep-sec > h2 { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-strong); }
.rep-sec p { font-size: 14.5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mini { border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; background: #fffdf7; font-size: 13.5px; }
.mini b { display: block; color: var(--gold); font-size: 13px; letter-spacing: 2px; margin-bottom: 5px; }

/* ===== 月卡 ===== */
.months { display: grid; gap: 14px; }
.month { border: 1px solid var(--line); border-radius: 12px; background: #fffdf7; overflow: hidden; box-shadow: 0 1px 6px rgba(80,60,25,.05); transition: box-shadow .15s; }
.month:hover { box-shadow: var(--shadow-hover); }
.month-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: linear-gradient(90deg, var(--paper-deep), #f7f1e2); border-bottom: 1px solid var(--line); }
.month-head .m {
  flex: none; min-width: 52px; height: 30px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #c14e33, #a03a24);
  color: #f9f3e6; font-size: 15px; font-weight: 700; letter-spacing: 1px;
  border-radius: 15px;
  box-shadow: 0 2px 6px rgba(179,67,43,.25);
}
.month-head .t { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.month-head .qi { margin-left: auto; font-size: 12px; color: var(--ink-light); }
.month-body { padding: 14px 16px 16px; font-size: 13.5px; display: grid; gap: 9px; }
.month-body .row b {
  display: inline-block;
  color: var(--gold); background: rgba(154,123,63,.1);
  letter-spacing: 1.5px; margin-right: 8px;
  padding: 1px 9px; border-radius: 4px; font-size: 12px;
  vertical-align: 1px;
}
.month-body .row { color: #3d362d; }
.month-body .extra { color: var(--cinnabar); background: rgba(179,67,43,.05); border-radius: 6px; padding: 7px 10px; }
.month-body .extra::before { content: "◆ "; font-size: 10px; }

/* 判词 */
.month .verdict {
  font-size: 17.5px; font-weight: 700; color: var(--cinnabar);
  letter-spacing: 1.5px; margin-bottom: 8px;
  padding-left: 10px; border-left: 3px solid var(--cinnabar);
  line-height: 1.5;
}
.month .verdict::before { content: '「'; opacity: .55; }
.month .verdict::after { content: '」'; opacity: .55; }

/* 特殊行（心境/星象/功法） */
.month-body .zw-line { border-left: 3px solid #7a5a9e; padding-left: 10px; color: #4a3a5e; background: rgba(122,90,158,.045); border-radius: 0 6px 6px 0; padding-top: 7px; padding-bottom: 7px; }
.month-body .zw-line b { color: #7a5a9e; background: rgba(122,90,158,.1); }
.month-body .star-line { border-left: 3px solid #3a5a8e; padding-left: 10px; color: #33445e; font-size: 13px; background: rgba(58,90,142,.045); border-radius: 0 6px 6px 0; padding-top: 7px; padding-bottom: 7px; }
.month-body .star-line b { color: #3a5a8e; background: rgba(58,90,142,.1); }
.month-body .jg-line { border-left: 3px solid #8a6d3b; padding-left: 10px; color: #55462a; background: rgba(154,123,63,.05); border-radius: 0 6px 6px 0; padding-top: 7px; padding-bottom: 7px; }
.month-body .jg-line b { color: #8a6d3b; background: rgba(154,123,63,.12); }

/* ===== 年度身体指标可视化 ===== */
.mx-profile {
  margin: 12px 0 4px; padding: 11px 14px;
  background: rgba(74,124,89,.06); border-left: 3px solid #4a7c59;
  border-radius: 0 8px 8px 0; font-size: 13px; color: #3d4a3f;
}
.mx-profile b { color: #3f6b4c; }
.mx-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0 20px; }
.mx-card {
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; background: #fffdf7;
  position: relative; overflow: hidden;
}
.mx-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
.mx-card.high::before { background: var(--cinnabar); }
.mx-card.low::before { background: #3a5a8e; }
.mx-card.ok::before { background: #4a7c59; }
.mx-card .mx-k { font-size: 13px; letter-spacing: 2px; color: var(--ink-light); }
.mx-card .mx-v { font-size: 25px; font-weight: 700; line-height: 1.2; color: var(--ink); font-family: Georgia, "Times New Roman", serif; }
.mx-card .mx-v em { font-style: normal; font-size: 16px; margin-left: 3px; vertical-align: 2px; }
.mx-card.high .mx-v { color: var(--cinnabar); }
.mx-card.low .mx-v { color: #3a5a8e; }
.mx-card.ok .mx-v { color: #3f6b4c; }
.mx-card .mx-range { font-size: 11.5px; color: var(--ink-light); }

.mx-chart, .mx-bars { border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; padding: 12px 12px 8px; margin-bottom: 12px; }
.mx-chart-title { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; color: var(--ink); margin-bottom: 4px; }
.mx-chart-title span { font-weight: 400; font-size: 11.5px; color: var(--ink-light); margin-left: 8px; letter-spacing: 0; }
.spark { display: block; margin-top: 2px; }
.spark .ax { font-size: 9px; fill: #9a8f7a; text-anchor: middle; font-family: inherit; }
.spark .pt { fill: #fffdf7; stroke: #b3432b; stroke-width: 1.4; }
.spark .pt-low { fill: #b3432b; stroke: #b3432b; }
.spark .lb-low { font-size: 9.5px; fill: #b3432b; text-anchor: middle; font-weight: 700; font-family: inherit; }
.spark .lb-high { font-size: 9.5px; fill: #4a7c59; text-anchor: middle; font-weight: 700; font-family: inherit; }
.mx-note { font-size: 12.5px; color: var(--ink-light); margin-top: 8px; line-height: 1.6; }
.mx-note b { color: var(--cinnabar); }

.bar-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 12.5px; }
.bar-k { flex: none; width: 40px; color: var(--ink-light); letter-spacing: 1px; }
.bar-track { flex: 1; height: 9px; background: var(--paper-deep); border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 5px; }
.el-木 { background: linear-gradient(90deg, #6a9a78, #4a7c59); }
.el-火 { background: linear-gradient(90deg, #d06a4e, #b3432b); }
.el-土 { background: linear-gradient(90deg, #c9a75f, #a8863f); }
.el-金 { background: linear-gradient(90deg, #b3ab99, #8c8271); }
.el-水 { background: linear-gradient(90deg, #6a86ad, #3a5a8e); }
.bar-v { flex: none; width: 30px; text-align: right; color: var(--ink-light); font-family: Georgia, serif; }

/* 月卡状态分 */
.month-head .mscore {
  margin-left: auto; flex: none;
  font-family: Georgia, serif; font-size: 13px; font-weight: 700;
  color: #3f6b4c; background: rgba(74,124,89,.1);
  border: 1px solid rgba(74,124,89,.25);
  padding: 1px 9px; border-radius: 10px;
}
.month-head .mscore.low { color: #3a5a8e; background: rgba(58,90,142,.1); border-color: rgba(58,90,142,.25); }
.month-head .mscore.high { color: var(--cinnabar); background: rgba(179,67,43,.08); border-color: rgba(179,67,43,.22); }

.summary-text { font-size: 15px; }

/* 节气提醒条 */
.term-tip {
  margin: 0 0 12px; padding: 11px 14px;
  background: linear-gradient(180deg, #fdf6e8, #faf1de);
  border: 1px solid #e6d3ae; border-left: 3px solid var(--cinnabar);
  border-radius: 4px; font-size: 14px; line-height: 1.75; color: #5a4a33;
}
.term-tip b { color: var(--cinnabar); font-weight: 700; }
.term-tip .tt-btn {
  display: inline-block; margin-left: 6px; padding: 3px 12px;
  background: var(--cinnabar); color: #fffdf7; border: 0; border-radius: 3px;
  font-family: inherit; font-size: 12.5px; letter-spacing: 1px; cursor: pointer;
}
.term-tip .tt-btn:active { background: var(--cinnabar-deep); }

/* 记录覆盖进度条 */
.fb-bar-wrap { display: flex; align-items: center; gap: 10px; margin: 12px 0 2px; }
.fb-bar { flex: 1; height: 6px; background: #efe6d4; border-radius: 3px; overflow: hidden; }
.fb-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d09a5e, var(--cinnabar)); border-radius: 3px; transition: width .6s ease; }
.fb-bar-wrap span { font-size: 12px; color: var(--gold); letter-spacing: .5px; white-space: nowrap; }

/* 自述输入 */
.fb-note {
  width: 100%; min-height: 64px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 4px; background: #fffdf7;
  font-family: inherit; font-size: 14px; line-height: 1.7; color: var(--ink);
  resize: vertical;
}
.fb-note:focus { outline: none; border-color: var(--cinnabar); }
.fb-note-tip { font-size: 12px; line-height: 1.7; color: #9b8a70; margin: 6px 0 0; }
.fb-note-tip em { font-style: normal; color: var(--cinnabar); }
.cons-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: 12.5px; padding: 4px 14px; border-radius: 20px; border: 1px solid var(--line-strong); background: #fffdf7; letter-spacing: 1px; }
.chip.main { background: linear-gradient(135deg, #c14e33, #a03a24); color: #f9f3e6; border-color: transparent; box-shadow: 0 2px 8px rgba(179,67,43,.25); }

/* ===== CTA / 反馈 ===== */
#cta h2, #fb-panel h2 { letter-spacing: 2px; }
.cta-row { display: flex; gap: 10px; margin-top: 10px; }
.cta-row .btn { flex: 1; min-width: 0; margin-top: 0 !important; white-space: nowrap; letter-spacing: 1px; padding-left: 8px; padding-right: 8px; }

/* ===== 页脚 ===== */
.footer { margin-top: 36px; text-align: center; }
.footer::before { content: ''; display: block; width: 180px; height: 1px; margin: 0 auto 18px; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); }
.sig { font-size: 16px; letter-spacing: 5px; color: var(--ink-light); margin-bottom: 8px; }

@media (max-width: 560px) {
  .rep-meta { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .card { padding: 24px 18px; }
  .rep-sec { padding: 20px 18px; }
  .month-head { flex-wrap: wrap; gap: 8px; }
  .month-head .qi { width: 100%; margin-left: 0; }
}

/* ===== 打印 ===== */
@media print {
  body { background: #fff; }
  .no-print, .toolbar { display: none !important; }
  .card, .rep-sec, .rep-head, .month, .mini { box-shadow: none; border-color: #bbb; background: #fff; break-inside: avoid; }
  .page { max-width: 100%; padding: 0; }
}

/* ===== 分享海报弹层 ===== */
#share-mask { position: fixed; inset: 0; background: rgba(20,16,12,.8); z-index: 99; display: flex; align-items: center; justify-content: center; padding: 18px; backdrop-filter: blur(3px); }
#share-mask.hidden { display: none; }
.share-box { background: var(--paper); border-radius: 16px; padding: 14px; max-width: 340px; width: 100%; text-align: center; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.share-box img { width: 100%; border-radius: 10px; display: block; }
.share-tip { font-size: 13px; color: var(--ink-light); margin: 12px 0; }

/* ===== 反馈面板选项自适应（3-5 个选项） ===== */
#fb-list .opts label { padding: 9px 2px; }
.fb-tag { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--ink-light); font-weight: 400; background: none; padding: 0; }
