:root {
  --paper: #f6f5fb;
  --paper-strong: #ffffff;
  --paper-subtle: #f0edff;
  --ink: #2e2b44;
  --dim: #79758d;
  --faint: #9792aa;
  --line: #e5e1f0;
  --line-strong: #cec7e2;
  --gold: #6858c7;
  --gold-deep: #2f296d;
  --gold-wash: #f0edff;
  --gold-fill: #6858c7;
  --jade: #3f8066;
  --jade-wash: #e6f6ef;
  --cinnabar: #a55267;
  --cinnabar-wash: #fbedf1;
  --blue: #527aa7;
  --blue-wash: #e9f2fc;
  --shadow: 0 18px 54px rgba(47, 41, 109, .09);
  --serif: 'Noto Serif SC', 'Songti SC', serif;
  --sans: 'Noto Sans SC', system-ui, sans-serif;
  --display: 'Ma Shan Zheng', 'STKaiti', serif;
}

:root[data-theme='dark'] {
  --paper: #191b19;
  --paper-strong: #222522;
  --paper-subtle: #1e211e;
  --ink: #e8e3d8;
  --dim: #aaa89f;
  --faint: #85857e;
  --line: rgba(214, 195, 157, .14);
  --line-strong: rgba(214, 195, 157, .25);
  --gold: #bea06a;
  --gold-deep: #c7a96f;
  --gold-wash: #312b21;
  --gold-fill: #a5844c;
  --jade: #78a18f;
  --jade-wash: #21302a;
  --cinnabar: #cb8176;
  --cinnabar-wash: #332522;
  --blue: #9aabba;
  --blue-wash: #242d33;
  --shadow: 0 20px 58px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 18%, color-mix(in srgb, var(--gold) 8%, transparent), transparent 28rem),
    radial-gradient(circle at 92% 42%, color-mix(in srgb, var(--jade) 7%, transparent), transparent 32rem),
    var(--paper) url('paper-fibers.svg');
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.hehun-main {
  width: min(1320px, calc(100% - 44px));
  margin: 0 auto;
  padding: clamp(28px, 4vw, 58px) 0 76px;
}

.hehun-hero {
  position: relative;
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
  padding: clamp(34px, 5vw, 68px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--paper-strong) 94%, transparent), color-mix(in srgb, var(--gold-wash) 72%, transparent)),
    url('bazi-orbit.webp') right center / auto 118% no-repeat;
  box-shadow: var(--shadow);
}
.hehun-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 62%, color-mix(in srgb, var(--paper-strong) 35%, transparent));
}
.hehun-hero-copy { position: relative; z-index: 1; max-width: 760px; }
.eyebrow { margin: 0 0 13px; color: var(--gold-deep); font-size: 12px; font-weight: 700; letter-spacing: 2.5px; }
.eyebrow span { display: inline-block; width: 28px; height: 1px; margin: 0 9px 3px 0; background: currentColor; }
.hehun-hero h1 { margin: 0; font: 400 clamp(38px, 5vw, 67px)/1.15 var(--serif); letter-spacing: .04em; }
.hehun-hero-copy > p:not(.eyebrow) { max-width: 690px; margin: 22px 0 0; color: var(--dim); font: 400 15px/1.9 var(--serif); }
.hehun-orbit { position: relative; z-index: 1; width: 280px; height: 180px; display: flex; align-items: center; justify-content: center; justify-self: end; }
.hehun-orbit::before, .hehun-orbit::after { content: ''; position: absolute; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 50%; }
.hehun-orbit::before { width: 174px; height: 174px; }
.hehun-orbit::after { width: 245px; height: 112px; transform: rotate(-17deg); }
.hehun-orbit b { width: 76px; height: 76px; display: grid; place-items: center; z-index: 1; border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); border-radius: 50%; color: var(--paper-strong); background: var(--gold-fill); box-shadow: 0 14px 34px color-mix(in srgb, var(--gold-fill) 24%, transparent); font: 400 35px/1 var(--display); }
.hehun-orbit i { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; z-index: 2; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-deep); background: var(--paper-strong); font: normal 700 17px/1 var(--serif); box-shadow: 0 8px 22px rgba(60, 48, 31, .1); }
.hehun-orbit i:first-child { left: 5px; bottom: 25px; }
.hehun-orbit i:last-child { right: 5px; top: 25px; }

.hehun-panel {
  margin-top: 24px;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--paper-strong) 92%, transparent);
  box-shadow: 0 12px 42px rgba(62, 52, 36, .055);
}
.panel-heading, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.panel-heading p, .section-heading p, .summary-copy > p { margin: 0 0 7px; color: var(--gold-deep); font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.panel-heading h2, .section-heading h2 { margin: 0; font: 600 clamp(23px, 2.4vw, 31px)/1.3 var(--serif); }
.panel-heading > span, .section-heading > span, .section-heading > strong { max-width: 480px; color: var(--dim); font-size: 12px; font-weight: 500; line-height: 1.65; text-align: right; }

.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.profile-card { min-width: 0; margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--paper-subtle) 45%, transparent); }
.profile-card legend { width: 100%; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; padding: 0 2px 18px; }
.profile-card legend > span { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); border-radius: 50%; color: var(--paper-strong); background: var(--gold-fill); font: 700 16px/1 var(--serif); }
.profile-card legend strong { font: 600 19px/1.2 var(--serif); }
.field { min-width: 0; display: grid; gap: 8px; color: var(--dim); font-size: 12px; font-weight: 600; line-height: 1.45; }
.field > small { color: var(--faint); font-size: 11.5px; font-weight: 500; }
.field input, .field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--paper-strong);
  font-size: 13px;
  font-weight: 500;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold-deep) 50%),
    linear-gradient(135deg, var(--gold-deep) 50%, transparent 50%);
  background-position: calc(100% - 18px) 53%, calc(100% - 13px) 53%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field input::placeholder { color: var(--faint); }
.field input:hover:not(:disabled), .field select:hover:not(:disabled) { border-color: var(--line-strong); }
.field input:focus, .field select:focus { border-color: color-mix(in srgb, var(--gold) 68%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 13%, transparent); }
.field input[aria-invalid='true'], .field select[aria-invalid='true'] { border-color: var(--cinnabar); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cinnabar) 10%, transparent); }
.field input:disabled, .field select:disabled { opacity: .58; cursor: not-allowed; background-color: var(--paper-subtle); }
.saved-field { margin-bottom: 17px; padding-bottom: 17px; border-bottom: 1px dashed var(--line); }
.form-row { display: grid; align-items: end; gap: 12px; margin-bottom: 14px; }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calendar-row { grid-template-columns: 1.35fr repeat(3, minmax(66px, .8fr)); }
.profile-card > .field, .profile-card > .check, .profile-card > .time-options { margin-bottom: 14px; }
.check { min-height: 32px; display: flex; align-items: flex-start; gap: 9px; color: var(--dim); font-size: 11px; font-weight: 500; line-height: 1.6; }
.check input { width: 17px; height: 17px; flex: 0 0 17px; margin: 1px 0 0; accent-color: var(--gold-fill); }
.time-options { display: flex; flex-wrap: wrap; gap: 9px 18px; }
.time-options .check { margin: 0; }
.location-block { margin-top: 3px; padding: 16px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 15px; background: color-mix(in srgb, var(--paper-strong) 55%, transparent); }
.location-block > p { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; color: var(--ink); font-size: 12px; font-weight: 700; }
.location-block > p small { color: var(--gold-deep); font-size: 11.5px; font-weight: 600; }
.location-block .form-row { margin-bottom: 12px; }
.precise-longitude { margin: 0; }
.profile-error { margin: 12px 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--cinnabar) 32%, var(--line)); border-radius: 11px; color: var(--cinnabar); background: var(--cinnabar-wash); font-size: 11px; line-height: 1.55; }
.submit-area { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 25px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 17px; background: color-mix(in srgb, var(--gold-wash) 52%, transparent); }
.submit-consent { max-width: 760px; display: grid; gap: 9px; }
.submit-area .check { min-height: 0; margin: 0; color: var(--ink); }
.primary-button { min-width: 190px; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; padding: 10px 18px 10px 24px; border: 0; border-radius: 999px; color: #fffdf8; background: var(--gold-fill); box-shadow: 0 10px 24px color-mix(in srgb, var(--gold-fill) 23%, transparent); font-size: 14px; font-weight: 700; }
.primary-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-button i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .14); font: normal 400 18px/1 var(--display); }
.primary-button:disabled { opacity: .62; cursor: wait; transform: none; }

.hehun-results { scroll-margin-top: 24px; }
.result-summary { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 22px; overflow: hidden; background: linear-gradient(120deg, color-mix(in srgb, var(--gold-wash) 75%, var(--paper-strong)), var(--paper-strong)); }
.summary-seal { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 18px; color: #fffdf8; background: var(--gold-fill); font: 400 34px/1 var(--display); box-shadow: 0 13px 28px color-mix(in srgb, var(--gold-fill) 22%, transparent); transform: rotate(-3deg); }
.summary-copy h2 { margin: 0; font: 600 clamp(23px, 3vw, 34px)/1.25 var(--serif); }
.summary-copy strong { display: block; margin-top: 10px; color: var(--gold-deep); font: 600 15px/1.4 var(--serif); }
.summary-copy > span { display: block; max-width: 760px; margin-top: 7px; color: var(--dim); font-size: 12px; line-height: 1.7; }
.summary-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.summary-actions button { min-height: 43px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); background: color-mix(in srgb, var(--paper-strong) 75%, transparent); font-size: 11px; font-weight: 600; }
.summary-actions button:hover { color: var(--ink); border-color: var(--line-strong); }

.chart-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart-person { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--paper-subtle) 45%, transparent); }
.chart-person > header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.chart-person > header h3 { margin: 0; font: 600 20px/1.3 var(--serif); }
.chart-person > header span { color: var(--faint); font-size: 10px; line-height: 1.45; text-align: right; }
.pillar-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pillar { min-width: 0; padding: 13px 7px; border: 1px solid var(--line); border-radius: 13px; text-align: center; background: var(--paper-strong); }
.pillar small { display: block; margin-bottom: 7px; color: var(--faint); font-size: 9px; letter-spacing: 1px; }
.pillar b { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--ink); font: 600 clamp(20px, 2.5vw, 28px)/1.2 var(--serif); }
.pillar.is-unknown b { color: var(--faint); font-size: 14px; }

.position-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.position-card { min-width: 0; min-height: 210px; display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper-subtle); }
.position-card[data-tone='connection'] { background: var(--jade-wash); }
.position-card[data-tone='friction'] { background: var(--cinnabar-wash); }
.position-card[data-tone='mixed'] { background: linear-gradient(135deg, var(--jade-wash), var(--cinnabar-wash)); }
.position-card[data-tone='resonance'] { background: var(--blue-wash); }
.position-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.position-card > header span { color: var(--gold-deep); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.position-card > header b { font: 600 16px/1.3 var(--serif); }
.position-pair { margin: 17px 0 12px; color: var(--ink); font: 600 23px/1 var(--serif); }
.position-pair i { margin: 0 7px; color: var(--gold-deep); font: normal 400 14px/1 var(--sans); }
.relation-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.relation-chip { padding: 5px 7px; border: 1px solid color-mix(in srgb, var(--line-strong) 68%, transparent); border-radius: 999px; color: var(--dim); background: color-mix(in srgb, var(--paper-strong) 64%, transparent); font-size: 9px; font-weight: 600; line-height: 1.3; }
.position-card > p { margin: auto 0 0; padding-top: 13px; color: var(--dim); font-size: 10px; line-height: 1.6; }

.group-signals { display: flex; flex-wrap: wrap; gap: 8px; margin: -5px 0 16px; padding: 13px; border: 1px solid color-mix(in srgb, var(--gold) 25%, var(--line)); border-radius: 14px; background: var(--gold-wash); }
.group-signals::before { content: '跨盘成组'; margin-right: 3px; color: var(--gold-deep); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.group-signals span { color: var(--ink); font-size: 11px; font-weight: 600; }
.relation-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.highlight-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; min-height: 86px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--paper-subtle) 48%, transparent); }
.highlight-item > i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--paper-strong); background: var(--gold-fill); font: normal 700 13px/1 var(--serif); }
.highlight-item[data-tone='friction'] > i { background: var(--cinnabar); }
.highlight-item b { display: block; margin: 1px 0 5px; font: 600 13px/1.4 var(--serif); }
.highlight-item small { display: block; color: var(--dim); font-size: 9px; line-height: 1.5; }
.empty-evidence { grid-column: 1 / -1; margin: 0; padding: 20px; border: 1px dashed var(--line); border-radius: 14px; color: var(--dim); background: color-mix(in srgb, var(--paper-subtle) 38%, transparent); font-size: 11px; line-height: 1.7; text-align: center; }

.element-comparison { display: grid; gap: 13px; }
.element-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 42px minmax(0, 1fr) 38px; align-items: center; gap: 10px; }
.element-row > b { font: 600 15px/1 var(--serif); text-align: center; }
.element-row > span { color: var(--dim); font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.element-track { position: relative; height: 11px; overflow: hidden; border-radius: 999px; background: var(--paper-subtle); }
.element-track i { position: absolute; inset: 0 auto 0 0; width: var(--value); border-radius: inherit; background: var(--gold-fill); }
.element-track.right i { background: var(--jade); }
.element-legend { display: flex; justify-content: center; gap: 22px; margin-bottom: 15px; color: var(--dim); font-size: 10px; }
.element-legend span::before { content: ''; width: 8px; height: 8px; display: inline-block; margin-right: 6px; border-radius: 50%; background: var(--gold-fill); }
.element-legend span:last-child::before { background: var(--jade); }

.uncertainty-notes { display: grid; gap: 7px; margin-bottom: 18px; }
.uncertainty-notes p { margin: 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--line)); border-radius: 11px; color: var(--gold-deep); background: var(--gold-wash); font-size: 10px; line-height: 1.6; }
.reality-check ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: question; }
.reality-check li { position: relative; min-height: 92px; padding: 17px 17px 17px 52px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: color-mix(in srgb, var(--paper-subtle) 46%, transparent); font: 500 12px/1.75 var(--serif); counter-increment: question; }
.reality-check li::before { content: counter(question, decimal-leading-zero); position: absolute; left: 16px; top: 17px; color: var(--gold-deep); font: 700 11px/1 var(--sans); }

/* ---------------- AI 双盘解读 ---------------- */
.ai-reading-panel {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--gold) 32%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold-wash) 42%, var(--paper-strong)), var(--paper-strong) 42%),
    var(--paper-strong);
}
.ai-reading-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-fill) 18%, var(--jade) 82%, transparent);
}
.ai-reading-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.ai-reading-head p { margin: 0 0 7px; color: var(--gold-deep); font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.ai-reading-head h2 { margin: 0; font: 600 clamp(25px, 2.6vw, 34px)/1.28 var(--serif); }
.ai-reading-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--gold) 25%, var(--line));
  border-radius: 14px;
  color: var(--dim);
  background: color-mix(in srgb, var(--gold-wash) 58%, transparent);
  font-size: 11px;
  line-height: 1.65;
}
.ai-reading-status::before { content: ''; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--gold-fill); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 13%, transparent); }
.ai-reading-status.is-loading::before { animation: ai-status-pulse 1.25s ease-in-out infinite; }
.ai-reading-status.is-complete { color: var(--jade-deep); border-color: color-mix(in srgb, var(--jade) 35%, var(--line)); background: var(--jade-wash); }
.ai-reading-status.is-complete::before { background: var(--jade); box-shadow: 0 0 0 5px color-mix(in srgb, var(--jade) 13%, transparent); }
.ai-reading-status.is-error { color: var(--cinnabar); border-color: color-mix(in srgb, var(--cinnabar) 35%, var(--line)); background: var(--cinnabar-wash); }
.ai-reading-status.is-error::before { background: var(--cinnabar); box-shadow: 0 0 0 5px color-mix(in srgb, var(--cinnabar) 12%, transparent); }
.ai-reading-status.is-warn { color: var(--gold-deep); }
@keyframes ai-status-pulse { 50% { opacity: .35; transform: scale(.72); } }
.account-login-notice {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--blue) 32%, var(--line));
  border-radius: 14px;
  background: var(--blue-wash);
}
.account-notice-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--paper-strong); background: var(--blue); font: 700 13px/1 var(--serif); }
.account-login-notice p { margin: 0; color: var(--ink); font-size: 11px; line-height: 1.7; }
.account-login-notice > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-login-notice a { flex: 0 0 auto; color: var(--blue); font-size: 11px; font-weight: 700; text-decoration: none; }
.account-login-notice a:hover { text-decoration: underline; }
.ai-reading-text {
  min-height: 260px;
  margin-top: 18px;
  padding: clamp(24px, 3.2vw, 42px);
  overflow-wrap: anywhere;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 19px;
  outline: none;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper-strong) 94%, transparent);
  font: 400 15px/2 var(--serif);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--paper-strong) 80%, transparent);
}
.ai-reading-text:focus { border-color: color-mix(in srgb, var(--gold) 58%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 10%, transparent); }
.ai-reading-text > :first-child { margin-top: 0; }
.ai-reading-text > :last-child { margin-bottom: 0; }
.ai-reading-text h1, .ai-reading-text h2, .ai-reading-text h3, .ai-reading-text h4 { color: var(--ink); font-family: var(--serif); line-height: 1.45; }
.ai-reading-text h2 { margin: 2em 0 .8em; padding-bottom: .45em; border-bottom: 1px solid var(--line); font-size: clamp(21px, 2.4vw, 28px); }
.ai-reading-text h3 { margin: 1.7em 0 .65em; color: var(--gold-deep); font-size: 19px; }
.ai-reading-text p { margin: 0 0 1.1em; }
.ai-reading-text ul, .ai-reading-text ol { margin: .8em 0 1.2em; padding-left: 1.6em; }
.ai-reading-text li { margin: .35em 0; }
.ai-reading-text blockquote { margin: 1.4em 0; padding: 12px 17px; border-left: 3px solid var(--jade); border-radius: 0 11px 11px 0; color: var(--dim); background: var(--jade-wash); }
.ai-reading-text pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.ai-reading-empty { min-height: 176px; display: flex; align-items: center; justify-content: center; gap: 20px; max-width: 690px; margin: 0 auto; color: var(--dim); }
.ai-reading-empty > span { width: 62px; height: 62px; display: grid; place-items: center; flex: 0 0 62px; border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line)); border-radius: 50%; color: var(--gold-deep); background: var(--gold-wash); font: 400 28px/1 var(--display); }
.ai-reading-empty b { display: block; margin-bottom: 8px; color: var(--ink); font: 600 18px/1.45 var(--serif); }
.ai-reading-empty p { margin: 0; color: var(--dim); font-size: 12px; line-height: 1.8; }
.ai-reading-status:empty { display: none; }
.ai-reading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 24px; margin-top: 18px; }
.ai-reading-actions > div { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.ai-generate-button, .ai-secondary-button, .ai-stop-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease, background .16s ease;
}
.ai-generate-button { min-width: 246px; border: 0; color: #fffdf8; background: var(--gold-fill); box-shadow: 0 10px 24px color-mix(in srgb, var(--gold-fill) 23%, transparent); }
.ai-generate-button i { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 29px; border-radius: 50%; background: rgba(255, 255, 255, .14); font: normal 400 16px/1 var(--display); }
.ai-secondary-button, .ai-stop-button { border: 1px solid var(--line); color: var(--dim); background: var(--paper-strong); }
.ai-stop-button { color: var(--cinnabar); border-color: color-mix(in srgb, var(--cinnabar) 35%, var(--line)); background: var(--cinnabar-wash); }
.ai-generate-button:hover:not(:disabled), .ai-secondary-button:hover:not(:disabled), .ai-stop-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); }
.ai-generate-button:focus-visible, .ai-secondary-button:focus-visible, .ai-stop-button:focus-visible, .hehun-dialog-close:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 26%, transparent); outline-offset: 2px; }
.ai-generate-button:disabled, .ai-secondary-button:disabled, .ai-stop-button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------------- AI 首次使用确认 ---------------- */
.hehun-dialog { position: fixed; z-index: 220; inset: 0; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.hehun-dialog-mask { position: absolute; inset: 0; background: color-mix(in srgb, #181621 68%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hehun-dialog-surface {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  max-height: min(760px, calc(100dvh - 36px));
  max-height: min(760px, calc(var(--tianji-visual-viewport-height, 100dvh) - 36px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(23px, 4vw, 36px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: 0 28px 90px rgba(18, 16, 28, .32);
}
.hehun-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hehun-dialog-head span { display: block; margin-bottom: 7px; color: var(--gold-deep); font-size: 11.5px; font-weight: 700; letter-spacing: 2px; }
.hehun-dialog-head h2 { margin: 0; font: 600 clamp(23px, 3vw, 31px)/1.35 var(--serif); }
.hehun-dialog-close { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--dim); background: var(--paper-subtle); font-size: 16px; }
.hehun-dialog-lead { margin: 19px 0 0; padding: 14px 16px; border-left: 3px solid var(--gold); color: var(--dim); background: var(--gold-wash); font-size: 12px; line-height: 1.8; }
.ai-consent-facts { display: grid; gap: 9px; margin: 18px 0 0; padding: 0; list-style: none; }
.ai-consent-facts li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--paper-subtle) 50%, transparent); }
.ai-consent-facts b { color: var(--gold-deep); font-size: 11.5px; line-height: 1.7; }
.ai-consent-facts span { color: var(--dim); font-size: 11.5px; line-height: 1.7; }
.ai-consent-checks { display: grid; gap: 10px; margin-top: 18px; }
.ai-consent-check { min-height: 52px; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--paper-strong); font-size: 11.5px; line-height: 1.7; cursor: pointer; }
.ai-consent-check:has(input:checked) { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); background: var(--gold-wash); }
.ai-consent-check input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--gold-fill); }
.ai-consent-error { margin: 11px 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--cinnabar) 35%, var(--line)); border-radius: 11px; color: var(--cinnabar); background: var(--cinnabar-wash); font-size: 11px; line-height: 1.6; }
.hehun-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.hehun-dialog-actions .ai-generate-button { min-width: 184px; }

.hehun-footer { width: min(1320px, calc(100% - 44px)); display: flex; justify-content: space-between; gap: 20px; margin: 0 auto; padding: 0 0 42px; color: var(--faint); font-size: 11.5px; }
.hehun-footer a { color: var(--dim); text-decoration: none; }
.hehun-footer a:hover { color: var(--gold-deep); }
.hehun-toast { position: fixed; z-index: 100; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px)); max-width: min(440px, calc(100% - 32px)); padding: 12px 17px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--paper-strong); background: color-mix(in srgb, var(--ink) 92%, transparent); box-shadow: 0 13px 34px rgba(0, 0, 0, .18); font-size: 11px; line-height: 1.45; text-align: center; transform: translateX(-50%); }

@media (max-width: 1080px) {
  .hehun-hero { grid-template-columns: minmax(0, 1fr) 250px; }
  .hehun-orbit { width: 235px; transform: scale(.88); }
  .position-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relation-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .hehun-main { width: min(760px, calc(100% - 28px)); padding-top: 20px; padding-bottom: 104px; }
  .hehun-hero { min-height: 0; grid-template-columns: 1fr; padding: 35px 28px; }
  .hehun-orbit { display: none; }
  .profile-grid, .chart-comparison { grid-template-columns: 1fr; }
  .hehun-panel { padding: 25px 20px; border-radius: 20px; }
  .profile-card { padding: 20px 16px; }
  .result-summary { grid-template-columns: 62px minmax(0, 1fr); }
  .summary-seal { width: 58px; height: 58px; border-radius: 15px; font-size: 28px; }
  .summary-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .ai-reading-actions { align-items: flex-start; flex-direction: column; }
  .ai-reading-actions > div { width: 100%; justify-content: flex-start; }
  .hehun-footer { width: calc(100% - 28px); padding-bottom: 100px; }
}

@media (max-width: 620px) {
  .hehun-main { width: calc(100% - 20px); }
  .hehun-hero { padding: 30px 21px; border-radius: 20px; }
  .hehun-hero h1 { font-size: 38px; }
  .hehun-hero-copy > p:not(.eyebrow) { font-size: 13px; line-height: 1.8; }
  .panel-heading, .section-heading { align-items: flex-start; flex-direction: column; margin-bottom: 21px; }
  .panel-heading > span, .section-heading > span, .section-heading > strong { text-align: left; }
  .field input, .field select { font-size: 16px; }
  .calendar-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calendar-row .field:first-child { grid-column: 1 / -1; }
  .location-block { padding: 13px; }
  .submit-area { align-items: stretch; flex-direction: column; padding: 17px; }
  .primary-button { width: 100%; }
  .position-grid, .relation-highlights, .reality-check ol { grid-template-columns: 1fr; }
  .position-card { min-height: 185px; }
  .pillar-row { gap: 5px; }
  .pillar { padding: 11px 4px; }
  .pillar b { font-size: 19px; }
  .element-row { grid-template-columns: 28px minmax(0, 1fr) 34px minmax(0, 1fr) 34px; gap: 6px; }
  .ai-reading-head { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 18px; }
  .ai-reading-status { align-items: flex-start; padding: 12px 13px; }
  .ai-reading-status::before { margin-top: 5px; }
  .account-login-notice > div { align-items: flex-start; flex-direction: column; gap: 5px; }
  .ai-reading-text { min-height: 230px; padding: 22px 17px; border-radius: 16px; font-size: 14px; line-height: 1.9; }
  .ai-reading-empty { min-height: 182px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .ai-reading-empty > span { width: 52px; height: 52px; flex-basis: 52px; font-size: 24px; }
  .ai-reading-actions { gap: 15px; }
  .ai-reading-actions > div { display: grid; grid-template-columns: 1fr; }
  .ai-generate-button, .ai-secondary-button, .ai-stop-button { width: 100%; min-width: 0; min-height: 48px; }
  .hehun-dialog { align-items: end; padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .hehun-dialog-surface { width: 100%; max-height: calc(100vh - max(20px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))); max-height: calc(100dvh - max(20px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))); max-height: calc(var(--tianji-visual-viewport-height, 100dvh) - max(20px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))); padding: 22px 16px; border-radius: 22px 22px 14px 14px; }
  .ai-consent-facts li { grid-template-columns: 1fr; gap: 4px; }
  .hehun-dialog-actions { flex-direction: column-reverse; }
  .hehun-dialog-actions .ai-generate-button { min-width: 0; }
  .hehun-footer { width: calc(100% - 20px); flex-direction: column; gap: 7px; }
}

@media (max-width: 390px) {
  .form-row.two { grid-template-columns: 1fr; }
  .calendar-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-card legend { grid-template-columns: 38px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .hehun-hero, .input-panel, .summary-actions, .ai-reading-status, .account-login-notice, .ai-reading-empty, .ai-reading-actions, .hehun-dialog, .hehun-footer, .mobile-tab-bar, .mobile-task-strip, .mobile-explore-sheet { display: none !important; }
  body { background: #fff; }
  .hehun-main { width: 100%; padding: 0; }
  .hehun-panel { break-inside: avoid; box-shadow: none; }
  .ai-reading-panel { border-color: #ddd; background: #fff; }
  .ai-reading-text { min-height: 0; padding: 0; border: 0; box-shadow: none; }
}
