/* 大荒落命理 - 精简现代样式 */

:root {
    --content-green: #5c5c5ca6;

}

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

/* 基础样式 */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: serif;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: all 0.3s ease;
    touch-action: pan-y;
}

/* 朦胧光斑背景效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(180, 140, 70, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 40% 70%, rgba(212, 175, 55, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(160, 120, 50, 0.07) 0%, transparent 38%),
        radial-gradient(circle at 15% 80%, rgba(200, 160, 80, 0.04) 0%, transparent 42%),
        radial-gradient(circle at 90% 85%, rgba(212, 175, 55, 0.06) 0%, transparent 40%);
    animation: float-lights 20s ease-in-out infinite;
}

@keyframes float-lights {
    0%, 100% {
        opacity: 0.6;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-20px) scale(1.05);
    }
}

/* API页面样式 - 确保文字可见性 */
.api-content,
.api-page,
.demo-container,
.demo-card {
    background: #0a0a0f !important;
    color: #b3b3b3 !important;
    padding: 20px;
    min-height: 100vh;
}

.api-content h1,
.api-content h2,
.api-content h3,
.api-page h1,
.api-page h2,
.api-page h3,
.demo-container h1,
.demo-card h1,
.demo-card h3 {
    color: #dbdada !important;
    margin: 20px 0 10px 0;
}

.api-content p,
.api-content div,
.api-content span,
.api-page p,
.api-page div,
.api-page span,
.demo-container p,
.demo-card p,
.demo-card div {
    color: rgba(179, 179, 179, 0.9) !important;
}

/* API演示页面特殊样式 */
.demo-card {
    background: rgb(31, 31, 31) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.api-demo {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.btn {
    color: #e8e7e8 !important;
}

#result {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 15px;
    border-radius: 8px;
}

#result pre {
    color: rgba(255, 255, 255, 0.9) !important;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* CSS变量定义 - Art Deco 主题（与主页统一） */
:root {
    /* Art Deco 深色主题 - 与主页完全统一 */
    --bg-primary: #0f0f1a; /* 主页背景色 */
    --bg-secondary: rgba(26, 26, 46, 0.6); /* 次要背景 */
    --bg-glass: rgba(26, 26, 46, 0.8); /* 玻璃态背景 */
    --text-primary: #f0e6d0; /* 主页文字色 */
    --text-secondary: rgba(240, 230, 208, 0.8);
    --text-muted: rgba(240, 230, 208, 0.5);
    --border-color: #d4af37; /* Art Deco 金色边框 */
    --accent-color: #d4af37; /* Art Deco 金色强调色 */
    --content-green: rgba(212, 175, 55, 0.1); /* 内容区域淡金色背景 */
}

/* 摇卦模态框样式 */
.yaogua-modal {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    background: rgba(27, 65, 87, 0.25);
    backdrop-filter: blur(20px);
}

.yaogua-modal .yaogua-content {
    flex: 1;
    overflow-y: auto;
}

.yaogua-content {
    padding: 10px;
}

.yaogua-instruction {
    background: linear-gradient(135deg, rgba(106, 107, 107, 0.08), rgba(92, 92, 92, 0.12));
    border: 1px solid rgba(88, 86, 214, 0.2);
    border-radius: 5px;
    padding: 16px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1rem;
}

.yaogua-instruction p {
    color: var(--text-primary);
    margin: 8px 0;
    line-height: 1.6;
}

.yaogua-question {
    margin-bottom: 10px;
}

.yaogua-question label {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1rem;
}

.yaogua-question .question-select {
    padding: 12px;
    border: 2px solid rgba(88, 86, 214, 0.2);
    border-radius: 8px;
    background: rgba(42, 42, 43, 0.906);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
}

.yaogua-question .question-select:focus {
    outline: none;
    border-color: #56a3d6;
    box-shadow: 0 0 0 4px rgba(88, 86, 214, 0.1);
}

.yaogua-question .question-select option {
    background: #2c2c2cb2;
    color: #ffffff;
}

.yaogua-question textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid rgba(88, 86, 214, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
}

.yaogua-question textarea:focus {
    outline: none;
    border-color: #568dd6;
    box-shadow: 0 0 0 4px rgba(88, 86, 214, 0.1);
}

.yaogua-actions {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 24px;
}

.yaogua-btn {
    background: linear-gradient(135deg, #56d6c5, #7ad9ea);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(88, 86, 214, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.yaogua-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 86, 214, 0.4);
}

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

.yaogua-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.yaogua-icon {
    font-size: 18px;
}

.yaogua-loading {
    animation: spin 1s linear infinite;
}

.yaogua-result {
    background: rgba(130, 167, 156, 0);
    border-radius: 12px;
    padding: 2px;
    animation: fadeInUp 0.5s ease;
}

.yaogua-result .result-header {
    text-align: center;
    margin-bottom: 5px;
}

.yaogua-result .result-header h4 {
    color: #1d1d1f;
    margin: 0;
    font-size: 18px;
}

.gua-display-section {
    margin-bottom: 5px;
}

.gua-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 16px;
    background-color: rgba(0, 0, 0, 0);
}

.single-gua {
    text-align: center;
    padding: 5px;
    background: rgba(182, 181, 181, 0.3);
    border: 1px solid rgba(88, 86, 214, 0.1);
    border-radius: 8px;
    /* 确保本卦和变卦高度一致 */
    display: flex;
    flex-direction: column;
    min-height: 280px;
    /* 设置最小高度 */
    justify-content: flex-start;
}

.single-gua h5 {
    color: #1d1d1f;
    margin: 0 0 12px 0;
    font-size: 14px;
    /* 确保标题高度一致 */
    min-height: 1.2em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yao-symbols {
    font-family: serif;
    font-size: 1rem;
    line-height: 1.3;
    /* 确保爻符号容器高度一致 */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
    /* 设置最小高度 */
}

.yao-display,
.yao-display-line {
    color: #0e0e0e;
    margin: 6px 0;
    /* 防止安卓设备文字换行 */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: keep-all !important;
    word-wrap: normal !important;
    hyphens: none !important;
    /* 确保高度一致 */
    min-height: 1.3em;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.changing-info {
    text-align: center;
    padding: 12px;
    background: rgba(71, 71, 70, 0.2);
    border: 1px solid rgba(71, 71, 70, 0.5);
    border-radius: 8px;
    color: #9e9ea3;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.result-actions .btn {
    padding: 30px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 16px;
}

.result-actions .btn-primary {
    background: linear-gradient(135deg, #31686879, #546e7a6c);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 30, 30, 0.3);
}

.result-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 37, 37, 0.4);
}

.result-actions .btn-secondary {
    background: rgba(24, 24, 24, 0.6);
    color: var(--text-primary);
    border: 1px solid rgba(201, 164, 0, 0.3);
}

.result-actions .btn-secondary:hover {
    background: rgba(67, 67, 68, 0.6);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .yaogua-modal {
        width: 95% !important;
        margin: 20px auto !important;
    }

    .gua-pair {
        grid-template-columns: 1fr 1fr;
        /* 保持两列布局 */
        gap: 8px;
        /* 减小间距 */
    }

    .single-gua {
        padding: 12px 8px;
        /* 减小内边距 */
        min-height: 240px;
        /* 移动端减小最小高度 */
    }

    .single-gua h5 {
        font-size: 12px;
        /* 减小字体 */
        margin-bottom: 8px;
    }

    .yao-symbols {
        font-size: 0.9rem;
        /* 减小字体 */
        min-height: 180px;
        /* 移动端减小最小高度 */
    }

    .yao-display,
    .yao-display-line {
        margin: 4px 0;
        /* 减小间距 */
        font-size: 0.85rem;
        /* 减小字体 */
        min-height: 1.2em;
    }

    .yaogua-btn {
        padding: 14px 28px;
        font-size: 15px;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .result-actions .btn {
        width: 100%;
    }
}

/* 安卓设备特殊修复 - 防止文字换行导致高度不一致 */
@supports (-webkit-appearance: none) {

    .yao-display,
    .yao-display-line {
        -webkit-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        font-variant-numeric: tabular-nums !important;
        letter-spacing: 0 !important;
        word-spacing: 0 !important;
    }

    .single-gua {
        -webkit-box-sizing: border-box !important;
        box-sizing: border-box !important;
    }

    .yao-symbols {
        -webkit-flex-shrink: 0 !important;
        flex-shrink: 0 !important;
    }
}

/* 针对安卓Chrome的特殊处理 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {

    .yao-display,
    .yao-display-line {
        font-feature-settings: "tnum" 1 !important;
        font-variant-numeric: tabular-nums !important;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        transform: rotate(360deg);
    }
}

/* 大衍筮法起卦动画 */
.dayan-animation-container {
    position: relative;
    width: 100%;
    border-radius: 5px;
    padding: 10px;
    margin: 2px 0 10px 0;
    display: none;
}

.dayan-animation-container.show {
    display: block;
}

.dayan-stage {
    text-align: center;
    margin-bottom: 5px;
}

.dayan-stage-title {
    font-size: 1.1rem;
    color: #ff7b00;
    margin-bottom: 5px;
    font-weight: 600;
}

.dayan-stage-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
    line-height: 1.5;
}

/* 筮草动画 */
/* 筮草动画已删除 */

/* 分组、计算、爻象动画已删除 */

.yao-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    min-width: 50px;
    text-align: left;
}

.yao-forming:nth-child(1) {
    animation-delay: 0.2s;
}

.yao-forming:nth-child(2) {
    animation-delay: 0.4s;
}

.yao-forming:nth-child(3) {
    animation-delay: 0.6s;
}

.yao-forming:nth-child(4) {
    animation-delay: 0.8s;
}

.yao-forming:nth-child(5) {
    animation-delay: 1.0s;
}

.yao-forming:nth-child(6) {
    animation-delay: 1.2s;
}

@keyframes yaoForm {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(90deg);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1) rotateY(45deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.yao-symbol {
    font-size: 1.5rem;
    color: #ff7b00;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 123, 0, 0.3);
    font-family: serif;
}

/* 进度指示器 */
/* 进度指示器已删除 */

/* 动画控制和进度点相关样式已删除 */

/* 移动端适配 */
@media (max-width: 768px) {
    .dayan-animation-container {
        padding: 5px;
    }

    .yao-symbol {
        font-size: 1rem;
    }

    /* 新增：移动端mobile class下，强制左右并列且缩小 */
    .gua-pair.mobile {
        display: flex;
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        align-items: flex-start;
    }

    .single-gua.mobile {
        padding: 8px 4px;
        font-size: 12px;
        background: rgba(255, 255, 255, 0.18);
        border-radius: 6px;
        min-width: 0;
        flex: 1 1 0;
        margin: 0 4px;
    }

    .single-gua.mobile h5 {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .yao-symbols.mobile {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .yao-display-line {
        font-size: 0.85em;
        margin: 4px 0;
    }
}

/* 顶部导航 */
.top-nav {
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    height: 60px;
    background: #0a0a0f;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 22px;

    color: var(--text-primary);
}

/* 设置按钮 */
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    border: 2px solid var(--border-color);
}

.settings-toggle:hover {
    background: var(--accent-color);
    color: white;
    transform: rotate(90deg);
}

.settings-toggle svg {
    transition: all 0.3s ease;
}

/* 设置下拉菜单 */
.settings-dropdown {
    position: fixed;
    /* top 和 left 现在由JavaScript动态设置 */
    width: 200px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 2000;
    /* 比普通模态框高，但比安装App按钮高很多 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.settings-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.settings-item svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.settings-item:hover svg {
    opacity: 1;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .settings-dropdown {
        /* 位置现在由JavaScript动态设置 */
        max-width: 250px;
    }

    .nav-left {
        gap: 8px;
    }

    .logo {
        font-size: 20px;
    }

    .settings-toggle {
        width: 32px;
        height: 32px;
    }

    .settings-toggle svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 4px 8px;
        /* 减小内边距 */
        gap: 6px;
        /* 减小间距 */
    }

    .settings-dropdown {
        /* 位置现在由JavaScript动态设置 */
        max-width: 200px;
    }

    .settings-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .auth-buttons {
        gap: 4px;
        /* 减小按钮间距 */
        flex-wrap: nowrap;
        /* 强制不换行 */
        min-width: 0;
        /* 允许收缩 */
    }

    .btn-nav {
        padding: 5px 10px;
        /* 减小内边距 */
        font-size: 12px;
        /* 减小字体 */
        min-height: 30px;
        white-space: nowrap;
        /* 防止文字换行 */
        flex-shrink: 0;
        /* 防止收缩 */
    }

    /* 特别处理退出按钮，确保在小屏幕上也能显示 */
    #logoutBtn {
        padding: 5px 8px;
        /* 减小内边距 */
        font-size: 0.85rem;
        /* 进一步减小字体 */
        min-width: auto;
        /* 自适应宽度 */
        max-width: none;
        /* 不限制最大宽度 */
    }

    /* 确保左侧元素不占用过多空间 */
    .nav-left {
        flex: 1;
        /* 占据剩余空间 */
        min-width: 0;
        /* 允许收缩 */
    }

    .logo {
        font-size: 14px;
        /* 进一步减小logo字体 */
    }

    .pc-version-btn {
        font-size: 11px;
        /* 减小版本切换按钮字体 */
        padding: 4px 8px;
        /* 减小内边距 */
    }
}

/* 超小屏幕优化 (≤360px) */
@media (max-width: 360px) {
    .top-nav {
        padding: 3px 6px;
        /* 进一步减小内边距 */
        gap: 4px;
        /* 进一步减小间距 */
    }

    .auth-buttons {
        gap: 3px;
        /* 进一步减小按钮间距 */
    }

    .btn-nav {
        padding: 4px 8px;
        /* 进一步减小内边距 */
        font-size: 11px;
        /* 进一步减小字体 */
        min-height: 28px;
        /* 减小高度 */
    }

    /* 特别处理退出按钮，确保在超小屏幕上也能显示 */
    #logoutBtn {
        padding: 4px 6px;
        /* 进一步减小内边距 */
        min-width: auto;
        /* 自适应宽度 */
    }

    .logo {
        font-size: 12px;
        /* 进一步减小logo字体 */
    }

    .pc-version-btn {
        font-size: 10px;
        /* 进一步减小版本切换按钮字体 */
        padding: 3px 6px;
        /* 进一步减小内边距 */
    }

    /* 隐藏一些非关键按钮以节省空间 */
    #forumBtn {
        display: none;
        /* 在超小屏幕上隐藏论坛按钮 */
    }
}

.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 导航按钮样式 */
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;

    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 35px;
    user-select: none;
    /* 移动端触摸优化 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 768px) {
    .pc-version-btn {
        display: none !important;
    }
}

.btn-nav:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-nav.btn-primary {
    background-color: #39606969;
    color: white;
}

.btn-nav.btn-primary:hover:not(:disabled) {
    background-color: #2a466d7c;
    transform: translateY(-1px);
}

.btn-nav.btn-outline {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-nav.btn-outline:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-nav.btn-outline.logged-in {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: #e8f5e8;
}

.btn-nav.btn-outline.logged-in:hover:not(:disabled) {
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
    border-color: #66bb6a;
}

.btn-nav.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 10px;
    z-index: 30;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    user-select: none;
}

/* 主内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 5px 5px;
    /* 增加顶部padding到80px，避免被60px高的导航栏遮挡，加上10px间距 */
}

/* 用户输入界面 */
.user-input-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 5px;
    width: 100%;
    max-width: 500px;
    text-align: left;
}

.input-group {
    margin-bottom: 5px;
}

.input-group label {
    display: block;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}

/* 内联布局样式 */
.input-group.inline {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group.inline label {
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 新输入框样式 - 基于.input */
.input,
input[type="datetime-local"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 32px;
    padding: 0 16px;
    font-size: 16px;
    /* 最小16px防止iOS自动缩放 */
    box-sizing: border-box;
    border-radius: 8px;
    border: none;
    background: rgba(38, 43, 44, 0.315);
    color: #fff;
    transition: box-shadow 0.4s;
}

input[type="datetime-local"] {
    line-height: normal;
    appearance: none;
    -webkit-appearance: none;
}

.input:hover {
    box-shadow: 0 0 0 1px rgba(135, 207, 235, 0.186);
}

.input:focus {
    box-shadow: 0 0 0 2px skyblue;
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* 选项组样式 */
.option-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 5px;
}

.input-group.inline .option-group {
    margin-top: 0;
}

/* 选项按钮样式 */
.option-btn {
    padding: 0;
    width: 70px;
    height: 32px;
    border: 2px solid #4a4a8a;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    box-sizing: border-box;
    margin: 0;
}

.option-btn.active {
    background: rgba(179, 248, 234, 0.2);
    border-color: #9df0df;
    color: aqua;
    box-shadow: 0 0 3px rgba(234, 234, 234, 0.3);
}

/* 城市选择器样式 */
select.input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select.input option {
    background: #2a2a2a;
    color: #fff;
    padding: 8px 12px;
}

select.input optgroup {
    background: #0a0a0f;
    color: #ccc;
    padding: 4px 8px;
}

/* 选项按钮样式 */
.option-btn.yellow {
    border-color: #4a4a8a;
    color: #ffffff;
}

.option-btn.yellow.active {
    background: rgba(245, 177, 19, 0.18);
    border-color: #ffb300;
    color: #fffbe6;
    box-shadow: 0 0 10px rgba(236, 166, 3, 0.25);
}

.option-btn.yellow:hover {
    border-color: #ffb300;
    color: #fffbe6;
}

/* 真太阳时按钮样式 */
.option-btn.btn-solar {
    color: #ffffff;
    width: 75px;
    height: 32px;
}

.option-btn.btn-solar.active {
    background: rgba(223, 192, 77, 0.283);
    border-color: #ffc107;
    color: #fffbe6;
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.25);
}

/* 四柱反推按钮样式 */
.option-btn.btn-ganzhi {
    color: #ffffff;
    width: 75px;
    height: 32px;
}

.option-btn.btn-ganzhi.active {
    background: rgba(255, 140, 0, 0.18);
    border-color: #ff9800;
    color: #fffbe6;
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.25);
}

/* 服务按钮样式 */
.services-section {
    margin-top: 16px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.services-grid {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 500px;
    margin: 0 auto;
}

/* 新按钮样式 - 基于.btn */
.btn {
    font-size: 15px;
    background: transparent;
    border: none;
    padding: 0.8em 1.2em;
    color: #ffedd3;
    text-transform: uppercase;
    position: relative;
    transition: 0.5s ease;
    cursor: pointer;
    border-radius: 8px;
}

.btn::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background-color: #ffc506;
    transition: 0.5s ease;
}

.btn:hover {
    color: #4b6d75;
    transition-delay: 0.5s;
}

.btn:hover::before {
    width: 100%;
}

.btn::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 0;
    width: 100%;
    transition: 0.4s ease;
    z-index: -1;
}

.btn:hover::after {
    height: 0%;
    transition-delay: 2s;
}

.service-btn {
    background: rgba(83, 99, 97, 0.171);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 18px 12px;
    width: 150px;
    text-align: center;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 150px;
    height: 70px;
    /* 移动端触摸优化 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

.service-title {
    font-size: 15px;
    margin-bottom: 8px;
    color: inherit;
}

.service-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* AI聊天按钮样式 - 标题和提示文字上下分段居中显示 */
.ai-chat-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.ai-chat-title {
    font-size: 15px;
    color: rgb(255, 255, 255);
    font-weight: 500;
}

.ai-chat-tip {
    font-size: 0.6rem;
    color: #addccd;
    line-height: 1.2;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    user-select: none;
    /* 防止选中文本 */
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE/Edge */
}

.modal-content {
    background: rgba(28, 28, 28, 0.55);
    backdrop-filter: blur(20px);
    margin: 5% auto;
    padding: 5px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 10px;
    color: #ffffff;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

.modal-footer a {
    color: #4d7c7eab;
    text-decoration: none;
}

.modal-footer a:hover {
    text-decoration: underline;
}

.modal-footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .services-grid {
        gap: 10px;
        justify-content: space-between;
    }

    .service-btn {
        width: 140px;
        padding: 15px 8px;
        flex: 1;
        min-width: 120px;
    }

    .service-title {
        font-size: 14px;
    }

    .service-subtitle {
        font-size: 11px;
    }

    .user-input-section {
        padding: 14px;
    }

    .services-section {
        margin: 12px 0;
        padding: 10px;
    }

    .input-group.inline {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        flex-wrap: nowrap;
    }

    .input-group.inline label {
        margin-bottom: 0;
        flex-shrink: 0;
        min-width: 70px;
    }

    .option-group {
        gap: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .option-btn {
        margin-top: 0;
        padding: 6px 10px;
        font-size: 14px;
        height: 26px;
        flex-shrink: 0;
        min-width: 50px;
    }

    .modal-content {
        margin: 5px;
        width: auto;
    }

    .services-section {
        margin-top: 4px;
    }

    .input-group label {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .top-nav {
        height: 56px;
        padding: 0 16px;
    }

    .services-grid {
        gap: 8px;
    }

    .service-btn {
        width: 110px;
        padding: 12px 6px;
        min-width: 100px;
    }

    .service-title {
        font-size: 14px;
    }

    .service-subtitle {
        font-size: 11px;
    }

    .input-group.inline label {
        min-width: 60px;
        font-size: 14px;
    }

    .option-btn {
        padding: 5px 8px;
        font-size: 14px;
        height: 24px;
        min-width: 45px;
    }

    .services-section {
        margin-top: 8px;
        padding: 8px;
    }

    .input-group label {
        font-size: 14px;
    }

    /* 反推移动端适配 */

}

.input-group.inline input#correctionResult {
    flex: 2;
    min-width: 0;
}

/* 保存控件容器样式 */
.save-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.input-group.inline button.btn-nav.btn-primary {
    margin-left: 10px;
    flex: 1;
    min-width: 80px;
    max-width: 120px;
    height: 48px;
    padding: 0 12px;
}

/* 按钮样式 记录保存 */
.btn-glass {
    background: rgba(53, 53, 53, 0.15);
    color: #f5f5f5;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    font-size: 11px;
    height: 35px;

}

.btn-glass:hover,
.btn-glass:focus {
    background: rgba(61, 153, 0, 0.938);
    color: #fff;
    box-shadow: 0 6px 32px 0 rgba(0, 0, 0, 0.18);
    border-color: #e0e0e0;
}

/* 自动保存样式已删除 */

/* 命运分析页面 - 八字四柱样式 */
.bazi-char {
    width: 50px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;

    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

/* 十神关系标签 */
.tengod-label {
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: #ffffff;
    text-align: center;
    line-height: 1;
    white-space: nowrap;

}

/* 地支藏干标签 */
.hidden-gan-label {
    font-size: 0.8rem;
    margin-top: 4px;
    color: #ffffff;
    text-align: center;
    line-height: 1;
    white-space: nowrap;

}

/* 大运显示区域 */
.dayun-item .gan-char {
    color: inherit;
}

.dayun-item .zhi-char {
    color: rgba(255, 255, 255, 0.9);
}

/* 五行颜色系统 - 苹果风格 */
.wuxing-mu {
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%) !important;
    border: 1px solid rgba(52, 199, 89, 0.3) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3), 0 1px 3px rgba(52, 199, 89, 0.4) !important;
}

.wuxing-huo {
    background: linear-gradient(135deg, #FF3B30 0%, #FF6961 100%) !important;
    border: 1px solid rgba(255, 59, 48, 0.3) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3), 0 1px 3px rgba(255, 59, 48, 0.4) !important;
}

.wuxing-tu {
    background: linear-gradient(135deg, #FF9500 0%, #FFAD33 100%) !important;
    border: 1px solid rgba(255, 149, 0, 0.3) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3), 0 1px 3px rgba(255, 149, 0, 0.4) !important;
}

.wuxing-jin {
    background: linear-gradient(135deg, #920fb3 0%, #661feb 100%) !important;
    border: 1px solid rgba(142, 142, 147, 0.3) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(142, 142, 147, 0.3), 0 1px 3px rgba(142, 142, 147, 0.4) !important;
}

.wuxing-shui {
    background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%) !important;
    border: 1px solid rgba(0, 122, 255, 0.3) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3), 0 1px 3px rgba(0, 122, 255, 0.4) !important;
}

/* 移动端适配 - 命运分析页面 */
@media (max-width: 768px) {
    .bazi-char {
        width: 45px;
        height: 80px;
        font-size: 1.2rem;
    }

    .tengod-label {
        font-size: 0.6rem;
    }

    .hidden-gan-label {
        font-size: 0.55rem;
    }

}

@media (max-width: 480px) {

    /* 移动端自动保存控件适配 */
    .save-controls {
        gap: 6px !important;
    }

    /* 自动保存移动端样式已删除 */

}

/* 八字反推模态框特殊样式 */
.modal-content.bazi-modal {
    max-width: 800px;
    width: 95%;
    min-width: 320px;
    max-height: 95vh;
    overflow-y: auto;
    min-height: 500px;
}

.bazi-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bazi-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bazi-group label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;

}

.ganzhi-selectors {
    display: flex;
    gap: 15px;
}

.ganzhi-select {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    font-size: 15px;
    border-radius: 8px;
    border: none;
    background: rgb(28, 28, 30);
    color: #fff;
    transition: box-shadow 0.3s;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 35px;
}

.ganzhi-select:hover {
    box-shadow: 0 0 0 2px rgba(135, 207, 235, 0.186);
}

.ganzhi-select:focus {
    box-shadow: 0 0 0 2px skyblue;
    outline: none;
}

.ganzhi-select option {
    background: #2a2a2a;
    color: #fff;
    padding: 8px 12px;
}

/* 干支按钮样式 */
.gan-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 25px;
    padding: 0;
    justify-items: center;
}

.zhi-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 25px;
    padding: 0;
    justify-items: center;
}

.gan-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    padding: 0;
    font-size: 22px;

    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gan-btn:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.16);
}

.gan-btn.active {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    color: #ffffff;
    border-color: rgba(0, 122, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25), 0 2px 6px rgba(0, 122, 255, 0.3);
    transform: translateY(-1px) scale(1.05);
}

.zhi-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    padding: 0;
    font-size: 20px;

    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.zhi-btn:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.16);
}

.zhi-btn.active {
    background: linear-gradient(135deg, #34C759 0%, #28A745 100%);
    color: #ffffff;
    border-color: rgba(52, 199, 89, 0.3);
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.25), 0 2px 6px rgba(52, 199, 89, 0.3);
    transform: translateY(-1px) scale(1.05);
}

/* 八字反推结果样式 */
.bazi-results {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    animation: resultsAppear 0.1s ease-out;
    position: relative;
}

.bazi-results h4 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    font-size: 16px;
}

.time-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.time-option-btn {
    padding: 12px 16px;
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    text-align: left;

}

.time-option-btn:hover {
    background: rgba(0, 122, 255, 0.2);
    border-color: rgba(0, 122, 255, 0.5);
    transform: translateY(-1px);
}

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

/* 八字操作按钮 */
.bazi-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bazi-actions .btn-nav {
    min-width: 80px;
}

/* 八字选择器网格 */
.bazi-selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px;
}

.bazi-pillar-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(61, 61, 61, 0.2);
    border-radius: 15px;
    padding: 15px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pillar-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;

}

.pillar-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.gan-display,
.zhi-display {
    font-size: 3rem;
    color: #ffffff;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid rgba(189, 139, 2, 0.699);
}

.gan-display:hover,
.zhi-display:hover {
    background: rgba(143, 98, 1, 0.2);
    border-color: rgba(224, 183, 0, 0.651);
    transform: scale(1.1);
}

/* 选择面板样式 */
.selection-panel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: rgba(15, 15, 15, 0.48);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(25px);
    z-index: 1500 !important;
    width: 90vw;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    margin: 0 !important;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.selection-header h4 {
    color: #fff;
    margin: 0;
    font-size: 1.3rem;

}

.close-selection {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.8rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-selection:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.1);
}

.gan-selection,
.zhi-selection {
    margin-bottom: 25px;
}

.gan-selection label,
.zhi-selection label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 15px;

}

.selection-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

/* 八字重新计算弹窗样式 - 森林主题 */
#baziRecalculateModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(49, 49, 49, 0.48);
}

#baziRecalculateModal .modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(50, 51, 49, 0.89), rgba(39, 44, 45, 0.863));
    margin: 5% auto;
    padding: 0;
    margin-top: calc(1% + 75px);
    border-radius: 22px;
    border: 1.5px solid rgba(168, 213, 186, 0.18);
    box-shadow: 0 8px 32px 0 rgba(34, 60, 44, 0.18);
    color: #eaf7e1;
    width: 90%;
    max-width: 380px;
    min-height: fit-content;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

#baziRecalculateModal h2 {
    background: rgba(60, 62, 60, 0.18);
    color: #a8d5ba;
    margin: 0;
    padding: 24px 30px;
    border-radius: 22px 22px 0 0;
    font-size: 1.4rem;
    text-align: center;
    letter-spacing: -0.01em;
    border-bottom: 1px solid rgba(168, 213, 186, 0.18);
}

#baziRecalculateModal .close {
    position: absolute;
    top: 18px;
    right: 24px;
    color: #a8d5ba;
    font-size: 50px;
    cursor: pointer;
    z-index: 1;
    transition: color 0.2s ease;
}

#baziRecalculateModal .close:hover {
    color: #ff9900;
}

#baziRecalculateModal .modal-body {
    padding: 32px;
    color: #eaf7e1;
}

#baziRecalculateModal .form-group {
    margin-bottom: 28px;
}

#baziRecalculateModal .form-group label {
    display: block;
    margin-bottom: 12px;
    color: #a8d5ba;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

#baziRecalculateModal .gender-options {
    display: flex;
    gap: 12px;
}

#baziRecalculateModal .gender-option {
    flex: 1;
    padding: 14px 24px;
    background: rgba(64, 66, 65, 0.18);
    border: 1.5px solid rgba(168, 213, 186, 0.18);
    border-radius: 12px;
    color: #eaf7e1;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    text-align: center;
    letter-spacing: -0.01em;
}

#baziRecalculateModal .gender-option:hover {
    background: rgba(94, 97, 95, 0.22);
    border-color: #a8d5ba;
    color: #eaf7e1;
}

#baziRecalculateModal .gender-option.active {
    background: linear-gradient(135deg, #818782 0%, #707878 100%);
    color: #fff;
    border-color: #a8d5ba;
    box-shadow: 0 4px 12px rgba(34, 60, 44, 0.18);
}

#baziRecalculateModal .gender-option.calculating {
    background: #afbdb2;
    color: white;
    border-color: #34c759;
    animation: genderCalculating 1s infinite;
}

@keyframes genderCalculating {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

#baziRecalculateModal .gender-option:disabled {
    pointer-events: none;
    opacity: 0.6;
}

#baziRecalculateModal #current-time-display {
    background: rgba(34, 60, 44, 0.12);
    color: #a8d5ba;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1.5px solid rgba(168, 213, 186, 0.18);
    font-size: 1rem;
    display: inline-block;
    min-width: 240px;
    letter-spacing: -0.01em;
}

#baziRecalculateModal #time-adjustment-options {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

#baziRecalculateModal .time-adjustment-btn {
    flex: 1;
    background: linear-gradient(135deg, rgba(57, 61, 58, 0.18) 0%, rgba(105, 109, 106, 0.18) 100%);
    border: 1.5px solid rgba(168, 213, 186, 0.18);
    color: #eaf7e1;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(34, 60, 44, 0.10);
    backdrop-filter: blur(8px);
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: serif;
}

#baziRecalculateModal .time-adjustment-btn:hover {
    background: linear-gradient(135deg, rgba(134, 160, 144, 0.5) 0%, rgba(105, 109, 106, 0.8) 100%);
    color: #205232;
    border-color: #a8d5ba;
}

#baziRecalculateModal .time-adjustment-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#baziRecalculateModal .time-adjustment-btn.calculating {
    background: #a1c2aa;
    color: white;
    border-color: #34c759;
    animation: timeCalculating 1s infinite;
    pointer-events: none;
}

@keyframes timeCalculating {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

#baziRecalculateModal .btn-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: #a8d5ba;
}

#baziRecalculateModal .btn-text {
    font-size: 1rem;
    color: #eaf7e1;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

#baziRecalculateModal .btn-time {
    font-size: 0.9rem;
    color: #b7d8c2;
    letter-spacing: -0.01em;
    text-align: center;
    line-height: 1.3;
}

#baziRecalculateModal .time-option-error {
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.18);
    color: #ff3b30;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-top: 16px;
}

#baziRecalculateModal .recalc-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(56, 61, 58, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    z-index: 10;
}

#baziRecalculateModal .recalc-loading div {
    background: rgba(104, 111, 106, 0.92);
    color: #eaf7e1;
    padding: 24px 32px;
    border-radius: 16px;
    font-size: 1rem;
    letter-spacing: -0.01em;
    border: 1.5px solid rgba(168, 213, 186, 0.18);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* 平板设备适配 */
@media (max-width: 768px) {
    #baziRecalculateModal .modal-content {
        width: 90%;
        max-width: 380px;
        margin: 3% auto;
        margin-top: calc(5% + 60px);
    }

    #baziRecalculateModal .modal-body {
        padding: 24px;
    }

    #baziRecalculateModal h2 {
        padding: 20px 24px;
        font-size: 1.3rem;
    }

    #baziRecalculateModal .close {
        top: 15px;
        right: 20px;
        font-size: 45px;
    }

    #baziRecalculateModal .gender-options {
        flex-direction: column;
        gap: 10px;
    }

    #baziRecalculateModal .gender-option {
        padding: 16px 24px;
        font-size: 1.1rem;
    }

    #baziRecalculateModal #time-adjustment-options {
        gap: 12px;
    }

    #baziRecalculateModal .time-adjustment-btn {
        padding: 18px;
        border-radius: 14px;
    }

    #baziRecalculateModal .btn-text {
        font-size: 1.1rem;
    }

    #baziRecalculateModal .btn-time {
        font-size: 1rem;
    }

    #baziRecalculateModal #current-time-display {
        font-size: 1rem;
        min-width: auto;
        width: 100%;
        text-align: center;
    }
}

/* 手机设备适配 */
@media (max-width: 480px) {
    #baziRecalculateModal .modal-content {
        width: 100%;
        max-width: 300px;
        margin: 2% auto;
        border-radius: 16px;
        max-height: 300px;
        margin-top: calc(1% + 60px);
    }

    #baziRecalculateModal .modal-body {
        padding: 20px;
    }

    #baziRecalculateModal h2 {
        padding: 18px 20px;
        font-size: 1.2rem;
        border-radius: 16px 16px 0 0;
    }

    #baziRecalculateModal .close {
        top: 12px;
        right: 16px;
        font-size: 40px;
    }

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

    #baziRecalculateModal .form-group label {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    #baziRecalculateModal .gender-option {
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 10px;
    }

    #baziRecalculateModal .time-adjustment-btn {
        padding: 16px;
        border-radius: 12px;
        gap: 6px;
    }

    #baziRecalculateModal .btn-icon {
        font-size: 1.3rem;
    }

    #baziRecalculateModal .btn-text {
        font-size: 1rem;
    }

    #baziRecalculateModal .btn-time {
        font-size: 0.9rem;
        line-height: 1.2;
    }

    #baziRecalculateModal #current-time-display {
        font-size: 0.95rem;
        padding: 12px 16px;
        border-radius: 10px;
    }
}

/* 小屏幕设备进一步适配 */
@media (max-width: 360px) {
    #baziRecalculateModal .modal-content {
        max-height: 98vh;
    }

    #baziRecalculateModal .modal-body {
        padding: 16px;
    }

    #baziRecalculateModal h2 {
        padding: 16px;
        font-size: 1.1rem;
    }

    #baziRecalculateModal .close {
        font-size: 36px;
        top: 10px;
        right: 12px;
    }

    #baziRecalculateModal .time-adjustment-btn {
        padding: 14px;
    }

    #baziRecalculateModal .btn-text {
        font-size: 0.95rem;
    }

    #baziRecalculateModal .btn-time {
        font-size: 0.75rem;
    }
}

/* 背景锁定样式 */
body.modal-open {
    /* 移除 position: fixed，避免关闭弹窗时页面跳转到顶部 */
    height: 100%;
}

/* 八字反推四柱移动设备适配 */
@media (max-width: 768px) {
    .bazi-selector-grid {
        gap: 8px;
        padding: 8px;
    }

    .bazi-pillar-btn {
        min-height: 220px;
        padding: 12px 6px;
        border-radius: 12px;
    }

    .pillar-label {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .pillar-display {
        gap: 6px;
        margin-bottom: 8px;
    }

    .gan-display,
    .zhi-display {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
        border-radius: 14px;
        border-width: 2px;
    }
}

@media (max-width: 480px) {
    .bazi-selector-grid {
        gap: 6px;
        padding: 6px;
    }

    .bazi-pillar-btn {
        min-height: 180px;
        padding: 10px 4px;
        border-radius: 10px;
    }

    .pillar-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .pillar-display {
        gap: 4px;
        margin-bottom: 6px;
    }

    .gan-display,
    .zhi-display {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        border-radius: 12px;
        border-width: 2px;
    }

    .gan-display:hover,
    .zhi-display:hover {
        transform: scale(1.05);
        /* 减小hover缩放，避免溢出 */
    }
}

@media (max-width: 360px) {
    .bazi-selector-grid {
        gap: 4px;
        padding: 4px;
    }

    .bazi-pillar-btn {
        min-height: 160px;
        padding: 8px 3px;
        border-radius: 8px;
    }

    .pillar-label {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }

    .pillar-display {
        gap: 3px;
        margin-bottom: 4px;
    }

    .gan-display,
    .zhi-display {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
        border-radius: 10px;
        border-width: 1px;
    }

    .gan-display:hover,
    .zhi-display:hover {
        transform: scale(1.02);
        /* 进一步减小hover缩放 */
    }
}

/* 选择面板移动设备适配 */
@media (max-width: 768px) {
    .selection-panel {
        width: 95vw;
        max-width: 500px;
        padding: 20px;
    }

    .selection-header h4 {
        font-size: 1.2rem;
    }

    .close-selection {
        font-size: 1.6rem;
        width: 30px;
        height: 30px;
    }

    .gan-selection label,
    .zhi-selection label {
        font-size: 1rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .selection-panel {
        width: 98vw;
        padding: 16px;
        border-radius: 16px;
        max-height: 95vh;
    }

    .selection-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .selection-header h4 {
        font-size: 1.1rem;
    }

    .close-selection {
        font-size: 1.4rem;
        width: 28px;
        height: 28px;
    }

    .gan-selection,
    .zhi-selection {
        margin-bottom: 20px;
    }

    .gan-selection label,
    .zhi-selection label {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .selection-actions {
        gap: 12px;
        margin-top: 20px;
        padding-top: 16px;
    }
}

@media (max-width: 360px) {
    .selection-panel {
        width: 99vw;
        padding: 12px;
        border-radius: 12px;
    }

    .selection-header {
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .selection-header h4 {
        font-size: 1rem;
    }

    .close-selection {
        font-size: 1.2rem;
        width: 24px;
        height: 24px;
    }

    .gan-selection,
    .zhi-selection {
        margin-bottom: 16px;
    }

    .gan-selection label,
    .zhi-selection label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
}

/* 天干地支按钮移动设备适配 */
@media (max-width: 768px) {
    .gan-buttons {
        gap: 10px;
        margin-bottom: 20px;
    }

    .zhi-buttons {
        gap: 8px;
        margin-bottom: 20px;
    }

    .gan-btn {
        width: 55px;
        height: 55px;
        font-size: 18px;
    }

    .zhi-btn {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }

    .gan-btn:hover,
    .zhi-btn:hover {
        transform: translateY(-1px) scale(1.02);
    }
}

@media (max-width: 480px) {
    .gan-buttons {
        gap: 8px;
        margin-bottom: 16px;
    }

    .zhi-buttons {
        gap: 6px;
        margin-bottom: 16px;
    }

    .gan-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }

    .zhi-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .gan-btn:hover,
    .zhi-btn:hover {
        transform: translateY(-1px) scale(1.01);
    }
}

@media (max-width: 360px) {
    .gan-buttons {
        gap: 6px;
        margin-bottom: 12px;
        grid-template-columns: repeat(5, 1fr);
    }

    .zhi-buttons {
        gap: 4px;
        margin-bottom: 12px;
        grid-template-columns: repeat(3, 1fr);
    }

    .gan-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .zhi-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .gan-btn:hover,
    .zhi-btn:hover {
        transform: scale(1.05);
    }
}

/* 八字反推模态框移动设备适配 */
@media (max-width: 768px) {
    .modal-content.bazi-modal {
        width: 95%;
        min-width: 300px;
        max-height: 90vh;
        min-height: 400px;
    }

    .bazi-form {
        gap: 16px;
    }

    .bazi-group {
        gap: 8px;
    }

    .bazi-group label {
        font-size: 15px;
    }

    .bazi-results {
        margin-top: 16px;
        padding: 16px;
    }

    .bazi-results h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .time-options {
        gap: 8px;
        max-height: 160px;
    }

    .time-option-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .bazi-actions {
        gap: 12px;
        margin-top: 16px;
        padding-top: 16px;
    }

    .bazi-actions .btn-nav {
        min-width: 70px;
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .modal-content.bazi-modal {
        width: 98%;
        min-width: 280px;
        max-height: 95vh;
        min-height: 350px;
    }

    .bazi-form {
        gap: 12px;
    }

    .bazi-group {
        gap: 6px;
    }

    .bazi-group label {
        font-size: 14px;
    }

    .bazi-results {
        margin-top: 12px;
        padding: 12px;
    }

    .bazi-results h4 {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .time-options {
        gap: 6px;
        max-height: 140px;
    }

    .time-option-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .bazi-actions {
        gap: 10px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .bazi-actions .btn-nav {
        min-width: 60px;
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 360px) {
    .modal-content.bazi-modal {
        width: 99%;
        min-width: 260px;
        max-height: 95vh;
        min-height: 320px;
    }

    .bazi-form {
        gap: 10px;
    }

    .bazi-group {
        gap: 4px;
    }

    .bazi-group label {
        font-size: 13px;
    }

    .bazi-results {
        margin-top: 10px;
        padding: 10px;
    }

    .bazi-results h4 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .time-options {
        gap: 4px;
    }

    .time-option-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .bazi-actions {
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        flex-direction: column;
    }

    .bazi-actions .btn-nav {
        min-width: auto;
        width: 100%;
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* 日历容器 */
.calendar-section {
    margin-bottom: 30px;
    width: 500px;
    max-width: 100%;
    /* 添加最大宽度限制 */
    border: 1px solid #ffd900c7;
    padding: 10px;
    background: rgba(42, 42, 42, 0.8);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    /* 确保padding不会导致溢出 */
}

.calendar-header {
    margin-bottom: 10px;

}

.calendar-title-row {
    cursor: pointer;
    padding: 10px 15px;
    transition: background-color 0.3s ease;
}

.calendar-title-row:hover {
    background-color: rgba(0, 217, 255, 0.02);
    border-radius: 15px;
}

.calendar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 15px;
    background-color: rgba(226, 121, 0, 0.05);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.calendar-grid-container.collapsed+.calendar-info {
    margin-top: 0;
}

.calendar-grid-container.collapsed .toggle-icon,
.calendar-grid-container.collapsed+.calendar-title-row .toggle-icon {
    transform: rotate(-90deg);
}

.calendar-grid-container {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.calendar-grid-container.collapsed {
    max-height: 0;
}

.calendar-nav-row {
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calendar-nav button {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-nav button:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.date-selector {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
    padding: 6px 8px;
    border-radius: 6px;
    margin: 0 5px;
    font-size: 0.9rem;
    min-width: 60px;
}

.date-selector:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
}

.date-selector option {
    background: #2a2a2a;
    color: #FFD700;
}

/* 日历表格 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 20px;
}

.calendar-weekday {
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
}

.calendar-day {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-height: 80px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.calendar-day:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.calendar-day.today {
    background: rgba(200, 200, 200, 0.15);
    border-color: rgba(200, 200, 200, 0.4);
}

.calendar-day.today.selected {
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.selected {
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.day-number {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 4px;
}

.lunar-info {
    font-size: 0.75rem;
    color: #FFD700;
    line-height: 1.2;
}

.lunar-date {
    margin: 1px;

}

.festival {
    background: #ff4757;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.6rem;
    margin-top: 2px;
    display: inline-block;
}

/* 信息展示面板 */
.calendar-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-title {
    color: #FFD700;
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    color: #FFD700;
    margin-bottom: 10px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 5px;
}

.card-content {
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.6;
}

.highlight {
    color: #FFD700;
}

.yi-ji {
    margin: 5px 0;
}

.yi {
    color: #2ed573;
}

.ji {
    color: #ff4757;
}

/* 时辰表格样式 */
.full-width {
    grid-column: 1 / -1;
}

.time-scroll-container {
    overflow-x: auto;
    margin-bottom: 15px;
}

.time-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 600px;
}

.time-table th,
.time-table td {
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 8px;
    text-align: center;
}

.time-table th {
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    font-size: 0.8rem;
}

.time-table td {
    color: #fff;
    font-size: 0.75rem;
}

.time-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.time-table tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

.time-detail-section {
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    padding-top: 15px;
}

.time-detail-item {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* 移动端时辰表格优化 */
@media (max-width: 768px) {
    .time-table {
        font-size: 0.7rem;
        min-width: 500px;
    }

    .time-table th {
        font-size: 0.65rem;
        padding: 6px 4px;
    }

    .time-table td {
        font-size: 0.6rem;
        padding: 6px 4px;
    }

    .time-detail-item {
        font-size: 0.7rem;
        padding: 6px;
    }

    .calendar-day {
        min-height: 50px;
        padding: 3px;
    }

}

@media (max-width: 480px) {
    .time-table {
        font-size: 0.6rem;
        min-width: 400px;
    }

    .time-table th,
    .time-table td {
        padding: 4px 2px;
        font-size: 0.55rem;
    }

    .time-detail-item {
        font-size: 0.75rem;
        padding: 5px;
    }

    .calendar-day {
        min-height: 50px;
        padding: 3px;
    }

}

/* ========== 老黄历白色模式美化 ========== */

/* 繁体字体样式 - 保持与简体字体一致 */
html.traditional-font,
html.traditional-font body,
html.traditional-font * {
    font-family: serif ;
}

/* 确保特定元素在繁体模式下也使用正确的字体 */
html.traditional-font .yao-symbols,
html.traditional-font .yao-symbol,
html.traditional-font .yao-display-line,
html.traditional-font [class*="yao-symbol"] {
    font-family: serif;
}

@media (max-width: 768px) {

    /* 原有移动端样式... */
    .gua-pair {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* 新增：移动端mobile class下，强制左右并列且缩小 */
    .gua-pair.mobile {
        display: flex;
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        align-items: flex-start;
    }

    .single-gua.mobile {
        padding: 8px 4px;
        font-size: 12px;
        background: rgba(255, 255, 255, 0.384);
        border-radius: 6px;
        min-width: 0;
        flex: 1 1 0;
        margin: 0 4px;
    }

    .single-gua.mobile h5 {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .yao-symbols.mobile {
        font-size: 1rem;
        line-height: 1.3;
    }

    .yao-display-line {
        font-size: 0.85em;
        margin: 4px 0;
    }
}

.yaogua-modal {
    max-width: 500px;
    user-select: none !important;
    /* 强制防止选中文本 */
    -webkit-user-select: none !important;
    /* Safari */
    -moz-user-select: none !important;
    /* Firefox */
    -ms-user-select: none !important;
    /* IE/Edge */
}

/* 防止模态框外部点击产生反色效果 */
.modal::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* 日历标题和切换按钮 */
.calendar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: bold;
}

.calendar-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.calendar-toggle:hover {
    opacity: 0.8;
}

.calendar-toggle .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.calendar-toggle.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* 日历网格容器 */
.calendar-grid-container {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.calendar-grid-container.collapsed {
    max-height: 0;
}

/* 节气分类颜色 */
.festival.jie-festival {
    background: #4da6ff;
    /* 浅蓝色 */
}

.festival.other-festival {
    background: #808080;
    /* 灰色 */
}

/* 超小屏幕 (≤360px) 导航栏优化 */
@media (max-width: 7680px) {

    .nav-left,
    .auth-buttons {
        flex-wrap: wrap;
    }

    .logo {
        font-size: 16px;
        margin-right: 4px;
    }

    .pc-version-btn,
    .mobile-version-btn,
    .auth-buttons .btn-nav {
        font-size: 14px;
        min-height: 20px;
    }

    .auth-buttons {
        gap: 4px;
    }
}

/* --------------------------------------------------- */
/* 自定义：移动端两行导航布局 & 样式优化              */
/* --------------------------------------------------- */

/* 整体导航栏与页面顶部保持 10px 间距 */
.top-nav {
    margin-top: 0px;
    /* 原本 top:0; 不变，使用 margin 推开 */
    background-color: #0a0a0f;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 移动端（≤768px）强制一行布局，比例缩小按钮 */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: row;
        /* 保持水平排列 */
        align-items: center;
        /* 垂直居中 */
        height: auto;
        /* 根据内容自适应高度 */
        padding: 5px 5px;
        /* 减小内边距 */
        padding-top: 15px;
        min-height: 60px;
        /* 减小最小高度 */
        gap: 8px;
        /* 元素间距 */
    }

    .nav-left {
        flex: 1;
        /* 占据剩余空间 */
        justify-content: flex-start;
        /* 左对齐 */
        margin-bottom: 0;
        /* 移除底部间距 */
    }

    .auth-buttons {
        flex-shrink: 0;
        /* 防止收缩 */
        justify-content: flex-end;
        /* 右对齐 */
        flex-wrap: nowrap;
        /* 防止折行 */
        gap: 6px;
        /* 按钮间距 */
    }

    /* 比例缩小按钮 */
    .btn-nav {
        padding: 6px 12px;
        /* 减小内边距 */
        font-size: 13px;
        /* 减小字体 */
        min-height: 32px;
        /* 减小高度 */
        border-radius: 16px;
        /* 调整圆角 */
    }

    /* 特别处理Forum按钮 */
    #forumBtn {
        padding: 6px 14px;
        /* 减小内边距 */
        font-size: 13px;
        /* 减小字体 */
        min-height: 32px;
        /* 减小高度 */
        border-radius: 16px;
        /* 调整圆角 */
    }

    /* 缩小logo */
    .logo {
        font-size: 16px;
        /* 减小logo字体 */
        white-space: nowrap;
        /* 防止换行 */
        flex-shrink: 0;
        /* 防止收缩 */
    }

    /* 缩小设置按钮 */
    .settings-toggle {
        padding: 6px;
        /* 减小内边距 */
        width: 32px;
        /* 减小宽度 */
        height: 32px;
        /* 减小高度 */
    }

    .settings-toggle svg {
        width: 16px;
        /* 减小图标 */
        height: 16px;
        /* 减小图标 */
    }

    /* 防止左侧元素换行 */
    .nav-left {
        flex-wrap: nowrap;
        /* 强制不换行 */
        gap: 6px;
        /* 元素间距 */
    }

    /* 版本切换按钮样式 */
    .mobile-version-btn,
    .pc-version-btn {
        white-space: nowrap;
        /* 防止文字换行 */
        flex-shrink: 0;
        /* 防止收缩 */
        min-width: auto;
        /* 允许自适应宽度 */
    }

    /* 确保左侧内容不换行 */
    .nav-left>* {
        flex-shrink: 0;
        /* 防止所有子元素收缩 */
    }

    /* 确保右侧按钮组不溢出 */
    .auth-buttons {
        min-width: 0;
        /* 允许收缩 */
        overflow: visible;
        /* 允许溢出显示 */
    }

    /* 特别处理退出按钮，确保始终可见 */
    #logoutBtn {
        white-space: nowrap;
        /* 防止文字换行 */
        flex-shrink: 0;
        /* 防止收缩 */
        min-width: auto;
        /* 自适应宽度 */
    }
}

/* Forum 按钮美化 */
#forumBtn {
    background: linear-gradient(135deg, #ff7b00 0%, #ff9900 100%);
    color: #ffffff !important;
    border: none;
    /* 去除边框，使用渐变背景 */
    padding: 5px 8px;
    min-height: 35px;
    /* 与其他按钮保持统一高度 */
    border-radius: 10px;
    /* 更圆润 */
}

#forumBtn svg {
    margin-right: 6px !important;
}

#forumBtn:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* 筮草分组容器已删除 */

/* 变爻颜色区分 - 灰度减半 */
.changing-yao {
    filter: grayscale(0.2);
    opacity: 0.7;
}

.yaogua-modal .modal-header {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    z-index: 10;
    border-radius: 7px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.yaogua-modal .yaogua-content {
    overflow-y: auto;
    padding-right: 15px;
    margin-right: -15px;
    border-radius: 7px;
}

/* === Yaogua Modal – Desktop Fixed Overlay (2025-07-11) === */
#yaoguaModal {
    /* 禁止整体滚动，只允许内部内容滚动 */
    overflow: hidden !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

#yaoguaModal .modal-content {
    margin: 5vh auto !important;
    /* 减小默认 10% 边距，避免超出视口 */
    max-height: 90vh !important;
    /* 始终限制在视口内 */
}

#yaoguaModal .yaogua-content {
    flex: 1 1 auto;
    overflow-y: auto;
    /* 仅内容可滚动 */
}

@media (min-width: 769px) {
    #yaoguaModal .modal-content {
        width: 100%;
        max-width: 500px;
        /* 保持原有最大宽度 */
    }
}

/* 小尺寸设备间距优化 */
@media (max-width: 480px) {

    /* 减少按钮之间的间距，避免内容溢出 */
    #baziRecalculateModal .gender-options {
        gap: 6px;
        /* 从12px减少到6px */
    }

    #baziRecalculateModal #time-adjustment-options {
        gap: 6px;
        /* 从12px减少到6px */
    }

    #baziRecalculateModal .form-group {
        margin-bottom: 15px;
        /* 从20px减少到15px */
    }

    #baziRecalculateModal .gender-option {
        padding: 12px 16px;
        /* 从14px 20px减少到12px 16px */
    }

    #baziRecalculateModal .time-adjustment-btn {
        padding: 14px;
        /* 从16px减少到14px */
        gap: 4px;
        /* 从6px减少到4px */
    }

    .selection-panel {
        width: 90vw;
        max-width: calc(100vw - 10px);
        padding: 10px;
        border-radius: 12px;
        max-height: 90vh;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .modal-content.bazi-modal {
        max-width: calc(100vw - 10px);
        min-width: unset;
        box-sizing: border-box;
        overflow-x: hidden;
    }
}

@media (max-width: 360px) {

    /* 进一步减少小屏幕的间距 */
    #baziRecalculateModal .gender-options {
        gap: 6px;
        /* 进一步减少到4px */
    }

    #baziRecalculateModal #time-adjustment-options {
        gap: 10px;
        /* 进一步减少到4px */
    }

    #baziRecalculateModal .form-group {
        margin-bottom: 12px;
        /* 进一步减少到12px */
    }

    #baziRecalculateModal .gender-option {
        padding: 10px 14px;
        /* 进一步减少到10px 14px */
    }

    #baziRecalculateModal .time-adjustment-btn {
        padding: 12px;
        /* 进一步减少到12px */
        gap: 3px;
        /* 进一步减少到3px */
    }
}

/* 安装App按钮样式 - 确保层级合理 */
#pwa-install-button {
    z-index: 100 !important;
    /* 只比基本面板高一级 */
}

#pwa-install-button>div {
    z-index: 100 !important;
}

/* 调整其他模态框的z-index，确保层级合理 */
.modal {
    z-index: 1000 !important;
    /* 比安装App按钮高 */
}

.prediction-modal {
    z-index: 1000 !important;
    /* 比安装App按钮高 */
}

.settings-dropdown {
    z-index: 2000 !important;
    /* 比普通模态框高 */
}

/* iOS安装指导模态框 */
.ios-install-guide {
    z-index: 1500 !important;
    /* 比普通模态框高，但比设置下拉菜单低 */
}