/* ============================================================
   天机阁 · 全页重排版式（v2）
   黑金星空 · 精致专业
   ============================================================ */

/* ===== 设计令牌 ===== */
:root {
    --ink-0: #05060a;
    --ink-1: #0a0d16;
    --ink-2: #10141f;
    --ink-3: #171c2b;
    --gold: #d4af37;
    --gold-bright: #ffd700;
    --gold-soft: #e9cf7a;
    --gold-deep: #a8862a;
    --gold-glow: rgba(212, 175, 55, 0.35);
    --gold-line: rgba(212, 175, 55, 0.28);
    --gold-line-soft: rgba(212, 175, 55, 0.14);
    --silver: #c9cbd6;
    --silver-dim: #8b90a0;
    --white: #f5f6fa;
    --teal: #5fc4b8;
    --red: #e05555;
    --red-soft: #ef7c7c;
    --purple: #8b7fe8;
    --card-bg: rgba(14, 18, 30, 0.82);
    --card-bg-deep: rgba(8, 10, 18, 0.9);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 9px;
    --font-serif: 'STSong', 'SimSun', 'Songti SC', serif;
    --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--gold-line-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--ink-0);
    font-family: var(--font-sans);
    color: var(--white);
    user-select: none;
    -webkit-user-select: none;
    text-rendering: optimizeLegibility;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ===== 星空背景 ===== */
#starCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* 雾霭层 */
.mist-layer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(70, 60, 30, 0.28) 0%, transparent 55%),
        linear-gradient(180deg, transparent 0%, rgba(5, 6, 10, 0.55) 100%);
    pointer-events: none;
    z-index: 1;
}

/* ===== 粒子爆发 ===== */
#burst-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
}

/* ===== 主应用容器 ===== */
#app {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 520px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 14px;
}

/* ============================================================
   品牌头部
   ============================================================ */
#site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px 0 10px;
}

.brand-mark {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, rgba(255, 215, 0, 0.22), rgba(212, 175, 55, 0.05) 70%);
    border: 1px solid var(--gold-line);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 22px var(--gold-glow), inset 0 0 14px rgba(212, 175, 55, 0.18);
    flex-shrink: 0;
}

.brand-mark::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px dashed rgba(212, 175, 55, 0.28);
    animation: rotate 24s linear infinite;
}

.brand-core {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-bright);
    text-shadow: 0 0 14px rgba(255, 215, 0, 0.55);
    line-height: 1;
}

.brand-text {
    text-align: left;
}

.brand-text h1 {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 10px;
    text-indent: 10px;
    color: var(--gold-soft);
    background: linear-gradient(180deg, #fff3c4 0%, var(--gold-bright) 45%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.35));
}

.brand-text p {
    font-size: 11px;
    color: var(--silver-dim);
    letter-spacing: 4px;
    margin-top: 3px;
}

/* ============================================================
   模块导航
   ============================================================ */
#module-nav {
    display: flex;
    gap: 6px;
    padding: 5px;
    margin: 12px 0 6px;
    background: rgba(10, 13, 22, 0.6);
    border: 1px solid var(--gold-line-soft);
    border-radius: 999px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.nav-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 4px;
    background: transparent;
    color: var(--silver-dim);
    border: none;
    border-radius: 999px;
    font-family: var(--font-serif);
    font-size: 14px;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.35s ease;
    position: relative;
}

.nav-ico {
    font-size: 15px;
    opacity: 0.85;
    transition: all 0.35s ease;
}

.nav-tab.active {
    color: var(--gold-bright);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(212, 175, 55, 0.1));
    box-shadow: 0 0 18px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.nav-tab.active .nav-ico {
    opacity: 1;
    transform: scale(1.1);
}

.nav-tab:active {
    transform: scale(0.95);
}

/* ===== 模块显隐 ===== */
.module {
    display: none;
}

.module.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-deep) transparent;
}

.module::-webkit-scrollbar { width: 4px; }
.module::-webkit-scrollbar-track { background: transparent; }
.module::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 2px; }

/* ===== 模块标题 ===== */
.module-head {
    text-align: center;
    padding: 16px 0 6px;
}

.module-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 8px;
    text-indent: 8px;
    color: var(--gold-soft);
    position: relative;
    display: inline-block;
}

.module-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.module-sub {
    font-size: 11px;
    color: var(--silver-dim);
    letter-spacing: 2px;
    margin-top: 12px;
}

/* ============================================================
   六爻模块
   ============================================================ */
#module-liuyao {
    justify-content: flex-start;
    align-items: center;
}

.compass-stage {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 6px;
}

/* ===== 罗盘容器 ===== */
#compass-container {
    position: relative;
    width: min(340px, 82vw);
    height: min(340px, 82vw);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 罗盘光晕 */
.compass-glow {
    position: absolute;
    width: 122%;
    height: 122%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-glow) 0%, rgba(212, 175, 55, 0.08) 40%, transparent 65%);
    animation: breathe 4.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes breathe {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.04); }
}

/* 罗盘旋转层 */
.compass-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5);
}

.ring-1 { width: 100%; height: 100%; animation: rotate 140s linear infinite; }
.ring-2 { width: 85%; height: 85%; animation: rotate 100s linear infinite reverse; }
.ring-3 { width: 70%; height: 70%; animation: rotate 70s linear infinite; }
.ring-4 { width: 55%; height: 55%; animation: rotate 50s linear infinite reverse; }
.ring-5 { width: 40%; height: 40%; animation: rotate 35s linear infinite; }

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.compass-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.2));
}

.taiji {
    position: absolute;
    width: 22%;
    height: 22%;
    animation: rotate 22s linear infinite;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.55));
}

.spinning-fast {
    animation: rotate 0.8s linear infinite !important;
}

.spinning-slow {
    animation: rotate 8s linear infinite !important;
    transition: animation-duration 1s;
}

/* ===== 交互提示 ===== */
#hint-text {
    margin-top: 8px;
    font-size: 15px;
    color: var(--white);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
    letter-spacing: 5px;
    text-indent: 5px;
    animation: hintPulse 2.2s ease-in-out infinite;
    white-space: nowrap;
    font-family: var(--font-serif);
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

/* ===== 摇卦进度指示器 ===== */
.shake-indicator {
    display: flex;
    gap: 9px;
    margin-top: 14px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(8, 10, 18, 0.5);
    border: 1px solid var(--gold-line-soft);
}

.shake-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.18);
    border: 1px solid var(--gold);
    transition: all 0.3s ease;
}

.shake-dot.active {
    background: var(--gold-bright);
    box-shadow: 0 0 14px var(--gold-glow);
    transform: scale(1.35);
}

/* ===== 排卦按钮 ===== */
#cast-btn {
    margin: 20px 0 8px;
    padding: 13px 52px;
    background: linear-gradient(180deg, rgba(24, 28, 46, 0.9), rgba(12, 15, 26, 0.95));
    color: var(--gold-soft);
    border: 1px solid var(--gold);
    border-radius: 999px;
    font-size: 16px;
    font-family: var(--font-serif);
    letter-spacing: 7px;
    text-indent: 7px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--gold-line-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#cast-btn:hover {
    border-color: var(--gold-bright);
    box-shadow: 0 0 26px var(--gold-glow), 0 8px 24px rgba(0, 0, 0, 0.5);
    background: linear-gradient(180deg, rgba(34, 38, 60, 0.95), rgba(16, 20, 34, 0.98));
    color: var(--gold-bright);
}

#cast-btn:active {
    transform: scale(0.96);
}

#cast-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ===== 爻线动画区 ===== */
#yao-animation {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column-reverse;
    align-items: center;
    gap: 9px;
    z-index: 20;
    padding: 16px 24px;
    background: rgba(5, 6, 12, 0.75);
    border: 1px solid var(--gold-line-soft);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.yao-line {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 210px;
    height: 20px;
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.5s ease;
}

.yao-line.show {
    opacity: 1;
    transform: scaleX(1);
}

.yao-yang {
    height: 6px;
    background: linear-gradient(90deg, transparent, var(--gold-bright), var(--gold), var(--gold-bright), transparent);
    box-shadow: 0 0 14px var(--gold-glow);
    border-radius: 3px;
}

.yao-yin {
    display: flex;
    gap: 22px;
}

.yao-yin::before, .yao-yin::after {
    content: '';
    width: 88px;
    height: 6px;
    background: linear-gradient(90deg, transparent, var(--silver), var(--silver), transparent);
    box-shadow: 0 0 9px rgba(201, 203, 214, 0.35);
    border-radius: 3px;
}

.yao-moving::after {
    content: attr(data-mark);
    position: absolute;
    right: -26px;
    color: var(--red-soft);
    font-size: 14px;
    font-family: var(--font-serif);
    animation: blink 0.8s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; text-shadow: 0 0 9px var(--red); }
}

/* ============================================================
   结果卡片（模态）
   ============================================================ */
#result-card, #interpret-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    width: min(92vw, 430px);
    max-height: 84vh;
    overflow-y: auto;
    background: var(--card-bg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card), 0 0 60px rgba(212, 175, 55, 0.12);
    padding: 22px 20px;
    z-index: 40;
    transition: all 0.5s var(--ease-spring);
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-deep) transparent;
}

#result-card.show, #interpret-panel.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

#result-card::-webkit-scrollbar, #interpret-panel::-webkit-scrollbar { width: 4px; }
#result-card::-webkit-scrollbar-track, #interpret-panel::-webkit-scrollbar-track { background: transparent; }
#result-card::-webkit-scrollbar-thumb, #interpret-panel::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 2px; }

/* 卦名 */
.hex-name {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-bright);
    text-shadow: 0 0 16px var(--gold-glow);
    letter-spacing: 3px;
}

.hex-subtitle {
    text-align: center;
    font-size: 12px;
    color: var(--silver-dim);
    margin-top: 6px;
    letter-spacing: 1px;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 14px 0;
    position: relative;
}

.divider::after {
    content: '❖';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--gold);
    background: var(--card-bg);
    padding: 0 10px;
    text-shadow: 0 0 8px var(--gold-glow);
}

/* 爻位表 */
.yao-table {
    display: flex;
    flex-direction: column-reverse;
    gap: 3px;
    margin-bottom: 14px;
}

.yao-row {
    display: grid;
    grid-template-columns: 36px 1fr 62px 40px 40px;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.3s;
    opacity: 0;
    transform: translateX(-12px);
}

.yao-row.show {
    opacity: 1;
    transform: translateX(0);
}

.yao-row:hover {
    background: rgba(212, 175, 55, 0.08);
}

.yao-pos {
    color: var(--silver-dim);
    text-align: center;
    font-family: var(--font-serif);
    font-size: 12px;
}

.yao-line-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 12px;
}

.line-yang {
    width: 82%;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright), var(--gold-deep));
    box-shadow: 0 0 8px var(--gold-glow);
    border-radius: 2px;
}

.line-yin {
    display: flex;
    gap: 13px;
    width: 82%;
    justify-content: center;
}

.line-yin::before, .line-yin::after {
    content: '';
    width: 36%;
    height: 4px;
    background: linear-gradient(90deg, #7d8294, var(--silver), #7d8294);
    box-shadow: 0 0 5px rgba(201, 203, 214, 0.35);
    border-radius: 2px;
}

.yao-zhi { color: var(--teal); text-align: center; font-size: 12px; }
.yao-relative { color: var(--gold-soft); text-align: center; font-size: 12px; }
.yao-spirit { color: var(--silver-dim); text-align: center; font-size: 11px; }

/* 世应 */
.yao-row[data-shi] .yao-pos::after {
    content: '·世';
    color: var(--red-soft);
    font-size: 10px;
}

.yao-row[data-ying] .yao-pos::after {
    content: '·应';
    color: var(--teal);
    font-size: 10px;
}

.yao-row.moving {
    background: rgba(224, 85, 85, 0.1);
    border-color: rgba(224, 85, 85, 0.25);
}

.yao-row.moving .yao-pos { color: var(--red-soft); }

/* 卦信息区 */
.hex-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 12px 8px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--gold-line-soft);
    border-radius: var(--radius-md);
}

.hex-info > div {
    text-align: center;
}

.hex-info .label {
    color: var(--silver-dim);
    font-size: 10px;
    letter-spacing: 1px;
}

.hex-info .value {
    color: var(--gold-soft);
    font-size: 13px;
    margin-top: 4px;
    font-family: var(--font-serif);
}

/* 操作按钮 */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn {
    flex: 1;
    padding: 10px 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-sm);
    color: var(--silver);
    font-size: 13px;
    font-family: var(--font-sans);
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    border-color: var(--gold);
    color: var(--white);
    background: rgba(30, 34, 52, 0.8);
}

.btn.primary {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.06));
}

.btn.primary:hover {
    color: var(--gold-bright);
    box-shadow: 0 0 18px var(--gold-glow);
}

/* ============================================================
   解卦面板
   ============================================================ */
#interpret-panel {
    z-index: 45;
}

.interp-header {
    text-align: center;
    margin-bottom: 6px;
}

.interp-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-bright);
    text-shadow: 0 0 14px var(--gold-glow);
    letter-spacing: 3px;
}

.interp-fortune {
    display: inline-block;
    padding: 4px 18px;
    margin-top: 10px;
    border-radius: 999px;
    font-size: 13px;
    font-family: var(--font-serif);
    letter-spacing: 4px;
    text-indent: 4px;
}

.fortune-da-ji { background: rgba(255, 215, 0, 0.14); color: var(--gold-bright); border: 1px solid rgba(255, 215, 0, 0.45); text-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
.fortune-ji { background: rgba(95, 196, 184, 0.14); color: var(--teal); border: 1px solid rgba(95, 196, 184, 0.45); }
.fortune-zhong-ji { background: rgba(201, 203, 214, 0.12); color: var(--silver); border: 1px solid rgba(201, 203, 214, 0.35); }
.fortune-zhong-ping { background: rgba(201, 203, 214, 0.12); color: var(--silver); border: 1px solid rgba(201, 203, 214, 0.35); }
.fortune-xiong { background: rgba(224, 85, 85, 0.14); color: var(--red-soft); border: 1px solid rgba(224, 85, 85, 0.45); }

.interp-section {
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.45s ease;
}

.interp-section.show {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 13px;
    color: var(--gold-soft);
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--gold);
    font-family: var(--font-serif);
    letter-spacing: 2px;
}

.section-content {
    font-size: 13px;
    line-height: 1.9;
    color: var(--silver);
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gold-line-soft);
}

.guaci-text {
    color: var(--white);
    font-family: var(--font-serif);
    font-size: 14px;
    line-height: 2;
    letter-spacing: 0.5px;
}

.aspect-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.aspect-item {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gold-line-soft);
}

.aspect-label {
    font-size: 12px;
    color: var(--gold-soft);
    margin-bottom: 5px;
    font-family: var(--font-serif);
    letter-spacing: 2px;
}

.aspect-text {
    font-size: 12px;
    line-height: 1.75;
    color: var(--silver);
}

.moving-yao-item {
    padding: 10px 12px;
    background: rgba(224, 85, 85, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(224, 85, 85, 0.22);
    margin-bottom: 8px;
}

.moving-yao-title {
    font-size: 13px;
    color: var(--red-soft);
    margin-bottom: 5px;
    font-family: var(--font-serif);
}

.moving-yao-text {
    font-size: 12px;
    line-height: 1.75;
    color: var(--silver);
}

/* ============================================================
   摇签模块
   ============================================================ */
#module-sign {
    align-items: center;
}

#sign-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-bottom: 40px;
}

/* 签筒 */
#sign-cylinder {
    position: relative;
    width: 156px;
    height: 196px;
    margin: 26px auto 20px;
    transform-origin: center bottom;
    perspective: 900px;
}

/* 晃动蓄力 */
#sign-cylinder.shaking {
    animation: cylinderShake 0.5s ease-in-out infinite;
}

@keyframes cylinderShake {
    0% { transform: rotate(-7deg) translateX(-5px); }
    50% { transform: rotate(10deg) translateX(6px); }
    100% { transform: rotate(-7deg) translateX(-5px); }
}

/* 签子飞出瞬间筒身喧上抛 */
#sign-cylinder.ejecting {
    animation: cylinderEject 0.7s ease-out forwards;
}

@keyframes cylinderEject {
    0% { transform: rotate(-4deg) translateY(0); }
    40% { transform: rotate(4deg) translateY(-16px); }
    70% { transform: rotate(-2deg) translateY(5px); }
    100% { transform: rotate(0deg) translateY(0); }
}

.cylinder-body {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 124px;
    height: 176px;
    background:
        linear-gradient(180deg, rgba(90, 70, 25, 0.9), rgba(40, 28, 10, 0.95) 55%, rgba(22, 15, 5, 0.98));
    border: 1.5px solid var(--gold);
    border-radius: 12px 12px 26px 26px;
    box-shadow: inset 0 0 34px rgba(212, 175, 55, 0.3), 0 14px 34px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    z-index: 1;
}

.cylinder-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 13px, rgba(212, 175, 55, 0.07) 13px, rgba(212, 175, 55, 0.07) 14px);
}

.cylinder-rim {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 138px;
    height: 15px;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep) 60%, #6e5417);
    border-radius: 8px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.55), 0 0 12px rgba(212, 175, 55, 0.4);
    z-index: 3;
}

/* 签子：露出筒口、透视倾斜、木/竹渐变 */
.cylinder-stick {
    position: absolute;
    top: -30px;
    width: 6px;
    height: 100px;
    background: linear-gradient(180deg, #ecd393, #d4a04a 45%, #a67c2c);
    border-radius: 3px;
    transform: rotate(var(--r, 0deg));
    transform-origin: center 126px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 0 2px rgba(255, 236, 190, 0.4);
    z-index: 2;
    will-change: transform, opacity;
}

/* 签子排布（相对 #sign-cylinder 定位，露出筒口形成透视倾斜效果） */
.cylinder-stick:nth-child(2) { left: 40px; --r: -18deg; }
.cylinder-stick:nth-child(3) { left: 60px; --r: -8deg; }
.cylinder-stick:nth-child(4) { left: 78px; --r: 2deg; }
.cylinder-stick:nth-child(5) { left: 96px; --r: 10deg; }
.cylinder-stick:nth-child(6) { left: 114px; --r: 20deg; }
.cylinder-stick:nth-child(7) { left: 72px; --r: -1deg; height: 114px; }

/* 蓄力时签子轻微内颤 */
#sign-cylinder.shaking .cylinder-stick {
    animation: stickJitter 0.45s ease-in-out infinite;
}

@keyframes stickJitter {
    0% { transform: rotate(var(--r, 0deg)) translate(0, 0); }
    25% { transform: rotate(calc(var(--r, 0deg) + 12deg)) translate(-2px, -2px); }
    60% { transform: rotate(calc(var(--r, 0deg) - 10deg)) translate(2px, -1px); }
    100% { transform: rotate(var(--r, 0deg)) translate(0, 0); }
}

/* 被摇中的签子：旋转飞出（抛物线 + 摇摆） */
.cylinder-stick.flying {
    animation: stickFlyOut 0.95s cubic-bezier(0.4, -0.15, 0.5, 1) forwards;
    z-index: 40;
    pointer-events: none;
}

@keyframes stickFlyOut {
    0% { transform: translate(0, 0) rotate(var(--r, 0deg)) scale(1); opacity: 1; }
    20% { transform: translate(-18px, -30px) rotate(calc(var(--r, 0deg) - 26deg)) scale(1.05); opacity: 1; }
    48% { transform: translate(12px, -88px) rotate(calc(var(--r, 0deg) + 20deg)) scale(1.12); opacity: 1; }
    74% { transform: translate(-8px, -132px) rotate(calc(var(--r, 0deg) - 8deg)) scale(1.18); opacity: 1; }
    100% { transform: translate(3px, -176px) rotate(calc(var(--r, 0deg) + 4deg)) scale(1.34); opacity: 1; }
}

/* 摇出的签 · 放大展示层（fixed 前景，签身含签诗） */
.drawn-sign-layer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
    background: radial-gradient(ellipse at center 42%, rgba(8, 12, 24, 0.5), rgba(2, 4, 10, 0.8));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.drawn-sign-layer.show {
    opacity: 1;
    visibility: visible;
}

.drawn-stick {
    position: relative;
    width: clamp(124px, 26vw, 176px);
    min-height: clamp(310px, 60vh, 470px);
    background:
        linear-gradient(180deg, rgba(240, 214, 158, 0.98), rgba(212, 168, 90, 0.98) 10%, rgba(166, 116, 44, 0.98) 52%, rgba(132, 88, 28, 0.98));
    border: 2px solid var(--gold-bright);
    border-radius: 12px 12px 28px 28px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.6), inset 0 0 34px rgba(255, 224, 150, 0.4), 0 0 46px var(--gold-glow);
    padding: 30px 18px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: rotate(-3deg);
}

.drawn-sign-layer.show .drawn-stick {
    animation: drawnStickIn 0.85s cubic-bezier(0.24, 1.08, 0.32, 1) both;
}

@keyframes drawnStickIn {
    0% { transform: rotate(-10deg) translateY(-48vh) scale(0.82); opacity: 0; }
    55% { transform: rotate(3deg) translateY(8px) scale(1.03); opacity: 1; }
    76% { transform: rotate(-4deg) translateY(-12px) scale(0.99); }
    100% { transform: rotate(-3deg) translateY(0) scale(1); opacity: 1; }
}

.drawn-glow {
    position: absolute;
    inset: -34px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.34), transparent 65%);
    border-radius: 50%;
    animation: drawnGlow 1.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes drawnGlow {
    0%, 100% { opacity: 0.45; transform: scale(0.94); }
    50% { opacity: 0.95; transform: scale(1.06); }
}

.drawn-no {
    font-size: 13px;
    letter-spacing: 4px;
    color: #5c3d08;
    background: linear-gradient(90deg, rgba(56, 36, 6, 0.1), rgba(56, 36, 6, 0.2), rgba(56, 36, 6, 0.1));
    border: 1px solid rgba(56, 36, 6, 0.28);
    border-radius: 999px;
    padding: 3px 16px;
    margin-bottom: 8px;
}

.drawn-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(24px, 4vw, 34px);
    color: #3a2405;
    letter-spacing: 6px;
    text-indent: 6px;
    text-shadow: 0 1px 1px rgba(255, 236, 190, 0.7);
}

.drawn-divider {
    width: 62%;
    height: 1px;
    margin: 14px auto 12px;
    background: linear-gradient(90deg, transparent, rgba(74, 46, 10, 0.6), transparent);
}

/* 签身竖排签诗（与签卦象/签意呼应，源自每支签的 poem 字段） */
.drawn-poem {
    font-family: var(--font-serif);
    writing-mode: vertical-rl;
    letter-spacing: 7px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.12;
    color: #3a2405;
    text-shadow: 0 1px 1px rgba(255, 236, 190, 0.65);
    white-space: pre-line;
    margin: 0 auto;
    min-height: 0;
}

/* 按钮区 */
.sign-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#sign-btn {
    padding: 13px 52px;
    background: linear-gradient(180deg, rgba(24, 28, 46, 0.9), rgba(12, 15, 26, 0.95));
    color: var(--gold-soft);
    border: 1px solid var(--gold);
    border-radius: 999px;
    font-size: 16px;
    font-family: var(--font-serif);
    letter-spacing: 7px;
    text-indent: 7px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#sign-btn:hover {
    border-color: var(--gold-bright);
    box-shadow: 0 0 26px var(--gold-glow);
    color: var(--gold-bright);
}

#sign-btn:active {
    transform: scale(0.96);
}

#sign-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.btn-plain {
    padding: 9px 30px;
    background: transparent;
    color: var(--silver-dim);
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    font-size: 13px;
    font-family: var(--font-serif);
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-plain:hover {
    color: var(--gold-bright);
    border-color: var(--gold);
    box-shadow: 0 0 14px var(--gold-glow);
}

/* 签文结果 */
#sign-result {
    width: 100%;
    margin-top: 22px;
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.6s var(--ease-spring);
}

#sign-result.show {
    opacity: 1;
    transform: translateY(0);
}

.sign-result-card {
    background: var(--card-bg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px 20px;
    text-align: center;
}

.sign-no {
    font-size: 12px;
    color: var(--silver-dim);
    letter-spacing: 3px;
}

.sign-fortune {
    display: inline-block;
    margin: 12px 0 6px;
    padding: 4px 20px;
    font-size: 14px;
    font-family: var(--font-serif);
    border-radius: 999px;
    letter-spacing: 4px;
    text-indent: 4px;
}

.sign-fortune.shangshang, .sign-fortune.shangji {
    color: var(--gold-bright);
    border: 1px solid rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.55);
}

.sign-fortune.zhongji {
    color: #a8e6cf;
    border: 1px solid rgba(168, 230, 207, 0.5);
    background: rgba(168, 230, 207, 0.1);
}

.sign-fortune.zhongping {
    color: var(--silver);
    border: 1px solid rgba(201, 203, 214, 0.4);
    background: rgba(201, 203, 214, 0.08);
}

.sign-fortune.xiangxia {
    color: var(--red-soft);
    border: 1px solid rgba(239, 124, 124, 0.5);
    background: rgba(239, 124, 124, 0.08);
}

.sign-title-big {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-bright);
    text-shadow: 0 0 14px var(--gold-glow);
    margin: 10px 0;
    letter-spacing: 4px;
}

.sign-poem {
    margin: 16px auto;
    padding: 16px;
    border: 1px dashed var(--gold-line);
    border-radius: var(--radius-md);
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 2.1;
    color: var(--white);
    white-space: pre-line;
    background: rgba(0, 0, 0, 0.18);
}

.sign-jie {
    text-align: left;
    font-size: 13px;
    line-height: 2;
    color: var(--silver);
    padding: 6px 10px;
}

.sign-jie .sign-jie-title {
    color: var(--gold-bright);
    letter-spacing: 2px;
    margin-bottom: 5px;
    font-family: var(--font-serif);
}

/* ============================================================
   星座模块
   ============================================================ */
#module-zodiac {
    align-items: center;
}

#zodiac-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-bottom: 40px;
}

#zodiac-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin: 20px 0 8px;
}

.zodiac-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 4px 13px;
    background: linear-gradient(180deg, rgba(16, 20, 31, 0.72), rgba(10, 13, 22, 0.82));
    border: 1px solid var(--gold-line-soft);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.zodiac-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: all 0.3s ease;
}

.zodiac-item:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 16px var(--gold-glow);
    transform: translateY(-3px);
}

.zodiac-item.active {
    border-color: var(--gold-bright);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.18), rgba(10, 13, 22, 0.9));
    box-shadow: 0 0 22px var(--gold-glow), inset 0 0 20px rgba(212, 175, 55, 0.08);
}

.zodiac-item.active::before {
    opacity: 1;
}

.zodiac-symbol {
    font-size: 27px;
    color: var(--gold-bright);
    text-shadow: 0 0 12px var(--gold-glow);
    line-height: 1;
}

.zodiac-name {
    font-size: 13px;
    color: var(--white);
    letter-spacing: 1px;
    font-family: var(--font-serif);
}

.zodiac-dates {
    font-size: 9px;
    color: var(--silver-dim);
    letter-spacing: 0.5px;
}

/* 星座详情 */
#zodiac-detail {
    width: 100%;
    margin-top: 18px;
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.55s var(--ease-spring);
}

#zodiac-detail.show {
    opacity: 1;
    transform: translateY(0);
}

.zodiac-card {
    background: var(--card-bg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 22px 20px;
}

.zodiac-head {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gold-line-soft);
}

.zodiac-head .zodiac-symbol {
    font-size: 38px;
    text-shadow: 0 0 20px var(--gold-glow);
}

.zodiac-head-info .zodiac-name {
    font-size: 20px;
    font-family: var(--font-serif);
    letter-spacing: 4px;
    color: var(--gold-bright);
    text-shadow: 0 0 12px var(--gold-glow);
}

.zodiac-head-info .zodiac-meta {
    font-size: 11px;
    color: var(--silver-dim);
    margin-top: 5px;
    letter-spacing: 1px;
}

.zodiac-section {
    margin-top: 16px;
}

.zodiac-section-title {
    font-size: 13px;
    color: var(--gold-soft);
    letter-spacing: 3px;
    border-left: 3px solid var(--gold);
    padding-left: 10px;
    margin-bottom: 9px;
    font-family: var(--font-serif);
}

.zodiac-trait-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zodiac-trait {
    font-size: 12px;
    color: var(--silver);
    padding: 5px 12px;
    border: 1px solid var(--gold-line-soft);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
}

.zodiac-personality {
    font-size: 13px;
    line-height: 2;
    color: var(--silver);
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gold-line-soft);
}

.zodiac-tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0 12px;
}

.zodiac-tab {
    flex: 1;
    padding: 8px 0;
    background: rgba(0, 0, 0, 0.25);
    color: var(--silver-dim);
    border: 1px solid var(--gold-line-soft);
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 3px;
    text-indent: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-serif);
}

.zodiac-tab.active {
    color: var(--gold-bright);
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.06));
    box-shadow: 0 0 14px var(--gold-glow);
}

.zodiac-fortune-content {
    font-size: 13px;
    line-height: 1.9;
    color: var(--silver);
    padding: 12px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gold-line-soft);
}

.zodiac-fortune-content .f-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 2px;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.12);
}

.zodiac-fortune-content .f-line:last-child {
    border-bottom: none;
}

.zodiac-fortune-content .f-label {
    color: var(--gold-bright);
    white-space: nowrap;
    letter-spacing: 2px;
    font-family: var(--font-serif);
    font-size: 12px;
}

.zodiac-fortune-content .f-stars {
    color: var(--gold-bright);
    letter-spacing: 2px;
    font-size: 13px;
    text-shadow: 0 0 8px var(--gold-glow);
}

/* ============================================================
   响应式
   ============================================================ */

/* ============================================================
   硬币摇卦模块
   ============================================================ */
#module-coin {
    align-items: center;
    justify-content: flex-start;
}

#coin-stage {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px 28px;
    margin: 0 auto;
    min-height: 0;
}

/* 三枚铜钱 */
#coin-tray {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    perspective: 720px;
    margin: 30px 0 4px;
    min-height: 96px;
}

.coin {
    width: 76px;
    height: 76px;
    position: relative;
    transform-style: preserve-3d;
}

.coin-inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform-style: preserve-3d;
    transition: transform 0.35s ease;
}

.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    backface-visibility: hidden;
    border: 2px solid var(--gold);
    background:
        radial-gradient(circle at 50% 36%, rgba(255, 236, 160, 0.9) 0%, transparent 40%),
        linear-gradient(180deg, #3a3010, #241c08 55%, #14100a);
    color: var(--gold-bright);
    text-shadow: 0 0 8px var(--gold-glow);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(212, 175, 55, 0.3);
}

.coin-front {
    transform: rotateY(0deg);
    font-size: 26px;
    letter-spacing: 4px;
}

.coin-back {
    transform: rotateY(180deg);
    font-size: 20px;
    letter-spacing: 6px;
}

/* 落定后展示正/反面 */
.coin[data-face="front"] .coin-inner { transform: rotateY(0deg); }
.coin[data-face="back"] .coin-inner { transform: rotateY(180deg); }

/* 抛掷翻落动画 */
.coin.tossing .coin-inner {
    animation: coinToss 0.9s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
.coin.tossing:nth-child(2) .coin-inner { animation-delay: 0.08s; }
.coin.tossing:nth-child(3) .coin-inner { animation-delay: 0.16s; }
.coin.bounce { animation: coinBounce 0.4s ease; }

@keyframes coinToss {
    0%   { transform: rotateY(0deg) translateY(0); }
    15%  { transform: rotateY(540deg) translateY(-64px); }
    40%  { transform: rotateY(1080deg) translateY(-22px); }
    60%  { transform: rotateY(1620deg) translateY(0); }
    78%  { transform: rotateY(1800deg) rotateX(26deg); }
    100% { transform: rotateY(0deg) translateY(0); }
}

@keyframes coinBounce {
    0%   { transform: translateY(-10px); }
    55%  { transform: translateY(2px); }
    100% { transform: translateY(0); }
}

/* 摇币状态提示 */
.coin-hint {
    font-family: var(--font-serif);
    color: var(--silver-dim);
    font-size: 13px;
    letter-spacing: 2px;
    margin: 14px 0 2px;
    min-height: 20px;
    text-align: center;
    transition: all 0.3s ease;
}
.coin-hint.hot {
    color: var(--gold-bright);
    text-shadow: 0 0 10px var(--gold-glow);
}

/* 爻位进度（初→上，自下而上亮起） */
.coin-yaos {
    width: 100%;
    margin: 16px 0 10px;
    padding: 14px 12px;
    background: var(--card-bg);
    border: 1px solid var(--gold-line-soft);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.c-yao-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.c-yao-slot em {
    font-style: normal;
    font-size: 11px;
    color: var(--silver-dim);
    letter-spacing: 2px;
    min-width: 44px;
    text-align: right;
}

.c-yao-slot .c-line {
    width: 56px;
    height: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.c-yao-slot .c-line::before {
    content: '';
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

/* 阴阳爻展示 */
.c-yao-slot.filled .c-line::before {
    background: var(--gold-bright);
    box-shadow: 0 0 10px var(--gold-glow);
}

.c-yao-slot.filled.yin .c-line::before {
    width: 46%;
}
.c-yao-slot.filled.yin .c-line::after {
    content: '';
    width: 46%;
    height: 3px;
    border-radius: 2px;
    background: var(--gold-bright);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* 动爻高亮（老阳○ / 老阴×） */
.c-yao-slot.filled.moving {
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}
.c-yao-slot.filled.moving .c-line::before,
.c-yao-slot.filled.moving.yin .c-line::after {
    background: #ff6b6b;
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.8);
}

.c-yao-slot .c-mark {
    min-width: 40px;
    font-size: 12px;
    color: var(--gold-soft);
    letter-spacing: 2px;
    text-align: left;
}
.c-yao-slot.filled.moving .c-mark { color: #ff9b9b; }

/* 待摇中高亮的爻位 */
.c-yao-slot.active { animation: slotPulse 1.1s ease infinite; }
@keyframes slotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.35); }
    50% { box-shadow: 0 0 14px 2px rgba(212, 175, 55, 0.55); }
}

/* 操作按钮 */
.coin-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#coin-toss-btn {
    padding: 13px 52px;
    background: linear-gradient(180deg, rgba(24, 28, 46, 0.9), rgba(12, 15, 26, 0.95));
    color: var(--gold-soft);
    border: 1px solid var(--gold);
    border-radius: 999px;
    font-size: 16px;
    font-family: var(--font-serif);
    letter-spacing: 7px;
    text-indent: 7px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#coin-toss-btn:hover {
    border-color: var(--gold-bright);
    box-shadow: 0 0 26px var(--gold-glow);
    color: var(--gold-bright);
}

#coin-toss-btn:active { transform: scale(0.96); }

#coin-toss-btn.disabled, #coin-toss-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* 成卦结果卡 / 解卦面板（模块内嵌，风格与六爻弹层一致） */
#coin-result, #coin-interpret {
    width: 100%;
    margin-top: 18px;
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.6s var(--ease-spring);
}

#coin-result.show, #coin-interpret.show {
    opacity: 1;
    transform: translateY(0);
}

#coin-result .card-inner,
#coin-interpret .card-inner {
    background: var(--card-bg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--gold-line);
    border-radius: 16px;
    padding: 22px 18px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* 窄屏 */
@media (max-width: 380px) {
    #app { padding: 0 10px; }
    .brand-text h1 { font-size: 23px; letter-spacing: 8px; text-indent: 8px; }
    #compass-container { width: min(300px, 84vw); height: min(300px, 84vw); }
    .nav-label { letter-spacing: 2px; font-size: 13px; }
    #cast-btn, #sign-btn, #coin-toss-btn { padding: 12px 44px; font-size: 15px; }
    .coin-tray-gap, #coin-tray { gap: 12px; margin-top: 22px; }
    .coin { width: 62px; height: 62px; }
    .coin-front { font-size: 21px; }
    .coin-back { font-size: 15px; }
    .c-yao-slot .c-line { width: 42px; }
    .c-yao-slot em { min-width: 32px; }
    .c-yao-slot .c-mark { min-width: 30px; font-size: 11px; }
    .yao-row { grid-template-columns: 30px 1fr 54px 34px 34px; font-size: 11px; }
    .hex-info { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .drawn-stick { width: 122px; min-height: 300px; padding: 26px 14px 22px; }
    .drawn-poem { font-size: 15px; letter-spacing: 5px; }
    .drawn-title { font-size: 24px; letter-spacing: 5px; text-indent: 5px; }
}

/* 横屏小高度 */
@media (orientation: landscape) and (max-height: 560px) {
    #site-header { padding: 8px 0 4px; }
    .brand-mark { width: 34px; height: 34px; }
    .brand-core { font-size: 18px; }
    .brand-text h1 { font-size: 19px; }
    .brand-text p { font-size: 10px; }
    #module-nav { margin: 5px 0 0; padding: 4px; }
    .nav-tab { padding: 6px 4px; font-size: 13px; }
    .module-head { padding: 6px 0 0; }
    .module-sub { margin-top: 5px; font-size: 10px; }
    .compass-stage { margin-top: 0; }
    #compass-container { width: min(230px, 38vh); height: min(230px, 38vh); }
    #hint-text { margin-top: 4px; font-size: 13px; }
    .shake-indicator { margin-top: 6px; padding: 5px 12px; }
    #cast-btn { margin: 8px 0 2px; padding: 8px 32px; font-size: 14px; letter-spacing: 5px; text-indent: 5px; }
    #sign-cylinder { margin: 8px auto 6px; transform: scale(0.72); }
    #zodiac-grid { margin: 10px 0 4px; }
    #sign-result, #zodiac-detail { margin-top: 10px; }
    #result-card, #interpret-panel { max-height: 92vh; }
    #yao-animation { top: 46%; }
    .drawn-stick { width: 112px; min-height: 74vh; padding: 22px 12px 18px; }
    .drawn-poem { font-size: 14px; letter-spacing: 5px; }
    .drawn-title { font-size: 22px; letter-spacing: 4px; text-indent: 4px; }
    .drawn-divider { margin: 10px auto 8px; }
}

/* ============================================================
   Site v3 · 现代东方美学 / 禅意科技风（落地首页 + 通栏导航）
   ============================================================ */
#app {
    max-width: 1280px;
    padding: 92px 24px 0;
}

/* ---- 通栏导航：顶部固定、贯穿视口、深黑底 + 细金边 ---- */
#site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: linear-gradient(180deg, #1a1a1a 0%, #141210 100%);
    border-bottom: 1px solid var(--gold-line);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

.site-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 28px;
}

/* Logo 徽章 */
.brand-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    flex-shrink: 0;
}

.badge-core {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--gold-bright);
    background: radial-gradient(circle at 50% 35%, rgba(255, 215, 0, 0.25), rgba(212, 175, 55, 0.06) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-bright);
    box-shadow: 0 0 18px var(--gold-glow), inset 0 0 12px rgba(212, 175, 55, 0.16);
}

.badge-text {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--gold-soft);
    line-height: 1.15;
}

.badge-text em {
    display: block;
    font-style: normal;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 5px;
    color: var(--silver-dim);
    margin-top: 2px;
}

/* 菜单 */
.site-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.site-menu-item {
    position: relative;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #c9cbcf;
    font-family: var(--font-sans);
    font-size: 15px;
    letter-spacing: 4px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.site-menu-item::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%) scaleX(0);
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold-bright), var(--gold));
    box-shadow: 0 0 8px var(--gold-glow);
    transition: transform 0.35s ease;
}

.site-menu-item:hover { color: var(--white); }
.site-menu-item.active { color: var(--gold-bright); }
.site-menu-item.active::after { transform: translateX(-50%) scaleX(1); }

/* 右侧描边装饰按钮 */
.deco-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--gold-bright);
    background: transparent;
    color: var(--gold-soft);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.deco-btn:hover {
    background: rgba(212, 175, 55, 0.12);
    box-shadow: 0 0 16px var(--gold-glow);
}

/* ---- 页面显隐（page = 落地首页；module = 功能页） ---- */
.page { display: none; }

.page.active {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-deep) transparent;
}

/* 功能页在宽屏下收窄居中，保持精致阅读感 */
.module.active {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

/* ---- 落地首页：左 Hero + 右卡片网格 ---- */
.home-inner {
    display: grid;
    grid-template-columns: 40fr 60fr;
    gap: 48px;
    align-items: center;
    width: 100%;
    min-height: 100%;
    padding: 40px 12px 48px;
}

.hero {
    position: relative;
    padding: 8px 12px;
}

.hero-kicker {
    font-size: 13px;
    letter-spacing: 8px;
    color: var(--gold-soft);
    margin-bottom: 22px;
}

.hero-kicker::before {
    content: '';
    display: inline-block;
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, var(--gold-bright), transparent);
    vertical-align: middle;
    margin-right: 12px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(44px, 5.4vw, 76px);
    font-weight: 900;
    line-height: 1.18;
    color: #f5f1e6;
    letter-spacing: 6px;
    text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
}

.hero-sub {
    font-family: var(--font-serif);
    font-size: 18px;
    letter-spacing: 10px;
    color: var(--gold-soft);
    margin-bottom: 18px;
}

.hero-desc {
    font-size: 14px;
    line-height: 2;
    letter-spacing: 2px;
    color: #b9b7ad;
    max-width: 340px;
}

.hero-seal {
    position: absolute;
    right: 10px;
    bottom: 4px;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 26px;
    color: rgba(212, 175, 55, 0.5);
    transform: rotate(-6deg);
    opacity: 0.8;
}

.home-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.land-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    min-height: 168px;
    padding: 26px 24px;
    text-align: left;
    background: rgba(20, 18, 14, 0.62);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.35s ease;
    overflow: hidden;
}

.land-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 0%, rgba(212, 175, 55, 0.1), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.land-card:hover {
    border-color: var(--gold-bright);
    transform: translateY(-4px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.18);
}

.land-card:hover::before { opacity: 1; }
.land-card:active { transform: translateY(-1px) scale(0.99); }

.land-no {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gold);
    font-family: var(--font-serif);
}

.land-ico {
    font-size: 30px;
    color: var(--gold-bright);
    text-shadow: 0 0 16px var(--gold-glow);
    line-height: 1;
}

.land-name {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #f5f1e6;
    margin-top: 2px;
}

.land-desc {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--silver-dim);
}

.land-enter {
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--gold-soft);
}

/* 金色渐变 CTA 通栏卡 */
.cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 20px 26px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(120deg, #8a6a1f 0%, #d4af37 45%, #f0d97c 100%);
    box-shadow: 0 16px 40px rgba(160, 130, 40, 0.28);
    cursor: pointer;
    text-align: left;
    transition: all 0.35s ease;
}

.cta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 52px rgba(160, 130, 40, 0.4);
}

.cta-card:active { transform: translateY(-1px) scale(0.99); }

.cta-text { display: flex; flex-direction: column; gap: 4px; }

.cta-label {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 5px;
    color: #211a08;
}

.cta-sub {
    font-size: 12px;
    letter-spacing: 2px;
    color: rgba(33, 26, 8, 0.78);
}

.cta-go {
    font-family: var(--font-serif);
    font-size: 16px;
    letter-spacing: 3px;
    color: #211a08;
    white-space: nowrap;
    border: 1px solid rgba(33, 26, 8, 0.45);
    border-radius: 999px;
    padding: 9px 18px;
    transition: all 0.3s ease;
}

.cta-card:hover .cta-go {
    background: rgba(33, 26, 8, 0.1);
    border-color: #211a08;
}

/* ---- 窄屏适配：单列卡片、Hero 收敛、导航横向滚动 ---- */
@media (max-width: 860px) {
    .home-inner {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 24px 4px 36px;
    }
    .hero { text-align: center; padding: 16px 6px 0; }
    .hero-kicker::before { display: none; }
    .hero-title { font-size: clamp(34px, 9vw, 46px); letter-spacing: 4px; }
    .hero-sub { font-size: 15px; letter-spacing: 6px; }
    .hero-desc { margin: 0 auto; }
    .hero-seal { display: none; }
    .card-grid { grid-template-columns: 1fr; gap: 14px; }
    .land-card { min-height: 0; padding: 22px 20px; }
    .cta-card { flex-direction: column; align-items: flex-start; padding: 18px 20px; }
    .cta-go { align-self: flex-end; }
}

@media (max-width: 600px) {
    #app { padding: 76px 14px 0; }
    .site-nav-inner { height: 56px; padding: 0 14px; gap: 10px; }
    .badge-core { width: 34px; height: 34px; font-size: 18px; }
    .badge-text { font-size: 17px; letter-spacing: 4px; }
    .badge-text em { display: none; }
    .site-menu { overflow-x: auto; scrollbar-width: none; gap: 0; }
    .site-menu::-webkit-scrollbar { display: none; }
    .site-menu-item { padding: 10px 12px; font-size: 13px; letter-spacing: 2px; flex-shrink: 0; }
    .deco-btn { width: 34px; height: 34px; font-size: 15px; }
    .module.active { max-width: 100%; }
}

/* ============================================================
   Ink Scene · 简约水墨风景背景
   纯内联 SVG + CSS 渐变 / 伪层实现，完全离线，无外链图片
   ============================================================ */
body {
    background: #131009;
}

.ink-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.ink-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* 明月：CSS 响应式层（竖屏 slice 裁剪时不受影响） */
.ink-moon {
    position: absolute;
    top: 15%;
    right: 12%;
    width: 94px;
    height: 94px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, #fff6d8 0%, #f3e6bd 54%, #e0cd93 80%, rgba(224,205,147,0.20) 100%);
    box-shadow:
        0 0 34px 12px rgba(226,207,150,0.24),
        0 0 110px 42px rgba(226,207,150,0.10);
    opacity: 0.94;
}

/* 水面倒影 */
.ink-reflection {
    position: absolute;
    right: 16.4%;
    bottom: 10%;
    width: 96px;
    height: 15px;
    border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(232,217,168,0.55), rgba(232,217,168,0) 75%);
    filter: blur(1px);
    box-shadow: 0 6px 18px 4px rgba(232,217,168,0.16);
}

/* 近水雾霭：贴近水面的淡墨雾带 */
.ink-water-fog {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20%;
    background: linear-gradient(180deg, rgba(185,177,155,0) 0%, rgba(130,126,110,0.10) 55%, rgba(96,94,84,0.18) 100%);
    pointer-events: none;
}

/* 云雾层：淡墨雾霭缓漂 */
.ink-mist {
    position: absolute;
    left: -18%;
    width: 136%;
    height: 55%;
    border-radius: 50%;
    filter: blur(8px);
    pointer-events: none;
}
.ink-mist.m1 {
    top: 30%;
    background: radial-gradient(50% 42% at 50% 50%, rgba(212,207,192,0.10), transparent 70%);
    animation: inkDrift 34s ease-in-out infinite alternate;
}
.ink-mist.m2 {
    top: 46%;
    background: radial-gradient(44% 36% at 50% 50%, rgba(192,186,168,0.12), transparent 70%);
    animation: inkDrift 46s ease-in-out infinite alternate-reverse;
}
.ink-mist.m3 {
    top: 62%;
    background: radial-gradient(52% 34% at 50% 50%, rgba(150,145,128,0.10), transparent 70%);
    animation: inkDrift 58s ease-in-out infinite alternate;
}

@keyframes inkDrift {
    0%   { transform: translateX(0) scaleX(1); }
    50%  { transform: translateX(5%) scaleX(1.05); }
    100% { transform: translateX(-3%) scaleX(0.97); }
}

/* 留白暗角：中心上移，弱化对山水的压制，保证前景内容可读 */
.ink-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(115% 92% at 50% 30%, rgba(10,8,6,0) 52%, rgba(8,6,4,0.22) 84%, rgba(6,5,3,0.46) 100%);
    pointer-events: none;
}

/* 窄屏 / 竖屏适配：月亮与倒影居中并缩小；山体放大上移露出主峰；前景卡片半透明透景 */
@media (max-width: 700px) {
    .ink-svg {
        transform: scaleY(1.16) translateY(7%);
        transform-origin: 50% 100%;
    }
    .ink-moon {
        top: 10%;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        width: 78px;
        height: 78px;
    }
    .ink-reflection {
        bottom: 8%;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 66px;
        height: 11px;
    }
    .ink-mist.m1 { top: 26%; }
    .ink-mist.m2 { top: 42%; }
    .land-card, .cta-card {
        background: rgba(18, 16, 12, 0.42);
    }
    #site-nav {
        background: linear-gradient(180deg, #121110 0%, #0f0d0b 100%);
    }
    .site-menu-item {
        color: #e8e6e2;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    }
}

/* ============================================================
   周公解梦模块
   ============================================================ */
#module-dream {
    justify-content: flex-start;
    align-items: center;
}

.dream-box {
    width: 100%;
    max-width: 620px;
    margin: 8px auto 26px;
}

.dream-search {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

#dream-input {
    flex: 1;
    min-width: 0;
    padding: 11px 16px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 8px;
    background: rgba(20, 18, 14, 0.6);
    color: #e8e6e2;
    font-size: 14px;
    font-family: var(--font-sans);
    letter-spacing: 1px;
    outline: none;
    transition: border-color .25s ease, box-shadow .25s ease;
}
#dream-input::placeholder { color: var(--silver-dim); }
#dream-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

#dream-btn {
    flex-shrink: 0;
    padding: 10px 24px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    background: linear-gradient(160deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.06));
    color: var(--gold-soft);
    font-family: var(--font-serif);
    font-size: 14px;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all .25s ease;
}
#dream-btn:hover { background: linear-gradient(160deg, rgba(212, 175, 55, 0.38), rgba(212, 175, 55, 0.12)); }
#dream-btn:active { transform: translateY(1px); }

.dream-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 18px;
}

.dream-cat-chip {
    padding: 6px 14px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 999px;
    background: rgba(20, 18, 14, 0.55);
    color: var(--silver-dim);
    font-size: 12px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all .25s ease;
}
.dream-cat-chip:hover { color: var(--gold-soft); border-color: var(--gold); }
.dream-cat-chip.active {
    color: #101010;
    background: linear-gradient(135deg, var(--gold), #f4d47f);
    border-color: var(--gold);
    font-weight: 600;
}

.dream-hint {
    text-align: center;
    color: var(--silver-dim);
    font-size: 12px;
    letter-spacing: 2px;
    padding: 28px 0;
}

.dream-count {
    text-align: center;
    color: var(--silver-dim);
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.dream-result-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dream-item {
    padding: 14px 18px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-left: 3px solid var(--gold-deep);
    border-radius: 8px;
    background: rgba(20, 18, 14, 0.62);
    transition: border-color .25s ease, transform .25s ease;
}
.dream-item:hover { border-color: rgba(212, 175, 55, 0.45); }

.dream-item-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}
.dream-item-name {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold-soft);
}
.dream-item-cat {
    font-size: 11px;
    color: var(--silver-dim);
    letter-spacing: 1px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 999px;
    padding: 1px 8px;
}
.dream-item-text {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(232, 230, 226, 0.88);
    letter-spacing: .5px;
}

.dream-empty {
    text-align: center;
    color: var(--silver-dim);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 30px 0;
}

@media (max-width: 700px) {
    .dream-box { margin: 4px auto 20px; }
    .dream-search { flex-direction: column; gap: 8px; }
    #dream-btn { width: 100%; padding: 11px; }
    .dream-cats { gap: 6px; }
    .dream-cat-chip { padding: 5px 11px; font-size: 11px; }
    .dream-item { padding: 12px 14px; }
}

/* ============================================================
   八字命理模块（黑金风格 · 与六爻/解梦等模块统一）
   ============================================================ */
#bazi-stage { max-width: 960px; margin: 0 auto; padding: 10px 10px 60px; }

.bazi-mode {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}
.bazi-mode-btn {
    padding: 9px 26px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 999px;
    background: rgba(20, 18, 14, 0.55);
    color: var(--silver-dim);
    font-family: var(--font-serif);
    font-size: 13px;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all .25s ease;
}
.bazi-mode-btn:hover { color: var(--gold-soft); border-color: var(--gold); }
.bazi-mode-btn.active {
    color: #101010;
    background: linear-gradient(135deg, var(--gold), #f4d47f);
    border-color: var(--gold);
    font-weight: 700;
}

.bazi-form {
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-left: 3px solid var(--gold-deep);
    border-radius: 8px;
    background: rgba(20, 18, 14, 0.62);
    padding: 14px 16px 16px;
    margin-bottom: 14px;
}
.bazi-form-title {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold-soft);
    margin-bottom: 12px;
}
.bazi-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.bazi-field {
    flex: 1 1 30%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
}
.bazi-field > span {
    font-size: 11px;
    color: var(--silver-dim);
    letter-spacing: 1px;
}
.bazi-field input,
.bazi-field select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 6px;
    background: rgba(10, 9, 7, 0.6);
    color: var(--gold-soft);
    font-size: 13px;
    outline: none;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.bazi-field input::placeholder { color: rgba(232, 230, 226, 0.3); }
.bazi-field input:focus,
.bazi-field select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.bazi-field select option { background: #14120e; color: var(--gold-soft); }

.bazi-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 4px 0 20px;
}
#bazi-btn {
    padding: 12px 40px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    background: linear-gradient(160deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.07));
    color: var(--gold-soft);
    font-family: var(--font-serif);
    font-size: 15px;
    letter-spacing: 6px;
    cursor: pointer;
    transition: all .25s ease;
}
#bazi-btn:hover { background: linear-gradient(160deg, rgba(212, 175, 55, 0.4), rgba(212, 175, 55, 0.13)); }
#bazi-btn:active { transform: translateY(1px); }

.bazi-empty {
    text-align: center;
    color: var(--silver-dim);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 30px 0;
}

.bazi-result-box {
    margin-top: 6px;
    animation: baziFade .45s ease;
}
@keyframes baziFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.bazi-result-title {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--gold-soft);
    margin: 6px 0 16px;
}
.bazi-zodiac {
    display: inline-block;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--silver-dim);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 999px;
    padding: 3px 10px;
    vertical-align: middle;
}

.bazi-pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.bazi-pillar {
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 8px;
    background: rgba(20, 18, 14, 0.62);
    text-align: center;
    padding: 12px 6px;
    transition: border-color .25s ease;
}
.bazi-pillar:hover { border-color: rgba(212, 175, 55, 0.45); }
.bazi-pillar-day { border-color: rgba(212, 175, 55, 0.5); box-shadow: inset 0 0 22px rgba(212, 175, 55, 0.06); }
.bazi-pillar-title {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--silver-dim);
    margin-bottom: 8px;
}
.bazi-pillar-cell {
    font-family: var(--font-serif);
    font-size: 26px;
    line-height: 1.15;
}
.bazi-pillar-cell em {
    display: block;
    font-style: normal;
    font-size: 11px;
    color: var(--silver-dim);
    letter-spacing: 1px;
    margin-top: 2px;
}
.bazi-pillar-gan { color: var(--gold-soft); }
.bazi-pillar-zhi { color: #e8e6e2; margin-top: 8px; }
.bazi-pillar-tg {
    display: inline-block;
    margin-top: 8px;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--gold-soft);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 999px;
    padding: 1px 8px;
}

.bazi-section {
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-left: 3px solid var(--gold-deep);
    border-radius: 8px;
    background: rgba(20, 18, 14, 0.62);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.bazi-section-title {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--gold-soft);
    margin-bottom: 12px;
}

.bazi-wxbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.bazi-wxbar-name {
    flex: 0 0 26px;
    font-size: 12px;
    color: var(--gold-soft);
    letter-spacing: 1px;
}
.bazi-wxbar-track {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.bazi-wxbar-track i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.bazi-wxbar-pct {
    flex: 0 0 40px;
    text-align: right;
    font-size: 11px;
    color: var(--silver-dim);
}
.bazi-wxbar-missing {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.bazi-missing-chip {
    font-size: 11px;
    letter-spacing: 1px;
    color: #101010;
    background: linear-gradient(135deg, var(--gold), #f4d47f);
    border-radius: 999px;
    padding: 2px 10px;
}
.bazi-missing-none {
    color: var(--gold-soft);
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 1px 10px;
}

.bazi-daymaster {
    font-size: 13px;
    line-height: 1.9;
    color: rgba(232, 230, 226, 0.9);
    letter-spacing: .5px;
}
.bazi-daymaster b { color: var(--gold-soft); font-size: 15px; }

.bazi-tengod-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.bazi-tengod-chip {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--silver-dim);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 999px;
    padding: 3px 10px;
}

.bazi-fortune {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.bazi-fortune-card {
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 8px;
    background: rgba(20, 18, 14, 0.62);
    padding: 14px 15px;
    transition: border-color .25s ease, transform .25s ease;
}
.bazi-fortune-card:hover { border-color: rgba(212, 175, 55, 0.45); transform: translateY(-2px); }
.bazi-fortune-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--gold-soft);
    margin-bottom: 9px;
}
.bazi-fortune-tag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #f4d47f);
    color: #101010;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bazi-fortune-text {
    font-size: 12.5px;
    line-height: 1.85;
    color: rgba(232, 230, 226, 0.86);
    letter-spacing: .3px;
}

/* 合婚 */
.bazi-hh-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 6px 0 14px;
}
.bazi-hh-score-num {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 900;
    border: 2px solid;
}
.bazi-hh-score-num.top { color: var(--gold-soft); border-color: var(--gold); background: rgba(212, 175, 55, 0.12); }
.bazi-hh-score-num.mid { color: #e8e6e2; border-color: rgba(212, 175, 55, 0.5); background: rgba(212, 175, 55, 0.07); }
.bazi-hh-score-num.low { color: #c98a8a; border-color: rgba(201, 122, 105, 0.55); background: rgba(201, 122, 105, 0.08); }
.bazi-hh-score-level {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--gold-soft);
}
.bazi-hh-score-desc {
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
    color: rgba(232, 230, 226, 0.9);
    letter-spacing: .5px;
    padding: 0 16px 14px;
}

.bazi-hh-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.16);
    font-size: 13px;
}
.bazi-hh-row:last-child { border-bottom: none; }
.bazi-hh-label {
    flex: 1 1 30%;
    color: var(--silver-dim);
    font-size: 12px;
    letter-spacing: 1px;
}
.bazi-hh-a, .bazi-hh-b { flex: 1 1 28%; text-align: center; color: var(--gold-soft); }
.bazi-hh-vs { color: var(--silver-dim); font-size: 11px; }

.bazi-hh-lines {
    list-style: none;
    padding: 0;
    margin: 0;
}
.bazi-hh-lines li {
    display: flex;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.8;
    color: rgba(232, 230, 226, 0.88);
    padding: 5px 0;
}
.bazi-hh-lines li.plus .bazi-hh-pts { color: #9fbf8f; }
.bazi-hh-lines li.minus .bazi-hh-pts { color: #c98a8a; }
.bazi-hh-pts { flex: 0 0 34px; font-weight: 700; }

/* 格局 · 用神 · 调候（典籍理论段） */
.bazi-theory .bazi-section-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.bazi-theory-sub { font-size: 11px; color: var(--silver-dim); letter-spacing: 1px; font-weight: 400; }
.bazi-theory-line {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 9px 4px; border-bottom: 1px dashed rgba(212, 175, 55, 0.16);
    font-size: 13px; line-height: 1.75; color: #cfccc5;
}
.bazi-theory-line:last-of-type { border-bottom: none; }
.bazi-theory-tag {
    flex: 0 0 40px; text-align: center;
    padding: 1px 0; margin-top: 2px;
    font-size: 12px; letter-spacing: 2px; color: var(--gold-soft);
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.07);
    border-radius: 3px;
}
.bazi-theory-line b { color: var(--gold-soft); font-weight: 600; }
.bazi-theory-div { color: rgba(212, 175, 55, 0.35); margin: 0 4px; }
.bazi-theory-summary {
    margin-top: 8px; padding: 10px 12px;
    border-left: 3px solid var(--gold);
    background: rgba(212, 175, 55, 0.06);
    color: #e6e1d6; font-size: 13px; line-height: 1.8;
}

/* 典籍参考区 */
.bazi-books {
    margin-top: 18px; padding: 16px 18px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.05), rgba(0, 0, 0, 0.15));
    border-radius: 10px;
}
.bazi-books-title {
    font-size: 16px; letter-spacing: 3px; color: var(--gold-soft);
    padding-bottom: 10px; margin-bottom: 14px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}
.bazi-books-title em { font-style: normal; font-size: 11px; letter-spacing: 1px; color: var(--silver-dim); margin-left: 6px; }
.bazi-book-group { margin-bottom: 16px; }
.bazi-book-group:last-child { margin-bottom: 0; }
.bazi-book-group-name {
    display: inline-block;
    font-size: 12px; letter-spacing: 3px; color: #14120e;
    background: var(--gold-soft);
    padding: 3px 12px; margin-bottom: 8px;
    border-radius: 2px;
}
.bazi-book {
    display: flex; flex-direction: column; gap: 2px;
    padding: 9px 10px; border-radius: 6px;
    border-left: 2px solid rgba(212, 175, 55, 0.35);
    background: rgba(255, 255, 255, 0.02);
    transition: background .2s ease;
}
.bazi-book + .bazi-book { margin-top: 6px; }
.bazi-book:hover { background: rgba(212, 175, 55, 0.06); border-left-color: var(--gold); }
.bazi-book-name { font-size: 13.5px; color: var(--gold-soft); font-weight: 600; letter-spacing: 1px; }
.bazi-book-desc { font-size: 12.5px; line-height: 1.7; color: #b9b5ac; }

@media (max-width: 700px) {
    #bazi-stage { padding: 4px 6px 50px; }
    .bazi-mode { gap: 8px; }
    .bazi-mode-btn { flex: 1; padding: 9px 8px; font-size: 12px; letter-spacing: 1px; }
    .bazi-field-row { gap: 8px; }
    .bazi-field { flex: 1 1 45%; min-width: 0; }
    .bazi-pillars { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .bazi-fortune { grid-template-columns: 1fr; gap: 10px; }
    .bazi-hh-score { flex-direction: column; gap: 8px; }
    .bazi-hh-row { flex-wrap: wrap; }
    .bazi-hh-label { flex: 1 1 100%; }
    .bazi-hh-a, .bazi-hh-b { flex: 1 1 42%; }
    #bazi-btn { width: 100%; letter-spacing: 4px; }
    .bazi-theory-line { flex-wrap: wrap; gap: 6px; padding: 8px 2px; }
    .bazi-theory-tag { flex: 0 0 auto; padding: 1px 8px; }
    .bazi-theory-summary { font-size: 12.5px; }
    .bazi-books { padding: 12px 12px; margin-top: 14px; }
    .bazi-books-title { font-size: 15px; }
    .bazi-book { padding: 8px 9px; }
    .bazi-book-name { font-size: 13px; }
    .bazi-book-desc { font-size: 12px; }
}
