:root {
  color-scheme: light;
  --ink: #27352f;
  --ink-soft: #5b6b63;
  --muted: #606c63;
  --paper: #f4f1e9;
  --paper-bright: #fffdf8;
  --green: #335747;
  --green-dark: #234336;
  --green-pale: #e5ece4;
  --line: #e2dfd5;
  --gold: #76552f;
  --shadow: 0 14px 44px rgba(35, 48, 40, .075);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% -15%, #fffdf8 0, var(--paper) 58%);
}

button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #c08d4c; outline-offset: 3px; }
[hidden] { display: none !important; }

.page-shell { width: min(100% - 36px, 690px); margin: 0 auto; }
.site-header { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(60, 76, 65, .12); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(51, 87, 71, .38); border-radius: 50%; color: var(--green); font-family: "Songti SC", SimSun, serif; font-size: 19px; }
.brand-name { font-weight: 670; letter-spacing: .08em; font-size: 15px; }
.header-note { color: var(--muted); font-size: 12px; letter-spacing: .04em; }

.intro { padding: 42px 0 24px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--green); font-size: 12px; font-weight: 650; letter-spacing: .12em; }
.eyebrow-dot, .result-label-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--gold); }
h1, h2, p { margin-top: 0; }
h1 { max-width: 520px; margin-bottom: 11px; font-family: "Songti SC", SimSun, serif; font-size: clamp(27px, 6.5vw, 38px); font-weight: 600; line-height: 1.32; letter-spacing: .035em; }
.intro-copy { max-width: 490px; margin-bottom: 22px; color: var(--ink-soft); font-size: 15px; line-height: 1.8; }
.date-strip { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; font-weight: 600; }
.date-icon { color: var(--gold); font-size: 17px; }
.date-zone { margin-left: 2px; color: var(--muted); font-weight: 450; }
.date-note { margin: 5px 0 0 26px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.draw-panel, .result-panel { padding: 28px; border: 1px solid rgba(68, 85, 72, .12); border-radius: 18px; background: rgba(255, 253, 248, .93); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-kicker { margin-bottom: 7px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.section-heading h2 { margin-bottom: 0; font-family: "Songti SC", SimSun, serif; font-size: 19px; font-weight: 600; line-height: 1.5; }
.step-count { color: #b8b9ae; font-family: Georgia, serif; font-size: 15px; letter-spacing: .06em; }
.direction-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.direction-card { min-height: 91px; display: flex; align-items: center; gap: 10px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffefa; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.direction-card:hover { border-color: #a1b2a1; transform: translateY(-1px); }
.direction-card[aria-pressed="true"] { border-color: var(--green); background: #f1f5ef; box-shadow: inset 0 0 0 1px var(--green); }
.direction-icon { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-family: "Songti SC", SimSun, serif; font-size: 16px; }
.career-icon { color: #395e4d; background: #e6eee6; }
.relationship-icon { color: #8b604e; background: #f4eae3; }
.finance-icon { color: #94703b; background: #f4eddb; }
.direction-copy { display: grid; gap: 3px; }
.direction-copy strong { font-size: 14px; font-weight: 660; }
.direction-copy small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.selection-mark { width: 12px; height: 12px; margin-left: auto; border: 1px solid #b9c1b8; border-radius: 50%; }
.direction-card[aria-pressed="true"] .selection-mark { border: 4px solid var(--green); background: #fff; }
.primary-button { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding: 0 18px; border: 0; border-radius: 10px; color: #fffdf8; background: var(--green); font-size: 15px; font-weight: 650; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.primary-button:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { color: #f7f5ed; background: #a6b1a8; cursor: not-allowed; }
.primary-button span:last-child { font-size: 20px; font-weight: 400; }
.hint-copy { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.result-panel { margin-top: 18px; padding: 28px; }
.result-topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.result-label { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; font-weight: 650; letter-spacing: .05em; }
.result-date { color: var(--muted); font-size: 12px; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0 20px; }
.result-status { margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.result-heading h2 { margin: 0 0 5px; font-family: "Songti SC", SimSun, serif; font-size: 31px; font-weight: 620; letter-spacing: .08em; }
.trigram-line { margin: 0; color: var(--ink-soft); font-size: 13px; }
.hexagram-lines { width: 84px; display: grid; gap: 6px; padding: 4px 0; }
.hex-line { height: 7px; display: flex; justify-content: space-between; gap: 10px; }
.hex-line span { display: block; height: 7px; flex: 1; border-radius: 2px; background: var(--green); }
.hex-line.yin span:first-child, .hex-line.yin span:last-child { flex: 0 0 calc(50% - 5px); }
.result-divider { display: flex; align-items: center; gap: 12px; margin: 0 0 15px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.result-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.interpretation { margin: 0 0 19px; color: #34453d; font-family: "Songti SC", SimSun, serif; font-size: 16px; line-height: 1.95; }
.action-card { display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px; border: 1px solid #e9e3d1; border-radius: 12px; background: #faf7ef; }
.action-badge { flex: 0 0 29px; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: #87643d; background: #eee4cb; font-family: "Songti SC", SimSun, serif; font-size: 14px; }
.action-label { margin: 1px 0 5px; color: #76552f; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.action-text { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.75; }
.direction-switcher { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.direction-switcher > div:first-child { display: grid; gap: 4px; }
.direction-switcher strong { font-size: 13px; font-weight: 650; }
.direction-switcher small { color: var(--muted); font-size: 11px; }
.switch-options { display: flex; gap: 5px; padding: 3px; border-radius: 9px; background: #f0efe9; }
.switch-options button { min-height: 44px; padding: 0 9px; border: 0; border-radius: 7px; color: var(--ink-soft); background: transparent; font-size: 12px; cursor: pointer; }
.switch-options button[aria-pressed="true"] { color: var(--green-dark); background: #fffefa; box-shadow: 0 1px 3px rgba(35, 48, 40, .12); font-weight: 650; }
.source-details { padding: 15px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.source-details summary { width: fit-content; min-height: 44px; display: flex; align-items: center; color: var(--green); cursor: pointer; font-weight: 650; }
.source-details p { margin: 10px 0 5px; }
.source-details a { min-height: 44px; display: inline-flex; align-items: center; color: var(--green); text-underline-offset: 3px; }
.source-details .editorial-status { color: #76552f; font-size: 11px; }
.disclaimer { margin: 17px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.7; }

.app-status { min-height: 22px; margin: 12px 0 4px; color: #8d593b; font-size: 13px; line-height: 1.6; text-align: center; }
.privacy-note { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 32px; padding: 15px 16px; border: 1px solid rgba(68, 85, 72, .12); border-radius: 12px; background: rgba(255, 253, 248, .63); }
.privacy-symbol { flex: 0 0 27px; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #c8d3c8; border-radius: 50%; color: var(--green); font-size: 16px; }
.privacy-copy h2 { margin: 1px 0 5px; font-size: 12px; font-weight: 670; }
.privacy-copy p { margin: 0 0 6px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.text-button { min-height: 44px; margin-right: 12px; padding: 0; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-button:disabled { color: var(--muted); cursor: not-allowed; }
.site-footer { padding: 0 0 26px; color: #63695f; font-size: 10px; line-height: 1.6; text-align: center; }
.site-footer p { margin: 3px 0; }

@media (max-width: 480px) {
  .page-shell { width: min(100% - 28px, 690px); }
  .site-header { height: 64px; }
  .header-note { font-size: 11px; }
  .intro { padding: 31px 0 19px; }
  .intro-copy { font-size: 14px; }
  .draw-panel, .result-panel { padding: 21px 17px; border-radius: 15px; }
  .section-heading h2 { font-size: 17px; }
  .direction-list { grid-template-columns: 1fr; gap: 8px; }
  .direction-card { min-height: 62px; padding: 10px 12px; }
  .direction-icon { width: 35px; height: 35px; }
  .direction-copy { display: flex; align-items: baseline; gap: 9px; }
  .direction-copy strong { font-size: 14px; }
  .direction-copy small { font-size: 12px; }
  .selection-mark { margin-right: 2px; }
  .primary-button { min-height: 52px; }
  .result-heading { gap: 10px; padding: 20px 0 17px; }
  .result-heading h2 { font-size: 29px; }
  .hexagram-lines { width: 74px; gap: 6px; }
  .direction-switcher { align-items: flex-start; flex-direction: column; gap: 11px; }
  .switch-options { width: 100%; }
  .switch-options button { flex: 1; }
}

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