:root {
    --bg: #070a14;
    --bg-soft: #0d1224;
    --panel: rgba(19, 26, 48, .72);
    --panel-solid: #121930;
    --border: rgba(148, 163, 199, .16);
    --text: #e8ecf8;
    --muted: #97a3c4;
    --gold: #d9b45b;
    --gold-soft: rgba(217, 180, 91, .14);
    --cinnabar: #c8503f;
    --jade: #4fbfa8;
    --radius: 16px;
    --shadow: 0 18px 48px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: "Cormorant Garamond", Georgia, "Songti SC", serif;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 .5em;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ── 星空背景 ── */
.starfield {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(1000px 620px at 78% -12%, rgba(217, 180, 91, .13), transparent 62%),
        radial-gradient(820px 540px at 8% 108%, rgba(79, 191, 168, .10), transparent 60%),
        radial-gradient(circle at 20% 22%, rgba(255, 255, 255, .55) 1px, transparent 1.4px),
        radial-gradient(circle at 68% 62%, rgba(255, 255, 255, .40) 1px, transparent 1.4px),
        radial-gradient(circle at 44% 84%, rgba(255, 255, 255, .32) 1px, transparent 1.4px);
    background-size: auto, auto, 620px 620px, 480px 480px, 700px 700px;
    opacity: .55;
}

.topbar, .page, .footer { position: relative; z-index: 1; }

/* ── 顶栏 ── */
.topbar {
    border-bottom: 1px solid var(--border);
    background: rgba(7, 10, 20, .82);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 14px 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 20px;
    letter-spacing: .04em;
    color: var(--text);
}

.brand:hover { text-decoration: none; }
.brand-mark { color: var(--gold); font-size: 20px; }

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-list {
    display: flex;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link { color: var(--muted); font-size: 14.5px; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.is-active { color: var(--gold); }

.lang-switch { display: flex; align-items: center; gap: 7px; }
.lang-link {
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--muted);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
}
.lang-sep { font-size: 12px; color: rgba(148, 163, 199, .3); }
.lang-link:hover { color: var(--text); text-decoration: none; }
.lang-link.is-active { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }

/* ── 页面 ── */
.page { padding: 42px 0 72px; }

.hero { text-align: center; padding: 22px 0 44px; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: 12px;
    color: var(--gold);
    margin: 0 0 14px;
}
.hero-title { font-size: clamp(2.1rem, 5.2vw, 3.5rem); margin-bottom: 18px; }
.hero-sub { max-width: 640px; margin: 0 auto 30px; color: var(--muted); font-size: 17.5px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.page-title { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.section { margin-bottom: 54px; }
.section-title { font-size: 1.75rem; margin-bottom: 8px; }
.section-sub { color: var(--muted); margin-top: 0; margin-bottom: 22px; }
.section-actions { margin-top: 18px; text-align: center; }

/* 仅供屏幕阅读器的文本（视觉隐藏但仍可被朗读） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── 卡片 ── */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}

.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.lead { font-size: 18px; color: var(--muted); }
.classical { font-family: "Songti SC", "SimSun", Georgia, serif; font-size: 17.5px; }
.essence { font-size: 18px; color: var(--gold); }

/* ── 按钮 ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-lg { padding: 14px 28px; font-size: 16.5px; }
.btn-primary {
    background: linear-gradient(135deg, var(--gold), #b98f34);
    border-color: transparent;
    color: #1a1206;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(217, 180, 91, .28);
}
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ── 议题网格 ── */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}
.topic-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 26px 16px;
    color: var(--text);
    text-align: center;
}
.topic-card:hover { text-decoration: none; border-color: var(--gold); }
.topic-icon { font-size: 30px; color: var(--gold); }
.topic-label { font-weight: 600; }

.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}
.pillar h3 { font-size: 1.25rem; color: var(--gold); }
.pillar p { margin: 0; }

/* ── 每日一卦 ── */
.daily-card {
    display: flex;
    gap: 22px;
    align-items: center;
    color: var(--text);
}
.daily-card:hover { text-decoration: none; border-color: var(--gold); }
.daily-symbol { font-size: 62px; color: var(--gold); line-height: 1; }
.daily-number { font-size: 12.5px; color: var(--muted); letter-spacing: .1em; }
.daily-zh { margin-left: 8px; color: var(--text); }
.daily-name { font-size: 1.6rem; margin: 4px 0 8px; }
.daily-essence { margin: 0; color: var(--muted); }

/* ── 起卦表单 ── */
.cast-form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; color: var(--muted); }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row > div { flex: 1 1 140px; display: flex; flex-direction: column; gap: 7px; }

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(7, 10, 20, .6);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--gold); }

.hint { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ── 卦象 / 六爻 ── */
.result-primary {
    display: flex;
    justify-content: center;
    gap: 42px;
    align-items: center;
    margin: 26px 0;
    flex-wrap: wrap;
}
.primary-symbol { font-size: 92px; color: var(--gold); line-height: 1; }

.lines { display: flex; flex-direction: column; gap: 9px; width: 168px; }
.line { position: relative; display: flex; gap: 10px; height: 15px; }
.line-seg {
    flex: 1;
    background: var(--gold);
    border-radius: 2px;
    height: 100%;
}
.line-yin .line-seg { background: var(--muted); }
.line-changing .line-seg { box-shadow: 0 0 14px rgba(200, 80, 63, .85); }
.line-mark {
    position: absolute;
    right: -26px;
    top: -2px;
    color: var(--cinnabar);
    font-size: 13px;
}
.line-mark::after { content: "✳"; }

.hex-card { text-align: center; }
.hex-symbol { font-size: 52px; color: var(--gold); }
.hex-name { font-size: 1.3rem; font-family: "Cormorant Garamond", Georgia, serif; }
.hex-zh { font-family: "Songti SC", "SimSun", Georgia, serif; color: var(--muted); }

/* ── 结果页 ── */
.result-head { text-align: center; margin-bottom: 8px; }
.result-name { font-size: clamp(2rem, 4.4vw, 3rem); }
.result-zh { font-family: "Songti SC", "SimSun", Georgia, serif; color: var(--muted); }
.pinyin { margin-left: 10px; color: var(--gold); font-style: italic; }

.reading-block { margin-bottom: 20px; }
.reading-block h2 {
    font-size: 1.15rem;
    color: var(--gold);
    margin-top: 22px;
    margin-bottom: 8px;
}
.reading-block h2:first-child { margin-top: 0; }
.reading-block p { margin: 0 0 8px; }

.keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: center; }
.tag {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255, 255, 255, .03);
}

.line-reading {
    border-left: 2px solid var(--gold);
    padding-left: 16px;
    margin-bottom: 16px;
}
.line-reading:last-child { margin-bottom: 0; }
.line-reading-pos { font-weight: 600; color: var(--gold); }
.line-reading-stage { margin-bottom: 4px; }

.yao-text {
    font-family: "Songti SC", "SimSun", Georgia, serif;
    font-size: 17px;
    color: var(--text);
    background: rgba(217, 180, 91, .07);
    border-left: 2px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    margin: 0 0 8px;
}
.use-all { border-left-color: var(--cinnabar); }
.use-all .yao-text { background: rgba(200, 80, 63, .08); border-left-color: var(--cinnabar); }

.perspective-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}
.perspective { text-align: center; }
.perspective-symbol { font-size: 44px; color: var(--gold); }
.perspective-name { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.15rem; }

.guidance dl { margin: 0; display: grid; gap: 12px; }
.guidance dt { color: var(--gold); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.guidance dd { margin: 0; }

.save-note { text-align: center; }
.share-row { display: flex; gap: 10px; margin: 16px 0 20px; }
.share-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(7, 10, 20, .6);
    color: var(--muted);
    font-size: 13.5px;
}

/* ── 免责声明 ── */
.disclaimer {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid rgba(200, 80, 63, .35);
    background: rgba(200, 80, 63, .08);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 26px;
    font-size: 13.5px;
    color: var(--muted);
}
.disclaimer-badge {
    flex: 0 0 auto;
    color: var(--cinnabar);
    font-weight: 600;
    border: 1px solid rgba(200, 80, 63, .5);
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 12px;
}

/* ══ 首页三步交互（Select Your Flow → Focus Your Mind → Cast Your Hexagram）══
   动效基调：克制。硬币翻转是有质感的物理动作，做实即可，
   不加撒花 / 闪光 / 音效 —— 用户刚认真写下困惑，
   轻佻的反馈会稀释内容的可信度。 */

.flow {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.flow-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 26px;
}
.flow-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    font-size: 12.5px;
    letter-spacing: .1em;
    color: rgba(148, 163, 199, .45);
    text-transform: uppercase;
}
.flow-steps li::after {
    content: '';
    width: 26px;
    height: 1px;
    background: rgba(148, 163, 199, .2);
}
.flow-steps li:last-child::after { display: none; }
.flow-steps li.is-active { color: var(--gold); }
.flow-steps li.is-done { color: var(--muted); }

.flow-panel { display: none; }
.flow-panel.is-active { display: block; }

.flow-title {
    font-family: "Cormorant Garamond", Georgia, "Songti SC", serif;
    font-size: 1.65rem;
    font-weight: 600;
    margin: 0 0 .4em;
    text-align: center;
}
.flow-sub {
    text-align: center;
    color: var(--muted);
    margin: 0 0 26px;
    font-size: 15px;
}

/* 第一步：三个领域卡片 */
.flow-choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 620px) {
    .flow-choices { grid-template-columns: 1fr; }
}
.flow-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 26px 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
    font: inherit;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.flow-choice:hover {
    border-color: rgba(217, 180, 91, .5);
    transform: translateY(-2px);
    text-decoration: none;
}
.flow-choice.is-selected {
    border-color: var(--gold);
    background: var(--gold-soft);
}
.flow-choice-icon { font-size: 30px; line-height: 1; }
.flow-choice-label { font-size: 14.5px; font-weight: 500; }

/* 第二步：困惑输入 */
.flow-question {
    width: 100%;
    min-height: 96px;
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font: inherit;
    resize: vertical;
}
.flow-question:focus {
    outline: none;
    border-color: rgba(217, 180, 91, .55);
}

.flow-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
}
.flow-nav .btn { min-width: 120px; }
.flow-nav-right { display: flex; gap: 10px; }

/* 第三步：投掷区 */
.flow-coin-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 30px 20px 34px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .18s ease;
}
.flow-coin-area:hover { border-color: rgba(217, 180, 91, .45); }
.flow-coin-area:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.flow-coin-area.is-busy { cursor: progress; }

.flow-coins {
    display: flex;
    gap: 14px;
    perspective: 700px;
}
.flow-coin {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #f0d693, #c79a3f 62%, #8f6c26);
    border: 1px solid rgba(255, 255, 255, .22);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 17px;
    font-weight: 700;
    color: rgba(28, 20, 6, .82);
}
.flow-coin-area.is-flipping .flow-coin {
    animation: zenhexa-coin-flip 1.1s cubic-bezier(.34, .01, .24, 1) both;
}
.flow-coin:nth-child(2) { animation-delay: .09s; }
.flow-coin:nth-child(3) { animation-delay: .18s; }

@keyframes zenhexa-coin-flip {
    0%   { transform: rotateY(0deg)   translateY(0); }
    55%  { transform: rotateY(900deg) translateY(-16px); }
    100% { transform: rotateY(1080deg) translateY(0); }
}

/* 爻线：自下而上逐条浮现（数组 index 0 = 初爻，渲染时倒序） */
.flow-lines {
    display: flex;
    flex-direction: column-reverse;
    gap: 9px;
    width: 100%;
    max-width: 210px;
}
.flow-line {
    height: 13px;
    border-radius: 3px;
    background: var(--gold);
    opacity: 0;
    transform: scaleX(.25);
}
.flow-line.is-yang { background: var(--gold); }
.flow-line.is-yin {
    background: transparent;
    border: 1px solid var(--gold);
}
.flow-line.is-moving { box-shadow: 0 0 0 2px rgba(200, 80, 63, .4); }
.flow-line.is-revealed {
    opacity: 1;
    transform: scaleX(1);
    transition: opacity .32s ease, transform .32s cubic-bezier(.2, .9, .3, 1);
}

.flow-progress {
    font-size: 13.5px;
    color: var(--muted);
    text-align: center;
    margin: 0;
    min-height: 1.4em;
}

/* 无障碍：尊重系统「减少动态效果」设置。
   保留最终状态（爻线直接可见），只去掉翻转与过渡，
   这样偏好该设置的用户仍能看到完整卦象，而非空白。 */
@media (prefers-reduced-motion: reduce) {
    .flow-coin-area.is-flipping .flow-coin { animation: none; }
    .flow-line {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .flow-choice { transition: none; }
    .flow-choice:hover { transform: none; }
}

/* ── 历史 ── */
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.history-item { display: flex; gap: 18px; align-items: center; color: var(--text); }
.history-item:hover { text-decoration: none; border-color: var(--gold); }
.history-symbol { font-size: 40px; color: var(--gold); line-height: 1; }
.history-name { font-size: 1.2rem; font-family: "Cormorant Garamond", Georgia, serif; }
.history-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.history-question { margin-top: 6px; font-size: 14px; }

.empty-state { text-align: center; }
.empty-symbol { font-size: 62px; color: var(--gold); margin-bottom: 12px; }

.callout { border-left: 3px solid var(--gold); }

.prose h2 { font-size: 1.4rem; color: var(--gold); margin-top: 30px; }

/* ── 页脚 ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 34px 0 46px;
    background: rgba(7, 10, 20, .72);
}
.footer-inner { text-align: center; }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-disclaimer {
    max-width: 640px;
    margin: 0 auto 12px;
    font-size: 12.5px;
    color: rgba(148, 163, 199, .8);
}
.footer-copy { margin: 0; font-size: 12.5px; color: rgba(148, 163, 199, .65); }

@media (max-width: 640px) {
    .hero-title { font-size: 2.1rem; }
    .result-primary { gap: 24px; }
    .primary-symbol { font-size: 70px; }
}
