/* 日期时间选择器样式 */
.datetime-selector {
    width: 100%;
    max-width: 800px;
    background: rgba(26, 26, 46, 0.7);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.datetime-title {
    text-align: center;
    color: #d4af37;
    margin-bottom: 15px;
}

.datetime-title h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.datetime-title p {
    font-size: 14px;
    color: #b8b0a0;
    font-style: italic;
}

.selector-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
}

.selector-group {
    flex: 1;
}

.selector-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #b8b0a0;
}

.selector-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 5px;
    background: rgba(12, 12, 21, 0.8);
    color: #e0d6c9;
    font-family: 'Noto Serif SC', serif;
    cursor: pointer;
}

.selector-group select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

/* 测算按钮样式 */
.calculate-btn-container {
    margin: 0 0 25px 0;
    text-align: center;
}

.calculate-btn {
    padding: 12px 35px;
    background: linear-gradient(135deg, #d4af37 0%, #b8941a 100%);
    border: none;
    border-radius: 35px;
    color: #0c0c15;
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.6);
}

.calculate-btn:active {
    transform: translateY(1px);
}

/* 标语样式 */
.slogan {
    text-align: center;
    max-width: 700px;
    margin-bottom: 25px;
    padding: 0 15px;
}

.slogan h2 {
    font-size: 26px;
    line-height: 1.5;
    margin-bottom: 12px;
    color: #e0d6c9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.slogan p {
    font-size: 15px;
    line-height: 1.5;
    color: #b8b0a0;
    font-style: italic;
}

.sub-slogan {
    text-align: center;
    max-width: 800px;
    margin-top: 20px;
    margin-bottom: 25px;
    padding: 0 15px;
}

.sub-slogan p {
    font-size: 14px;
    line-height: 1.6;
    color: #b8b0a0;
    margin-bottom: 10px;
}

.sub-slogan .en {
    font-size: 12px;
    line-height: 1.5;
    color: #8a8275;
    font-style: italic;
}

/* 版权信息样式 */
.copyright {
    width: 100%;
    text-align: center;
    padding: 20px 0 10px 0;
    margin-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    color: #b8b0a0;
    font-size: 13px;
}

.copyright p {
    margin: 4px 0;
}

.copyright .en {
    font-style: italic;
}

/* 结果展示区域 */
.result-container {
    width: 100%;
    max-width: 800px;
    background: rgba(26, 26, 46, 0.7);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: none;
}

.result-title {
    text-align: center;
    color: #d4af37;
    margin-bottom: 15px;
}

.result-title h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.result-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 15px;
    margin-bottom: 20px;
}

.result-column {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.result-column h4 {
    color: #d4af37;
    margin-bottom: 10px;
    font-size: 16px;
}

.result-box {
    background: rgba(12, 12, 21, 0.8);
    border-radius: 8px;
    padding: 15px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-box p {
    font-size: 18px;
    font-weight: bold;
}

/* 天干地支颜色样式 */
.ganzhi-char {
    display: inline-block;
    text-align: center;
    width: 24px;
}

.result-gender {
    width: 100%;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: rgba(12, 12, 21, 0.8);
    border-radius: 8px;
    margin-bottom: 20px;
}

/* 新增内容区域 */
.result-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}


.detail-card {
    background: rgba(12, 12, 21, 0.8);
    border-radius: 8px;
    padding: 15px;
    border-left: 3px solid #d4af37;
}

.detail-card h4 {
    color: #d4af37;
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.detail-card h4 .en {
    font-size: 12px;
    margin-left: 8px;
    color: #b8941a;
    font-style: italic;
}

.detail-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #e0d6c9;
}
/* 核心：精准定位八字特征的flex容器（层级+属性双重匹配） */
/* 核心：八字特征flex容器 - 竖屏强制文字在上、饼图在下，且容器高度自适应 */
.detail-card h4 + div {
    display: flex !important;
    gap: 20px !important;
    align-items: flex-start !important; 
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 280px !important; /* 保底高度，避免内容挤压 */
    padding-bottom: 10px !important; /* 容器内底部留白 */
}

/* 八字特征文字区域 - 占满宽度，文字完整展示 */
.detail-card h4 + div #baziCharacteristics {
    flex: 1 !important;
    min-width: 0 !important; 
    padding: 5px 0 !important;
    line-height: 1.8 !important; /* 优化文字行高，确保完整显示 */
}

/* 饼图容器 - 固定尺寸+精准定位，竖屏时在文字下方居中 */
.detail-card h4 + div > div {
    flex: 0 0 180px !important;  /* 缩小容器宽度 */
    height: 200px !important;    /* 缩小容器高度 */
    position: relative !important;
    margin: 0 !important;
    padding-top: 0 !important;   /* 移除顶部内边距 */
}

/* ========== 竖屏适配（核心：文字在上，饼图在文字最后一行下方） ========== */
@media (max-width: 767px) or (orientation: portrait) {
    .detail-card h4 + div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
        min-height: 320px !important;
        position: relative !important; /* 新增：相对定位 */
        padding-bottom: 240px !important; /* 新增：为饼图预留空间 */
    }

    /* 竖屏：文字区域撑满宽度 */
    .detail-card h4 + div #baziCharacteristics {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 0 !important;
    }

    /* 竖屏：饼图容器固定在底部 */
    .detail-card h4 + div > div {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 200px !important;  /* 从240px减小到200px */
        margin: 0 auto !important;
        padding-top: 5px !important; /* 从15px减小到5px */
    }

    /* 饼图本身 - 竖屏居中 */
    #wuxingChart {
        position: absolute !important;
        top: 0 !important;       /* 从10px调整为0 */
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    /* 五行比例标题 */
    .detail-card h4 + div > div [style*="bottom: 50px"] {
        bottom: 30px !important;  /* 从40px减小到30px */
        left: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }

    /* 金木水火土比例标签 */
    .detail-card h4 + div > div [style*="bottom: 10px"] {
        bottom: 5px !important;   /* 从10px减小到5px */
        left: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: space-around !important;
    }
}

/* ========== 横屏适配（保留原有逻辑） ========== */
@media (min-width: 768px) and (orientation: landscape) {
    .detail-card h4 + div {
        flex-direction: row !important; /* 横屏：文字左，饼图右 */
        align-items: flex-start !important;
    }
    .detail-card h4 + div > div {
        height: 180px !important;
        position: relative !important;
    }
    
    /* 五行比例标题 - 调整到饼图下方 */
    .detail-card h4 + div > div [style*="bottom: 50px"] {
        bottom: -10px !important;  /* 从50px调整为-10px，移到饼图下方 */
        left: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    /* 金木水火土比例标签 - 调整到标题下方 */
    .detail-card h4 + div > div [style*="bottom: 10px"] {
        bottom: -30px !important;  /* 从10px调整为-30px，移到标题下方 */
        left: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: space-around !important;
    }
}

/* 兜底：detail-card 基础样式强化 */
.detail-card {
    background: rgba(12, 12, 21, 0.8);
    border-radius: 8px;
    padding: 15px;
    border-left: 3px solid #d4af37;
    margin-bottom: 20px !important;
    height: auto !important; /* 强制高度自适应，覆盖任何固定高度 */
    overflow: visible !important; /* 内容不被裁剪 */
    position: relative !important;
}

/* 性格特征模块顶部加间距，双重保险避免重合 */
.detail-card:has(h4:contains("性格特征")) {
    margin-top: 15px !important;
}
/* 大运运势表格样式 */
.luck-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: rgba(12, 12, 21, 0.6);
    border-radius: 8px;
    overflow: hidden;
    filter: blur(5px); /* 添加模糊效果 */
    transition: filter 0.3s ease; /* 添加过渡效果 */
    user-select: none; /* 添加这行禁止用户选择文本 */
    -webkit-user-select: none; /* Safari支持 */
    -moz-user-select: none; /* Firefox支持 */
    -ms-user-select: none; /* IE10+/Edge支持 */
}

.luck-table th, .luck-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.luck-table th {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    font-weight: bold;
}

.luck-table tr:nth-child(even) {
    background: rgba(26, 26, 46, 0.4);
}

.luck-table tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* 详细测算按钮区域 */
.detailed-analysis {
    text-align: center;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.detail-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4e 100%);
    border: 1px solid #d4af37;
    border-radius: 25px;
    color: #d4af37;
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.detail-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.info-tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.info-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #b8b0a0;
    color: #b8b0a0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-style: italic;
}

.tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: rgba(26, 26, 46, 0.95);
    color: #e0d6c9;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #1a1a2e;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #d4af37;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

.modal-content h3 {
    color: #d4af37;
    margin-bottom: 15px;
    font-size: 20px;
}

.modal-content p {
    color: #e0d6c9;
    margin-bottom: 10px;
    font-size: 16px;
}

.modal-content .en {
    color: #b8b0a0;
    font-style: italic;
    font-size: 14px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #b8b0a0;
    font-size: 20px;
    cursor: pointer;
}

.close-btn:hover {
    color: #d4af37;
}


/* 响应式设计 */
@media (max-width: 900px) {
    .selector-row {
        flex-wrap: wrap;
    }
    
    .selector-group {
        flex: 1 0 calc(50% - 10px);
        margin-bottom: 15px;
    }
    
    .result-content {
        flex-direction: column;
    }
    
    .luck-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 600px) {
    body {
        padding: 12px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        padding: 10px 0;
        margin-bottom: 15px;
    }
    
    .main-image {
        height: 250px;
        margin-bottom: 15px;
    }
    
    .datetime-selector {
        padding: 15px;
    }
    
    .datetime-title h3 {
        font-size: 16px;
    }
    
    .datetime-title p {
        font-size: 13px;
    }
    
    .selector-group {
        flex: 1 0 100%;
    }
    
    .slogan h2 {
        font-size: 22px;
    }
    
    .slogan p {
        font-size: 13px;
    }
    
    .sub-slogan p {
        font-size: 12px;
    }
    
    .sub-slogan .en {
        font-size: 11px;
    }
    
    .calculate-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .copyright {
        padding: 15px 0 5px 0;
        font-size: 11px;
    }
    
    .result-column {
        min-width: 100%;
    }
    
    .detailed-analysis {
        flex-direction: column;
        gap: 15px;
    }
    
    .tooltip-text {
        width: 250px;
    }
    
    .luck-table th, .luck-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .modal-content {
        width: 90%;
        padding: 20px;
        margin: 30% auto;
    }
}

@media (max-height: 800px) {
    .main-image {
        height: 250px;
    }
    
    .slogan h2 {
        font-size: 20px;
    }
    
    .slogan p {
        font-size: 14px;
    }
}
/* 大运运势表格样式 */
.luck-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: rgba(12, 12, 21, 0.6);
    border-radius: 8px;
    overflow: hidden;
    filter: blur(5px); /* 添加模糊效果 */
    transition: filter 0.3s ease; /* 添加过渡效果 */
}
/* 鼠标悬停时取消模糊 */
/* .luck-table:hover {
    filter: blur(0); 
} */

/* 加载动画 */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d4af37;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
