* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --desktop-max-width: 1200px;
    --mobile-breakpoint: 768px;
    --z-header: 1000;
    --z-modal: 4000;
    --header-height: 50px;
    --footer-height: 60px;
    --message-padding: 15px;
    --highlight-color: rgba(37, 125, 111, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 电脑端最大宽度限制 */
@media (min-width: 769px) {
    body {
        max-width: var(--desktop-max-width);
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        position: relative;
    }
    

    
    .chat-header {
        position: absolute;
        left: 0;
        right: 0;
        max-width: var(--desktop-max-width);
        margin: 0 auto;
    }
    
    .chat-footer {
        position: absolute;
        left: 0;
        right: 0;
        max-width: var(--desktop-max-width);
        margin: 0 auto;
    }
}

.chat-header {
    background: white;
    color: #333;
    padding: 0 var(--message-padding);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn, .settings-btn, .theme-toggle-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.back-btn:hover, .settings-btn:hover, .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

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

.chat-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.chat-container {
    flex: 1;
    margin-top: var(--header-height);
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--footer-height);
}

.chat-messages {
    flex: 1;
    padding: 20px var(--message-padding) var(--footer-height) var(--message-padding);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    max-width: 100%;
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 10px;
}

.avatar-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
}

.message.ai .avatar-icon {
    width: 36px;
    height: 36px;
}

.message.user .avatar-icon {
    filter: none;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    font-size: 16px;
}

.message.ai .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 6px;
    white-space: pre-wrap;
    /* 确保第一个文本节点紧贴顶部 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    max-width: 90%;
    min-width: min-content;
    word-break: break-word;
}

/* 系统消息高亮效果 - 黄色光影动画 */
.message.highlighted .message-bubble {
    position: relative;
    overflow: hidden;
}

.message.highlighted .message-bubble::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        var(--highlight-color) 50%,
        transparent 70%
    );
    animation: shine 3s ease-in-out forwards;
    z-index: 0;
}

/* 八字起名消息的高亮效果（增加特异性） */
.message.system.qiming-paipan.highlighted .message-bubble::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        var(--highlight-color) 50%,
        transparent 70%
    );
    animation: shine 3s ease-in-out forwards;
    z-index: 0;
    display: block !important;
}

/* 为其他通用卡片添加光影动画 */
.card.highlighted, .result-card.highlighted {
    position: relative;
    overflow: hidden;
}

.card.highlighted::before, .result-card.highlighted::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        var(--highlight-color) 50%,
        transparent 70%
    );
    animation: shine 3s ease-in-out forwards;
    z-index: 0;
}

@keyframes shine {
    to { transform: translateX(50%) translateY(50%) rotate(45deg); }
}

/* AI分析按钮样式 */
.ai-analysis-container {
    margin-top: 8px;
    width: 100%;
    align-self: flex-start;
}

.ai-analysis-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-analysis-title .title-text {
    flex: 1;
}

.ai-analysis-title .jump-icon {
    cursor: pointer;
    font-size: 16px;
    color: #999;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    user-select: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ai-analysis-title .jump-icon:hover {
    background-color: #f0f0f0;
    color: #666;
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.2);
}

.ai-analysis-title .jump-icon:active {
    transform: translateY(0);
}

/* 暗色主题下的跳转图标样式 */
.dark-theme .ai-analysis-title .jump-icon {
    color: #A09CC9;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #3A3552;
}

.dark-theme .ai-analysis-title .jump-icon:hover {
    background-color: #262336;
    color: #E2E0F3;
    border-color: #7C5AED;
}

.ai-analysis-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-analysis-buttons button {
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.ai-analysis-buttons button:hover {
    background: #e0e0e0;
}

.message.ai .message-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}
.message.ai.welcome-message .message-bubble {
    white-space: normal !important;
    max-width: 90% !important;
}

.message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: calc(100% - 50px);
    flex: 1;
}

.ai-analysis-message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: calc(100% - 50px) !important;
    flex: 1;
}

.message.user .message-content {
    align-items: flex-end;
}

.message.user .message-bubble {
    background: #07c160;
    color: white;
    border-bottom-right-radius: 6px;
    max-width: 70%;
    min-width: min-content;
    word-break: break-word;
    white-space: normal;
    position: relative;
}

.message.user .message-bubble::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #07c160;
}

.message-time {
    font-size: 11px;
    color: #666;
    margin-top: 1px;
    opacity: 0.8;
    text-align: center;
    display: block;
    width: 100%;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

body:not(.dark-theme) .message.user .message-time {
    color: rgba(0, 0, 0, 0.8);
}

/* 消息删除按钮样式 */
.message-bubble {
    position: relative;
}

.message-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.message-delete-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    transform: scale(1.1);
}

.message-bubble:hover .message-delete-btn {
    opacity: 1;
}

.message.user .message-delete-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #dc3545;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.message.user .message-delete-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* 暗色主题删除按钮样式 */
body.dark-theme .message-delete-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #dc3545;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-theme .message-delete-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* 自定义确认弹框样式 */
.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: #dc3545;
    color: white;
}

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

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

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

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

body.dark-theme .custom-confirm-cancel {
    background: #474555;
    color: #e0e0e0;
    border-color: #5a5768;
}

body.dark-theme .custom-confirm-cancel:hover {
    background: #5a5768;
}

body.dark-theme .custom-confirm-ok {
    background: #dc3545;
}

body.dark-theme .custom-confirm-ok:hover {
    background: #c82333;
}

/* 暗色主题 */
body.dark-theme {
    background: #0F0E15;
    color: #E8E8E8;
    --highlight-color: rgba(245, 166, 35, 0.25);
}

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

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

body.dark-theme .back-btn,
body.dark-theme .settings-btn,
body.dark-theme .theme-toggle-btn {
    color: #FFFFFF;
}

body.dark-theme .chat-container {
    background: #0F0E15;
}

body.dark-theme .message.ai .message-bubble {
    background: #25252B;
    color: #E8E8E8;
    border: 1px solid #3A3A40;
    max-width: 90%;
}

body.dark-theme .message.ai .message-bubble::before {
    border-right-color: #25252B;
    filter: drop-shadow(-1px 0 0 #3A3A40);
    left: -7px;
}

body.dark-theme .message.user .message-bubble {
    background: #443828;
    color: #FFFFFF;
}



body.dark-theme .message.user .message-bubble::after {
    border-left-color: #443828;
}

body.dark-theme .chat-footer {
    background: #1A1A1F;
    border-top: 1px solid #25252B;
}

body.dark-theme .input-group {
    background: #25252B;
}

body.dark-theme #messageInput {
    background: transparent;
    color: #E8E8E8;
}

body.dark-theme #messageInput::placeholder {
    color: #B8B8B8;
}

body.dark-theme .message-time {
    color: #B8B8B8;
}

body.dark-theme .back-btn:hover,
body.dark-theme .settings-btn:hover,
body.dark-theme .theme-toggle-btn:hover {
    background: rgba(74, 144, 226, 0.2);
}



/* AI消息思考指示器 */
.message.ai.thinking .message-bubble {
    position: relative;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
    font-size: 16px;
    height: 100%;
    line-height: 1;
    padding: 8px 0;
}

.thinking-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    animation: thinking 1.4s infinite ease-in-out;
}

/* 文字垂直居中 */
.thinking-indicator span {
    vertical-align: middle;
}

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

.thinking-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    animation: thinking 1.4s infinite ease-in-out;
}

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

@keyframes thinking {
    0%, 80%, 100% { 
        transform: scale(0.8); 
        opacity: 0.5; 
    }
    40% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

/* 暗色主题下的思考指示器 */
body.dark-theme .message.ai.thinking .message-bubble {
    background: #25252B;
}

body.dark-theme .thinking-indicator {
    color: #B8B8B8;
}

body.dark-theme .thinking-dot {
    background: #B8B8B8;
}

.chat-footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 10px 15px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 1000;
    min-height: 60px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.plus-btn, #sendBtn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #07c160;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.plus-btn {
    background: #666;
    font-size: 24px; /* 增大图标 */
    padding: 0; /* 减小内边距 */
    line-height: 1; /* 确保垂直居中 */
}

#sendBtn {
    font-size: 20px; /* 调整发送按钮图标大小 */
    padding: 0; /* 与+按钮保持一致 */
    line-height: 1; /* 确保垂直居中 */
}

.plus-btn:hover {
    background: #555;
}

body.dark-theme .plus-btn {
    background: #b89152;
}

body.dark-theme .plus-btn:hover {
    background: #c9a666;
}

#sendBtn:hover {
    background: #06a050;
}

#sendBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.input-group {
    flex: 1;
    background: #e0e0e0;
    border-radius: 20px;
    padding: 3px 15px;
    min-height: 36px;
    display: flex;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 8px 0;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    resize: none;
    min-height: 18px;
    max-height: 100px;
    line-height: 1.4;
    font-family: inherit;
    overflow: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    align-self: center;
}

#messageInput::placeholder {
    color: #999;
}

@media (max-width: 768px) {
    /* 移动端视口完美处理方案 */
    body {
        height: 100vh;
        height: 100dvh; /* 使用动态视口高度 */
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .chat-header {
        padding: 0 10px;
        height: 50px;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        flex-shrink: 0;
        background: inherit;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }
    
    .back-btn, .settings-btn, .theme-toggle-btn {
        font-size: 14px;
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .chat-container {
        flex: 1;
        overflow-y: auto;
        margin: 0;
        padding: 0;
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
        overscroll-behavior: contain; /* 防止滚动传播 */
    }
    
    .chat-messages {
        padding: 15px 10px 15px 10px;
        min-height: calc(100dvh - 130px); /* 动态计算高度 */
    }
    
    .chat-footer {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        flex-shrink: 0;
        background: inherit;
        padding: 8px 10px;
        min-height: 62px;
        align-items: center;
    }
    
    /* 键盘弹出时的特殊处理 */
    body.keyboard-open {
        height: 100vh;
    }
    
    body.keyboard-open .chat-messages {
        min-height: auto;
        padding-bottom: 20px;
    }
    
    /* 防止iOS Safari的弹性滚动问题 */
    @supports (-webkit-touch-callout: none) {
        body {
            height: -webkit-fill-available;
        }
        
        .chat-container {
            height: -webkit-fill-available;
        }
    }
    
    .message-bubble {
        max-width: 80%;
        padding: 10px 14px;
        font-size: 16px;
    }
    
    .message.user .message-bubble {
        max-width: 80%;
    }
    
    .message.ai .message-bubble:not(.history-message),
    .message.ai.welcome-message .message-bubble {
        max-width: 90% !important;
    }
    
    /* 历史记录消息保持正常宽度 */
    .message.ai .message-bubble.history-message {
        max-width: 80% !important;
    }
    

    
    .avatar {
        width: 35px;
        height: 35px;
    }
    
    .avatar-icon {
        width: 35px;
        height: 35px;
    }
    
    .message.ai .avatar-icon {
        width: 32px;
        height: 32px;
    }
    
    .input-group {
        padding: 3px 10px;
        border-radius: 5px;
        min-height: 40px;
        display: flex;
        align-items: center;
    }
    
    .plus-btn, #sendBtn {
        width: 32px;
        height: 32px;
        font-size: 16px;
        margin: 0;
        align-self: center;
    }
    
    .plus-btn {
        font-size: 20px; /* 移动端增大图标 */
        padding: 0; /* 减小内边距 */
        line-height: 1; /* 确保垂直居中 */
    }
    
    #sendBtn {
        font-size: 18px; /* 移动端发送按钮图标大小 */
        padding: 0; /* 与+按钮保持一致 */
        line-height: 1; /* 确保垂直居中 */
    }
    
    #messageInput {
        font-size: 16px;
        padding: 6px 0;
        min-height: 18px;
        max-height: 60px;
        line-height: 1.4;
        overflow: hidden;
        overflow-wrap: break-word;
        word-wrap: break-word;
        white-space: pre-wrap;
        align-self: center;
        /* 移除height: auto !important 让JavaScript控制高度 */
    }
    
    .message-time {
        font-size: 9px;
    }
    

}

@media (max-width: 480px) {
    .chat-header {
        height: 45px;
        padding: 0 8px;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        flex-shrink: 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    
    .back-btn, .settings-btn, .theme-toggle-btn {
        font-size: 14px;
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .chat-container {
        flex: 1;
        overflow-y: auto;
        margin: 0;
        padding: 0;
    }
    
    .message-bubble {
        max-width: 75%;
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .message.ai .message-bubble,
    .message.ai.welcome-message .message-bubble {
        max-width: 90% !important;
    }
    

    
    .chat-footer {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        flex-shrink: 0;
    }
    
    .avatar {
        width: 30px;
        height: 30px;
    }
    
    .avatar-icon {
        width: 30px;
        height: 30px;
    }
    
    .message.ai .avatar-icon {
        width: 28px;
        height: 28px;
    }
    
    .chat-footer {
        padding: 6px 8px;
        min-height: 62px;
        align-items: center;
    }
    
    .input-group {
        padding: 2px 10px;
        display: flex;
        align-items: center;
        min-height: 36px !important;
        /* 移除height: auto !important 让JavaScript控制高度 */
    }
    
    #messageInput {
        font-size: 16px;
        align-self: center;
    }
    
    .plus-btn, #sendBtn {
        width: 32px;
        height: 32px;
        font-size: 12px;
        margin: 0;
        align-self: center;
    }
    
    .plus-btn {
        font-size: 18px; /* 小屏幕移动端增大图标 */
        padding: 0; /* 减小内边距 */
        line-height: 1; /* 确保垂直居中 */
    }
    
    #sendBtn {
        font-size: 16px; /* 小屏幕移动端发送按钮图标大小 */
        padding: 0; /* 与+按钮保持一致 */
        line-height: 1; /* 确保垂直居中 */
    }
    
    /* 键盘弹出时的特殊处理 - 确保思考指示器不被遮挡 */
    body.keyboard-open .chat-messages {
        min-height: auto;
        padding-bottom: 20px;
    }
}

/* 底部弹出窗口样式 */
.bottom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.bottom-modal.show {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    border-radius: 5px 5px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    z-index: 2001;
    animation: slideUp 0.3s ease;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 15px 20px 20px;
}

/* 快捷选项容器 */
.quick-options-container {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    padding-top: 10px;
}

.options-page {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: calc(100% - 10px);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.options-page.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.options-page.prev {
    transform: translateX(-100%);
}

.options-page.next {
    transform: translateX(100%);
}

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

.option-btn {
    background: #f8f9fa;
    border: none;
    border-radius: 12px;
    padding: 12px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.option-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.option-icon {
    font-size: 20px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
}

.option-svg-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
}

.option-text {
    font-size: 12px;
    font-weight: 500;
    color: #495057;
}

/* 分页指示器 */
.pagination-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* 系统消息样式 - 居中显示 */
/* 通用系统消息样式 */
.message.system {
    justify-content: center;
    align-items: stretch;
    margin: 15px 0;
    width:100%;
}

/* 基础系统消息气泡样式 - 顶部卷边效果 */
.message.system .message-bubble {
    background: #393644;
    color: #ffffff;
    border-radius: 8px 5px 8px 8px;
    padding: 12px 20px;
    max-width: 600px;
    width: 85% !important;
    text-align: left;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
    border-bottom: none;
    overflow: hidden;
    box-shadow: none;
    transform: none;
    transition: none;
    margin: 15px auto;
}

/* 顶部卷边效果 - 简洁样式 */
.message.system .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 8px 8px 0 0;
    box-shadow: none;
    transform: translateY(0);
}

/* 移除内阴影，保持简洁 */
.message.system .message-bubble {
    box-shadow: none;
}

/* 浅色主题下的系统消息气泡样式 - 顶部卷边效果 */
body:not(.dark-theme) .message.system .message-bubble {
    background: white;
    color: #212529;
    border-radius: 8px 5px 8px 8px;
    padding: 12px 20px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-bottom: none;
    transform: none;
    transition: none;
    box-shadow: none;
    margin: 15px auto;
    width: 85% !important;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
}

/* 浅色主题下的顶部卷边效果 - 简洁样式 */
body:not(.dark-theme) .message.system .message-bubble::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.02) 100%);
    box-shadow: none;
}

/* 确保按钮区域可点击 */
.message.system .message-bubble .action-buttons {
    position: relative;
}


/* 系统消息时间样式 */
.message.system .message-time {
    color: #6c757d;
    font-size: 12px;
    margin-top: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-align: center;
    display: block;
    width: 100%;
}

/* 系统消息类型样式 - 八字排盘 - 顶部卷边效果 */
.message.system.bazi-paipan .message-bubble {
    background: #393644;
    color: #ffffff;
    border-radius: 8px 5px 8px 8px;
    max-width: 600px !important;
    padding: 12px 20px;
    font-size: 14px;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
    border-bottom: none;
    overflow: hidden;
    box-shadow: none;
    transform: none;
    transition: none;
}

/* 八字排盘顶部卷边效果 - 简洁样式 */
.message.system.bazi-paipan .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 8px 8px 0 0;
    box-shadow: none;
}

/* 八字排盘内部元素尺寸调整 */
.message.system.bazi-paipan .tian-gan-display,
.message.system.bazi-paipan .di-zhi-display {
    font-size: 14px;
    font-weight: bold;
    color: #000000 !important;
}

.message.system.bazi-paipan .pillar .label {
    font-size: 11px;
}



.message.system.bazi-paipan .message-bubble:hover {
    transform: none;
    box-shadow: none;
}



/* 浅色主题下的系统消息类型样式 - 统一基础样式 */
body:not(.dark-theme) .message.system.bazi-paipan .message-bubble,
body:not(.dark-theme) .message.system.qiming-paipan .message-bubble,
body:not(.dark-theme) .message.system.hehun-analysis .message-bubble,
body:not(.dark-theme) .message.system.taluo-choupai .message-bubble,
body:not(.dark-theme) .message.system.xiuyao-paipan .message-bubble,
body:not(.dark-theme) .message.system.mianxiang-paipan .message-bubble {
    background: white;
    color: #2d3748;
    border-radius: 8px 5px 8px 8px;
    max-width: 600px !important;
    padding: 12px 20px;
    font-size: 14px;
    position: relative;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-bottom: none;
    box-shadow: none;
    margin: 15px auto;
    width: 85% !important;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
}

/* 统一悬停效果 */
body:not(.dark-theme) .message.system.bazi-paipan .message-bubble:hover,
body:not(.dark-theme) .message.system.qiming-paipan .message-bubble:hover,
body:not(.dark-theme) .message.system.hehun-analysis .message-bubble:hover,
body:not(.dark-theme) .message.system.taluo-choupai .message-bubble:hover,
body:not(.dark-theme) .message.system.xiuyao-paipan .message-bubble:hover,
body:not(.dark-theme) .message.system.mianxiang-paipan .message-bubble:hover {
    transform: none;
    box-shadow: none;
}

/* 统一顶部卷边效果 */
body:not(.dark-theme) .message.system.bazi-paipan .message-bubble::before,
body:not(.dark-theme) .message.system.qiming-paipan .message-bubble::before,
body:not(.dark-theme) .message.system.hehun-analysis .message-bubble::before,
body:not(.dark-theme) .message.system.taluo-choupai .message-bubble::before,
body:not(.dark-theme) .message.system.xiuyao-paipan .message-bubble::before,
body:not(.dark-theme) .message.system.mianxiang-paipan .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.02) 100%);
    border-radius: 8px 0 0 0;
    box-shadow: none;
    transform: translateY(0);
}







/* 统一所有结果卡片样式 */
.result-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 塔罗牌卡片网格样式 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}





/* 塔罗牌卡片项样式 */
.tarot-result .card-item {
    text-align: center;
    background: #7e7c88;
    border-radius: 12px;
    padding: 15px 10px;
    color: white;
    box-shadow: none;
    border: none;
    font-family: 'SimSun', '宋体', serif;
    position: relative;
}

.tarot-result .card-item:hover {
    transform: none;
    box-shadow: none;
}

.tarot-result .card-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: 600;
}

.tarot-result .card-content {
    display: block;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
}



/* 通用卡片头部样式 */
.result-header {
    text-align: left;
    margin-bottom: 12px;
    border-bottom: 1px solid #a0a0a0;
    padding: 10px 20px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-header h3 {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

/* 关闭按钮样式 */
.close-result {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-result:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* 暗色主题下的结果卡片样式 */
body.dark-theme .result-header {
    border-bottom: 1px solid #404040;
}

body.dark-theme .result-header h3 {
    color: #ffffff;
}

body.dark-theme .close-result {
    color: #b8b8b8;
}

body.dark-theme .close-result:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* 统一卡片区域样式 */
.user-info-section {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.user-info {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.info-item {
    font-size: 13px;
    color: #495057;
    background: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
    border: 1px solid #ced4da;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.content-section {
    margin-bottom: 15px;
}

.analysis-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

/* 暗色主题下的卡片区域样式 */
body.dark-theme .user-info-section {
    background: linear-gradient(135deg, #3a3a3a 0%, #2d2d2d 100%);
    border: 1px solid #404040;
}

body.dark-theme .info-item {
    color: #e0e0e0;
    background: #303030;
    border: 1px solid #404040;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-theme .analysis-section {
    border-top: 1px solid #404040;
}

/* 塔罗牌结果中的问题项样式 - 允许换行 */
.tarot-result .info-item {
    white-space: normal;
    word-break: break-word;
    max-width: 300px;
    text-align: center;
}

/* 四柱布局样式 */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

/* 通用卡片项样式 */
.card-item1 {
    text-align: center;
    background: #666666;
    border-radius: 12px;
    padding: 22px 16px;
    color: white;
    box-shadow: none;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
}

.card-item::before {
    display: none;
}

.card-item:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.card-label {
    display: block;
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-content {
    display: block;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.3;
}

/* 八字排盘特定样式 */
.pillar {
    text-align: center;
    background: #7e887c;
    border-radius: 5px;
    padding: 4px 20px;
    color: #ffffff;
    box-shadow: none;
    border: none;
    font-family: 'SimSun', '宋体', serif;
    position: relative;
}

/* 浅色主题下八字排盘结果卡片文字颜色优化 */
body:not(.dark-theme) .bazi-result .pillar {
    color: #000000;
}

body:not(.dark-theme) .bazi-result .pillar .card-content {
    color: #000000;
    font-weight: bold;
}

.pillar::before {
    display: none;
}

.pillar-label {
    display: block;
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 600;
}

.pillar-content {
    display: block;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.3;
}

/* 通用按钮组样式 */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    grid-auto-flow: row;
}

/* 通用操作按钮样式 */
.action-btn {
    background: #b5bbb4;
    border: none;
    border-radius: 8px;
    color: #000000;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'SimSun', '宋体', serif;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #596657;
    color: #ffffff;
    transform: translateY(-1px);
}

.action-btn:active {
    background: #4a5348;
    transform: translateY(0);
}

/* 合婚分析结果样式 */
.hehun-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.hehun-pillar {
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #dee2e6;
}

.male-pillar-row {
    margin-bottom: 8px;
}

.female-pillar-row {
    margin-top: 8px;
}

.male-pillar {
    font-size: 16px;
    font-weight: bold;
    color: #1976d2;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.female-pillar {
    font-size: 16px;
    font-weight: bold;
    color: #c2185b;
    background: #fce4ec;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* 暗色主题下的合婚分析样式 */
body.dark-theme .hehun-pillar {
    background: #262336;
    border-color: #3A3552;
}

body.dark-theme .male-pillar {
    color: #5D6AFB;
    background: #7C5AED;
}

body.dark-theme .female-pillar {
    color: #D4AF37;
    background: #C44569;
}



/* 塔罗占卜按钮样式 */
.tarot-btn {
    background: linear-gradient(135deg, #7C5AED 0%, #5D6AFB 100%);
    border-color: #6A4FC9;
    color: white;
}

/* 占星术按钮样式 */
.astrology-btn {
    background: linear-gradient(135deg, #5D6AFB 0%, #7C5AED 100%);
    border-color: #6A4FC9;
    color: white;
}

/* 紫微斗数按钮样式 */
.ziwei-btn {
    background: linear-gradient(135deg, #C44569 0%, #D4AF37 100%);
    border-color: #C44569;
    color: white;
}

/* 暗色主题下的系统消息和八字结果样式 */
/* 暗色主题下的系统消息样式 - 保留顶部卷边效果 */
body.dark-theme .message.system .message-bubble {
    background: #25252B;
    color: #E8E8E8;
    border-radius: 8px 5px 8px 8px;
    padding: 12px 20px;
    border-left: 1px solid #3A3A40;
    border-right: 1px solid #3A3A40;
    border-top: none;
    border-bottom: none;
    transform: none;
    transition: none;
    box-shadow: none;
    margin: 15px auto;
    width: 90% !important;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
}

/* 暗色主题下的顶部卷边效果 */
body.dark-theme .message.system .message-bubble::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.15) 100%);
    box-shadow: none;
    border-radius: 8px 0 0 0;
}

body.dark-theme .message.system .message-time {
    color: #F5A623;
}

/* 暗色主题下的系统消息类型样式 - 统一基础样式 */
body.dark-theme .message.system.bazi-paipan .message-bubble,
body.dark-theme .message.system.qiming-paipan .message-bubble,
body.dark-theme .message.system.hehun-analysis .message-bubble,
body.dark-theme .message.system.taluo-choupai .message-bubble,
body.dark-theme .message.system.xiuyao-paipan .message-bubble,
body.dark-theme .message.system.mianxiang-paipan .message-bubble {
    background: #25252B;
    color: #E8E8E8;
    border-radius: 8px 5px 8px 8px;
    max-width: 600px !important;
    padding: 12px 20px;
    font-size: 14px;
    position: relative;
    border-left: 1px solid #3A3A40;
    border-right: 1px solid #3A3A40;
    border-top: none;
    border-bottom: none;
    box-shadow: none;
    margin: 15px auto;
    width: 85% !important;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
}

/* 统一悬停效果 */
body.dark-theme .message.system.bazi-paipan .message-bubble:hover,
body.dark-theme .message.system.qiming-paipan .message-bubble:hover,
body.dark-theme .message.system.hehun-analysis .message-bubble:hover,
body.dark-theme .message.system.taluo-choupai .message-bubble:hover,
body.dark-theme .message.system.xiuyao-paipan .message-bubble:hover,
body.dark-theme .message.system.mianxiang-paipan .message-bubble:hover {
    transition: none;
    transform: none;
    box-shadow: none;
}

/* 统一顶部卷边效果 */
body.dark-theme .message.system.bazi-paipan .message-bubble::before,
body.dark-theme .message.system.qiming-paipan .message-bubble::before,
body.dark-theme .message.system.hehun-analysis .message-bubble::before,
body.dark-theme .message.system.taluo-choupai .message-bubble::before,
body.dark-theme .message.system.xiuyao-paipan .message-bubble::before,
body.dark-theme .message.system.mianxiang-paipan .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.15) 100%);
    border-radius: 8px 0 0 0;
    box-shadow: none;
    transform: translateY(0);
}

/* 暗色主题下的八字排盘内部元素尺寸调整 */
body.dark-theme .message.system.bazi-paipan .tian-gan-display,
body.dark-theme .message.system.bazi-paipan .di-zhi-display {
    font-size: 14px;
    font-weight: bold;
    color: #E8E8E8 !important;
}

body.dark-theme .message.system.bazi-paipan .pillar .label {
    font-size: 11px;
    color: #B8B8B8 !important;
}



/* 系统消息类型样式 - 八字起名 */
.message.system.qiming-paipan {
    justify-content: center;
    align-items: stretch;
    margin: 15px 0;
    width: 100%;
}

/* 统一所有结果卡片样式 - 移除叠加效果 */
.message.system.qiming-paipan .qiming-result,
.message.system.qiming-paipan .result-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
    font-family: inherit;
}

body:not(.dark-theme) .message.system.qiming-paipan .qiming-result,
body:not(.dark-theme) .message.system.qiming-paipan .result-card {
    background: transparent;
}

body.dark-theme .message.system.qiming-paipan .qiming-result,




/* 暗色主题下的通用结果卡片样式 - 纸片化 */
body.dark-theme .result-card {
    background: #25252B;
    border: none;
    box-shadow: none;
    transform: none;
    transition: none;
}

body.dark-theme .bazi-result,
body.dark-theme .xiuyao-result,
body.dark-theme .qiming-result,
body.dark-theme .hehun-result,
body.dark-theme .tarot-result,
body.dark-theme .simple-result {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* 暗色主题下的塔罗牌卡片样式 */
body.dark-theme .tarot-result .card-item {
    background: #1A1A1F;
    border-color: #3A3A40;
    color: #E8E8E8;
}

body.dark-theme .tarot-result .card-item:hover {
    background: #25252B;
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.3);
}

body.dark-theme .tarot-result .card-label {
    color: #B8B8B8;
}

body.dark-theme .tarot-result .card-content {
    color: #FFFFFF;
}

/* 暗色主题下塔罗牌结果中的问题项样式 */
body.dark-theme .tarot-result .info-item {
    white-space: normal;
    word-break: break-word;
    max-width: 300px;
    text-align: center;
}





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

body.dark-theme .result-header h3 {
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    font-size: 1rem;
    font-weight: 600;
}

body.dark-theme .close-result {
    color: #b8b5c1;
}

body.dark-theme .close-result:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

/* 内联结果头部暗色主题样式 */
body.dark-theme .result-header-inline {
    border-bottom-color: #3A3A40;
}

body.dark-theme .result-title-inline {
    color: #ffffff;
}

body.dark-theme .close-result-inline {
    color: #b8b8b8;
}

body.dark-theme .close-result-inline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* 全宽结果头部暗色主题样式 */
body.dark-theme .result-header-fullwidth {
    border-bottom-color: #3A3A40;
}

body.dark-theme .result-title-fullwidth {
    color: #ffffff;
}

body.dark-theme .close-result-fullwidth {
    color: #b8b8b8;
}

body.dark-theme .close-result-fullwidth:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.dark-theme .user-info-section {
    background: linear-gradient(135deg, #1A1A1F 0%, #25252B 100%);
    border-color: #3A3A40;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 6px;
}

body.dark-theme .user-info {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.dark-theme .content-section {
    margin-bottom: 15px;
}

body.dark-theme .action-buttons {
    gap: 8px;
}

body.dark-theme .info-item {
    background: #25252B;
    color: #F5A623;
    border-color: #3A3A40;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(245, 166, 35, 0.2);
}

body.dark-theme .analysis-section {
    border-top-color: #3A3A40;
    margin-top: 12px;
    padding-top: 12px;
}

body.dark-theme .card-item {
    background: linear-gradient(135deg, #1A1A1F 0%, #25252B 100%);
    border-color: #3A3A40;
    color: #F5A623;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.2);
}

body.dark-theme .action-btn {
    background: #443828;
    color: #FFFFFF;
    padding: 8px 12px;
    font-size: 13px;
}

body.dark-theme .action-btn:hover {
    background: #5BA0F2;
    transform: translateY(-1px);
}

body.dark-theme .tarot-btn {
    background: linear-gradient(135deg, #1A1A1F 0%, #25252B 100%);
    border-color: #3A3A40;
    color: #443828;
}

body.dark-theme .astrology-btn {
    background: linear-gradient(135deg, #1A1823 0%, #262336 100%);
    border-color: #3A3552;
    color: #5D6AFB;
}

body.dark-theme .ziwei-btn {
    background: linear-gradient(135deg, #1A1A1F 0%, #25252B 100%);
    border-color: #3A3A40;
    color: #F5A623;
}

body.dark-theme .bazi-header h3 {
    color: #FFFFFF;
}



body.dark-theme .pillar {
    background: #25252B;
    color: #FFFFFF;
    border: 2px solid #3A3A40;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-theme .pillar::before {
    background: linear-gradient(45deg, transparent 0%, rgba(245, 166, 35, 0.1) 50%, transparent 100%);
}

body.dark-theme .action-btn {
    background: #443828;
    color: #FFFFFF;
    padding: 8px 12px;
    font-size: 13px;
}

body.dark-theme .action-btn:hover {
    background: #5BA0F2;
    transform: translateY(-1px);
}

body.dark-theme .action-btn:active {
    background: #3A7BC8;
    transform: translateY(0);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .message.system .message-bubble {
        max-width: 100%;

      
    }
    
    /* 八字起名系统消息在移动端保持固定宽度 - 使用更高特异性的选择器 */
    .message.system.qiming-paipan .message-bubble,
    body .message.system.qiming-paipan .message-bubble,
    html body .message.system.qiming-paipan .message-bubble {
        max-width: 600px !important;
        width: 85% !important;
    }
    

    
    .bazi-pillars {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    .user-info {
        gap: 10px;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .info-item {
        font-size: 13px;
        padding: 3px 10px;
    }
    
    .pillar {
        padding: 4px 20px;
    }
    
    .pillar-content {
        font-size: 18px;
    }
    
    /* 星宿排盘分析按钮在移动端的适配 */
    .message.system.xiuyao-paipan .action-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .message.system.xiuyao-paipan .action-btn {
        font-size: 14px;
        padding: 8px 4px;
        min-height: 40px;
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .pillar-label {
    font-size: 12px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
}

@media (max-width: 480px) {
    .bazi-pillars {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .pillar {
        padding: 4px 14px;
    }
    
    .pillar-label {
    font-size: 12px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
    
    .pillar-content {
        font-size: 18px;
    }
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: #6c757d;
    transform: scale(1.2);
}

.dot:hover {
    background: #adb5bd;
}

/* 暗色主题样式 */
body.dark-theme .modal-content {
    background: #1A1A1F;
    color: #E8E8E8;
}

body.dark-theme .modal-header {
    border-bottom: 1px solid #3A3A40;
}

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

body.dark-theme .close-btn:hover {
    color: #FFFFFF;
}

/* 百科模态窗口样式 */
.baike-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.baike-modal .modal-content {
    max-height: 80vh;
    width: 100%;
    max-width: 768px;
    margin: 0;
    border-radius: 12px 12px 0 0;
    animation: slideUp 0.3s ease;
}

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

.baike-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.baike-modal .modal-body {
    padding: 0;
}

/* 暗色主题适配 */
body.dark-theme .baike-modal .modal-content {
    background: #25252B;
}

body.dark-theme .baike-modal .modal-header {
    background: #25252B;
    border-bottom: 1px solid #3A3A40;
}

body.dark-theme .baike-modal .modal-header h3 {
    color: #E8E8E8;
}

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

body.dark-theme .option-btn:hover {
    background: #3A3A40;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.4);
}

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

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

body.dark-theme .dot.active {
    background: #443828;
}

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

/* 字号大小控制样式 */
.font-size-control {
    margin-bottom: 25px;
    padding: 20px 0;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent) bottom no-repeat;
    background-size: 100% 1px;
}



.font-size-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.font-size-value {
    color: #07c160;
    font-weight: 600;
    font-size: 14px;
}

.font-size-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    margin-bottom: 25px;
    margin-top: 5px;
    -webkit-appearance: none;
}

.font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #07c160;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.font-size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #07c160;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.font-size-presets {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.font-size-preset {
    flex: 1;
    background: #f0f0f0;
    border: none;
    border-radius: 5px;
    padding: 8px 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.font-size-preset:hover {
    background: #e0e0e0;
}

.font-size-preset.active {
    background: #07c160;
    color: white;
}

.option-btn.active {
    background: #e1e5e9;
    color: #333;
}

.option-btn.active .option-icon {
    filter: brightness(0.7);
}

body.dark-theme .option-btn.active {
    background: #1e1e22;
    color: #d4af37;
}

body.dark-theme .option-btn.active .option-icon {
    filter: brightness(1.5);
}

/* 百科知识控制样式 */
.baike-control {
    margin-bottom: 25px;
    padding: 0;
    border-bottom: 1px solid #e0e0e0;
}

.baike-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    gap: 1px;
    width: 100%;
}

.baike-tab {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    padding: 14px 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.baike-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.baike-tab.active {
    background: #e8f5e8;
    color: #2e7d32;
    border-bottom-color: #4caf50;
    font-weight: 600;
}

body.dark-theme .baike-tab.active {
    color: #FFFFFF;
    border-bottom-color: #7C5AED;
    background: #262336;
}

.baike-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    gap: 15px;
    padding: 0 5px;
}

.baike-footer {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #e0e0e0;
}

.baike-refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: fit-content;
}

.baike-refresh-btn:hover {
    background: #06a050;
}

.baike-refresh-btn:active {
    transform: none;
}

.baike-refresh-btn.loading {
    background: #6c757d;
    cursor: not-allowed;
}

.baike-refresh-btn.loading:hover {
    background: #6c757d;
    transform: none;
}

.baike-refresh-btn.loading .refresh-icon {
    animation: spin 1s linear infinite;
    transform-origin: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.refresh-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.refresh-text {
    font-size: 14px;
    font-weight: 500;
}

.baike-content {
    padding: 15px 0;
}

.baike-tab-content {
    display: none;
}

.baike-tab-content.active {
    display: block;
}

.hot-questions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.question-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.question-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

/* 暗色主题样式 */
body.dark-theme .baike-control {
    border-bottom: 1px solid #4a4659;
}

body.dark-theme .baike-tabs {
    border-bottom: 1px solid #3A3A40;
    background: #25252B;
}

body.dark-theme .baike-tab {
    color: #B8B8B8;
    border-bottom: 2px solid transparent;
}

body.dark-theme .baike-tab:hover {
    background: #3A3A40;
    color: #E8E8E8;
}

body.dark-theme .baike-tab.active {
    color: #d4af37;
    border-bottom-color: #d4af37;
    background: #3A3A40;
}

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

body.dark-theme .baike-footer {
    border-top: 1px dashed #4a4659;
}

body.dark-theme .baike-refresh-btn {
    background: #2ea18e;
}

body.dark-theme .baike-refresh-btn:hover {
    background: #258f7c;
}

body.dark-theme .baike-refresh-btn.loading {
    background: #474555;
}

body.dark-theme .baike-refresh-btn.loading:hover {
    background: #474555;
    transform: none;
}

/* 暗色主题下的问题项样式 */
body.dark-theme .question-item {
    background: #1A1A1F;
    border: 1px solid #3A3A40;
}

body.dark-theme .question-item:hover {
    background: #5a5768;
    border-color: #6c697a;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

body.dark-theme .question-text {
    color: #d0d0d0;
}

body.dark-theme .font-size-control {
    background: linear-gradient(to right, transparent, #4a4659, transparent) bottom no-repeat;
    background-size: 100% 1px;
}

body.dark-theme .font-size-slider {
    background: #474555;
}

body.dark-theme .font-size-slider::-webkit-slider-thumb {
    background: #5a5768;
    border: 2px solid #3a3648;
}

body.dark-theme .font-size-slider::-moz-range-thumb {
    background: #5a5768;
    border: 2px solid #3a3648;
}

body.dark-theme .font-size-preset {
    background: #474555;
    color: #e0e0e0;
}

body.dark-theme .font-size-preset:hover {
    background: #5a5768;
}

body.dark-theme .font-size-preset.active {
    background: #2ea18e;
    color: white;
}





.dialog-close-btn:hover {
    background: #e9ecef;
    color: #333;
}


}

body.dark-theme .notification-text {
    color: #e0e0e0;
}

body.dark-theme .notification-buttons button {
    background: #07c160;
    color: white;
}

body.dark-theme .notification-buttons button:hover {
    background: #06a652;
}

/* 暗色主题适配 */
body.dark-theme .notification-icon {
    background: #2ea18e;
    border-color: #302d40;
    box-shadow: 0 2px 8px rgba(46, 161, 142, 0.3);
}

body.dark-theme .notification-icon:hover {
    background: #258f7c;
    box-shadow: 0 4px 12px rgba(46, 161, 142, 0.4);
}

body.dark-theme .dialog-content {
    background: #302d40;
    border-color: #4a4659;
}



body.dark-theme .notification-content {
    color: #e0e0e0;
}

body.dark-theme .notification-content .message-bubble {
    background: #474555;
    border-color: #5a5768;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .notification-icon {
        width: 28px;
        height: 28px;
        top: calc(50px - 16px); /* 移动端使用实际header高度50px，图标上移一点，一半覆盖标题栏边框，一半在下方 */
    }

    .notification-badge {
        font-size: 14px;
    }

    .notification-dialog {
        top: 40px; /* 移动端对话框顶部位置 */
    }

    .dialog-content {
        margin: 10px;
        max-height: 70vh;
    }



    .dialog-body {
        padding: 20px 20px;
        max-height: calc(100vh - 100px); /* 移动端动态高度 */
    }
}

@media (max-width: 480px) {
    .header-notification-icon {
        width: 26px;
        height: 26px;
        bottom: -13px;
    }
    
    .notification-badge {
        font-size: 13px;
    }
    
    .dialog-content {
        margin: 5px;
        max-height: 65vh;
    }
    

    
    .dialog-body {
        padding: 18px 16px;
        max-height: calc(100vh - 80px); /* 小屏幕动态高度 */
    }
}