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


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

}





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

/* 基础样式 */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: all 0.3s ease;
}

/* API页面样式 - 确保文字可见性 */
.api-content, .api-page, .demo-container, .demo-card {
    background: #1a1a1a !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: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px;
    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: #ffedd3 !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变量定义 - 主题支持 */
:root {
    /* 深色主题 (默认) */
    --bg-primary: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(0, 0, 0, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(182, 181, 181, 0.9);
    --text-muted: rgba(151, 151, 151, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #ff7b00;
}



/* 摇卦模态框样式 */
.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(66, 141, 175, 0.08), rgba(122, 202, 234, 0.12));
    border: 1px solid rgba(88, 86, 214, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 0.8rem;
}

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

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

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

.yaogua-question .question-select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(88, 86, 214, 0.2);
    border-radius: 8px;
    background: rgba(25, 81, 114, 0.3);
    color: var(--text-primary);
    font-size: 18px;
    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: #112f31b2;
    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: 12px;
    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: 20px;
    animation: fadeInUp 0.5s ease;
}

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

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

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

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

.single-gua {
    text-align: center;
    padding: 16px;
    background: rgba(182, 181, 181, 0.3);
    border: 1px solid rgba(88, 86, 214, 0.1);
    border-radius: 8px;
}

.single-gua h5 {
    color: #1d1d1f;
    margin: 0 0 12px 0;
    font-size: 14px;
}

.yao-symbols {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.3;
}

.yao-display, .yao-display-line {
    color: #0e0e0e;
    margin: 6px 0;
}

.changing-info {
    text-align: center;
    padding: 12px;
    background: rgba(255, 159, 10, 0.2);
    border: 1px solid rgba(255, 159, 10, 0.5);
    border-radius: 8px;
    color: #1d1d1f;
}

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

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

.result-actions .btn-primary {
    background: linear-gradient(135deg, #56d6d679, #7ac7ea57);
    color: white;
    box-shadow: 0 4px 12px rgba(88, 86, 214, 0.3);
}

.result-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 86, 214, 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;
        gap: 16px;
    }
    
    .yaogua-btn {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .result-actions .btn {
        width: 100%;
        max-width: 200px;
    }
}

@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%;
    min-height: 400px;
    background: linear-gradient(135deg, rgba(255, 123, 0, 0.1) 0%, rgba(255, 123, 0, 0.05) 100%);
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    overflow: hidden;
    display: none;
}

.dayan-animation-container.show {
    display: block;
    animation: containerFadeIn 0.8s ease-out;
}

.dayan-animation-container.collapsed {
    min-height: 170px;
    max-height: 170px;
    overflow: hidden;
    padding-bottom: 50px; /* 为控制按钮留出空间 */
}

.dayan-animation-container.collapsed .yarrow-sticks,
.dayan-animation-container.collapsed .yarrow-groups,
.dayan-animation-container.collapsed .calculation-process,
.dayan-animation-container.collapsed .yao-formation {
    display: none;
}

.dayan-animation-container.collapsed .dayan-stage-description {
    display: none;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

/* 筮草动画 */
.yarrow-sticks {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    margin: 20px 0;
    position: relative;
}

.yarrow-stick {
    width: 3px;
    height: 80px;
    background: linear-gradient(to bottom, #8B4513, #A0522D);
    margin: 0 1px;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(20px);
    animation: stickFall 0.5s ease-out forwards;
}

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

.yarrow-stick:nth-child(odd) {
    animation-delay: 0.1s;
}

.yarrow-stick:nth-child(even) {
    animation-delay: 0.2s;
}

/* 分组动画 */
.yarrow-groups {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 30px 0;
    opacity: 0;
    animation: groupsAppear 1s ease-out forwards;
}

@keyframes groupsAppear {
    to {
        opacity: 1;
    }
}

.yarrow-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.group-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.group-sticks {
    display: flex;
    flex-wrap: wrap;
    max-width: 80px;
    justify-content: center;
}

.group-sticks .yarrow-stick {
    width: 2px;
    height: 40px;
    margin: 1px;
    animation: groupStickMove 0.8s ease-out forwards;
}

@keyframes groupStickMove {
    from {
        transform: translateX(0) translateY(0);
        opacity: 0.3;
    }
    to {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

/* 计算过程动画 */
.calculation-process {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    opacity: 0;
    animation: calculationAppear 1s ease-out forwards;
}

@keyframes calculationAppear {
    to {
        opacity: 1;
    }
}

.calculation-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    opacity: 0;
    animation: stepAppear 0.6s ease-out forwards;
}

.calculation-step:nth-child(1) { animation-delay: 0.2s; }
.calculation-step:nth-child(2) { animation-delay: 0.4s; }
.calculation-step:nth-child(3) { animation-delay: 0.6s; }
.calculation-step:nth-child(4) { animation-delay: 0.8s; }
.calculation-step:nth-child(5) { animation-delay: 1.0s; }
.calculation-step:nth-child(6) { animation-delay: 1.2s; }

@keyframes stepAppear {
    to {
        opacity: 1;
    }
}

.step-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.step-value {
    font-size: 1rem;
    color: #ff7b00;
    font-weight: 600;
}

/* 爻象形成动画 */
.yao-formation {
    margin: 30px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yao-forming {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    opacity: 0;
    transform: scale(0.8);
    animation: yaoForm 1.2s ease-out forwards;
    min-height: 30px;
}

.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: 'Courier New', monospace;
}

/* 进度指示器 */
.progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 5px;
    animation: progressPulse 1.5s ease-in-out infinite;
}

.progress-dot.active {
    background: #ff7b00;
    box-shadow: 0 0 10px rgba(255, 123, 0, 0.5);
}

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

/* 动画控制按钮 */
.animation-controls {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 123, 0, 0.1);
    border: 1px solid rgba(255, 123, 0, 0.3);
    color: #ff7b00;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 123, 0, 0.2);
    border-color: #ff7b00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 123, 0, 0.3);
}

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

/* 移动端适配 */
@media (max-width: 768px) {
    .dayan-animation-container {
        padding: 20px;
        min-height: 300px;
    }
    
    .yarrow-sticks {
        height: 80px;
    }
    
    .yarrow-stick {
        height: 60px;
    }
    
    .yarrow-groups {
        flex-direction: row; /* 强制一行显示 */
        gap: 10px;
        justify-content: center;
        align-items: center;
    }
    
    .yarrow-group-container.force-row {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
    }
    
    .yarrow-group {
        flex: 1;
        min-width: 0;
    }
    
    .calculation-process {
        padding: 15px;
    }
    
    .yao-symbol {
        font-size: 1.2rem;
    }
    
    /* 新增：移动端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: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #1a1a1a;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.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: 9999; /* 提高z-index确保在最顶层 */
    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: 11px;                  /* 进一步减小字体 */
        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;                 /* 进一步减小内边距 */
        font-size: 10px;                  /* 进一步减小字体 */
        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: 20px;
    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;
}

.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%);
    border-color: #4caf50;
    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;
    min-height: 100vh;
    padding: 80px 5px 5px; /* 增加顶部padding到80px，避免被60px高的导航栏遮挡 */
}

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

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

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

/* 内联布局样式 */
.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: 40px;
    padding: 0 16px;
    font-size: 17px;
    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 2px 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: 20px;
    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(0, 255, 204, 0.2);
    border-color: #00ffcc;
    color: aqua;
    box-shadow: 0 0 10px rgba(0, 255, 204, 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: #1a1a1a;
    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 {
    border-color: #4a4a8a;
    color: #ffffff;
    width: 75px;
    height: 32px;
}
.option-btn.btn-solar.active {
    background: rgba(255, 200, 0, 0.18);
    border-color: #ffc107;
    color: #fffbe6;
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.25);
}

/* 四柱反推按钮样式 */
.option-btn.btn-ganzhi {
    border-color: #4a4a8a;
    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: 8px;
}

.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%;
    background-color: #1eb2bd4d;
    transition: 0.4s ease;
    z-index: -1;
}

.btn:hover::after {
    height: 87%;
    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: 18px;
    margin-bottom: 8px;
    color: inherit;
}

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

/* 模态框 */
.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(41, 41, 41, 0.55);
    backdrop-filter: blur(20px);
    margin: 10% auto;
    padding: 30px;
    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: 0;
    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 {
        margin: 14px 0;
        padding: 14px;
    }
    
    .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: 16px;
        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: 2px;
    }
    
    .input-group label {
        font-size: 14px;
    }
    
    /* 反推移动端适配 */

}

.input-group.inline input#correctionResult {
    flex: 2;
    min-width: 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;
}

/* 自动保存按钮样式 */
.auto-save-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 未激活状态 - 灰色 */
.auto-save-btn:not(.active) {
    background: rgba(88, 88, 88, 0.548) !important;
    border: 1px solid rgba(150, 150, 150, 0.4) !important;
    color: rgba(255, 255, 255, 0.973) !important;
}

.auto-save-btn:not(.active):hover {
    background: rgba(140, 140, 140, 0.4) !important;
    border-color: rgba(160, 160, 160, 0.5) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 激活状态 - 发光效果 */
.auto-save-btn.active {
 
    border: 1px solid rgba(76, 175, 80, 0.6) !important;
    color: #ffffff !important;
    box-shadow: 
        0 0 10px rgba(76, 175, 80, 0.3),
        0 4px 5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.auto-save-btn.active:hover {
  
    border-color: rgba(12, 171, 192, 0.8) !important;
    box-shadow: 
        0 0 5px rgba(76, 175, 80, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}



/* 命运分析页面 - 八字四柱样式 */
.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) {

    
    /* 移动端自动保存按钮适配 */
    .auto-save-btn {
        min-width: 80px !important;
        max-width: 100px !important;
        font-size: 12px !important;
    }
    
    .auto-save-btn.active {
        box-shadow: 
            0 0 15px rgba(76, 175, 80, 0.3),
            0 3px 10px rgba(0, 0, 0, 0.3) !important;
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.4) !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.8s ease-out;
    position: relative;
}

@keyframes resultsAppear {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
        background: rgba(255, 215, 0, 0.6);
        border-color: rgba(255, 215, 0, 0.8);
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 
                    0 0 80px rgba(255, 215, 0, 0.4),
    }
    30% {
        background: rgba(255, 215, 0, 0.3);
        border-color: rgba(255, 215, 0, 0.6);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6),
                    0 0 60px rgba(255, 215, 0, 0.3);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: none;
    }
}

.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;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: left;
    animation: optionSlideIn 0.5s ease-out;
    animation-fill-mode: both;
}

@keyframes optionSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-40px) scale(0.95);
        background: rgba(255, 215, 0, 0.4);
        border-color: rgba(255, 215, 0, 0.6);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }
    50% {
        background: rgba(255, 215, 0, 0.2);
        border-color: rgba(255, 215, 0, 0.4);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        background: rgba(0, 122, 255, 0.1);
        border-color: rgba(0, 122, 255, 0.3);
        box-shadow: none;
    }
}

.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: 9999 !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: 9000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(67, 90, 83, 0.08);
    backdrop-filter: blur(5px);
}

#baziRecalculateModal .modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(66, 69, 62, 0.65), hsla(194, 29%, 27%, 0.75));
    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;
    backdrop-filter: blur(450px);
    width: 90%;
    max-width: 380px;
    min-height: fit-content;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#baziRecalculateModal h2 {
    background: rgba(34, 60, 44, 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(34, 60, 44, 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(56, 110, 72, 0.22);
    border-color: #a8d5ba;
    color: #eaf7e1;
}

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

#baziRecalculateModal .gender-option.calculating {
    background: #34c759;
    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(34, 60, 44, 0.18) 0%, rgba(56, 110, 72, 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: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

#baziRecalculateModal .time-adjustment-btn:hover {
    background: linear-gradient(135deg, rgba(134, 160, 144, 0.5) 0%, rgba(56, 110, 72, 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: #34c759;
    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(34, 60, 44, 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(56, 110, 72, 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);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 成功消息动画 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* 平板设备适配 */
@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 {
        flex-direction: column;
        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 {
        margin: 1% auto;
        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.85rem;
    }
}

/* 背景锁定样式 */
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;
        max-height: 120px;
    }
    
    .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-top: 10px;
    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.9rem;
    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.65rem;
        padding: 5px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 3px;
    }

}

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





















/* 繁体字体样式 - 保持与简体字体一致 */
html.traditional-font, 
html.traditional-font body,
html.traditional-font * {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

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

@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.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;
    }
}

.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 {
        padding: 4px 6px;
        font-size: 14px;
        min-height: 26px;
    }

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

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

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

/* 移动端（≤768px）强制一行布局，比例缩小按钮 */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: row;              /* 保持水平排列 */
        align-items: center;              /* 垂直居中 */
        height: auto;                     /* 根据内容自适应高度 */
        padding: 6px 10px;                /* 减小内边距 */
        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;                        /* 去除边框，使用渐变背景 */
    font-weight: 600;
    padding: 8px 18px;
    min-height: 35px;                    /* 与其他按钮保持统一高度 */
    border-radius: 22px;                 /* 更圆润 */
}

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

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

/* 筮草分组容器 */
.yarrow-group-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
}

/* 移动端强制一行显示 */
.yarrow-group-container.force-row {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

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

/* === 调整PC端筮草分组间距 === */
.yarrow-group-container {
    gap: 30px; /* 增加左右组之间的间距，PC端适用 */
    
}

.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 {
        width: 90vw;
        max-width: calc(100vw - 10px);
        min-width: unset;
        box-sizing: border-box;
        overflow-x: hidden;
    }
}

@media (max-width: 360px) {
    /* 进一步减少小屏幕的间距 */
    #baziRecalculateModal .gender-options {
        gap: 4px; /* 进一步减少到4px */
    }
    
    #baziRecalculateModal #time-adjustment-options {
        gap: 4px; /* 进一步减少到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 */
    }
}

