* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #080810;
    --bg-card: rgba(20, 16, 35, 0.9);
    --bg-card-light: rgba(30, 25, 50, 0.8);
    --gold: #d4af37;
    --gold-light: #f4e4bc;
    --gold-glow: rgba(212, 175, 55, 0.6);
    --purple: #8b5cf6;
    --purple-dark: #4c1d95;
    --red: #ef4444;
    --green: #10b981;
    --text: #f0ede8;
    --text-dim: rgba(255, 255, 255, 0.55);
    --border: rgba(212, 175, 55, 0.25);
    --border-light: rgba(212, 175, 55, 0.15);
    
    --wood: #22c55e;
    --fire: #ef4444;
    --earth: #f59e0b;
    --metal: #e2e8f0;
    --water: #3b82f6;
}

body {
    font-family: 'STKaiti', 'KaiTi', 'Microsoft YaHei', serif;
    background: var(--bg-dark);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    overflow-x: hidden;
}

/* 玄幻背景 */
.mystic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 15% 15%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 85%, rgba(212, 175, 55, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(76, 29, 149, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
    animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.mystic-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.04;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: calc(2rem + env(safe-area-inset-top));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 输入区 */
.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.logo {
    margin-bottom: 3rem;
}

.logo-icon {
    font-size: 6rem;
    color: var(--gold);
    text-shadow: 0 0 80px var(--gold-glow), 0 0 150px var(--gold-glow);
    animation: rotate 25s linear infinite;
    display: inline-block;
}

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

.logo h1 {
    font-size: 3rem;
    color: var(--gold);
    font-weight: normal;
    letter-spacing: 0.8rem;
    text-shadow: 0 0 40px var(--gold-glow);
    margin: 1.2rem 0 0.6rem;
}

.tagline {
    color: var(--text-dim);
    font-size: 1.2rem;
    letter-spacing: 0.4rem;
}

.input-box {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 650px;
    margin-bottom: 1.2rem;
}

#walletInput {
    flex: 1;
    padding: 1.1rem 1.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    outline: none;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

#walletInput:focus {
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--gold-glow);
}

#walletInput::placeholder {
    color: var(--text-dim);
    font-family: inherit;
}

#analyzeBtn {
    padding: 1.1rem 2.5rem;
    background: linear-gradient(135deg, var(--gold) 0%, #b8860b 100%);
    border: none;
    border-radius: 12px;
    color: #1a1a2e;
    font-size: 1.1rem;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

#analyzeBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 40px var(--gold-glow);
}

#analyzeBtn .btn-loading { display: none; }
#analyzeBtn.loading .btn-text { display: none; }
#analyzeBtn.loading .btn-loading { display: inline; }

.hint {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* 结果区 */
.result-section {
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 1.8rem;
    margin-bottom: 2rem;
    align-items: start;
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 卡片通用样式 */
.wuxing-card,
.fortune-card,
.hex-stats,
.comment-box,
.reading-item,
.advice-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* 五行卡 */
.wuxing-card {
    padding: 1.8rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.wuxing-card::before {
    content: "☯︎";
    position: absolute;
    font-size: 12rem;
    color: rgba(212, 175, 55, 1);
    opacity: 0.06;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate 60s linear infinite reverse;
    pointer-events: none;
    user-select: none;
}

.bagua-ring {
    width: 70px;
    height: 70px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    animation: pulse 3s infinite;
    background: radial-gradient(circle, rgba(212,175,55,0.1) 0%, transparent 70%);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 15px var(--gold-glow); }
    50% { box-shadow: 0 0 40px var(--gold-glow), 0 0 80px rgba(212,175,55,0.3); }
}

.bagua-symbol {
    color: var(--gold);
    font-size: 2rem;
}

.gua-info {
    margin-bottom: 1.2rem;
}

.gua-name {
    font-size: 1.4rem;
    color: var(--gold);
    font-weight: bold;
    text-shadow: 0 0 15px var(--gold-glow);
    margin-bottom: 0.4rem;
}

.gua-detail {
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.15rem;
}

.wuxing-main {
    margin-bottom: 0.8rem;
}

.wuxing-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 20px currentColor);
}

.wuxing-name {
    font-size: 2.8rem;
    font-weight: bold;
    margin-top: 0.4rem;
}

.wuxing-name.wood { color: var(--wood); text-shadow: 0 0 25px var(--wood); }
.wuxing-name.fire { color: var(--fire); text-shadow: 0 0 25px var(--fire); }
.wuxing-name.earth { color: var(--earth); text-shadow: 0 0 25px var(--earth); }
.wuxing-name.metal { color: var(--metal); text-shadow: 0 0 25px rgba(255,255,255,0.5); }
.wuxing-name.water { color: var(--water); text-shadow: 0 0 25px var(--water); }

.wuxing-desc {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.wuxing-traits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    font-size: 0.85rem;
}

.wuxing-traits span {
    background: rgba(0,0,0,0.4);
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.wuxing-traits i {
    color: var(--text-dim);
    font-style: normal;
    margin-right: 0.3rem;
}

.wuxing-traits em {
    color: var(--gold);
    font-style: normal;
}

/* 链契合度 */
.chain-compat {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.chain-compat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.chain-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.chain-compat-level {
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.chain-compat-level.good {
    color: var(--green);
    background: rgba(16, 185, 129, 0.2);
}

.chain-compat-level.neutral {
    color: var(--earth);
    background: rgba(245, 158, 11, 0.2);
}

.chain-compat-level.bad {
    color: var(--red);
    background: rgba(239, 68, 68, 0.2);
}

.chain-compat-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.5;
    text-align: left;
}

/* 运势卡 */
.fortune-card {
    padding: 2rem 1.5rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fortune-seal {
    width: 110px;
    height: 110px;
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--gold);
    border: 4px solid var(--gold);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,175,55,0.2) 0%, transparent 70%);
    box-shadow: 0 0 40px var(--gold-glow), inset 0 0 40px var(--gold-glow);
    animation: sealGlow 2s infinite alternate;
}

@keyframes sealGlow {
    from { box-shadow: 0 0 25px var(--gold-glow), inset 0 0 25px var(--gold-glow); }
    to { box-shadow: 0 0 50px var(--gold-glow), inset 0 0 50px var(--gold-glow); }
}

.fortune-seal.bad {
    color: var(--red);
    border-color: var(--red);
    box-shadow: 0 0 40px rgba(239,68,68,0.5), inset 0 0 40px rgba(239,68,68,0.3);
}

.fortune-seal.neutral {
    color: var(--earth);
    border-color: var(--earth);
    box-shadow: 0 0 40px rgba(245,158,11,0.5), inset 0 0 40px rgba(245,158,11,0.3);
}

.fortune-score {
    margin-bottom: 0.8rem;
}

.score-num {
    font-size: 4rem;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 30px var(--gold-glow);
    line-height: 1;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.score-adjust {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
}

.score-adjust.plus {
    color: var(--green);
    background: rgba(16, 185, 129, 0.2);
}

.score-adjust.minus {
    color: var(--red);
    background: rgba(239, 68, 68, 0.2);
}

.fortune-level {
    font-size: 1.6rem;
    color: var(--green);
    padding: 0.6rem 1.5rem;
    background: rgba(16,185,129,0.2);
    border-radius: 10px;
    display: inline-block;
    border: 1px solid rgba(16,185,129,0.3);
}

.fortune-level.bad {
    color: var(--red);
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.3);
}

.fortune-level.neutral {
    color: var(--earth);
    background: rgba(245,158,11,0.2);
    border-color: rgba(245,158,11,0.3);
}

/* 中间面板 */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.panel-title {
    text-align: center;
    margin-bottom: 0.3rem;
}

.panel-title span {
    display: inline-block;
    padding: 0.4rem 2rem;
    background: linear-gradient(90deg, transparent, rgba(20,16,35,0.9), transparent);
    border-left: 2px solid var(--gold);
    border-right: 2px solid var(--gold);
    color: var(--gold);
    font-size: 1.1rem;
    letter-spacing: 0.3rem;
}

.hex-stats {
    padding: 1.2rem 1.5rem;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.stat-row:last-child { border-bottom: none; }

.stat-icon { font-size: 1.2rem; width: 28px; text-align: center; }
.stat-name { width: 50px; font-size: 0.95rem; color: var(--text-dim); }

.stat-bar {
    flex: 1;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple) 0%, var(--gold) 100%);
    border-radius: 6px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--gold-glow);
}

.stat-row.risk .stat-fill {
    background: linear-gradient(90deg, var(--earth) 0%, var(--red) 100%);
    box-shadow: 0 0 10px rgba(239,68,68,0.5);
}

.stat-val {
    width: 35px;
    text-align: right;
    font-weight: bold;
    color: var(--gold);
    font-size: 1rem;
}

/* 天机批语区 */
.comment-box {
    padding: 1.8rem;
    flex: 1;
}

.comment-gua {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--border);
}

.comment-gua-symbol {
    display: block;
    font-size: 3rem;
    color: var(--gold);
    text-shadow: 0 0 30px var(--gold-glow);
    margin-bottom: 0.6rem;
    animation: symbolGlow 3s ease-in-out infinite alternate;
}

@keyframes symbolGlow {
    from { text-shadow: 0 0 20px var(--gold-glow); }
    to { text-shadow: 0 0 40px var(--gold-glow), 0 0 60px rgba(212,175,55,0.3); }
}

.comment-gua-name {
    display: block;
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 0.4rem;
    letter-spacing: 0.2rem;
}

.comment-gua-detail {
    display: block;
    font-size: 0.9rem;
    color: var(--text-dim);
    letter-spacing: 0.1rem;
}

.comment-box p {
    color: var(--text);
    line-height: 2;
    font-size: 1rem;
    text-indent: 2em;
    text-align: justify;
}

.comment-divider {
    text-align: center;
    color: var(--gold);
    font-size: 0.9rem;
    margin: 1.5rem 0;
    opacity: 0.8;
    letter-spacing: 0.2rem;
}

/* 右侧面板 */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.reading-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.reading-item {
    padding: 1rem;
    transition: all 0.3s;
}

.reading-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.reading-head {
    font-size: 0.95rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.reading-head span {
    margin-right: 0.4rem;
    font-size: 1.1rem;
}

.reading-item p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.advice-list {
    padding: 1.2rem 1.5rem;
    flex: 1;
}

.advice-list li {
    padding: 0.6rem 0;
    font-size: 0.95rem;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.advice-list li:last-child { border-bottom: none; }
.advice-list li::before { 
    content: "✦"; 
    color: var(--gold); 
    font-size: 0.8rem;
    text-shadow: 0 0 10px var(--gold-glow);
}

/* 作者信息 */
.author-info {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border);
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.author-info a {
    display: inline-block;
    color: #fff;
    background: linear-gradient(135deg, #1da1f2, #0d8ecf);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.4);
    transition: all 0.3s;
}

.author-info a:hover {
    background: linear-gradient(135deg, #1dcaff, #1da1f2);
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.6);
    transform: translateY(-2px);
}

.author-tip {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--gold);
    line-height: 1.6;
    text-align: center;
}

/* 重测按钮 */
.retry-btn {
    display: block;
    width: 220px;
    margin: 0 auto;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 2px solid var(--gold);
    border-radius: 12px;
    color: var(--gold);
    font-size: 1.1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.2rem;
}

.retry-btn:hover {
    background: rgba(212,175,55,0.15);
    box-shadow: 0 0 30px var(--gold-glow);
    transform: translateY(-2px);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: auto;
}

.hidden { display: none !important; }

/* 响应式 */
@media (max-width: 1100px) {
    .container {
        max-width: 100%;
        padding: 1.5rem;
        padding-top: calc(1.5rem + env(safe-area-inset-top));
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
    
    .result-layout {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .right-panel {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
        padding-top: calc(1rem + env(safe-area-inset-top));
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    
    .logo-icon { font-size: 4.5rem; }
    .logo h1 { font-size: 2.2rem; letter-spacing: 0.4rem; }
    .tagline { font-size: 1rem; }
    
    .input-box {
        flex-direction: column;
    }
    
    #analyzeBtn {
        width: 100%;
    }
    
    .result-layout {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .left-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .right-panel {
        grid-column: span 1;
    }
    
    .reading-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .wuxing-icon { font-size: 2.8rem; }
    .wuxing-name { font-size: 2.2rem; }
    .fortune-seal { width: 90px; height: 90px; font-size: 2.8rem; }
    .score-num { font-size: 3rem; }
    
    .comment-gua-symbol { font-size: 2.5rem; }
    .comment-gua-name { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .left-panel {
        grid-template-columns: 1fr;
    }
    
    .reading-grid {
        grid-template-columns: 1fr;
    }
}

/* 算法说明 - 右下角直接显示 */
.algo-info {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.algo-info h4 {
    color: var(--gold);
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    text-align: center;
    letter-spacing: 0.1rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.5rem;
}

.algo-info p {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    text-align: justify;
}

.algo-info p:last-child {
    margin-bottom: 0;
}

.algo-info strong {
    color: var(--gold);
    font-weight: normal;
}

@media (max-width: 768px) {
    .algo-info {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        margin-top: 1rem;
    }
}

/* 太极鱼动画 */
.taiji-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0a0a15 0%, #000 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* 让动画遮罩默认不挡点击，但在 active 时显示在最上层 */
.taiji-animation-overlay { pointer-events: none; }
.taiji-animation-overlay.active { pointer-events: auto; }

/* 动画层内部元素默认不出现，避免一直看到“空舞台” */
.fish-orbit,
.ink-fish,
.taiji-core,
.bagua-ring-outer,
.ink-wash {
    opacity: 0;
}

.taiji-animation-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 加载面板（玄幻风：金边、暗紫、微光） */
.taiji-container.loading {
    width: min(86vw, 560px);
    height: auto;
    padding: 24px 22px;
    border-radius: 18px;
    background:
        radial-gradient(120% 140% at 20% 10%, rgba(139, 92, 246, 0.18) 0%, rgba(0,0,0,0) 55%),
        radial-gradient(120% 140% at 90% 90%, rgba(212, 175, 55, 0.12) 0%, rgba(0,0,0,0) 60%),
        linear-gradient(180deg, rgba(20, 16, 35, 0.92), rgba(12, 10, 22, 0.92));
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow:
        0 18px 60px rgba(0, 0, 0, 0.70),
        0 0 0 1px rgba(212, 175, 55, 0.10) inset,
        0 0 36px rgba(139, 92, 246, 0.10);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.taiji-container.loading::before {
    content: '';
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.06) 0%, transparent 38%),
        radial-gradient(circle at 70% 40%, rgba(212,175,55,0.08) 0%, transparent 40%),
        radial-gradient(circle at 55% 75%, rgba(139,92,246,0.06) 0%, transparent 44%);
    opacity: 0.9;
    pointer-events: none;
    filter: blur(0.2px);
}

.loading-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1;
}

.loading-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: rgba(244, 228, 188, 0.95);
    background:
        radial-gradient(circle at 30% 25%, rgba(244, 228, 188, 0.22) 0%, rgba(0,0,0,0) 58%),
        linear-gradient(180deg, rgba(212,175,55,0.18), rgba(0,0,0,0));
    border: 1px solid rgba(212, 175, 55, 0.32);
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.18),
        0 0 0 1px rgba(212, 175, 55, 0.10) inset;
    font-size: 22px;
    letter-spacing: 0.06em;
}

.loading-title {
    font-size: 20px;
    color: var(--text);
    letter-spacing: 0.08em;
}

.loading-subtitle {
    margin-top: 6px;
    font-size: 14px;
    color: rgba(255,255,255,0.68);
    letter-spacing: 0.05em;
}

.loading-subtitle.loading-only {
    margin-top: 0;
    text-align: center;
    font-size: 16px;
    color: rgba(244, 228, 188, 0.92);
    letter-spacing: 0.10em;
}

.loading-dots::after {
    content: '...';
    display: inline-block;
    width: 1.6em;
    overflow: hidden;
    vertical-align: bottom;
    animation: loadingDots 1.1s steps(4, end) infinite;
}

@keyframes loadingDots {
    0% { width: 0em; }
    100% { width: 1.6em; }
}

.loading-progress {
    position: relative;
    z-index: 1;
    margin-top: 18px;
}

.progress-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.35) inset,
        0 10px 24px rgba(0,0,0,0.25);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background:
        linear-gradient(90deg, rgba(139,92,246,0.90), rgba(212,175,55,0.90));
    box-shadow:
        0 0 18px rgba(139, 92, 246, 0.20),
        0 0 18px rgba(212, 175, 55, 0.18);
    transition: width 0.08s linear;
}

.progress-meta {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: rgba(255,255,255,0.62);
}

.progress-percent {
    color: rgba(244, 228, 188, 0.92);
    letter-spacing: 0.06em;
}

.loading-ornament {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    font-size: 12px;
    color: rgba(212,175,55,0.55);
    letter-spacing: 0.22em;
    text-align: center;
    user-select: none;
}

@media (max-width: 480px) {
    .taiji-container.loading { padding: 20px 16px; border-radius: 16px; }
    .loading-title { font-size: 18px; }
    .loading-mark { width: 40px; height: 40px; border-radius: 10px; }
}


.taiji-container {
    position: relative;
    width: min(72vmin, 420px);
    height: min(72vmin, 420px);
}

/* 水墨舞台 */
.taiji-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.ink-wash {
    position: absolute;
    inset: -15%;
    background:
        radial-gradient(circle at 35% 40%, rgba(255,255,255,0.10) 0%, transparent 55%),
        radial-gradient(circle at 65% 60%, rgba(212,175,55,0.08) 0%, transparent 52%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06) 0%, transparent 62%);
    filter: blur(8px);
    opacity: 0;
    transform: scale(0.92);
}

/* 轨道：容纳两鱼绕圈 */
.fish-orbit {
    position: absolute;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.96);
    transform-origin: 50% 50%;
    will-change: transform;
}

/* 墨鱼：用径向渐变 + 模糊营造晕染 */
.ink-fish {
    position: absolute;
    width: 34%;
    aspect-ratio: 2 / 1;
    border-radius: 70% 30% 55% 45% / 55% 55% 45% 45%;
    filter: blur(0.2px);
    opacity: 0;
    will-change: transform, filter, opacity;
}

.ink-fish::before {
    content: '';
    position: absolute;
    inset: -18% -22%;
    border-radius: inherit;
    filter: blur(12px);
    opacity: 0.55;
}

.ink-fish::after {
    content: '';
    position: absolute;
    inset: 12% 18% 12% 18%;
    border-radius: inherit;
    filter: blur(2px);
    opacity: 0.55;
}

.ink-fish-black {
    left: 50%;
    top: 0;
    transform: translateX(-50%) rotate(90deg);
    background: radial-gradient(circle at 35% 50%, rgba(40,40,45,0.9) 0%, rgba(0,0,0,0.92) 60%, rgba(0,0,0,0.98) 100%);
}

.ink-fish-black::before {
    background: radial-gradient(circle at 40% 55%, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.0) 68%);
}

.ink-fish-black::after {
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.0) 70%);
}

.ink-fish-white {
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) rotate(-90deg);
    background: radial-gradient(circle at 55% 50%, rgba(255,255,255,0.95) 0%, rgba(232,232,236,0.92) 62%, rgba(230,230,235,0.85) 100%);
}

.ink-fish-white::before {
    background: radial-gradient(circle at 60% 45%, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.0) 70%);
}

.ink-fish-white::after {
    background: radial-gradient(circle at 60% 50%, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.0) 72%);
}

/* 融合后的太极本体（用两个半圆 + 金边） */
.taiji-core {
    position: absolute;
    width: 64%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.92);
    overflow: hidden;
    filter: drop-shadow(0 0 28px rgba(212, 175, 55, 0.28));
    will-change: transform, opacity;
}

.taiji-half {
    position: absolute;
    inset: 0;
}

.taiji-black {
    background:
        radial-gradient(circle at 50% 25%, rgba(0,0,0,1) 0 18%, transparent 19% 100%),
        radial-gradient(circle at 50% 25%, rgba(0,0,0,0.9) 0 50%, transparent 51% 100%),
        linear-gradient(90deg, #000 0 50%, transparent 50% 100%);
}

.taiji-white {
    background:
        radial-gradient(circle at 50% 75%, rgba(255,255,255,1) 0 18%, transparent 19% 100%),
        radial-gradient(circle at 50% 75%, rgba(255,255,255,0.92) 0 50%, transparent 51% 100%),
        linear-gradient(90deg, transparent 0 50%, #fff 50% 100%);
    mix-blend-mode: screen;
}

.taiji-dot {
    position: absolute;
    width: 12%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    filter: blur(0.2px);
}

.dot-white { top: 22%; background: rgba(255,255,255,0.95); box-shadow: 0 0 12px rgba(255,255,255,0.35); }
.dot-black { top: 66%; background: rgba(0,0,0,0.95); box-shadow: 0 0 12px rgba(0,0,0,0.35); }

.taiji-gold-stroke {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(212,175,55,0.85);
    box-shadow: 0 0 24px rgba(212,175,55,0.35), inset 0 0 16px rgba(212,175,55,0.12);
    pointer-events: none;
}

/* 外圈八卦 */
.bagua-ring-outer {
    position: absolute;
    width: 86%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.96);
}

.bagua-ring-outer::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(212,175,55,0.35);
    box-shadow: 0 0 34px rgba(212,175,55,0.18);
}

/* 八卦文字稍微“书写感” */
.bagua-ring-outer .bagua-char {
    opacity: 0.92;
    filter: drop-shadow(0 0 10px rgba(212,175,55,0.20));
}

.bagua-char {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 0 0;
    color: rgba(244,228,188,0.95);
    text-shadow: 0 0 18px rgba(212,175,55,0.35);
    font-size: 1.05rem;
    letter-spacing: 0.15rem;
    font-family: 'STKaiti', 'KaiTi', 'Microsoft YaHei', serif;
}

.bagua-char.c1 { transform: rotate(0deg) translate(0, -44%) translate(-50%, -50%); }
.bagua-char.c2 { transform: rotate(45deg) translate(0, -44%) translate(-50%, -50%); }
.bagua-char.c3 { transform: rotate(90deg) translate(0, -44%) translate(-50%, -50%); }
.bagua-char.c4 { transform: rotate(135deg) translate(0, -44%) translate(-50%, -50%); }
.bagua-char.c5 { transform: rotate(180deg) translate(0, -44%) translate(-50%, -50%); }
.bagua-char.c6 { transform: rotate(225deg) translate(0, -44%) translate(-50%, -50%); }
.bagua-char.c7 { transform: rotate(270deg) translate(0, -44%) translate(-50%, -50%); }
.bagua-char.c8 { transform: rotate(315deg) translate(0, -44%) translate(-50%, -50%); }

/* 不显示提示文字（保留 DOM 但隐藏，避免布局抖动） */
.taiji-text { display: none; }


/* 水墨动画时间轴（由 JS 切换 body class 驱动） */
.taiji-animation-overlay.active .ink-wash {
    animation: inkWashIn 1.2s ease forwards;
}

@keyframes inkWashIn {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}

/* 阶段：黑鱼出现 */
.taiji-animation-overlay.phase-black .fish-orbit { opacity: 1; }
.taiji-animation-overlay.phase-black .ink-fish-black { opacity: 1; animation: inkFloat 3.2s ease-in-out infinite; }

/* 阶段：白鱼出现 */
.taiji-animation-overlay.phase-white .ink-fish-white { opacity: 1; animation: inkFloat 3.2s ease-in-out infinite reverse; }

/* 阶段：白鱼出现时确保轨道也可见 */
.taiji-animation-overlay.phase-white .fish-orbit { opacity: 1; }

@keyframes inkFloat {
    0%, 100% { filter: blur(0.2px); transform: translateX(-50%) rotate(90deg) scale(1); }
    50% { filter: blur(0.5px); transform: translateX(-50%) rotate(90deg) scale(1.03); }
}

/* 旋转绕圈：轨道整体旋转，模拟两鱼沿圆周旋转 */
.taiji-animation-overlay.phase-orbit .fish-orbit {
    opacity: 1;
    animation: orbitSpin 6.0s linear infinite;
}

/* 旋转阶段让两条鱼逐渐“拉伸成半圆”的视觉（像墨被离心拉长） */
.taiji-animation-overlay.phase-orbit .ink-fish {
    animation: inkStretch 3.2s ease-in-out infinite;
}

.taiji-animation-overlay.phase-orbit .ink-fish-white {
    animation-direction: reverse;
}

@keyframes inkStretch {
    0%, 100% {
        border-radius: 70% 30% 55% 45% / 55% 55% 45% 45%;
        filter: blur(0.2px);
        transform: translateX(-50%) rotate(90deg) scale(1);
    }
    50% {
        border-radius: 60% 40% 70% 30% / 45% 55% 45% 55%;
        filter: blur(0.55px);
        transform: translateX(-50%) rotate(90deg) scaleX(1.10) scaleY(0.95);
    }
}

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

/* 融合：两鱼逐渐拉伸成半圆的感觉（通过宽高+模糊+淡出配合核心显形） */
.taiji-animation-overlay.phase-merge .ink-fish {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.taiji-animation-overlay.phase-merge .taiji-core {
    opacity: 1;
    transform: scale(1);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

/* 融合阶段给太极边缘一点“墨晕” */
.taiji-animation-overlay.phase-merge .taiji-core {
    filter: drop-shadow(0 0 34px rgba(212, 175, 55, 0.22)) blur(0.0px);
}

/* 太极稳定旋转 */
.taiji-animation-overlay.phase-rotate .taiji-core {
    opacity: 1;
    transform: scale(1);
    animation: taijiSlowRotate 3.8s linear infinite;
}

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

/* 八卦外圈出现并慢转 */
.taiji-animation-overlay.phase-bagua .bagua-ring-outer {
    opacity: 1;
    transform: scale(1);
    transition: opacity 1.0s ease, transform 1.0s ease;
    animation: baguaRotate 12s linear infinite;
}

/* 外圈出现时先轻微“墨开”一下 */
.taiji-animation-overlay.phase-bagua .bagua-ring-outer::before {
    animation: ringInkIn 1.2s ease both;
}

@keyframes ringInkIn {
    0% { opacity: 0; filter: blur(2px); }
    100% { opacity: 1; filter: blur(0px); }
}

@keyframes baguaRotate {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(-360deg) scale(1); }
}
