/* 主页样式 */

/* 覆盖电脑端最大宽度 */
:root {
    --desktop-max-width: 1185px;
}

/* 覆盖chat-style.css中的body样式，允许滚动 */
body {
    height: auto !important;
    min-height: 100vh;
    display: block !important;
    overflow-y: auto;
    position: relative !important;
}

/* 重置html和body的滚动行为 */
html, body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 菜单按钮样式 */
.menu-toggle-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    margin-right: 0;
}

.menu-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 标题栏固定 */
.chat-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 50px;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* AI聊天按钮样式 */
.ai-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.ai-chat-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* 侧边菜单样式 */
.side-menu {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100dvh;
    z-index: var(--z-modal);
    transition: left 0.3s ease;
}

.side-menu.active {
    left: 0;
}

.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
    display: none; /* 默认隐藏 */
}

.side-menu.active .menu-backdrop {
    display: block; /* 菜单激活时显示 */
}

.menu-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.menu-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-title:hover {
    color: #256d6f;
}

.menu-title-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.menu-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.menu-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.menu-items {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.menu-item:hover {
    background-color: #f8f9fa;
}

.menu-icon {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-svg-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.menu-text {
    font-size: 14px;
    color: #333;
}

/* 暗色主题菜单样式 */
body.dark-theme .menu-content {
    background: #1A1A1F;
}

body.dark-theme .menu-header {
    background: #25252B;
    border-bottom-color: #3A3A40;
}

body.dark-theme .menu-title {
    color: #E8E8E8;
}

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

body.dark-theme .menu-close-btn {
    color: #E8E8E8;
}

body.dark-theme .menu-close-btn:hover {
    background-color: rgba(74, 144, 226, 0.2);
}

body.dark-theme .menu-item {
    border-color: #3A3A40;
}

body.dark-theme .menu-item:hover {
    background-color: #25252B;
}

body.dark-theme .menu-text {
    color: #E8E8E8;
}

/* 功能选项卡样式 */
.feature-tabs {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

/* 结果展示区域样式 */
.result-section-inline {
    margin-bottom: 0;
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    flex: 1;
    min-width: 60px;
    max-width: 100px;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
}

.tab-btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
    color: #256d6f;
    border-bottom-color: #256d6f;
    background: #fff;
}

.tab-content {
    padding: 20px;
}

/* 暗色主题样式 */
body.dark-theme .feature-tabs {
    background: #25252B;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .tab-nav {
    background: #1A1A1F;
    border-bottom-color: #3A3A40;
}

body.dark-theme .tab-btn {
    color: #B8B8B8;
}

body.dark-theme .tab-btn:hover {
    color: #E8E8E8;
    background: rgba(212, 175, 55, 0.1);
}

body.dark-theme .tab-btn.active {
    color: #d4af37;
    border-bottom-color: #d4af37;
    background: #25252B;
}

body.dark-theme .tab-content {
    background: #25252B;
}

body.dark-theme .feature-form {
    background: #25252B;
}

body.dark-theme .form-group label {
    color: #E8E8E8;
}

body.dark-theme .bazi-input {
    border: 1px solid #3A3A40;
    background: #1A1A1F;
    color: #E8E8E8;
}

/* 暗色主题日期输入框样式 */
body.dark-theme .date-input {
    background: #25252B !important;
    color: #E8E8E8;
    border-color: #3A3A40;
}

body.dark-theme .date-input:hover {
    background: #3A3A40 !important;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

body.dark-theme .date-input:focus {
    background: #3A3A40 !important;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

body.dark-theme .gender-text {
    color: #E8E8E8;
}

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

body.dark-theme .gender-option input[type="radio"]:checked + .gender-label {
    border-color: #00d1b2;
    background: rgba(0, 209, 178, 0.2);
}

body.dark-theme .form-description {
    color: #B8B8B8;
}

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

body.dark-theme .spread-option input[type="radio"]:checked + .spread-label {
    border-color: #00d1b2;
    background: rgba(0, 209, 178, 0.2);
}

body.dark-theme .form-btn {
    background: #443828;
    color: #fff;
}

body.dark-theme .form-btn:hover {
    background: #5a4a35;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 默认提示样式 */
.default-prompt {
    text-align: center;
    padding: 15px 20px;
    color: #333;
}

.default-prompt h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #256d6f;
}

.default-prompt p {
    font-size: 16px;
    margin-bottom: 10px;
    color: #666;
}

.default-prompt ul {
    text-align: left;
    max-width: 100%;
    margin: 0 auto;
    padding-left: 20px;
}

.default-prompt li {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 6px;
    color: #555;
}

/* 移动端默认提示样式 */
@media (max-width: 768px) {
    .default-prompt {
        padding: 10px 15px;
    }
    
    .default-prompt h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .default-prompt p {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .default-prompt ul {
        max-width: 100%;
        padding-left: 15px;
    }
    
    .default-prompt li {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 4px;
    }
}

/* 暗色主题默认提示样式 */
body.dark-theme .default-prompt {
    color: #E8E8E8;
}

body.dark-theme .default-prompt h3 {
    color: #d4af37;
}

body.dark-theme .default-prompt p {
    color: #B8B8B8;
}

body.dark-theme .default-prompt li {
    color: #B8B8B8;
}

.feature-form {
    max-width: 500px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.date-input-container {
    position: relative;
}

.bazi-input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
}

.date-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    cursor: pointer;
}

.gender-options {
    display: flex;
    gap: 20px;
}

.gender-option {
    display: flex;
    align-items: center;
}

.gender-option input[type="radio"] {
    display: none;
}

.gender-label {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gender-option input[type="radio"]:checked + .gender-label {
    border-color: #256d6f;
    background: rgba(37, 109, 111, 0.1);
}

.gender-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.gender-text {
    font-size: 14px;
}

.single-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.single-row label {
    margin-bottom: 0;
    white-space: nowrap;
}

.surname-input {
    width: 100px;
}

.tarot-spread-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.spread-option {
    flex: 1;
    min-width: 100px;
}

.spread-option input[type="radio"] {
    display: none;
}

.spread-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.spread-option input[type="radio"]:checked + .spread-label {
    border-color: #256d6f;
    background: rgba(37, 109, 111, 0.1);
}

.spread-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.spread-text {
    font-size: 12px;
    font-weight: 600;
}

.tarot-input,
.jiemeng-input,
.bugua-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

/* 暗色主题输入框样式 */
body.dark-theme .tarot-input,
body.dark-theme .jiemeng-input,
body.dark-theme .bugua-input {
    border: 1px solid #3A3A40;
    background: #1A1A1F;
    color: #E8E8E8;
}

/* 暗色主题下抖动动画的红色边框 */
body.dark-theme .tarot-input.shake,
body.dark-theme .jiemeng-input.shake,
body.dark-theme .bugua-input.shake {
    animation: shake-dark 0.5s ease-in-out;
    border-color: #E74C3C !important;
    color: #E74C3C !important;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.form-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.form-btn {
    background: #256d6f;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    max-width: 340px;
    display: block;
    margin: 0 auto;
}

.form-btn:hover {
    background: #1d5a5c;
}

/* 主页内容样式 */
.home-container {
    min-height: calc(100vh - var(--header-height));
    padding: 0 20px;
    margin-top: var(--header-height);
    overflow: visible;
    padding-top: 20px;
}

/* 今日黄历样式 */
.today-almanac {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.almanac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2d8c8f;
    flex-wrap: nowrap;
    gap: 10px;
}

.almanac-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d8c8f;
    margin: 0;
}

.almanac-date {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.almanac-toggle-btn {
    background: linear-gradient(135deg, #2d8c8f 0%, #3aa8ab 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(45, 140, 143, 0.3);
}

.almanac-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 140, 143, 0.4);
}

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

.toggle-icon {
    transition: transform 0.3s ease;
}

.almanac-toggle-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* 神煞信息区域 */
.gods-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    animation: fadeIn 0.3s ease;
}

.gods-section {
    margin-bottom: 20px;
}

.gods-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d8c8f;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.gods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.gods-value {
    background: #f0f7f7;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #2d8c8f;
    font-weight: 500;
    text-align: center;
    border: 1px solid #d1eaea;
}

.gods-grid .gods-value {
    background: #e8f4f4;
    border: 1px solid #c2e0e0;
}

/* 吉神样式 */
.good-god {
    background: linear-gradient(135deg, #e8f6f3 0%, #d1f2eb 100%) !important;
    border: 1px solid #a3e4d7 !important;
    color: #1a7d6f !important;
    box-shadow: 0 2px 4px rgba(26, 125, 111, 0.2);
}

/* 凶神样式 */
.bad-god {
    background: linear-gradient(135deg, #fdedec 0%, #fadbd8 100%) !important;
    border: 1px solid #f5b7b1 !important;
    color: #a93226 !important;
    box-shadow: 0 2px 4px rgba(169, 50, 38, 0.2);
}

/* 暗色主题下的吉神凶神样式 */
body.dark-theme .good-god {
    background: linear-gradient(135deg, #1A1A1F 0%, #25252B 100%) !important;
    border: 1px solid #D4AF37 !important;
    color: #D4AF37 !important;
}

body.dark-theme .bad-god {
    background: linear-gradient(135deg, #1A1A1F 0%, #25252B 100%) !important;
    border: 1px solid #E74C3C !important;
    color: #E74C3C !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 暗色主题 */
body.dark-theme .gods-info {
    border-top-color: #3A3A40;
}

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

body.dark-theme .gods-value {
    background: #25252B;
    color: #B8B8B8;
    border-color: #3A3A40;
}

body.dark-theme .gods-grid .gods-value {
    background: #1A1A1F;
    border-color: #25252B;
}

/* 吉神方位样式 */
.luck-directions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.luck-direction-item {
    background: linear-gradient(135deg, #e8f6f3 0%, #d1f2eb 100%);
    border: 1px solid #a3e4d7;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(26, 125, 111, 0.2);
}

.luck-god-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a7d6f;
    margin-bottom: 5px;
}

.luck-direction-info {
    font-size: 0.8rem;
    color: #2d8c8f;
    line-height: 1.4;
}

.luck-direction-info .direction {
    font-weight: 600;
    color: #1a7d6f;
}

/* 暗色主题下的吉神方位样式 */
body.dark-theme .luck-direction-item {
    background: linear-gradient(135deg, #1A1A1F 0%, #25252B 100%);
    border: 1px solid #D4AF37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

body.dark-theme .luck-god-name {
    color: #D4AF37;
}

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

body.dark-theme .luck-direction-info .direction {
    color: #D4AF37;
}

.almanac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.almanac-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.almanac-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.almanac-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.almanac-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.action-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.action-item:first-child .action-label {
    color: #2ecc71;
}

.action-item:last-child .action-label {
    color: #e74c3c;
}

.action-content {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
    min-height: 40px;
}

.good-acts {
    color: #27ae60;
}

.bad-acts {
    color: #c0392b;
}

/* 黄历暗色主题样式 */
body.dark-theme .today-almanac {
    background: linear-gradient(135deg, #1A1A1F 0%, #25252B 100%);
    border: 1px solid #3A3A40;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .almanac-header {
    border-bottom-color: #D4AF37;
}

body.dark-theme .almanac-title {
    color: #D4AF37;
}

body.dark-theme .almanac-date {
    color: #B8B8B8;
}

body.dark-theme .almanac-item {
    background: #25252B;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

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

body.dark-theme .action-item {
    background: #25252B;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .action-label {
    border-bottom-color: #3A3A40;
}

body.dark-theme .action-item:first-child .action-label {
    color: #07c060;
}

body.dark-theme .action-item:last-child .action-label {
    color: #E74C3C;
}

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

body.dark-theme .good-acts {
    color: #07c060;
}

body.dark-theme .bad-acts {
    color: #E74C3C;
}

body.dark-theme .almanac-toggle-btn {
    background: linear-gradient(135deg, #D4AF37 0%, #F5A623 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

body.dark-theme .almanac-toggle-btn:hover {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .today-almanac {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .almanac-header {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .almanac-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .almanac-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.feature-section {
    text-align: center;
    width: 100%;
    margin: 0 auto;
    padding: 0px 0px 20px 0px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
    max-width: 100%;
}

.feature-card {
    background: #fff;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* 抖动动画 */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
        border-color: #d32f2f;
        color: #d32f2f;
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
        border-color: #d32f2f;
        color: #d32f2f;
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
        border-color: #d32f2f;
        color: #d32f2f;
    }
}

/* 暗色主题抖动动画 */
@keyframes shake-dark {
    0%, 100% {
        transform: translateX(0);
        border-color: #ff5252;
        color: #ff5252;
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
        border-color: #ff5252;
        color: #ff5252;
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
        border-color: #ff5252;
        color: #ff5252;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 确保移动端可以滚动 */
    body {
        height: auto !important;
        min-height: 100vh;
        display: block !important;
        overflow-y: auto;
    }
    
    .side-menu {
        width: 280px;
        left: -280px;
    }
    
    /* 移动端选项卡优化 */
    .tab-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 8px;
    }
    
    .tab-btn {
        flex: 0 0 calc(25% - 6px); /* 每行4个，考虑gap */
        min-width: auto;
        max-width: none;
        padding: 14px 6px;
        font-size: 14px;
        border-bottom: 3px solid transparent;
        border-radius: 8px;
        background: #f8f9fa;
        transition: all 0.3s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .tab-btn:hover {
        background: #e9ecef;
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }
    
    .tab-btn.active {
        color: #256d6f;
        border-bottom: 3px solid #256d6f;
        background: #fff;
        box-shadow: 0 2px 8px rgba(37, 109, 111, 0.2);
        font-weight: 600;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .feature-form {
        max-width: 100%;
    }
    
    .form-group label {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .bazi-input {
        font-size: 16px;
        padding: 14px 40px 14px 14px;
    }
    
    .gender-options {
        gap: 15px;
    }
    
    .gender-text {
        font-size: 15px;
    }
    
    .single-row {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .surname-input {
        width: auto;
        flex: 0 0 120px;
        font-size: 16px;
    }
    
    .tarot-spread-options {
        flex-direction: row;
        gap: 8px;
        justify-content: space-between;
    }
    
    .spread-option {
        min-width: auto;
        flex: 1;
    }
    
    .spread-label {
        flex-direction: column;
        justify-content: center;
        padding: 6px 3px;
        text-align: center;
        min-height: 50px;
    }
    
    .spread-icon {
        font-size: 20px;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .spread-text {
        font-size: 12px;
        line-height: 1.2;
    }
    
    .tarot-input,
    .jiemeng-input,
    .bugua-input {
        font-size: 16px;
        padding: 14px;
    }
    
    .form-description {
        font-size: 15px;
    }
    
    .form-btn {
        font-size: 17px;
        padding: 14px 35px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .feature-section {
         padding: 0px 0px 20px 0px;
    }
    
    .home-container {
        padding: 0 15px;
        margin-top: calc(var(--header-height) + 10px);
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .tab-btn {
        flex: 0 0 calc(25% - 6px); /* 每行4个，考虑gap */
        font-size: 15px;
        padding: 12px 6px;
        line-height: 1.4;
    }
    
    .tab-content {
        padding: 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 0;
        min-width: 60px;
        flex-shrink: 0;
        text-align: center;
        justify-content: center;
        display: flex;
        align-items: center;
    }
    
    .form-group .date-input-container,
    .form-group .gender-options,
    .form-group .tarot-spread-options {
        flex: 1;
    }
    
    .form-group .bazi-input {
        width: 100%;
    }
    
    .bazi-input {
        padding: 10px 35px 10px 10px;
        font-size: 14px;
    }
    
    .gender-options {
        gap: 8px;
    }
    
    .gender-text {
        font-size: 13px;
    }
    
    .spread-text {
        font-size: 12px;
    }
    
    .tarot-input,
    .jiemeng-input,
    .bugua-input {
        font-size: 14px;
        padding: 10px;
        min-height: 70px;
    }
}

/* 移动端暗色主题选项卡样式 */
@media (max-width: 768px) {
    body.dark-theme .tab-nav {
        gap: 8px;
        padding: 8px;
    }
    
    body.dark-theme .tab-btn {
        background: #25252B;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    body.dark-theme .tab-btn:hover {
        background: #3A3A40;
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
    }
    
    body.dark-theme .tab-btn.active {
        color: #d4af37;
        border-bottom-color: #d4af37;
        background: #25252B;
        box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
        font-weight: 600;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .almanac-header {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .almanac-title {
        font-size: 1.2rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .almanac-date {
        font-size: 0.9rem;
        white-space: nowrap;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .almanac-toggle-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 确保标题栏元素不会换行 */
    .almanac-header > * {
        flex-shrink: 0;
    }
    
    .almanac-date {
        flex-shrink: 1;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .tab-btn {
        flex: 0 0 calc(25% - 6px);
        font-size: 15px;
        padding: 12px 6px;
        line-height: 1.4;
    }
    
    .tab-content {
        padding: 10px;
    }
    
    /* 移动端提交按钮底部间距 */
    .form-actions {
        margin-bottom: 15px;
    }
}

.form-group {
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 0;
        min-width: 60px;
        flex-shrink: 0;
    }
    
    .form-group .date-input-container,
    .form-group .gender-options,
    .form-group .tarot-spread-options {
        flex: 1;
    }
    
    .form-group .bazi-input {
        width: 100%;
    }
    
    .bazi-input {
        padding: 10px 35px 10px 10px;
        font-size: 14px;
    }
    
    .gender-options {
        gap: 8px;
    }
    
    .gender-text {
        font-size: 13px;
    }
    
    .spread-text {
        font-size: 12px;
    }
    
    .tarot-input,
    .jiemeng-input,
    .bugua-input {
        font-size: 14px;
        padding: 10px;
        min-height: 70px;
    }
    
    .form-description {
        font-size: 15px;
    }
    
    .form-btn {
        padding: 10px 25px;
        font-size: 15px;
    }
}

/* 超小屏幕暗色主题选项卡样式 */
@media (max-width: 480px) {
    body.dark-theme .tab-btn {
        background: #25252B;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    body.dark-theme .tab-btn:hover {
        background: #3A3A40;
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
    }
    
    body.dark-theme .tab-btn.active {
        color: #d4af37;
        border-bottom-color: #d4af37;
        background: #25252B;
        box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
        font-weight: 600;
    }
}

/* 移除系统暗色主题支持，完全依赖手动主题切换 */

/* 暗色主题 */
body.dark-theme {
    background: #0F0E15;
    color: #E8E8E8;
}

body.dark-theme .chat-header {
    background: #1A1A1F;
    border-bottom: 1px solid #25252B;
    color: #FFFFFF;
}

body.dark-theme .chat-title {
    color: #FFFFFF;
}

body.dark-theme .menu-toggle-btn,
body.dark-theme .theme-toggle-btn,
body.dark-theme .ai-chat-btn {
    color: #FFFFFF;
}

body.dark-theme .menu-toggle-btn:hover,
body.dark-theme .theme-toggle-btn:hover,
body.dark-theme .ai-chat-btn:hover {
    background-color: rgba(74, 144, 226, 0.2);
}

body.dark-theme .menu-content {
    background: #1A1A1F;
    color: #E8E8E8;
}

body.dark-theme .menu-header {
    background: #25252B;
    border-bottom: 1px solid #25252B;
}

body.dark-theme .menu-title {
    color: #E8E8E8;
}

body.dark-theme .menu-close-btn {
    color: #E8E8E8;
}

body.dark-theme .menu-close-btn:hover {
    background-color: rgba(74, 144, 226, 0.2);
}

body.dark-theme .menu-text {
    color: #E8E8E8;
}

body.dark-theme .feature-card {
    background: #25252B;
    color: #E8E8E8;
}

body.dark-theme .feature-card h3 {
    color: #E8E8E8;
}

body.dark-theme .feature-card p {
    color: #B8B8B8;
}

body.dark-theme .feature-card:hover {
    background: #3A3A40;
}

/* 自定义确认弹框样式 */
.custom-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.custom-confirm-modal.show {
    display: flex;
}

.custom-confirm-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 320px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.custom-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.custom-confirm-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.custom-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.custom-confirm-cancel {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e0e0e0;
}

.custom-confirm-cancel:hover {
    background: #e9ecef;
}

.custom-confirm-ok {
    background: #ab968c;
    color: white;
}

.custom-confirm-ok:hover {
    background: #9a847a;
    transform: translateY(-1px);
}

/* 暗色主题自定义确认弹框 */
body.dark-theme .custom-confirm-content {
    background: #1A1823;
    color: #E2E0F3;
}

body.dark-theme .custom-confirm-title {
    color: #FFFFFF;
}

body.dark-theme .custom-confirm-message {
    color: #A09CC9;
}

/* 暗色主题性别选项样式 */
body.dark-theme .gender-option input[type="radio"]:checked + .gender-label {
    border-color: #D4AF37;
    background: #0a0a0a;
    color: #D4AF37;
}

/* 暗色主题塔罗选项样式 */
body.dark-theme .spread-option input[type="radio"]:checked + .spread-label {
    border-color: #D4AF37;
    background: #0a0a0a;
    color: #D4AF37;
}