:root {
    /* 主题颜色 */
    --primary-color: #4a2c82;
    --secondary-color: #7253b0;
    --accent-color: #d4af37;
    --text-color: #333333;
    --text-light: #ffffff;
    --bg-color: #f9f7ff;
    --bg-card: #ffffff;
    --shadow-color: rgba(74, 44, 130, 0.1);
    
    /* 字体 */
    --font-main: 'Noto Sans SC', sans-serif;
    --font-title: 'Noto Serif SC', serif;
    
    /* 尺寸 */
    --header-height: 70px;
    --border-radius: 8px;
    
    /* 过渡 */
    --transition-speed: 0.3s;
}

/* 暗黑模式变量 */
.dark-mode {
    --primary-color: #8a5ad1;
    --secondary-color: #644394;
    --text-color: #e1e1e1;
    --bg-color: #121212;
    --bg-card: #1e1e1e;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    margin-bottom: 1rem;
    line-height: 1.2;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--secondary-color);
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: var(--primary-color);
    position: relative;
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 15px auto 0;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: none;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-text {
    padding: 0;
    background: none;
    color: var(--primary-color);
    position: relative;
}

.btn-text::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -3px;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

.btn-text:hover::after {
    width: 100%;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 头部样式 */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--bg-card);
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 100;
    transition: background-color var(--transition-speed);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: var(--primary-color);
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin: 0 15px;
}

.main-nav a {
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width var(--transition-speed);
}

.main-nav a.active {
    color: var(--primary-color);
}

.main-nav a.active::after,
.main-nav a:hover::after {
    width: 100%;
}

.header-controls {
    display: flex;
    align-items: center;
}

.icon-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
    margin-right: 15px;
    transition: color var(--transition-speed);
}

.icon-button:hover {
    color: var(--primary-color);
}

.sign-in-button {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.sign-in-button:hover {
    background: var(--primary-color);
    color: white;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

/* 英雄区域样式 */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-color) 0%, #e6e1ff 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-outer {
    width: 100%;
}

.hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    width: 50%;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.hero-image {
    width: 40%;
    position: relative;
}

/* 起卦系统样式 */
.divination-section {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow-color);
    margin: 0 auto;
    max-width: 1100px;
}

.method-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 10px 25px;
    border: none;
    background: none;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    color: var(--text-color);
}

.tab-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    transition: width var(--transition-speed);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    width: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.method-cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.method-card {
    width: 200px;
    padding: 25px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    cursor: pointer;
}

.method-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.method-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.method-icon img {
    max-width: 100%;
    max-height: 100%;
}

.method-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.method-card p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.divination-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    border-top: 1px solid rgba(0,0,0,0.1);
    text-align: center;
}

.divination-form h3 {
    text-align: center;
    margin-bottom: 20px;
}

.question-types {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.type-btn {
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.type-btn.active {
    background: var(--primary-color);
    color: var(--text-light);
}

.question-input {
    margin-bottom: 30px;
}

.question-input textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    resize: vertical;
    font-family: var(--font-main);
    transition: border-color var(--transition-speed);
    background-color: var(--bg-color);
    color: var(--text-color);
}

.question-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 起卦按钮样式 */
#start-divination {
    display: block;
    margin: 0 auto;
    min-width: 200px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#start-divination:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(74, 44, 130, 0.3);
}

#start-divination:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(74, 44, 130, 0.2);
}

#start-divination::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right, 
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: rotate(30deg);
    transition: all 0.5s ease;
    opacity: 0;
}

#start-divination:hover::after {
    opacity: 1;
    left: 100%;
    transition: all 0.8s ease;
}

/* 卦象结果区域样式 */
.result-section {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow-color);
    margin: 30px auto;
    max-width: 1100px;
}

.result-section.hidden {
    display: none;
}

.hexagram-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.hexagram-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60%;
}

.hexagram {
    text-align: center;
    padding: 20px;
}

.hexagram h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.hexagram-visual {
    width: 120px;
    margin: 0 auto 10px;
}

.hexagram-name {
    font-weight: bold;
    font-size: 1.2rem;
}

.hexagram-arrow {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0 20px;
}

.fortune-indicator {
    width: 35%;
    padding: 20px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.fortune-meter {
    text-align: center;
}

.meter-label {
    font-weight: bold;
    margin-bottom: 10px;
}

.meter-bar {
    height: 12px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffaa33 50%, #33cc77 100%);
    width: 0;
    transition: width 1s ease-in-out;
}

.meter-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.analysis-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.analysis-tabs .tab-btn {
    padding: 10px 20px;
}

.analysis-content {
    padding: 0 20px;
    margin-bottom: 30px;
}

.analysis-content .tab-content {
    min-height: 250px;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* 学习资源区样式 */
.learn-section {
    background-color: var(--bg-color);
}

.learning-paths {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.path-card {
    width: 300px;
    padding: 30px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow-color);
    text-align: center;
    transition: transform var(--transition-speed);
}

.path-card:hover {
    transform: translateY(-10px);
}

.card-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: rgba(74, 44, 130, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* 社区区域样式 */
.community-section {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow-color);
    margin: 30px auto;
    max-width: 1100px;
    padding-bottom: 60px;
}

.feature-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.discussion-list, .masters-list {
    max-width: 800px;
    margin: 0 auto;
}

.placeholder-text {
    text-align: center;
    padding: 40px 0;
    color: rgba(0,0,0,0.5);
    font-style: italic;
}

/* 页脚样式 */
.main-footer {
    background-color: #2a1650;
    color: var(--text-light);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-about .footer-logo {
    height: 40px;
    margin-bottom: 15px;
}

.footer-about p {
    opacity: 0.8;
}

.footer-links h4 {
    margin-bottom: 20px;
    color: var(--accent-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-light);
    opacity: 0.8;
    transition: opacity var(--transition-speed);
}

.footer-links a:hover {
    opacity: 1;
}

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-family: var(--font-main);
}

.newsletter-form button {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    opacity: 0.6;
}

.social-links a {
    color: var(--text-light);
    margin-left: 20px;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity var(--transition-speed);
}

.social-links a:hover {
    opacity: 1;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 1.8rem;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    font-family: var(--font-main);
}

.form-footer {
    text-align: center;
    margin-top: 15px;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-text {
    opacity: 0;
    animation: fadeIn 1s forwards;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1.2s forwards;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 已经是纵向排列，不需要修改 hero-section .container */
    
    .hero-content, .hero-image {
        width: 100%;
        /* 文本已经居中，不需要修改 */
    }
    
    .hero-image {
        margin-top: 20px; /* 减少顶部间距 */
    }
}

@media (max-width: 768px) {
    .main-nav, .header-controls {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hexagram-container {
        flex-direction: column;
        width: 100%;
    }
    
    .hexagram-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }
    
    .fortune-indicator {
        width: 100%;
        margin-top: 30px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h2 {
        font-size: 2rem; /* 在小屏幕上减小字体大小 */
    }
    
    .hero-content p {
        font-size: 1rem; /* 在小屏幕上减小字体大小 */
    }
    
    .method-cards {
        flex-direction: column;
        align-items: center;
    }
}

/* 演算卦象区域样式 - 优化版 */
.divination-calculation {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.5s ease;
}

.divination-calculation.hidden {
    display: none;
}

.calculation-title {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-family: var(--font-title);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: pulseText 2s infinite alternate;
}

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

.calculation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calculation-animation {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-bottom: 30px;
}

.coin-animation {
    width: 40%;
    position: relative;
    perspective: 1000px;
}

.coin-container {
    position: relative;
    height: 150px;
    width: 150px;
    margin: 0 auto;
}

.coin {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #d4af37, #f2e279);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-weight: bold;
    color: #8e6b23;
    font-size: 1.5rem;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.coin .front,
.coin .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.coin .front {
    background: linear-gradient(45deg, #d4af37, #f2e279);
    z-index: 2;
}

.coin .back {
    background: linear-gradient(45deg, #c09b2f, #e0d169);
    transform: rotateY(180deg);
}

.coin:nth-child(1) {
    top: 0;
    left: 0;
    animation: flipCoin1 3s infinite;
}

.coin:nth-child(2) {
    top: 10px;
    left: 50px;
    animation: flipCoin2 3s infinite;
    animation-delay: 0.2s;
}

.coin:nth-child(3) {
    top: 20px;
    left: 25px;
    animation: flipCoin3 3s infinite;
    animation-delay: 0.4s;
}

@keyframes flipCoin1 {
    0%, 100% { transform: rotateY(0deg) translateY(0) rotateZ(0deg); }
    10% { transform: rotateY(0deg) translateY(-10px) rotateZ(0deg); }
    40% { transform: rotateY(1800deg) translateY(-60px) rotateZ(180deg); }
    60% { transform: rotateY(1800deg) translateY(-20px) rotateZ(180deg); }
    75% { transform: rotateY(1800deg) translateY(-40px) rotateZ(360deg); }
    90% { transform: rotateY(0deg) translateY(-10px) rotateZ(360deg); }
}

@keyframes flipCoin2 {
    0%, 100% { transform: rotateY(0deg) translateY(0) rotateZ(0deg); }
    15% { transform: rotateY(0deg) translateY(-15px) rotateZ(0deg); }
    45% { transform: rotateY(1800deg) translateY(-50px) rotateZ(-180deg); }
    65% { transform: rotateY(1800deg) translateY(-10px) rotateZ(-180deg); }
    80% { transform: rotateY(1800deg) translateY(-30px) rotateZ(-360deg); }
    95% { transform: rotateY(0deg) translateY(-5px) rotateZ(-360deg); }
}

@keyframes flipCoin3 {
    0%, 100% { transform: rotateY(0deg) translateY(0) rotateZ(0deg); }
    5% { transform: rotateY(0deg) translateY(-5px) rotateZ(0deg); }
    35% { transform: rotateY(1800deg) translateY(-70px) rotateZ(90deg); }
    55% { transform: rotateY(1800deg) translateY(-30px) rotateZ(90deg); }
    70% { transform: rotateY(1800deg) translateY(-50px) rotateZ(180deg); }
    85% { transform: rotateY(0deg) translateY(-20px) rotateZ(180deg); }
}

.energy-flow {
    position: absolute;
    top: 50%;
    right: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent-color));
    transform: translateY(-50%);
    opacity: 0;
    animation: flowEnergy 3s infinite;
    height: 4px;
    box-shadow: 0 0 15px var(--accent-color);
}

.energy-flow:after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color);
}

@keyframes flowEnergy {
    0% { width: 0; opacity: 0; }
    10% { opacity: 0.3; }
    50% { width: 100px; opacity: 1; }
    80% { width: 120px; opacity: 0.5; }
    100% { width: 150px; opacity: 0; }
}

.yao-building {
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.hexagram-forming {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 240px;
    justify-content: flex-end;
    background: radial-gradient(circle at center, rgba(74, 44, 130, 0.1) 0%, transparent 70%);
    border-radius: 10px;
    padding: 15px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    position: relative;
    transform-style: preserve-3d;
    perspective: 800px;
}

.hexagram-forming .yao {
    width: 150px;
    height: 20px;
    margin: 8px 0;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    transform-origin: center;
}

.hexagram-forming .yao.animated {
    opacity: 1;
    transform: scale(1);
    animation: yaoAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes yaoAppear {
    0% { 
        opacity: 0;
        transform: scale(0.5) translateX(-50px); 
    }
    70% { 
        opacity: 1;
        transform: scale(1.1) translateX(10px); 
    }
    100% { 
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

.hexagram-forming .yao:before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle at center, var(--accent-color, #d4af37) 0%, transparent 80%);
    opacity: 0;
    border-radius: 5px;
    z-index: -1;
    animation: glowPulse 2s ease-out;
}

@keyframes glowPulse {
    0% { opacity: 0.7; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(1); }
}

.hexagram-forming .yang .yao-line {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(74, 44, 130, 0.3);
}

.hexagram-forming .yin .yao-line {
    width: 45%;
    height: 8px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(74, 44, 130, 0.3);
}

.hexagram-forming .yin .yao-line.left {
    margin-right: 10%;
}

.hexagram-forming .yao.changing:after {
    content: "○";
    position: absolute;
    right: -25px;
    font-size: 18px;
    color: var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.5; transform: scale(0.9); }
}

.calculation-progress {
    width: 100%;
    margin-top: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.progress-text {
    margin-bottom: 15px;
    color: var(--text-color);
    font-style: italic;
    animation: fadeInOut 4s infinite;
}

@keyframes fadeInOut {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.progress-indicator {
    width: 100%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.progress-steps .step {
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(0,0,0,0.1);
    font-size: 1rem;
    color: var(--text-color);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-steps .step.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(74, 44, 130, 0.4);
    animation: stepPulse 1s infinite alternate;
}

@keyframes stepPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.progress-steps .step.active:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -50%; }
    100% { left: 150%; }
}

.progress-steps .step.completed {
    background-color: var(--secondary-color);
    color: white;
}

.progress-bar {
    position: relative;
    height: 10px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.progress-bar .progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
    box-shadow: 0 0 10px var(--primary-color);
    will-change: width;
    transition: width 0.3s ease-out;
}

.progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
    z-index: 2;
    animation: progressShimmer 2s infinite linear;
}

@keyframes progressShimmer {
    0% { transform: translateX(0%); }
    100% { transform: translateX(250%); }
}

/* 修正进度条闪光效果 */
.progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.4) 50%, 
        rgba(255,255,255,0) 100%);
    animation: shimmer 2s infinite;
}

.progress-bar .progress-fill[style*="width"] {
    transition: width 0.3s linear !important;
}

@keyframes shimmer {
    0% { transform: translateX(-150%) skewX(-45deg); }
    100% { transform: translateX(150%) skewX(-45deg); }
}

/* 能量粒子效果 */
.energy-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    transform: translateZ(0);
}

@keyframes particleFloat {
    0% { 
        transform: translateY(100px) translateX(0) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    100% { 
        transform: translateY(-100px) translateX(var(--x-end)) scale(1);
        opacity: 0;
    }
}

.forming-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: radial-gradient(ellipse at center bottom, 
                               rgba(74, 44, 130, 0.3) 0%, 
                               rgba(212, 175, 55, 0.1) 50%, 
                               transparent 70%);
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

.forming-glow.active {
    opacity: 1;
    animation: glowPulse 3s infinite alternate;
}

@keyframes glowPulse {
    0% { opacity: 0.3; transform: scale(0.95); }
    100% { opacity: 0.7; transform: scale(1.05); }
}

/* 确保响应式设计 */
@media (max-width: 768px) {
    .calculation-animation {
        flex-direction: column;
        align-items: center;
    }
    
    .coin-animation, .yao-building {
        width: 80%;
        margin-bottom: 30px;
    }
    
    .progress-steps .step {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .coin-container {
        height: 120px;
        width: 120px;
    }
    
    .coin {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {
    .coin {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .hexagram-forming {
        height: 200px;
    }
    
    .hexagram-forming .yao {
        width: 120px;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .progress-steps .step {
        font-size: 0.7rem;
        padding: 5px 8px;
    }
}

/* 黑暗模式适配 */
.dark-mode .forming-glow {
    background: radial-gradient(ellipse at center bottom, 
                               rgba(138, 90, 209, 0.3) 0%, 
                               rgba(212, 175, 55, 0.1) 50%, 
                               transparent 70%);
}

.dark-mode .coin .front {
    background: linear-gradient(45deg, #c09b2f, #e0d169);
}

.dark-mode .coin .back {
    background: linear-gradient(45deg, #b08f2c, #d1c362);
}

/* 卦象解析等待动画样式 */
.analysis-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.analysis-loading.hidden {
    display: none;
}

.loading-container {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    border-radius: var(--border-radius);
    background-color: var(--bg-card);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.hexagram-loader {
    width: 120px;
    height: 160px;
    margin: 0 auto 30px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
}

.hexagram-loader .yao {
    height: 16px;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 8px;
    animation: loadingPulse 1.5s infinite;
    opacity: 0.5;
}

.hexagram-loader .yao.yao1 { animation-delay: 0s; }
.hexagram-loader .yao.yao2 { animation-delay: 0.2s; }
.hexagram-loader .yao.yao3 { animation-delay: 0.4s; }
.hexagram-loader .yao.yao4 { animation-delay: 0.6s; }
.hexagram-loader .yao.yao5 { animation-delay: 0.8s; }
.hexagram-loader .yao.yao6 { animation-delay: 1.0s; }

.hexagram-loader .yao:nth-child(even)::before,
.hexagram-loader .yao:nth-child(even)::after {
    content: "";
    position: absolute;
    height: 100%;
    width: 45%;
    background-color: var(--primary-color);
    border-radius: 8px;
}

.hexagram-loader .yao:nth-child(even) {
    background: none;
    position: relative;
}

.hexagram-loader .yao:nth-child(even)::before {
    left: 0;
}

.hexagram-loader .yao:nth-child(even)::after {
    right: 0;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loading-title {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.loading-subtitle {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 25px;
}

.loading-progress {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.loading-dot {
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: dotBounce 1.5s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.3s; }
.loading-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotBounce {
    0%, 80%, 100% { 
        transform: translateY(0); 
    }
    40% { 
        transform: translateY(-12px); 
    }
}
