/* === 全局样式 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
}

/* === 主容器布局 === */
.main-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* === 左侧面板 === */
.left-panel {
    width: 350px;
    background: linear-gradient(180deg, #2d1b69 0%, #1a1a2e 100%);
    border-right: 2px solid #9b59b6;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(155, 89, 182, 0.3);
}

/* === 头像区域 === */
.avatar-section {
    text-align: center;
    margin-bottom: 40px;
}

.avatar-placeholder {
    margin-bottom: 15px;
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #9b59b6;
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.5);
    transition: transform 0.3s ease;
}

.avatar-img:hover {
    transform: scale(1.05);
}

.avatar-text {
    font-size: 18px;
    font-weight: 600;
    color: #e8d5ff;
    margin-top: 10px;
}

/* === 信息区域 === */
.info-section h2 {
    color: #e8d5ff;
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
    background: linear-gradient(45deg, #9b59b6, #e8d5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-section p {
    color: #b19cd9;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 30px;
}

/* === 功能特色 === */
.features {
    margin-top: 20px;
}

.feature-item {
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid #9b59b6;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #e8d5ff;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(155, 89, 182, 0.3);
    transform: translateX(5px);
}

/* === 右侧聊天面板 === */
.right-panel {
    flex: 1;
    background: #000000;
    display: flex;
    flex-direction: column;
}

/* === 用户信息栏 === */
.user-info-bar {
    background: rgba(155, 89, 182, 0.1);
    border-bottom: 1px solid rgba(155, 89, 182, 0.3);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #e8d5ff;
}

.user-status {
    font-size: 12px;
    color: #b19cd9;
}

.user-actions {
    position: relative;
}

.user-menu-btn {
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.5);
    border-radius: 6px;
    color: #e8d5ff;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.user-menu-btn:hover {
    background: rgba(155, 89, 182, 0.3);
    border-color: #9b59b6;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(155, 89, 182, 0.5);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 120px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
    margin-top: 5px;
}

.menu-item {
    display: block;
    padding: 10px 16px;
    color: #e8d5ff;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

.menu-item:hover {
    background: rgba(155, 89, 182, 0.2);
    color: #ffffff;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0;
}

/* === 聊天消息区域 === */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(180deg, #000000 0%, #1a0d26 100%);
}

/* === 消息样式 === */
.message {
    margin-bottom: 15px;
    padding: 15px 20px;
    border-radius: 20px;
    max-width: 80%;
    line-height: 1.6;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease-out;
}

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

.user-message {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.gemini-message {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #ecf0f1;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    border: 1px solid #9b59b6;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.2);
}

.system-message {
    background: rgba(241, 196, 15, 0.2);
    color: #f39c12;
    align-self: center;
    border: 1px solid #f39c12;
    border-radius: 15px;
    font-size: 14px;
    max-width: 90%;
    text-align: center;
}

/* === 聊天输入区域 === */
.chat-input {
    background: linear-gradient(90deg, #1a1a2e, #2d1b69);
    border-top: 2px solid #9b59b6;
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(155, 89, 182, 0.3);
}

#chat-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

#message-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #9b59b6;
    border-radius: 25px;
    padding: 15px 20px;
    font-size: 16px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
}

#message-input:focus {
    border-color: #e8d5ff;
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.5);
}

#message-input::placeholder {
    color: #b19cd9;
}

/* === 按钮样式 === */
#chat-form button {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 80px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

#chat-form button:hover {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.6);
}

/* === 麦克风按钮 === */
.mic-button {
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
    min-width: 50px !important;
    width: 50px;
    height: 50px;
    border-radius: 50% !important;
    font-size: 18px;
}

.mic-button:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
}

.mic-button.recording {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    animation: pulse 1.5s infinite;
}

/* === 打字机效果 === */
.typing-cursor {
    color: #9b59b6;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* === 正在输入指示器 === */
.typing-indicator-message {
    opacity: 0.8;
    font-style: italic;
    background: rgba(155, 89, 182, 0.2) !important;
    border: 1px solid #9b59b6 !important;
}

.typing-dots {
    display: inline-block;
}

.typing-dots span {
    opacity: 0;
    animation: typing-dots 1.4s infinite;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dots {
    0%, 60%, 100% { opacity: 0; }
    30% { opacity: 1; }
}

/* === 加载动画 === */
.loading-indicator {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.loading-indicator span {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: linear-gradient(45deg, #9b59b6, #e8d5ff);
    margin: 0 5px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-indicator span:nth-child(1) { animation-delay: -0.32s; }
.loading-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

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

/* === 滚动条样式 === */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #9b59b6, #8e44ad);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8e44ad, #9b59b6);
}

/* === 响应式设计 === */
@media (max-width: 768px) {
    body {
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }
    
    .main-container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }
    
    .left-panel {
        width: 100%;
        height: auto;
        min-height: 200px;
        max-height: 250px;
        padding: 15px;
        flex-shrink: 0;
        overflow-y: auto;
    }
    
    .right-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    
    .chat-container {
        height: 100%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .chat-input {
        flex-shrink: 0;
        padding: 15px;
        background: linear-gradient(90deg, #1a1a2e, #2d1b69);
        border-top: 2px solid #9b59b6;
        box-shadow: 0 -5px 20px rgba(155, 89, 182, 0.3);
        position: sticky;
        bottom: 0;
        z-index: 1000;
    }
    
    #chat-form {
        display: flex;
        gap: 8px;
        align-items: center;
        width: 100%;
    }
    
    #message-input {
        flex: 1;
        min-width: 0;
        font-size: 16px;
        padding: 12px 15px;
        border-radius: 20px;
    }
    
    .mic-button {
        min-width: 44px !important;
        width: 44px;
        height: 44px;
        font-size: 16px;
        margin-left: 5px;
        margin-right: 5px;
    }
    
    #chat-form button[type="submit"] {
        min-width: 60px;
        height: 44px;
        padding: 0 15px;
        font-size: 14px;
    }
    
    .avatar-section {
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .avatar-placeholder {
        margin-bottom: 0;
    }
    
    .avatar-img {
        width: 60px;
        height: 60px;
    }
    
    .avatar-text {
        font-size: 16px;
        margin-top: 0;
    }
    
    .info-section h2 {
        font-size: 18px;
        margin-bottom: 10px;
        text-align: left;
    }
    
    .info-section p {
        font-size: 13px;
        text-align: left;
        margin-bottom: 15px;
        line-height: 1.4;
    }
    
    .features {
        display: none;
    }
    
    .message {
        max-width: 90%;
        padding: 10px 15px;
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .loading-indicator {
        padding: 8px;
    }
    
    /* 确保在移动设备上输入框可见 */
    .chat-input {
        min-height: 70px;
    }
    
    /* iOS Safari 兼容性 */
    @supports (-webkit-touch-callout: none) {
        .chat-input {
            padding-bottom: env(safe-area-inset-bottom, 15px);
        }
        
        #message-input {
            font-size: 16px; /* 防止 iOS 缩放 */
        }
    }
}

/* 更小屏幕的额外优化 */
@media (max-width: 480px) {
    .left-panel {
        padding: 10px;
        max-height: 180px;
    }
    
    .info-section h2 {
        font-size: 16px;
    }
    
    .info-section p {
        font-size: 12px;
    }
    
    .avatar-img {
        width: 50px;
        height: 50px;
    }
    
    .avatar-text {
        font-size: 14px;
    }
    
    .chat-input {
        padding: 12px;
    }
    
    #message-input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .mic-button {
        min-width: 40px !important;
        width: 40px;
        height: 40px;
    }
    
    #chat-form button[type="submit"] {
        min-width: 55px;
        height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }
}

/* === 移动端键盘优化 === */
.keyboard-open .left-panel {
    display: none !important;
}

.keyboard-open .chat-messages {
    padding-bottom: 20px;
}

/* === 触摸设备优化 === */
@media (hover: none) and (pointer: coarse) {
    .mic-button:hover,
    #chat-form button:hover,
    .feature-item:hover {
        transform: none;
        background: inherit;
    }
    
    .mic-button:active {
        transform: scale(0.95);
    }
    
    #chat-form button:active {
        transform: scale(0.95);
    }
}

/* === 表单样式（保留原有表单页面样式） === */
.form-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 800px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-container label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-container input[type="text"], 
.form-container select, 
.form-container textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-container input[type="text"]:focus, 
.form-container select:focus, 
.form-container textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-container textarea {
    resize: vertical;
}

.submit-btn {
    background-color: #007bff;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #0056b3;
}

/* === 聊天界面表单样式 === */
.form-container-chat {
    height: 100%;
    padding: 20px;
    overflow-y: auto;
    background: rgba(26, 26, 46, 0.3);
    backdrop-filter: blur(10px);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #9b59b6;
}

.form-header h3 {
    color: #9b59b6;
    font-size: 1.5rem;
    margin: 0;
}

.back-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
}

.form-container-chat .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-container-chat .form-group.full-width {
    grid-column: 1 / -1;
}

.form-container-chat label {
    display: block;
    margin-bottom: 8px;
    color: #e8e8e8;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-container-chat input,
.form-container-chat select,
.form-container-chat textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(155, 89, 182, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.form-container-chat input:focus,
.form-container-chat select:focus,
.form-container-chat textarea:focus {
    outline: none;
    border-color: #9b59b6;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.2);
}

.form-container-chat input::placeholder,
.form-container-chat textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-container-chat select option {
    background: #1a1a2e;
    color: #ffffff;
}

.form-container-chat .submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.form-container-chat .submit-btn:hover {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

/* === 选择题按钮样式 === */
.choice-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding: 10px 0;
}

.choice-btn {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(142, 68, 173, 0.2));
    color: #ffffff;
    border: 2px solid rgba(155, 89, 182, 0.5);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    min-width: 80px;
    text-align: center;
}

.choice-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.4), rgba(142, 68, 173, 0.4));
    border-color: #9b59b6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.choice-btn:active:not(:disabled) {
    transform: translateY(0);
}

.choice-btn.selected {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border-color: #9b59b6;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.choice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.choice-btn:disabled:not(.selected) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* === 注册弹窗样式 === */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 50%, #16213e 100%);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(155, 89, 182, 0.2);
    max-width: 380px;
    width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    transform: translateX(100%) translateY(-20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-overlay.show .popup-content {
    transform: translateX(0) translateY(0);
}

.popup-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid rgba(155, 89, 182, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background-color: rgba(155, 89, 182, 0.2);
    color: #ffffff;
    transform: scale(1.1);
}

.popup-body {
    padding: 20px;
}

.popup-body p {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.popup-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: 1px solid rgba(155, 89, 182, 0.3);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
    background: linear-gradient(135deg, #a569c7 0%, #9f55be 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 移动端弹窗适配 */
@media (max-width: 480px) {
    .popup-content {
        top: 15px;
        right: 15px;
        left: auto;
        width: calc(100vw - 30px);
        max-width: none;
    }
    
    .popup-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .popup-buttons button {
        min-width: auto;
        width: 100%;
    }
    
    .popup-header h3 {
        font-size: 16px;
    }
    
    .popup-body p {
        font-size: 14px;
    }
}

/* === 表单复选框样式 === */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(155, 89, 182, 0.3);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #9b59b6;
}

.checkbox-item input[type="checkbox"]:checked + span,
.checkbox-item:has(input[type="checkbox"]:checked) {
    color: #9b59b6;
    font-weight: 500;
}

/* === 返回按钮样式 === */
.back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.form-group.full-width .submit-btn {
    display: inline-block;
    width: auto;
    min-width: 300px;
}

/* === 嵌入式表单样式 === */
.form-container-embedded {
    height: 100%;
    background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 50%, #16213e 100%);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.form-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid rgba(155, 89, 182, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(155, 89, 182, 0.1);
    flex-shrink: 0;
}

.form-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.back-to-chat-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.back-to-chat-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.form-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(155, 89, 182, 0.5) rgba(255, 255, 255, 0.1);
}

.form-body::-webkit-scrollbar {
    width: 8px;
}

.form-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.form-body::-webkit-scrollbar-thumb {
    background: rgba(155, 89, 182, 0.5);
    border-radius: 4px;
}

.form-body::-webkit-scrollbar-thumb:hover {
    background: rgba(155, 89, 182, 0.7);
}

/* 表单内部样式适配 */
.form-container-embedded .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-container-embedded .form-group {
    margin-bottom: 0;
}

.form-container-embedded .form-group.full-width {
    grid-column: 1 / -1;
    margin-top: 15px;
}

/* 按钮容器特殊处理 */
.form-container-embedded .form-group.button-group {
    display: block;
    text-align: center;
}

.form-container-embedded label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 14px;
}

.form-container-embedded input,
.form-container-embedded select,
.form-container-embedded textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

/* 多选下拉框特殊样式 */
.form-container-embedded select[multiple] {
    min-height: 120px;
    padding: 8px;
    overflow-y: auto;
}

.form-container-embedded select[multiple]:focus {
    outline: none;
    border-color: rgba(155, 89, 182, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.2);
}

.form-container-embedded input:focus,
.form-container-embedded select:focus,
.form-container-embedded textarea:focus {
    outline: none;
    border-color: rgba(155, 89, 182, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.2);
}

.form-container-embedded input::placeholder,
.form-container-embedded textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-container-embedded select option {
    background: #2d1b69;
    color: #ffffff;
    padding: 8px 12px;
}

.form-container-embedded select option:checked {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.form-container-embedded select option:hover {
    background: rgba(155, 89, 182, 0.3);
}

.form-container-embedded .checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.form-container-embedded .checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.form-container-embedded .checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(155, 89, 182, 0.3);
}

.form-container-embedded .checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #9b59b6;
    width: auto;
}

.form-container-embedded .form-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    width: 100%;
}

.form-container-embedded .submit-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    min-width: 100px;
    flex: 0 0 auto;
}

.form-container-embedded .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
    background: linear-gradient(135deg, #a569c7 0%, #9f55be 100%);
}

.form-container-embedded .back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 100px;
    flex: 0 0 auto;
}

.form-container-embedded .back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 移动端嵌入式表单适配 */
@media (max-width: 768px) {
    .form-container-embedded .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-container-embedded .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .form-body {
        padding: 20px;
    }
    
    .form-header {
        padding: 15px 20px 12px;
    }
    
    .form-header h3 {
        font-size: 16px;
    }
    
    /* 移动端按钮适配 */
    .form-container-embedded .form-buttons {
        flex-direction: column !important;
        gap: 10px;
        margin-top: 15px;
    }
    
    .form-container-embedded .submit-btn,
    .form-container-embedded .back-btn {
        width: 100%;
        min-width: auto;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    /* 移动端多选框适配 */
    .form-container-embedded select[multiple] {
        min-height: 100px;
        font-size: 15px;
    }
}

/* 小屏幕设备（手机竖屏）*/
@media (max-width: 480px) {
    .form-container-embedded .form-buttons {
        gap: 8px;
    }
    
    .form-container-embedded .submit-btn,
    .form-container-embedded .back-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* === 表单模态框样式 === */
.form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.form-modal.show {
    display: flex;
    opacity: 1;
    justify-content: center;
    align-items: center;
}

.form-modal-content {
    background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 50%, #16213e 100%);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(155, 89, 182, 0.2);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.form-modal.show .form-modal-content {
    transform: scale(1) translateY(0);
}

.form-modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid rgba(155, 89, 182, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(155, 89, 182, 0.1);
}

.form-modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.form-modal-close:hover {
    background-color: rgba(155, 89, 182, 0.2);
    color: #ffffff;
    transform: scale(1.1);
}

.form-modal-body {
    padding: 25px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(155, 89, 182, 0.5) rgba(255, 255, 255, 0.1);
}

.form-modal-body::-webkit-scrollbar {
    width: 8px;
}

.form-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.form-modal-body::-webkit-scrollbar-thumb {
    background: rgba(155, 89, 182, 0.5);
    border-radius: 4px;
}

.form-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(155, 89, 182, 0.7);
}

/* 表单内部样式适配 */
.form-modal .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-modal .form-group {
    margin-bottom: 0;
}

.form-modal .form-group.full-width {
    grid-column: 1 / -1;
    margin-top: 15px;
}

.form-modal label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 14px;
}

.form-modal input,
.form-modal select,
.form-modal textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.form-modal input:focus,
.form-modal select:focus,
.form-modal textarea:focus {
    outline: none;
    border-color: rgba(155, 89, 182, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.2);
}

.form-modal input::placeholder,
.form-modal textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-modal select option {
    background: #2d1b69;
    color: #ffffff;
}

.form-modal .checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.form-modal .checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.form-modal .checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(155, 89, 182, 0.3);
}

.form-modal .checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #9b59b6;
    width: auto;
}

.form-modal .submit-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    margin-right: 15px;
}

.form-modal .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
    background: linear-gradient(135deg, #a569c7 0%, #9f55be 100%);
}

.form-modal .back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-modal .back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 移动端表单模态框适配 */
@media (max-width: 768px) {
    .form-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .form-modal-body {
        padding: 20px;
        max-height: calc(95vh - 80px);
    }
    
    .form-modal .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-modal .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .form-modal .submit-btn,
    .form-modal .back-btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* === 移动端表单优化 === */
@media (max-width: 768px) {
    .form-container-chat {
        padding: 15px;
    }
    
    .form-container-chat .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .back-btn {
        align-self: stretch;
    }
    
    /* 移动端按钮优化 */
    .choice-buttons {
        gap: 8px;
    }
    
    .choice-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        min-width: 70px;
    }
}

/* === 系统消息样式 === */
.system-message {
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.5);
    color: #b19cd9;
    text-align: center;
    font-size: 14px;
    font-style: italic;
    margin: 10px auto;
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    align-self: center;
}