/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f3e9;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 卡片阴影样式 */
.card-shadow {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* 占卜区域 */
.divination-section {
    padding: 30px;
    border-left: 5px solid #8B4513;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #8B4513;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: #8B4513;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #8B4513;
}

.input-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #777;
    font-style: italic;
}

/* 安全提示样式 */
.security-note {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.security-note i {
    color: #d68910;
    font-size: 1.2rem;
    margin-top: 2px;
}

.security-note p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.5;
}

.divine-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.divine-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.divine-btn:active {
    transform: translateY(0);
}

/* 结果区域 */
.result-section {
    padding: 30px;
    border-left: 5px solid #CD853F;
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.divination-time {
    color: #777;
    font-style: italic;
}

/* 卦象卡片 */
.trigram-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 600px) {
    .trigram-cards {
        grid-template-columns: 1fr;
    }
}

.trigram-card {
    background: linear-gradient(135deg, #f8f5f0 0%, #f0e6d2 100%);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0d6c2;
}

.trigram-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

#month-trigram::before {
    background: #8B4513;
}

#day-trigram::before {
    background: #CD853F;
}

#hour-trigram::before {
    background: #DEB887;
}

.trigram-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.trigram-title {
    font-size: 1rem;
    color: #777;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.trigram-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #8B4513;
}

/* 卦象注解 */
.interpretation {
    background: #f9f7f2;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #8B4513;
}

.interpretation-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #555;
}

.hour-msg {
    line-height: 1.8;
    color: #444;
    white-space: pre-line;
}

/* 介绍区域 */
.introduction-section {
    padding: 30px;
    margin-bottom: 40px;
}

.intro-text {
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

/* 优化后的页脚样式 */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    border-top: 2px solid rgba(139, 69, 19, 0.1);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
}

.copyright {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.友情链接 {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(139, 69, 19, 0.1);
}

.links-title {
    font-size: 0.9rem;
    color: #888;
    font-weight: 500;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 15px;
    background: rgba(139, 69, 19, 0.08);
    color: #8B4513;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 69, 19, 0.15);
}

.footer-link:hover {
    background: rgba(139, 69, 19, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(139, 69, 19, 0.2);
}

.separator {
    color: rgba(139, 69, 19, 0.3);
    font-size: 0.9rem;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .友情链接 {
        flex-direction: column;
        gap: 8px;
    }
    
    .separator {
        display: none;
    }
    
    .footer-link {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* 重置按钮样式 */
.reset-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.reset-btn:active {
    transform: translateY(0);
}

/* 分享按钮样式 */
.share-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #4CAF50 !important;
    color: white !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.share-btn:hover {
    background: #45a049 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.share-btn:active {
    transform: translateY(0);
}

/* 起卦仪式模态框样式 */
.ritual-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
    transition: opacity 0.5s ease;
}

.ritual-content {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.ritual-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    pointer-events: none;
}

.ritual-header h2 {
    color: #f8f9fa;
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.ritual-steps {
    margin-bottom: 20px;
}

.ritual-step {
    display: none;
}

/* 深呼吸步骤样式 */
.breathing-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.circle-inner {
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, #3498db, #2980b9);
    border-radius: 50%;
    position: absolute;
    transition: transform 4s ease-in-out, box-shadow 4s ease-in-out;
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.5);
}

.breathing-instruction {
    color: #ecf0f1;
    font-size: 20px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.breathing-count {
    color: #3498db;
    font-size: 48px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 20px rgba(52, 152, 219, 0.8);
}

/* 集中精神步骤样式 */
.focus-image {
    margin: 40px auto;
    color: #2ecc71;
    opacity: 0.8;
    transition: transform 3s ease-in-out;
    filter: drop-shadow(0 0 20px rgba(46, 204, 113, 0.5));
}

.focus-instruction {
    color: #ecf0f1;
    font-size: 20px;
    line-height: 1.5;
    padding: 0 20px;
    opacity: 0;
    transition: opacity 1s ease;
}

/* 倒计时步骤样式 */
.countdown-number {
    color: #e74c3c;
    font-size: 80px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(231, 76, 60, 0.7);
    transition: transform 0.5s ease;
}

.countdown-text {
    color: #ecf0f1;
    font-size: 18px;
}

/* 提示信息样式 */
.ritual-tips {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ritual-tips p {
    color: #bdc3c7;
    font-size: 14px;
    font-style: italic;
}

/* 加载覆盖层样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 悬浮动画 */
@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(-40px) translateX(-10px); }
    75% { transform: translateY(-20px) translateX(10px); }
    100% { transform: translateY(0) translateX(0); }
}

/* 卡片悬停增强 */
.trigram-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.trigram-card:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* 按钮点击效果增强 */
.divine-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.divine-btn:active {
    transform: scale(0.98);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .header,
    .divination-section,
    .result-section,
    .introduction-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .trigram-value {
        font-size: 1.5rem;
    }
}
