/* 弹窗遮罩 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
}

.modal-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 通用黑色弹窗样式 */
.history-modal,
.service-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000000;
    border-radius: 16px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 历史记录固定标题区域 */
.history-header-fixed {
    flex-shrink: 0;
    margin-bottom: 15px;
}

/* 历史记录滚动内容区域 */
.history-content-scroll {
    max-height: calc(80vh - 160px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

/* 历史记录滚动条样式 */
.history-content-scroll::-webkit-scrollbar {
    width: 6px;
}

.history-content-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.history-content-scroll::-webkit-scrollbar-thumb {
    background: rgba(80, 80, 80, 0.6);
    border-radius: 3px;
}

.history-content-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 100, 0.8);
}

.history-modal.active,
.service-modal.active {
    display: block;
    animation: slideIn 0.3s ease;
}

.history-modal h2,
.service-modal h2 {
    color: #ffffff;
    font-size: 24px;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* 历史记录列表 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.history-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.history-meta {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 12px 0;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-btn {
    padding: 8px 16px;
    background: #ffffff;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.history-btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.history-btn.delete {
    background: #dc3545;
    color: #ffffff;
}

.history-btn.delete:hover {
    background: #c82333;
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-history-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

/* 客服弹窗 */
.service-modal {
    max-width: 280px !important;
    text-align: center;
    padding: 20px !important;
}

.qrcode-container {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.qrcode-placeholder {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.qrcode-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.service-tip {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-top: 15px;
}

/* 关闭按钮 */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ffffff;
}

/* 注册/登录表单样式 */
.auth-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.auth-tab.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(40, 40, 40, 0.9);
    color: #ffffff;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: #ffffff;
    background: rgba(60, 60, 60, 0.9);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

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

/* 🔥 禁用浏览器自动填充的白色/黄色高亮背景 */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(40, 40, 40, 0.9) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .history-modal,
    .service-modal {
        width: 95%;
        padding: 20px;
    }
    
    .history-actions {
        flex-direction: column;
    }
    
    .history-btn {
        width: 100%;
    }
}

/* 免责声明黑色主题 */
.auth-panel > div[style*="background"] {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7) !important;
}

.auth-panel > div[style*="background"] strong {
    color: #ffffff !important;
}

/* 确保所有按钮使用黑色主题 */
.history-modal .history-btn,
.auth-panel .history-btn {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

.history-modal .history-btn:hover,
.auth-panel .history-btn:hover {
    background: #f0f0f0 !important;
}


/* 强制按钮样式 */
.history-btn {
    background: #1a1a1a !important;
    color: #ffffff !important;
}

.history-btn:hover {
    background: #000000 !important;
    color: #ffffff !important;
}

/* 黑色滚动条 */
.history-modal::-webkit-scrollbar,
.service-modal::-webkit-scrollbar,
.auth-panel div::-webkit-scrollbar {
    width: 8px;
}

.history-modal::-webkit-scrollbar-track,
.service-modal::-webkit-scrollbar-track,
.auth-panel div::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.history-modal::-webkit-scrollbar-thumb,
.service-modal::-webkit-scrollbar-thumb,
.auth-panel div::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 100, 0.5);
    border-radius: 4px;
}

.history-modal::-webkit-scrollbar-thumb:hover,
.service-modal::-webkit-scrollbar-thumb:hover,
.auth-panel div::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.7);
}