/* 八字结果组件样式 */
.bazi-result-container {
    max-width: 100%;

    margin: 0 auto;
    padding: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 标题样式已移至伪元素，此样式保留以确保兼容性 */
.section-title {
    display: none;
}

/* 基本信息区域头部 */
.section-header {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 40px 0 0;
    min-height: 40px;
}

/* 标题标签化样式 - 右上角标签 */
.bazi-result-container .section-header[data-title]::before,
.bazi-result-container .four-pillars-section::before,
.bazi-result-container .elements-section::before,
.bazi-result-container .ten-gods-section::before,
.bazi-result-container .branch-ten-gods-section::before,
.bazi-result-container .take-sound-section::before,
.bazi-result-container .missing-section::before,
.bazi-result-container .gods-section::before,
.bazi-result-container .dayun-section::before {
    content: attr(data-title);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(222, 226, 230, 0.8);
    color: #495057;
    padding: 4px 12px;
    border-radius: 0 0 12px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1;
}

/* 为所有带有 data-title 的区域添加相对定位 */
.section-header,
.four-pillars-section,
.elements-section,
.ten-gods-section,
.branch-ten-gods-section,
.take-sound-section,
.missing-section,
.gods-section,
.dayun-section {
    position: relative;
}

/* 自定义关闭按钮 */
.custom-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    line-height: 1;
}

.custom-close-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
    transform: scale(1.1);
}

.custom-close-btn:active {
    transform: scale(0.95);
}

/* 基本信息区域 */
.basic-info-section {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* AI分析按钮区域 */
.bazi-result-container .ai-analysis-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 15px;
}

.bazi-result-container .ai-analysis-buttons button {
    padding: 10px 15px;
    background: linear-gradient(135deg, #2d8c8f 0%, #3aa8ab 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 8px rgba(45, 140, 143, 0.2);
}

.bazi-result-container .ai-analysis-buttons button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #3aa8ab 0%, #4ac8cb 100%);
    box-shadow: 0 6px 16px rgba(45, 140, 143, 0.35);
}

.bazi-result-container .ai-analysis-buttons button:active {
    transform: translateY(0);
    background: linear-gradient(135deg, #257a7d 0%, #2d8c8f 100%);
    box-shadow: 0 2px 8px rgba(45, 140, 143, 0.2);
}

.bazi-result-container .ai-analysis-buttons button:disabled,
.bazi-result-container .ai-analysis-buttons button.disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

.bazi-result-container .ai-analysis-buttons button:disabled:hover,
.bazi-result-container .ai-analysis-buttons button.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* AI回复区域 */
.ai-response-section {
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ai-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ai-response-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d8c8f;
    margin: 0;
}

.ai-response-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.ai-response-toggle:hover {
    background: #f8f9fa;
    color: #495057;
}

.ai-response-content {
    line-height: 1.6;
    color: #212529;
    font-size: 0.95rem;
}

/* 加载动画 */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d8c8f;
    font-size: 0.9rem;
}

.loading-dots {
    display: flex;
    gap: 3px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: #2d8c8f;
    border-radius: 50%;
    animation: loading-pulse 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading-pulse {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.info-grid {
    display: grid;
    grid-template-areas: 
        "name gender zodiac"
        "birth birth birth";
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* 为每个info-item分配grid区域 */
.info-item:nth-child(1) {
    grid-area: name;
}

.info-item:nth-child(2) {
    grid-area: gender;
}

.info-item:nth-child(3) {
    grid-area: birth;
}

.info-item:nth-child(4) {
    grid-area: zodiac;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
}

.info-value {
    color: #212529;
    font-weight: 500;
}

/* 四柱排盘区域 */
.four-pillars-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

/* 五行分析区域 */
.elements-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.elements-table {
    margin-bottom: 20px;
}

.elements-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
}

.elements-header {
    background: linear-gradient(135deg, #2d8c8f 0%, #3aa8ab 100%);
    color: white;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

.elements-cell {
    text-align: center;
    padding: 8px;
    font-weight: 500;
}

.elements-row:not(.elements-header) .elements-cell {
    background: #f8f9fa;
    border-radius: 4px;
}

.elements-cell.element-木 {
    color: #4CAF50;
    font-weight: 600;
}

.elements-cell.element-火 {
    color: #F44336;
    font-weight: 600;
}

.elements-cell.element-土 {
    color: #FF9800;
    font-weight: 600;
}

.elements-cell.element-金 {
    color: #FFC107;
    font-weight: 600;
}

.elements-cell.element-水 {
    color: #2196F3;
    font-weight: 600;
}

.elements-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.elements-stats h4 {
    color: #2d8c8f;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.stat-item {
    text-align: center;
    background: white;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #e9ecef;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-fill.element-木 {
    background: linear-gradient(90deg, #4CAF50 0%, #66BB6A 100%);
}

.stat-fill.element-火 {
    background: linear-gradient(90deg, #F44336 0%, #EF5350 100%);
}

.stat-fill.element-土 {
    background: linear-gradient(90deg, #FF9800 0%, #FFA726 100%);
}

.stat-fill.element-金 {
    background: linear-gradient(90deg, #FFC107 0%, #FFCA28 100%);
}

.stat-fill.element-水 {
    background: linear-gradient(90deg, #2196F3 0%, #42A5F5 100%);
}

.stat-count {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}

/* 四柱排盘区域 */
.four-pillars-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.pillar {
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.pillar:hover {
    border-color: #2d8c8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 140, 143, 0.2);
}

.pillar-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 600;
}

.pillar-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tian-gan, .di-zhi {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d8c8f;
    padding: 5px;
    border-radius: 4px;
    background: rgba(45, 140, 143, 0.1);
}

/* 十神分析区域 */
.ten-gods-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.ten-gods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.ten-god-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.ten-god-item:hover {
    border-color: #2d8c8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 140, 143, 0.2);
}

.ten-god-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.ten-god-value {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    min-height: 24px;
}

/* 地支藏干十神区域 */
.branch-ten-gods-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.branch-ten-gods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.branch-ten-god-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.branch-ten-god-item:hover {
    border-color: #2d8c8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 140, 143, 0.2);
}

.branch-ten-god-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.branch-ten-god-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    min-height: 24px;
    word-break: break-all;
}

/* 纳音区域 */
.take-sound-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.take-sound-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.take-sound-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.take-sound-item:hover {
    border-color: #2d8c8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 140, 143, 0.2);
}

.take-sound-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.take-sound-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2d8c8f;
    min-height: 24px;
}

/* 空亡地支区域 */
.missing-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.missing-content {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.missing-value {
    font-size: 1rem;
    font-weight: 600;
    color: #856404;
}

/* 神煞区域 */
.gods-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
}

.gods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.god-item {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1e8e9 100%);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    border: 1px solid #b8d4d9;
    transition: all 0.3s ease;
}

.god-item:hover {
    border-color: #2d8c8f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 140, 143, 0.2);
}

.god-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.god-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d8c8f;
    min-height: 24px;
    word-break: break-all;
}

/* 操作按钮区域 */
.action-section {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.bazi-result-container .action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.bazi-result-container .action-btn.primary {
    background: linear-gradient(135deg, #2d8c8f 0%, #3aa8ab 100%);
    color: white;
}

.bazi-result-container .action-btn.secondary {
    background: #6c757d;
    color: white;
}

.bazi-result-container .action-btn.outline {
    background: transparent;
    color: #2d8c8f;
    border: 2px solid #2d8c8f;
}

.bazi-result-container .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .bazi-result-container {
        border-radius: 0;
        box-shadow: none;
    }
    
    /* 移动端标题标签字体大小 */
    .bazi-result-container .section-header[data-title]::before,
    .bazi-result-container .four-pillars-section::before,
    .bazi-result-container .elements-section::before,
    .bazi-result-container .ten-gods-section::before,
    .bazi-result-container .branch-ten-gods-section::before,
    .bazi-result-container .take-sound-section::before,
    .bazi-result-container .missing-section::before,
    .bazi-result-container .gods-section::before,
    .bazi-result-container .dayun-section::before {
        font-size: 11px;
    }
    
    /* AI分析按钮区域响应式 */
    .bazi-result-container .ai-analysis-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 15px;
        margin-bottom: 12px;
    }
    
    .bazi-result-container .ai-analysis-buttons button {
        padding: 8px 12px;
        font-size: 0.85rem;
        background: linear-gradient(135deg, #2d8c8f 0%, #3aa8ab 100%);
        color: white;
        border: none;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(45, 140, 143, 0.2);
    }
    
    /* AI回复区域响应式 */
    .ai-response-section {
        padding: 12px;
        margin-top: 12px;
    }
    
    .ai-response-header {
        margin-bottom: 12px;
    }
    
    .ai-response-title {
        font-size: 1rem;
    }
    
    .ai-response-content {
        font-size: 0.9rem;
    }
    
    .basic-info-section {
        padding: 12px;
    }
    
    .info-grid {
        grid-template-areas: 
            "name gender zodiac"
            "birth birth birth";
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .info-label {
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .info-value {
        font-size: 0.9rem;
    }
    
    .four-pillars-section,
    .elements-section,
    .ten-gods-section,
    .branch-ten-gods-section,
    .take-sound-section,
    .missing-section,
    .gods-section,
    .dayun-section {
        padding: 12px;
    }
    
    .pillars-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .pillar {
        padding: 8px 5px;
    }
    
    .pillar-label {
        font-size: 0.75rem;
        margin-bottom: 5px;
    }
    
    .tian-gan, .di-zhi {
        font-size: 1.1rem;
        padding: 3px;
    }
    
    .ten-gods-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .ten-god-item {
        padding: 8px 5px;
    }
    
    .ten-god-label {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    
    .ten-god-value {
        font-size: 0.85rem;
        min-height: 20px;
    }
    
    .branch-ten-gods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .branch-ten-god-item {
        padding: 8px 5px;
    }
    
    .branch-ten-god-label {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    
    .branch-ten-god-value {
        font-size: 0.85rem;
        min-height: 20px;
    }
    
    .take-sound-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .take-sound-item {
        padding: 8px 5px;
    }
    
    .take-sound-label {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    
    .take-sound-value {
        font-size: 0.85rem;
        min-height: 20px;
    }
    
    .gods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .god-item {
        padding: 8px 5px;
    }
    
    .god-label {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    
    .god-value {
        font-size: 0.85rem;
        min-height: 20px;
    }
    
    .elements-stats {
        padding: 10px;
    }
    
    .elements-stats h4 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .stats-grid {
        gap: 6px;
    }
    
    .stat-item {
        padding: 8px 5px;
    }
    
    .stat-label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .stat-bar {
        height: 6px;
        margin-bottom: 5px;
    }
    
    .stat-count {
        font-size: 0.8rem;
    }
    
    /* 五行分析区域移动端优化 */
    .elements-table {
        margin-bottom: 12px;
    }
    
    .elements-row {
        padding: 8px 6px;
        gap: 6px;
    }
    
    .elements-cell {
        padding: 6px 4px;
        font-size: 0.9rem;
    }
    
    .elements-header {
        border-radius: 4px 4px 0 0;
    }
    
    .action-section {
        padding: 12px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .bazi-result-container .action-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
        flex: 1;
        min-width: 80px;
    }
    
    .dayun-item {
        padding: 12px;
    }
    
    .dayun-header {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 5px;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    
    .dayun-age {
        font-size: 1rem;
    }
    
    .dayun-years {
        font-size: 0.8rem;
    }
    
    .dayun-pillar {
        font-size: 1.1rem;
    }
    
    .liunian-title {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .liunian-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }
    
    .liunian-item {
        padding: 8px 10px;
    }
    
    .liunian-year {
        font-size: 0.9rem;
    }
    
    .liunian-pillar {
        font-size: 0.8rem;
    }
    
    .start-age-info {
        padding: 8px 10px;
        margin-bottom: 10px;
    }
    
    .start-age-label {
        font-size: 0.8rem;
    }
    
    .start-age-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .basic-info-section {
        padding: 10px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .info-item {
        flex-direction: row;
        align-items: center;
        gap: 5px;
    }
    
    .four-pillars-section,
    .elements-section,
    .ten-gods-section,
    .branch-ten-gods-section,
    .take-sound-section,
    .missing-section,
    .gods-section,
    .dayun-section {
        padding: 10px;
    }
    
    .pillars-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        margin-bottom: 10px;
    }
    
    .pillar {
        padding: 6px 3px;
    }
    
    .pillar-label {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    
    .tian-gan, .di-zhi {
        font-size: 1rem;
        padding: 2px;
    }
    
    .ten-gods-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .ten-god-item {
        padding: 6px 3px;
    }
    
    .ten-god-label {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .ten-god-value {
        font-size: 0.8rem;
        min-height: 18px;
    }
    
    .branch-ten-gods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .branch-ten-god-item {
        padding: 6px 3px;
    }
    
    .branch-ten-god-label {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .branch-ten-god-value {
        font-size: 0.8rem;
        min-height: 18px;
    }
    
    .take-sound-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .take-sound-item {
        padding: 6px 3px;
    }
    
    .take-sound-label {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .take-sound-value {
        font-size: 0.8rem;
        min-height: 18px;
    }
    
    .gods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .god-item {
        padding: 6px 3px;
    }
    
    .god-label {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .god-value {
        font-size: 0.8rem;
        min-height: 18px;
    }
    
    /* 五行分析区域小屏幕优化 */
    .elements-table {
        margin-bottom: 10px;
    }
    
    .elements-row {
        padding: 6px 4px;
        gap: 4px;
    }
    
    .elements-cell {
        padding: 5px 3px;
        font-size: 0.85rem;
    }
    
    .elements-header {
        border-radius: 3px 3px 0 0;
    }
    
    .elements-stats {
        padding: 8px;
    }
    
    .elements-stats h4 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .stats-grid {
        gap: 4px;
    }
    
    .stat-item {
        padding: 6px 3px;
    }
    
    .stat-label {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    
    .stat-bar {
        height: 5px;
        margin-bottom: 4px;
    }
    
    .stat-count {
        font-size: 0.75rem;
    }
    
    .action-section {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .bazi-result-container .action-btn {
        width: 100%;
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .dayun-item {
        padding: 10px;
    }
    
    .dayun-header {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 3px;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    
    .dayun-age {
        font-size: 0.9rem;
    }
    
    .dayun-years {
        font-size: 0.75rem;
    }
    
    .dayun-pillar {
        font-size: 1rem;
    }
    
    .liunian-title {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .liunian-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 5px;
    }
    
    .liunian-item {
        padding: 6px 8px;
    }
    
    .liunian-year {
        font-size: 0.85rem;
    }
    
    .liunian-pillar {
        font-size: 0.75rem;
    }
    
    .start-age-info {
        padding: 6px 8px;
        margin-bottom: 8px;
    }
    
    .start-age-label {
        font-size: 0.75rem;
    }
    
    .start-age-value {
        font-size: 0.85rem;
    }
    
    .section-header {
        margin-bottom: 12px;
    }
    
    .custom-close-btn {
        font-size: 1.5rem;
        padding: 3px 8px;
    }
}

@media (max-width: 360px) {
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ten-gods-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .take-sound-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-grid {
        grid-template-areas: 
            "name gender zodiac"
            "birth birth birth";
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    /* 调整超小屏幕下的grid区域分配 */
    .info-item:nth-child(3) {
        grid-area: birth;
    }
    
    .info-item:nth-child(4) {
        grid-area: zodiac;
    }
    
    /* 五行分析区域超小屏幕优化 */
    .elements-table {
        margin-bottom: 8px;
    }
    
    .elements-row {
        padding: 5px 3px;
        gap: 3px;
    }
    
    .elements-cell {
        padding: 4px 2px;
        font-size: 0.8rem;
    }
    
    .elements-header {
        border-radius: 2px 2px 0 0;
    }
    
    .elements-stats {
        padding: 6px;
    }
    
    .elements-stats h4 {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .stats-grid {
        gap: 3px;
    }
    
    .stat-item {
        padding: 5px 2px;
    }
    
    .stat-label {
        font-size: 0.8rem;
        margin-bottom: 3px;
    }
    
    .stat-bar {
        height: 4px;
        margin-bottom: 3px;
    }
    
    .stat-count {
        font-size: 0.7rem;
    }
}

/* 暗色主题 */
body.dark-theme .bazi-result-container {
    background: #1A1A1F;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 暗色主题下的标题标签 */
body.dark-theme .section-header[data-title]::before,
body.dark-theme .four-pillars-section::before,
body.dark-theme .elements-section::before,
body.dark-theme .ten-gods-section::before,
body.dark-theme .branch-ten-gods-section::before,
body.dark-theme .take-sound-section::before,
body.dark-theme .missing-section::before,
body.dark-theme .gods-section::before,
body.dark-theme .dayun-section::before {
    background-color: rgba(212, 175, 55, 0.8);
    color: #1A1A1F;
}

body.dark-theme .basic-info-section {
    background: linear-gradient(135deg, #2D2D33 0%, #25252B 100%);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

body.dark-theme .basic-info-section,
body.dark-theme .four-pillars-section,
body.dark-theme .elements-section,
body.dark-theme .ten-gods-section,
body.dark-theme .branch-ten-gods-section,
body.dark-theme .take-sound-section,
body.dark-theme .missing-section,
body.dark-theme .gods-section {
    background: #25252B;
    border-bottom-color: #3A3A40;
    margin-bottom: 0;
}

body.dark-theme .info-label {
    color: #B8B8B8;
}

body.dark-theme .info-value {
    color: #E8E8E8;
}

body.dark-theme .info-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: 6px;
}

body.dark-theme .four-pillars-section {
    border-bottom-color: #3A3A40;
}

body.dark-theme .pillar {
    background: #2D2D33;
    border-color: #3A3A40;
}

body.dark-theme .pillar:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

body.dark-theme .pillar-label {
    color: #B8B8B8;
}

body.dark-theme .tian-gan,
body.dark-theme .di-zhi {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.15);
}

body.dark-theme .ten-gods-section {
    border-bottom-color: #3A3A40;
}

body.dark-theme .ten-god-item {
    background: #2D2D33;
    border-color: #3A3A40;
}

body.dark-theme .ten-god-item:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

body.dark-theme .ten-god-label {
    color: #B8B8B8;
}

body.dark-theme .ten-god-value {
    color: #E8E8E8;
}

/* 暗色主题下的AI分析按钮 */
body.dark-theme .bazi-result-container .ai-analysis-buttons button {
    background: linear-gradient(135deg, #d4af37 0%, #e5c158 100%);
    color: #1A1A1F;
    border: 1px solid #d4af37;
}

body.dark-theme .bazi-result-container .ai-analysis-buttons button:hover {
    background: linear-gradient(135deg, #e5c158 0%, #f5d178 100%);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

body.dark-theme .bazi-result-container .ai-analysis-buttons button:active {
    background: linear-gradient(135deg, #c9a12e 0%, #d4af37 100%);
}

/* 暗色主题下的AI回复区域 */
body.dark-theme .ai-response-section {
    background: #2D2D33;
    border: 1px solid #3A3A40;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark-theme .ai-response-title {
    color: #d4af37;
}

body.dark-theme .ai-response-toggle {
    color: #B8B8B8;
}

body.dark-theme .ai-response-toggle:hover {
    background: #3A3A40;
    color: #d4af37;
}

body.dark-theme .ai-response-content {
    color: #E8E8E8;
}

body.dark-theme .loading-indicator {
    color: #d4af37;
}

body.dark-theme .loading-dot {
    background: #d4af37;
}

body.dark-theme .branch-ten-gods-section {
    border-bottom-color: #3A3A40;
}

body.dark-theme .branch-ten-god-item {
    background: #2D2D33;
    border-color: #3A3A40;
}

body.dark-theme .branch-ten-god-item:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

body.dark-theme .branch-ten-god-label {
    color: #B8B8B8;
}

body.dark-theme .branch-ten-god-value {
    color: #E8E8E8;
}

body.dark-theme .take-sound-section {
    border-bottom-color: #3A3A40;
}

body.dark-theme .take-sound-item {
    background: linear-gradient(135deg, #2D2D33 0%, #25252B 100%);
    border-color: #3A3A40;
}

body.dark-theme .take-sound-item:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

body.dark-theme .take-sound-label {
    color: #B8B8B8;
}

body.dark-theme .take-sound-value {
    color: #d4af37;
}

body.dark-theme .missing-section {
    border-bottom-color: #3A3A40;
}

body.dark-theme .missing-content {
    background: rgba(212, 175, 55, 0.15);
    border-color: #d4af37;
}

body.dark-theme .missing-value {
    color: #d4af37;
}

body.dark-theme .gods-section {
    border-bottom-color: #3A3A40;
}

body.dark-theme .god-item {
    background: linear-gradient(135deg, #2D2D33 0%, #25252B 100%);
    border-color: #3A3A40;
}

body.dark-theme .god-item:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

body.dark-theme .god-label {
    color: #B8B8B8;
}

body.dark-theme .god-value {
    color: #d4af37;
}

body.dark-theme .action-section {
    background: #25252B;
    border-top-color: #3A3A40;
}

body.dark-theme .bazi-result-container .action-btn.outline {
    color: #d4af37;
    border-color: #d4af37;
}

body.dark-theme .bazi-result-container .action-btn.outline:hover {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* 五行分析区域 - 暗色主题 */
body.dark-theme .elements-section {
    border-bottom-color: #3A3A40;
}

body.dark-theme .elements-row {
    border-bottom-color: #3A3A40;
}

body.dark-theme .elements-header {
    background: linear-gradient(135deg, #3A3A40 0%, #4A4A50 100%);
    color: #E8E8E8;
}

body.dark-theme .elements-row:not(.elements-header) .elements-cell {
    background: #25252B;
}

body.dark-theme .elements-stats {
    background: #25252B;
}

body.dark-theme .elements-stats h4 {
    color: #d4af37;
}

body.dark-theme .stat-item {
    background: #1A1A1F;
    border-color: #3A3A40;
}

body.dark-theme .stat-bar {
    background: #3A3A40;
}

/* 大运流年区域 */
.dayun-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.start-age-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.start-age-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.start-age-value {
    font-size: 1rem;
    color: #2d8c8f;
    font-weight: bold;
}

.dayun-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dayun-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dayun-item:hover {
    box-shadow: 0 4px 12px rgba(45, 140, 143, 0.2);
    transform: translateY(-2px);
}

.dayun-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.dayun-age {
    font-weight: bold;
    color: #2d8c8f;
    font-size: 1.1rem;
    text-align: center;
}

.dayun-years {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
}

.dayun-pillar {
    font-size: 1.3rem;
    color: #2d8c8f;
    font-weight: bold;
    text-align: center;
}

.liunian-container {
    margin-top: 15px;
}

.liunian-title {
    font-weight: bold;
    color: #2d8c8f;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.liunian-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.liunian-item {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.3s ease;
}

.liunian-item:hover {
    background: #f0f8f0;
    border-color: #2d8c8f;
    box-shadow: 0 2px 8px rgba(45, 140, 143, 0.2);
    transform: translateY(-2px);
}

.liunian-year {
    font-weight: bold;
    color: #2d8c8f;
    font-size: 1rem;
}

.liunian-pillar {
    color: #6c757d;
    font-size: 0.9rem;
}

.dayun-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 0.95rem;
}

/* 大运流年区域 - 暗色主题 */
body.dark-theme .dayun-section {
    border-bottom-color: #3A3A40;
}

body.dark-theme .start-age-info {
    background: linear-gradient(135deg, #2D2D33 0%, #25252B 100%);
    border-left-color: #d4af37;
}

body.dark-theme .start-age-label {
    color: #B8B8B8;
}

body.dark-theme .start-age-value {
    color: #d4af37;
}

body.dark-theme .dayun-item {
    background: #1A1A1F;
    border-color: #3A3A40;
}

body.dark-theme .dayun-item:hover {
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

body.dark-theme .dayun-header {
    border-bottom-color: #3A3A40;
}

body.dark-theme .dayun-age {
    color: #d4af37;
}

body.dark-theme .dayun-years {
    color: #B8B8B8;
}

body.dark-theme .dayun-pillar {
    color: #d4af37;
}

body.dark-theme .liunian-title {
    color: #d4af37;
}

body.dark-theme .liunian-item {
    background: #25252B;
    border-color: #3A3A40;
}

body.dark-theme .liunian-item:hover {
    background: #3A3A40;
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

body.dark-theme .liunian-year {
    color: #d4af37;
}

body.dark-theme .liunian-pillar {
    color: #E8E8E8;
}

body.dark-theme .dayun-empty {
    color: #B8B8B8;
}