/* ===== 全局基础样式 ===== */
:root {
    --bg-dark: #0a0a1a;
    --bg-card: rgba(15, 12, 35, 0.92);
    --gold: #d4af37;
    --gold-light: #e8d5a3;
    --gold-dim: rgba(212, 175, 55, 0.3);
    --cyan: #4af0e0;
    --cyan-dim: rgba(74, 240, 224, 0.2);
    --purple: #8b5cf6;
    --text-primary: #e0d5c0;
    --text-secondary: #9a8a6a;
    --text-dim: #5a4a3a;
    --border-gold: rgba(212, 175, 55, 0.25);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.15);
    --font-title: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    --font-body: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    /* 五行色彩 */
    --wx-jin: #fbbf24;
    --wx-mu: #4ade80;
    --wx-shui: #60a5fa;
    --wx-huo: #f87171;
    --wx-tu: #a78bfa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 自定义滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.4);
}
::-webkit-scrollbar-corner {
    background: transparent;
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.2) transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    overflow: hidden;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== 应用切换列 ===== */
.app-column {
    display: none;
}

/* ===== 移动端顶部导航 ===== */
.mobile-nav-bar {
    display: none;
}
@media (max-width: 767px) {
    #app {
        display: flex;
        flex-direction: column;
    }
    .page-container {
        flex: 1;
        min-height: 0;
    }
    .mobile-nav-bar {
        display: flex;
        align-items: center;
        height: 44px;
        padding: 5px 9px;
        background: rgba(8, 6, 20, 0.98);
        border-bottom: 1px solid var(--border-gold);
        flex-shrink: 0;
        z-index: 80;
    }
    .mobile-nav-bar.hidden { display: none; }
    .mobile-app-trigger {
        width: 100%;
        min-width: 0;
        height: 34px;
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 0 2px 0 0;
        border: 1px solid rgba(212,175,55,.28);
        border-radius: 8px;
        background: linear-gradient(90deg, rgba(15,12,35,.88), rgba(34,211,238,.06));
        color: var(--gold-light);
        cursor: pointer;
        font-family: var(--font-body);
        text-align: left;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
        transition: border-color .18s, background .18s;
    }
    .mobile-app-trigger:active {
        border-color: var(--gold);
        background: linear-gradient(90deg, rgba(212,175,55,.14), rgba(34,211,238,.08));
    }
    .mobile-app-trigger-icon {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--gold);
        border-right: 1px solid rgba(212,175,55,.18);
        flex-shrink: 0;
    }
    .mobile-app-trigger-copy {
        min-width: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 1px;
    }
    .mobile-app-trigger-label {
        color: var(--text-dim);
        font-size: 9px;
        line-height: 1;
        letter-spacing: 0;
    }
    .mobile-app-trigger-copy strong {
        min-width: 0;
        color: var(--gold-light);
        font-size: 14px;
        line-height: 1.15;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-app-trigger-menu {
        width: 32px;
        color: var(--cyan);
        text-align: center;
        font-size: 14px;
        flex-shrink: 0;
    }
    .mobile-nav-tab {
        display: none;
        flex: 1;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 13px;
        color: var(--text-secondary);
        cursor: pointer;
        border-bottom: 2px solid transparent;
        transition: all .2s;
        letter-spacing: 1px;
    }
    .mobile-nav-tab.active {
        color: var(--gold);
        border-bottom-color: var(--gold);
    }
    .mobile-nav-tab i { font-size: 14px; }
    .mobile-app-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 240;
        background: rgba(2, 3, 10, .66);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
    }
    .mobile-app-drawer {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 241;
        width: min(320px, 86vw);
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 14px;
        background:
            radial-gradient(circle at 22% 0%, rgba(212,175,55,.16), transparent 34%),
            linear-gradient(180deg, rgba(10,10,26,.98), rgba(5,4,13,.98));
        border-right: 1px solid rgba(212,175,55,.34);
        box-shadow: 18px 0 44px rgba(0,0,0,.56);
        transform: translateX(-104%);
        transition: transform .26s cubic-bezier(.16, 1, .3, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #app.mobile-app-drawer-open .mobile-app-drawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    #app.mobile-app-drawer-open .mobile-app-drawer {
        transform: translateX(0);
    }
    .mobile-app-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 4px 0 12px;
        border-bottom: 1px solid rgba(212,175,55,.2);
    }
    .mobile-app-drawer-head span {
        display: block;
        color: var(--cyan);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0;
    }
    .mobile-app-drawer-head strong {
        display: block;
        margin-top: 3px;
        color: var(--gold-light);
        font-family: var(--font-title);
        font-size: 22px;
        letter-spacing: 0;
    }
    .mobile-app-drawer-close {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        border: 1px solid rgba(212,175,55,.28);
        border-radius: 8px;
        background: rgba(255,255,255,.03);
        color: var(--gold-light);
        cursor: pointer;
    }
    .mobile-app-drawer-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .mobile-app-drawer-item {
        width: 100%;
        min-height: 52px;
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) 18px;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border: 1px solid rgba(212,175,55,.18);
        border-radius: 8px;
        background: rgba(255,255,255,.025);
        color: var(--text-primary);
        cursor: pointer;
        text-align: left;
        font-family: var(--font-body);
    }
    .mobile-app-drawer-item.active {
        border-color: rgba(212,175,55,.72);
        background: linear-gradient(90deg, rgba(212,175,55,.14), rgba(34,211,238,.08));
        box-shadow: inset 3px 0 0 var(--gold);
    }
    .mobile-app-drawer-item-icon {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: rgba(212,175,55,.08);
        color: var(--gold);
        font-size: 16px;
    }
    .mobile-app-drawer-item-copy {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    .mobile-app-drawer-item-copy strong {
        color: var(--gold-light);
        font-size: 15px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-app-drawer-item-copy span {
        color: var(--text-secondary);
        font-size: 11px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-app-drawer-item-check {
        color: var(--cyan);
        opacity: 0;
        font-size: 12px;
    }
    .mobile-app-drawer-item.active .mobile-app-drawer-item-check {
        opacity: 1;
    }
}
@media (min-width: 768px) {
    .mobile-nav-bar,
    .mobile-app-drawer-backdrop,
    .mobile-app-drawer {
        display: none !important;
    }
}
.app-column-header {
    padding: 14px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-gold);
    flex-shrink: 0;
}
.app-column-logo {
    font-size: 18px;
    color: var(--gold);
}
.app-column-list {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}
.app-column-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 6px auto;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    transition: all .2s;
    border-left: 2px solid transparent;
}
.app-column-item:hover {
    color: var(--text-primary);
    background: rgba(212, 175, 55, .06);
}
.app-column-item.active {
    color: var(--gold);
    background: rgba(212, 175, 55, .1);
    border-left-color: var(--gold);
}

/* ===== 左侧历史排盘栏 ===== */
.sidebar-history {
    display: none;
}

.page-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ===== 页面切换 ===== */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* ===== 天机点明细页 ===== */
.token-page { padding: 20px; max-width: 500px; margin: 0 auto; width: 100%; }
.token-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.token-header h2 { font-size: 18px; color: var(--gold); letter-spacing: 1px; }
.token-back { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all .2s; }
.token-back:hover { color: var(--gold); background: rgba(212,175,55,.08); }
.token-balance-card { background: linear-gradient(135deg, rgba(212,175,55,.12), rgba(212,175,55,.04)); border: 1px solid var(--border-gold); border-radius: 14px; padding: 20px; text-align: center; margin-bottom: 20px; }
.token-balance-label { font-size: 12px; color: var(--text-secondary); letter-spacing: 1px; }
.token-balance-value { font-size: 36px; font-weight: 700; color: var(--gold); margin: 6px 0; }
.token-balance-total { font-size: 12px; color: var(--text-dim); }
.token-balance-total span { color: var(--text-secondary); }
.token-list { display: flex; flex-direction: column; gap: 1px; }
.token-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: rgba(15,12,35,.6); border-radius: 8px; }
.token-item-left { display: flex; flex-direction: column; gap: 2px; }
.token-action { font-size: 14px; color: var(--text-primary); }
.token-detail { font-size: 11px; color: var(--text-dim); }
.token-time { font-size: 11px; color: var(--text-dim); }
.token-cost { font-size: 15px; font-weight: 600; color: #f87171; white-space: nowrap; }
.token-cost.token-refund { color: #4ade80; }
.token-cost-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.token-cny { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.token-empty { text-align: center; color: var(--text-dim); padding: 40px 0; font-size: 13px; }
.token-load-more { text-align: center; padding: 14px; color: var(--gold); font-size: 13px; cursor: pointer; border: 1px solid var(--border-gold); border-radius: 8px; margin-top: 12px; transition: all .2s; }
.token-load-more:hover { background: rgba(212,175,55,.08); }
.token-load-more.hidden { display: none; }

/* 页面切换退出动画 */
.page.slide-out-left {
    transform: translateX(-30%);
    opacity: 0;
    pointer-events: none;
}
.page.slide-out-right {
    transform: translateX(30%);
    opacity: 0;
    pointer-events: none;
}

/* 页面切换进入动画（从偏移位置恢复到中心） */
.page.slide-in-left {
    transform: translateX(-30%);
    opacity: 0;
}
.page.slide-in-right {
    transform: translateX(30%);
    opacity: 0;
}
.page.active:not(.slide-in-left):not(.slide-in-right):not(.slide-out-left):not(.slide-out-right) {
    transform: translateX(0);
    opacity: 1;
}

/* ===== 欢迎页 ===== */
#welcomePage {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 30px;
}

.welcome-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.welcome-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-cards {
    display: none;
}

.logo-container {
    margin-bottom: 30px;
}

.bagua-symbol {
    font-size: 72px;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

.title {
    font-family: var(--font-title);
    font-size: 36px;
    color: var(--gold);
    letter-spacing: 8px;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 4px;
    margin-top: 8px;
}

.welcome-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 25px 0;
    gap: 15px;
}

.welcome-divider::before,
.welcome-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.divider-icon {
    color: var(--gold);
    font-size: 18px;
}

.welcome-text {
    font-size: 15px;
    line-height: 2;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.welcome-app-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.welcome-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 22px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    min-width: 100px;
    transition: border-color 0.3s, background 0.3s;
}

.welcome-app-item:hover {
    border-color: var(--gold-dim);
    background: rgba(212,175,55,0.06);
}

.welcome-app-item i {
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 4px;
}

.welcome-app-item span {
    font-size: 14px;
    color: var(--text-primary);
    font-family: var(--font-title);
}

.welcome-app-item small {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ===== 通用按钮 ===== */
.btn-immortal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 40px;
    font-size: 16px;
    font-family: var(--font-title);
    color: var(--gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border: 1px solid var(--gold-dim);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn-immortal:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.1));
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-immortal:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 18px;
}

/* ===== 排盘展示 ===== */
.chart-container {
    padding: 20px;
    position: relative;
    z-index: 2;
}

.chart-header {
    text-align: center;
    margin-bottom: 25px;
}

.chart-header h2 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 22px;
    letter-spacing: 4px;
}

.chart-name {
    color: var(--text-secondary);
    margin-top: 5px;
    font-size: 14px;
}

/* 四柱展示 */
.four-pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.pillar {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 15px 8px;
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    min-width: 0;
}
.pillar.revealed {
    animation: pillarReveal 0.4s ease-out forwards;
}
@keyframes pillarReveal {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.pillar-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.pillar-extra {
    display: none;
}

.pillar-gan {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--gold);
    margin-bottom: 5px;
}

.pillar-zhi {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--cyan);
}

/* 地势/自坐（十二长生）—— 排盘深度信息 */
.pillar-dishi {
    font-size: 11px;
    color: var(--gold-light);
    margin-top: 6px;
    letter-spacing: 0.5px;
    line-height: 1.4;
    overflow-wrap: break-word;
}

/* 五行统计条 */
.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.detail-section h3 {
    color: var(--gold-light);
    font-size: 14px;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

/* 命盘要素卡片：空亡/胎元/胎息/命宫/身宫（lunar 原生计算） */
.life-elem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}
.life-elem-item {
    background: rgba(8, 6, 22, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.life-elem-label {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}
.life-elem-value {
    font-family: var(--font-title);
    font-size: 16px;
    color: var(--gold);
}
.life-elem-nayin {
    font-size: 10px;
    color: var(--text-dim);
    font-style: italic;
}
.life-elem-kongwang .life-elem-value {
    color: var(--purple);
}

.wuxing-bar {
    display: flex;
    gap: 8px;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
}

.wuxing-detail {
    display: none;
}

.wuxing-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.wuxing-item.jin { background: linear-gradient(135deg, #c9a44a, var(--wx-jin)); color: #1a1a2e; }
.wuxing-item.mu { background: linear-gradient(135deg, #2d8a4e, var(--wx-mu)); color: #1a1a2e; }
.wuxing-item.shui { background: linear-gradient(135deg, #2563eb, var(--wx-shui)); color: #fff; }
.wuxing-item.huo { background: linear-gradient(135deg, #dc2626, var(--wx-huo)); color: #fff; }
.wuxing-item.tu { background: linear-gradient(135deg, #7c3aed, var(--wx-tu)); color: #fff; }

/* 大运时间线 - 移动端隐藏 */
.dayun-section {
    display: none;
}

/* 命局概览 */
.chart-overview {
    display: none;
}
.overview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.overview-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 6px;
    letter-spacing: 1px;
}
.overview-tag.strength-身强, .overview-tag.strength-偏旺 {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #f87171;
}
.overview-tag.strength-身弱, .overview-tag.strength-偏弱 {
    background: rgba(74, 240, 224, 0.12);
    border: 1px solid rgba(74, 240, 224, 0.25);
    color: #4af0e0;
}
.overview-tag.strength-中和 {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--gold);
}
.overview-tag.pattern {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}
.overview-tag.yongshen, .overview-tag.wuxing-yong {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.25);
    color: #4ade80;
}
.overview-tag.jishen {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
}
.overview-tag.shensha {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    font-size: 12px;
    padding: 3px 10px;
}

/* 流年卡片 - 移动端简单横滑 */
.liunian-section {
    display: none;
}
.liunian-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}
.liunian-card {
    flex-shrink: 0;
    text-align: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    min-width: 90px;
}
.liunian-card.current {
    border-color: var(--gold-dim);
    background: rgba(212, 175, 55, 0.08);
}
.liunian-card-year {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.liunian-card.current .liunian-card-year {
    color: var(--gold);
    font-weight: bold;
}
.liunian-card-gz {
    font-family: var(--font-title);
    font-size: 18px;
    color: var(--gold);
}
.liunian-card-info {
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 3px;
}
.liunian-card-nayin {
    font-size: 10px;
    color: var(--text-dim);
}
.liunian-card-dayun {
    font-size: 10px;
    color: var(--purple);
    margin-top: 3px;
}

/* 排盘操作按钮 */
.chart-actions {
    text-align: center;
    margin-top: 20px;
}

/* ===== 报告页 ===== */
.report-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.report-toc {
    display: none;
}

.report-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 2;
    width: 100%;
}

.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-gold);
}

.report-header h2 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 18px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* 报告操作栏：图标+文字按钮，分组排列，移动端自动换行 */
.report-action-bar {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.report-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--gold);
    font-size: 12px;
    padding: 6px 11px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}
.report-action-btn i { font-size: 12px; }
.report-action-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}
.report-action-btn.primary {
    background: rgba(168, 85, 247, 0.16);
    border-color: rgba(168, 85, 247, 0.4);
    color: #c4b5fd;
}
.report-action-btn.primary:hover {
    background: rgba(168, 85, 247, 0.28);
}
.report-action-btn.ghost {
    background: transparent;
    border-color: rgba(212, 175, 55, 0.18);
    color: var(--text-secondary, #9999aa);
}
.report-action-btn.ghost:hover {
    color: var(--gold);
    border-color: rgba(212, 175, 55, 0.4);
}
.report-action-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(212, 175, 55, 0.18);
    margin: 2px 3px;
}
@media (max-width: 768px) {
    .report-header { flex-wrap: wrap; gap: 8px; }
    .report-header h2 { order: -1; width: 100%; text-align: center; font-size: 16px; }
    .report-action-bar { width: 100%; justify-content: center; }
    .report-action-btn { font-size: 11px; padding: 5px 8px; }
}

.report-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.report-content h1 {
    color: var(--gold);
    font-size: 20px;
    margin: 20px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gold-dim);
}

.report-content h2 {
    color: var(--gold-light);
    font-size: 17px;
    margin: 18px 0 8px;
}

.report-content h3 {
    color: var(--cyan);
    font-size: 15px;
    margin: 12px 0 6px;
}

.report-content p {
    line-height: 1.8;
    margin: 8px 0;
    color: var(--text-primary);
}

.report-content strong {
    color: var(--gold-light);
}

.report-content li {
    margin: 5px 0;
    padding-left: 10px;
    line-height: 1.7;
}

/* ===== 返回按钮 ===== */
.btn-back {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-action {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

/* ===== 加载遮罩 ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
}

.bagua-spin {
    font-size: 48px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 2px;
}

/* ===== 报告栏内嵌进度（无全屏遮罩） ===== */
.gen-inline-spinner {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 16px auto 10px;
}
.gen-inline-bagua {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: var(--gold);
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
    animation: genBaguaPulse 2s ease-in-out infinite;
}
@keyframes genBaguaPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.12); opacity: 0.75; }
}
.gen-inline-ring {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 2px solid transparent;
    border-top-color: var(--gold);
    border-right-color: rgba(212, 175, 55, 0.25);
    border-radius: 50%;
    animation: genRingSpin 1.5s linear infinite;
}
@keyframes genRingSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.gen-inline-title {
    text-align: center;
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 3px;
    margin-bottom: 4px;
}
.gen-inline-sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 12px;
    min-height: 18px;
}
.gen-inline-bar-wrap {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    margin-bottom: 14px;
}
.gen-inline-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), #e8d5a3);
    transition: width 0.8s ease;
}
.gen-inline-chapters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.gen-ch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    transition: all 0.4s ease;
}
.gen-ch.generating {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
    color: var(--gold-light);
}
.gen-ch.generating .gen-ch-status {
    animation: genSpin 1s linear infinite;
    color: var(--gold);
}
.gen-ch.done {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}
.gen-ch.done .gen-ch-status {
    color: #4ade80;
}
.gen-ch-status {
    font-size: 12px;
    font-weight: bold;
}
@keyframes genSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Toast提示 ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 200;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--gold-dim);
    border-left: 3px solid var(--gold-dim);
    color: var(--gold-light);
    backdrop-filter: blur(10px);
    opacity: 1;
}

.toast.hidden {
    display: none;
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

.toast.toast-show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.3);
    border-left-color: #f87171;
    color: #f87171;
}

.toast.success {
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.3);
    border-left-color: #4ade80;
    color: #4ade80;
}

/* 按钮点击反馈 */
.btn-immortal:active,
.btn-send:active,
.btn-back:active,
.btn-action:active,
.hint-tag:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* 确认对话框 */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.confirm-dialog {
    background: #1a1a3e;
    border: 1px solid var(--gold-dim);
    border-radius: 12px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
}
.confirm-dialog p {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.6;
}
.confirm-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-btns button {
    padding: 8px 24px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.confirm-btns .confirm-cancel {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
}
.confirm-btns .confirm-ok {
    background: rgba(212,175,55,0.2);
    color: var(--gold-light);
    border: 1px solid var(--gold-dim);
}
.confirm-btns .confirm-ok:hover {
    background: rgba(212,175,55,0.3);
}
.confirm-btns button:active {
    transform: scale(0.96);
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton-pillar {
    width: 60px;
    height: 80px;
    border-radius: 8px;
}
.skeleton-msg {
    height: 48px;
    margin: 8px 0;
    border-radius: 12px;
    width: 70%;
}
.skeleton-msg.right {
    margin-left: auto;
    width: 50%;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== 登录注册页 ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.auth-back {
    position: absolute;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.3s, background 0.3s;
    z-index: 3;
}

.auth-back:hover {
    color: var(--gold);
    background: rgba(212,175,55,0.1);
}

.auth-card {
    position: relative;
    background: linear-gradient(170deg, rgba(20, 16, 45, 0.97), rgba(10, 8, 30, 0.98));
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 40px 30px 30px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.12), inset 0 1px 0 rgba(212, 175, 55, 0.1);
    overflow: hidden;
}

/* 卡片顶部装饰光晕 */
.auth-card::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 120px;
    background: radial-gradient(ellipse, rgba(212, 175, 55, 0.15), transparent 70%);
    pointer-events: none;
}

/* 卡片四角装饰 */
.auth-card::after {
    content: '◈';
    position: absolute;
    top: 12px;
    right: 14px;
    color: rgba(212, 175, 55, 0.2);
    font-size: 10px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.auth-logo {
    font-size: 56px;
    margin-bottom: 12px;
    display: inline-block;
    animation: authFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
}

@keyframes authFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.auth-header h2 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 24px;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 6px;
    letter-spacing: 1px;
}

/* 分隔装饰线 */
.auth-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    gap: 10px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.auth-divider span {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 2px;
}

/* 登录表单样式 */
.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-card .form-group label {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-card .form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    outline: none;
}

.auth-card .form-group input::placeholder {
    color: var(--text-dim);
}

.auth-card .form-group input:focus {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.04);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

/* 登录/注册按钮 */
.auth-card .btn-submit {
    width: 100%;
    margin-top: 6px;
    padding: 15px;
    font-size: 17px;
    letter-spacing: 4px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.08));
    border: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-card .btn-submit::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.05) 50%, transparent 60%);
    animation: shimmer-slide 3s ease-in-out infinite;
}

@keyframes shimmer-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.auth-card .btn-submit:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.12));
    border-color: var(--gold);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.2);
    transform: translateY(-1px);
}

/* 切换登录/注册 */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.auth-switch a {
    color: var(--gold);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.auth-switch a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.3s;
}

.auth-switch a:hover::after {
    width: 100%;
}

/* ===== 左侧历史栏共用样式 ===== */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-gold);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.sidebar-logo {
    font-size: 22px;
}

.sidebar-title {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 2px;
}

.sidebar-header-actions {
    display: flex;
    gap: 6px;
}
.sidebar-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.sidebar-icon-btn.active {
    background: var(--gold);
    color: #0a0a1a;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}
.sidebar-icon-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}
.sidebar-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.sidebar-add-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.sidebar-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
    border: 1px solid transparent;
}

.sidebar-item:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--border-gold);
}

.sidebar-item.active {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--gold-dim);
}

.sidebar-item-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}
.gender-tag {
    font-size: 14px;
    font-weight: 700;
}
.gender-male {
    color: #60a5fa;
}
.gender-female {
    color: #f472b6;
}

.sidebar-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
/* 右侧徽章组：评分 + 资产，避免破坏 sidebar-item-top 的 space-between 两栏布局 */
.sidebar-item-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sidebar-item-score {
    font-size: 12px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}
.sidebar-item-score.high {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}
.sidebar-item-score.mid {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
}
.sidebar-item-score.low {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}
/* AI精批评分：金色发光，强调这是基于精批内容的真实评分 */
.sidebar-item-score.ai {
    background: rgba(212, 175, 55, 0.18);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.45);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.25);
}
/* 纯计算分：灰色弱化，提示「精批后会AI重评」 */
.sidebar-item-score.calc {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    opacity: 0.85;
}

.sidebar-report-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    margin-left: 4px;
    font-weight: 500;
    vertical-align: middle;
}

.sidebar-item-score-na {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    cursor: pointer;
    border: 1px dashed rgba(212, 175, 55, 0.2);
    transition: all 0.15s;
}
.sidebar-item-score-na:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    border-color: var(--gold);
}

/* 资产顶峰预测徽章（💰A几点几·金额），复用 score 徽章视觉语言 */
.sidebar-item-asset {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}
.sidebar-item-asset.ai {
    background: rgba(212, 175, 55, 0.18);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.45);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.25);
}
.sidebar-item-asset.calc {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    opacity: 0.85;
}

.sidebar-item-pillars {
    font-size: 12px;
    color: var(--gold);
    font-family: var(--font-title);
    margin-top: 3px;
    letter-spacing: 1px;
}

.sidebar-item-date {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.sidebar-bottom {
    padding: 10px 14px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    flex-shrink: 0;
}

/* 用户信息显示 */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.user-info a {
    color: var(--gold);
    text-decoration: none;
    cursor: pointer;
}

.user-info a:hover {
    text-decoration: underline;
}

/* 天机点余额显示 */
.user-balance {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 8px;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s;
}
.user-balance:hover {
    background: rgba(212, 175, 55, 0.15);
}
.balance-icon {
    color: var(--gold);
    font-size: 12px;
}
.balance-num {
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
}
.balance-label {
    color: var(--text-dim);
    font-size: 11px;
}

.redeem-row {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.redeem-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    background: rgba(10, 10, 26, 0.6);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    font-family: monospace;
}
.redeem-input::placeholder { color: var(--text-dim); }
.redeem-input:focus { border-color: var(--gold); }
.redeem-btn {
    padding: 4px 10px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    background: transparent;
    color: var(--gold);
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font-body);
    white-space: nowrap;
}
.redeem-btn:hover { background: rgba(212, 175, 55, 0.15); }
.purchase-link {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-dim);
    cursor: pointer;
    text-decoration: none;
}
.purchase-link:hover { color: var(--gold); }

/* ===== 响应式 ===== */
@media (min-width: 481px) and (max-width: 767px) {
    #app {
        border-left: 1px solid var(--border-gold);
        border-right: 1px solid var(--border-gold);
    }
}

/* ===== Mobile (<=480px) ===== */
@media (max-width: 480px) {
    .pillar-extra {
        display: block;
    }
    .pillar-shishen {
        font-size: 10px;
        color: var(--purple);
        margin-bottom: 2px;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }
    .pillar-dishi {
        font-size: 9px;
        margin-top: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pillar-canggan {
        font-size: 10px;
        color: var(--text-secondary);
        margin-top: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pillar-nayin {
        font-size: 9px;
        color: var(--text-dim);
        margin-top: 2px;
        font-style: italic;
    }
    .pillar {
        padding: 12px 8px;
        min-width: 0;
    }
    .pillar-gan, .pillar-zhi {
        font-size: 22px;
    }
    .mobile-expand-btn {
        display: inline-block;
        font-size: 12px;
        padding: 8px 16px;
    }
    .four-pillars.mobile-expanded .pillar {
        padding: 20px 12px;
    }
    .four-pillars.mobile-expanded .pillar-gan,
    .four-pillars.mobile-expanded .pillar-zhi {
        font-size: 28px;
    }
    .four-pillars.mobile-expanded .pillar-shishen {
        font-size: 11px;
    }
    .four-pillars.mobile-expanded .pillar-dishi {
        font-size: 11px;
        white-space: normal;
    }
    .four-pillars.mobile-expanded .pillar-canggan {
        font-size: 12px;
        white-space: normal;
    }
    .four-pillars.mobile-expanded .pillar-nayin {
        font-size: 11px;
    }
    /* 命盘要素卡片移动端：单列堆叠，避免窄屏挤压 */
    .life-elem-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 桌面端隐藏移动展开按钮 */
@media (min-width: 481px) {
    .mobile-expand-btn {
        display: none;
    }
}

@media (max-height: 600px) {
    .bagua-symbol {
        font-size: 48px;
    }
    .title {
        font-size: 28px;
    }
    .welcome-text {
        margin-bottom: 20px;
    }
    .welcome-app-grid {
        margin-bottom: 20px;
        gap: 12px;
    }
    .welcome-app-item {
        padding: 12px 16px;
    }
}

/* ===== Tablet (768px+) ===== */
@media (min-width: 768px) {
    #app {
        max-width: 100%;
        display: flex;
        flex-direction: row;
        border-left: none;
        border-right: none;
    }

    /* 应用切换列 */
    .app-column {
        display: flex;
        flex-direction: column;
        width: 48px;
        height: 100%;
        background: rgba(8, 6, 20, 0.98);
        border-right: 1px solid var(--border-gold);
        flex-shrink: 0;
        z-index: 4;
    }

    /* 左侧历史排盘栏 */
    .sidebar-history {
        display: flex;
        flex-direction: column;
        width: 240px;
        height: 100%;
        background: rgba(10, 10, 26, 0.95);
        border-right: 1px solid var(--border-gold);
        flex-shrink: 0;
        z-index: 3;
    }

    /* 页面容器 */
    .page-container {
        flex: 1;
        overflow: hidden;
    }

    /* 欢迎页放大 */
    .bagua-symbol {
        font-size: 96px;
    }
    .title {
        font-size: 48px;
    }
    .subtitle {
        font-size: 16px;
    }
    .welcome-text {
        font-size: 16px;
        max-width: 500px;
    }
    .btn-immortal {
        padding: 16px 50px;
        font-size: 18px;
    }

    /* 排盘 - 四柱2x2网格 + 额外数据 */
    .four-pillars {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .pillar {
        padding: 20px 15px;
    }
    .pillar-extra {
        display: block;
    }
    .pillar-shishen {
        font-size: 11px;
        color: var(--purple);
        margin-bottom: 4px;
        letter-spacing: 1px;
    }
    .pillar-dishi {
        font-size: 11px;
        color: var(--gold-light);
        margin-top: 4px;
        letter-spacing: 0.5px;
    }
    .pillar-canggan {
        font-size: 12px;
        color: var(--text-secondary);
        margin-top: 6px;
        line-height: 1.5;
    }
    .pillar-nayin {
        font-size: 11px;
        color: var(--text-dim);
        margin-top: 4px;
        font-style: italic;
    }

    /* 五行详情替代扁平条 */
    .wuxing-bar {
        display: none;
    }
    .wuxing-detail {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .wuxing-row {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .wuxing-row-label {
        width: 30px;
        text-align: center;
        font-family: var(--font-title);
        font-size: 15px;
        font-weight: bold;
    }
    .wuxing-row-label.jin { color: #d4af37; }
    .wuxing-row-label.mu { color: #4ade80; }
    .wuxing-row-label.shui { color: #60a5fa; }
    .wuxing-row-label.huo { color: #f87171; }
    .wuxing-row-label.tu { color: #d97706; }
    .wuxing-row-bar {
        flex: 1;
        height: 22px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.05);
        overflow: hidden;
    }
    .wuxing-row-fill {
        height: 100%;
        border-radius: 6px;
        transition: width 0.6s ease;
    }
    .wuxing-row-fill.jin { background: linear-gradient(90deg, #c9a44a, #d4af37); }
    .wuxing-row-fill.mu { background: linear-gradient(90deg, #2d8a4e, #4ade80); }
    .wuxing-row-fill.shui { background: linear-gradient(90deg, #2563eb, #60a5fa); }
    .wuxing-row-fill.huo { background: linear-gradient(90deg, #dc2626, #f87171); }
    .wuxing-row-fill.tu { background: linear-gradient(90deg, #92400e, #d97706); }
    .wuxing-row-count {
        width: 50px;
        text-align: right;
        font-size: 13px;
        color: var(--text-secondary);
    }

    /* 大运时间线 */
    .dayun-section {
        display: block;
    }
    .chart-overview {
        display: block;
    }
    .liunian-section {
        display: block;
    }
    .dayun-timeline {
        display: flex;
        gap: 0;
        overflow-x: auto;
        padding: 10px 0;
    }
    .dayun-node {
        flex-shrink: 0;
        text-align: center;
        padding: 10px 12px;
        border-right: 1px solid rgba(212, 175, 55, 0.15);
        position: relative;
    }
    .dayun-node:last-child {
        border-right: none;
    }
    .dayun-node::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--gold);
        margin: 0 auto 8px;
        display: block;
    }
    .dayun-gz {
        font-family: var(--font-title);
        font-size: 18px;
        color: var(--gold);
    }
    .dayun-age {
        font-size: 11px;
        color: var(--text-dim);
        margin-top: 4px;
    }
    .dayun-year {
        font-size: 10px;
        color: var(--text-dim);
        opacity: 0.7;
    }
}

/* ===== Desktop (1024px+) ===== */
@media (min-width: 1024px) {
    /* 左侧历史栏更宽 */
    .sidebar-history {
        width: 280px;
    }

    /* 欢迎页 - 居中放大 + feature cards */

    /* 欢迎页 - 居中放大 + feature cards */
    .bagua-symbol {
        font-size: 120px;
    }
    .title {
        font-size: 56px;
    }
    .welcome-content {
        gap: 60px;
    }
    .feature-cards {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    .feature-card {
        padding: 14px 22px;
        background: var(--bg-card);
        border: 1px solid var(--border-gold);
        border-radius: 10px;
        color: var(--text-secondary);
        font-size: 14px;
        text-align: center;
        transition: all 0.3s;
    }
    .feature-card:hover {
        border-color: var(--gold);
        color: var(--gold-light);
        box-shadow: var(--shadow-gold);
    }

    /* 排盘 - 回4列宽卡片 */
    .four-pillars {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    .pillar {
        padding: 25px 15px;
    }
    .pillar-gan, .pillar-zhi {
        font-size: 36px;
    }

    /* 大运节点更宽 */
    .dayun-node {
        padding: 12px 18px;
    }
    .dayun-gz {
        font-size: 22px;
    }

    /* 报告TOC侧栏 */
    .report-toc {
        display: block;
        width: 200px;
        flex-shrink: 0;
        padding: 20px 15px;
        border-right: 1px solid var(--border-gold);
        overflow-y: auto;
        background: rgba(10, 10, 26, 0.5);
    }
    .report-toc-title {
        color: var(--gold);
        font-size: 13px;
        letter-spacing: 2px;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--gold-dim);
    }
    .report-toc a {
        display: block;
        padding: 7px 0;
        font-size: 13px;
        color: var(--text-secondary);
        text-decoration: none;
        border-left: 2px solid transparent;
        padding-left: 12px;
        transition: all 0.2s;
    }
    .report-toc a:hover,
    .report-toc a.active {
        color: var(--gold);
        border-left-color: var(--gold);
    }
    .report-toc a.toc-h3 {
        padding-left: 24px;
        font-size: 12px;
    }
    .report-content {
        font-size: 16px;
        line-height: 2;
    }
}

/* ===== Large Desktop (1440px+) ===== */
@media (min-width: 1440px) {
    .sidebar-history {
        width: 300px;
    }
    .four-pillars {
        gap: 25px;
    }
    .pillar-gan, .pillar-zhi {
        font-size: 42px;
    }
}

/* ===== 通用应用状态条（天机点 / 有效期 / 兑换码入口） ===== */
.app-status-bar {
    margin: 22px auto 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 560px;
    box-sizing: border-box;
}
.app-status-bar:empty { display: none; }
.app-status-bar b { color: var(--gold); font-weight: 600; margin-left: 2px; }
.bazi-desktop-status {
    margin: 18px auto 32px;
}
.app-status-bar a {
    color: var(--gold);
    cursor: pointer;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 1px;
    transition: background .2s, color .2s;
}
.app-status-bar a:hover {
    background: var(--gold);
    color: #1a1410;
}
@media (max-width: 480px) {
    .app-status-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 8px;
        padding: 12px 14px;
        font-size: 12px;
        margin: 18px 14px 10px;
    }
    .app-status-bar a { align-self: center; padding: 8px 18px; }
}
@media (max-width: 767px) {
    .bazi-desktop-status { display: none; }
}

/* ===== 八字移动端：底部 footer（历史按钮 + 状态条） ===== */
.bazi-mobile-footer {
    display: none;
    max-width: 560px;
    margin: 18px auto 28px;
    padding: 0 14px;
    flex-direction: column;
    gap: 14px;
}
@media (max-width: 767px) {
    .bazi-mobile-footer { display: flex; }
}
.bazi-history-btn {
    width: 100%;
    padding: 14px 18px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.18) 0%, transparent 70%),
        linear-gradient(180deg, rgba(30, 22, 40, 0.6) 0%, rgba(15, 12, 35, 0.7) 100%);
    border: 1px solid var(--border-gold);
    color: var(--gold);
    border-radius: 10px;
    font-family: var(--font-title);
    font-size: 15px;
    letter-spacing: 4px;
    text-indent: 4px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.08), inset 0 0 0 1px rgba(212, 175, 55, 0.08);
    transition: border-color .25s, box-shadow .25s, color .25s;
}
.bazi-history-btn:hover, .bazi-history-btn:active {
    border-color: rgba(212, 175, 55, 0.55);
    color: var(--gold-light);
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.18), inset 0 0 0 1px rgba(212, 175, 55, 0.2);
}
.bazi-history-btn i { margin-right: 8px; font-size: 14px; }

/* 八字风格状态条（卷轴底+金边） */
.bazi-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    background:
        radial-gradient(ellipse at 0% 50%, rgba(212, 175, 55, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse at 100% 50%, rgba(74, 240, 224, 0.06) 0%, transparent 55%),
        linear-gradient(180deg, rgba(15, 12, 35, 0.7) 0%, rgba(8, 6, 24, 0.8) 100%);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(212, 175, 55, 0.05);
}
.bazi-status-bar:empty { display: none; }
.bazi-status-bar > div {
    display: flex;
    align-items: center;
    gap: 4px;
}
.bazi-status-bar b {
    color: var(--gold);
    font-family: var(--font-title);
    font-weight: 600;
    margin-left: 4px;
    letter-spacing: 1px;
}
.bazi-status-bar a {
    color: var(--gold);
    cursor: pointer;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 6px 14px;
    border-radius: 999px;
    font-family: var(--font-title);
    font-size: 12px;
    letter-spacing: 2px;
    text-indent: 2px;
    transition: background .25s, color .25s, border-color .25s;
}
.bazi-status-bar a:hover, .bazi-status-bar a:active {
    background: linear-gradient(135deg, var(--gold), #b8941f);
    color: #1a1410;
    border-color: var(--gold);
}
@media (max-width: 480px) {
    .bazi-status-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 8px;
        padding: 14px 16px;
        font-size: 12px;
    }
    .bazi-status-bar > div { justify-content: center; }
    .bazi-status-bar a { align-self: center; padding: 9px 22px; }
}

/* ===== 八字历史排盘弹窗（移动端） ===== */
.bazi-history-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.bazi-history-modal.show { display: flex; }
.bazi-history-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: bzhmFadeIn .22s ease;
}
@keyframes bzhmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.bazi-history-modal-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.12) 0%, transparent 60%),
        linear-gradient(180deg, rgba(15, 12, 35, 0.98) 0%, rgba(8, 6, 24, 0.99) 100%);
    border: 1px solid var(--border-gold);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
    animation: bzhmSlideUp .3s cubic-bezier(.22, .61, .36, 1);
}
@keyframes bzhmSlideUp { from { transform: translateY(20%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.bazi-history-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-gold);
    position: relative;
}
.bazi-history-modal-header h3 {
    flex: 1;
    color: var(--gold);
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 6px;
    text-indent: 6px;
    text-align: center;
    text-shadow: 0 0 16px rgba(212, 175, 55, 0.3);
    margin: 0;
}
.bazi-history-modal-header .scroll-ornament {
    color: var(--gold);
    opacity: 0.6;
    font-size: 14px;
}
.bazi-history-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s, transform .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bazi-history-modal-close:hover { background: rgba(212, 175, 55, 0.12); transform: rotate(90deg); }
.bazi-history-modal-search {
    padding: 12px 18px 6px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}
.bazi-history-modal-search input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.bazi-history-modal-search input:focus { border-color: var(--gold); }
.bazi-history-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 24px;
    -webkit-overflow-scrolling: touch;
}
.bazi-history-modal-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 36px 0;
    font-size: 13px;
    letter-spacing: 1px;
}
.bazi-history-modal-item {
    padding: 12px 14px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
}
.bazi-history-modal-item:active {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.4);
}
.bazi-history-modal-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.bazi-history-modal-name {
    color: var(--gold);
    font-family: var(--font-title);
    font-size: 15px;
    letter-spacing: 1.5px;
    font-weight: 500;
}
.bazi-history-modal-gender {
    font-family: var(--font-title);
    color: var(--purple);
    font-size: 12px;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 4px;
    letter-spacing: 1px;
}
.bazi-history-modal-meta {
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bazi-history-modal-meta .dot { opacity: 0.5; }
@media (min-width: 768px) {
    .bazi-history-modal { align-items: center; }
    .bazi-history-modal-box {
        border: 1px solid var(--border-gold);
        border-radius: 16px;
        max-height: 75vh;
    }
}

/* ==================== 资产大运走势看板弹窗 ==================== */
.asset-trend-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.asset-trend-modal.show { display: flex; }
.asset-trend-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: bzhmFadeIn .22s ease;
}
.asset-trend-box {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.12) 0%, transparent 60%),
        linear-gradient(180deg, rgba(15, 12, 35, 0.98) 0%, rgba(8, 6, 24, 0.99) 100%);
    border: 1px solid var(--border-gold);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
    animation: bzhmSlideUp .3s cubic-bezier(.22, .61, .36, 1);
}
.asset-trend-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-gold);
}
.asset-trend-header h3 {
    flex: 1;
    color: var(--gold);
    font-family: var(--font-title);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 5px;
    text-indent: 5px;
    text-align: center;
    text-shadow: 0 0 16px rgba(212, 175, 55, 0.3);
    margin: 0;
}
.asset-trend-header .scroll-ornament { color: var(--gold); opacity: 0.6; font-size: 14px; }
.asset-trend-close {
    background: none; border: none; color: var(--gold); opacity: 0.6;
    font-size: 16px; cursor: pointer; transition: all .2s; padding: 4px;
}
.asset-trend-close:hover { opacity: 1; transform: rotate(90deg); }
.asset-trend-body {
    padding: 14px 16px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.asset-trend-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 20px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.at-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #c9a961;
}
.at-legend-item { display: flex; align-items: center; gap: 5px; }
.at-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d4af37; }
.at-dot.peak { background: #ffd76a; box-shadow: 0 0 6px rgba(255, 215, 106, 0.6); }
.at-chart-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 4px 0 10px;
}
.at-svg { display: block; width: 100%; min-width: 560px; height: 280px; }
.at-detail-title {
    color: var(--gold);
    font-size: 13px;
    font-family: var(--font-title);
    letter-spacing: 2px;
    margin: 8px 0 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-gold);
}
.at-detail { display: flex; flex-direction: column; gap: 4px; }
.at-row {
    display: grid;
    grid-template-columns: 48px 1fr 2.4fr;
    gap: 10px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}
.at-row.peak {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
}
.at-row-gz { color: var(--gold); font-family: var(--font-title); font-weight: 600; }
.at-row-yr { color: var(--text-dim); font-size: 11px; }
.at-row-tier { font-weight: 700; color: #e8d9b0; text-align: center; }
.at-row-tier.peak { color: #ffd76a; }
.at-row-note { color: var(--text-secondary); font-size: 11px; }
@media (min-width: 768px) {
    .asset-trend-modal { align-items: center; }
    .asset-trend-box {
        border: 1px solid var(--border-gold);
        border-radius: 16px;
        max-height: 85vh;
    }
}
