/* 连连支付BD销售实训系统 V3 - 深色科技风样式 */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-input: #16162a;
    --brand-blue: #1677FF;
    --brand-blue-hover: #4096ff;
    --brand-blue-dark: #0958d9;
    --purple-start: #7C3AED;
    --purple-end: #A855F7;
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #6b6b80;
    --border-color: #2a2a40;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --glass-bg: rgba(26, 26, 46, 0.8);
    --glass-border: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.top-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--brand-blue), var(--purple-start));
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
}

.page { display: none; }
.page.active { display: block; }

/* ============ 登录页 ============ */
#login-page {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 70%);
}
#login-page.active { display: flex; }

.login-container {
    width: 400px;
    padding: 48px 40px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.login-logo { text-align: center; margin-bottom: 36px; }

.logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--brand-blue), var(--purple-start));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.login-logo h1 { font-size: 24px; font-weight: 600; color: var(--text-primary); }
.login-subtitle { color: var(--text-secondary); margin-top: 8px; font-size: 14px; }

.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--brand-blue); }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; min-height: 20px; }

/* ============ 按钮 ============ */
.btn-primary {
    padding: 10px 20px;
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover { background: var(--brand-blue-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-block { width: 100%; padding: 14px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-ghost {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-secondary); }

.btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { opacity: 0.9; }

/* ============ 导航栏 ============ */
.navbar {
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 3px;
    z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: 10px; min-width: 180px; }

.nav-logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--brand-blue), var(--purple-start));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.nav-title { font-size: 15px; font-weight: 600; }

.nav-tabs { display: flex; gap: 4px; flex: 1; justify-content: center; }

.nav-tab {
    padding: 8px 18px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.nav-tab.active { color: var(--brand-blue); background: rgba(22, 119, 255, 0.1); }

.nav-right { display: flex; align-items: center; gap: 12px; min-width: 180px; justify-content: flex-end; }
.nav-right span { font-size: 13px; color: var(--text-secondary); }

/* ============ Tab内容 ============ */
.tab-content { display: none; height: calc(100vh - 59px - 40px); overflow: hidden; }
.tab-content.active { display: block; }

/* ============ 对话实训页 ============ */
.training-layout { display: flex; height: 100%; gap: 0; }

.chat-panel { flex: 1; display: flex; flex-direction: column; border-right: 1px solid var(--border-color); min-width: 0; }

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-header-left { display: flex; align-items: center; gap: 12px; }
.chat-status { font-size: 14px; color: var(--text-secondary); }
.turn-counter { font-size: 12px; color: var(--text-muted); }

.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.message { display: flex; gap: 12px; max-width: 80%; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message.bd-message { align-self: flex-end; flex-direction: row-reverse; }

.message-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.ai-message .message-avatar { background: linear-gradient(135deg, var(--brand-blue), #0050b3); }
.bd-message .message-avatar { background: linear-gradient(135deg, var(--purple-start), var(--purple-end)); font-size: 14px; font-weight: 600; color: white; }

.message-bubble { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; line-height: 1.6; position: relative; }
.ai-message .message-bubble { background: var(--glass-bg); border: 1px solid var(--glass-border); backdrop-filter: blur(10px); border-top-left-radius: 4px; }
.bd-message .message-bubble { background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark)); color: white; border-top-right-radius: 4px; }
.message-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.bd-message .message-meta { text-align: right; }

.typing-indicator { display: flex; gap: 4px; padding: 8px 0; }
.typing-indicator span { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; animation: typing 1.4s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

.chat-input-area { padding: 16px 20px; border-top: 1px solid var(--border-color); background: var(--bg-secondary); }

.customer-state-bar {
    display: flex;
    gap: 16px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(22, 119, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
}
.state-item { white-space: nowrap; }

.input-row { display: flex; gap: 12px; align-items: flex-end; }
.input-row textarea {
    flex: 1; padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
}
.input-row textarea:focus { border-color: var(--brand-blue); }
.input-row .btn-primary { height: 44px; white-space: nowrap; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-hint { font-size: 13px; margin-top: 4px; color: var(--text-muted); }

/* ============ 评分面板 ============ */
.scoring-panel { width: 360px; overflow-y: auto; background: var(--bg-secondary); border-left: 1px solid var(--border-color); }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.panel-header h3 { font-size: 15px; font-weight: 600; }
.panel-content { padding: 16px 20px; display: flex; flex-direction: column; gap: 20px; }

.profile-card, .score-card, .supervisor-panel, .final-score-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border-color);
}
.profile-card h4, .score-card h4, .supervisor-panel h4, .final-score-card h4 {
    font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text-primary);
}

.profile-hint {
    font-size: 11px;
    color: var(--warning);
    font-weight: 400;
    margin-left: 8px;
}

.profile-card .profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-item { font-size: 12px; }
.profile-item .label { color: var(--text-muted); }
.profile-item .value { color: var(--text-primary); font-weight: 500; }

.total-score-display { text-align: center; margin-bottom: 16px; }
.score-number { font-size: 48px; font-weight: 700; color: var(--brand-blue); }
.score-label { font-size: 18px; color: var(--text-muted); margin-left: 4px; }

.dimension-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.dimension-bar { display: flex; align-items: center; gap: 8px; }
.dimension-bar .dim-name { width: 80px; font-size: 12px; color: var(--text-secondary); text-align: right; }
.dimension-bar .bar-bg { flex: 1; height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
.dimension-bar .bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-hover)); border-radius: 3px; transition: width 0.5s ease; }
.dimension-bar .bar-fill.low { background: linear-gradient(90deg, var(--danger), #ff7875); }
.dimension-bar .bar-fill.mid { background: linear-gradient(90deg, var(--warning), #ffc53d); }
.dimension-bar .bar-fill.high { background: linear-gradient(90deg, var(--success), #73d13d); }
.dimension-bar .dim-score { width: 30px; font-size: 12px; color: var(--text-primary); font-weight: 600; }

.score-comment { font-size: 13px; color: var(--text-secondary); padding: 10px; background: rgba(22, 119, 255, 0.06); border-radius: var(--radius-sm); margin-bottom: 8px; line-height: 1.5; }
.score-suggestion { font-size: 13px; color: var(--warning); padding: 10px; background: rgba(250, 173, 20, 0.06); border-radius: var(--radius-sm); line-height: 1.5; }

.supervisor-panel textarea {
    width: 100%; padding: 10px;
    background: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 13px; resize: none; outline: none; margin-bottom: 10px; font-family: inherit;
}
.supervisor-panel textarea:focus { border-color: var(--brand-blue); }

.final-score-card .final-dimensions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.final-highlights { font-size: 13px; color: var(--success); margin-bottom: 8px; }
.final-weaknesses { font-size: 13px; color: var(--danger); margin-bottom: 8px; }
.final-comment { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ============ [Fix 3] 训练记录页 ============ */
.records-container { padding: 24px; height: 100%; overflow-y: auto; }
.records-header { margin-bottom: 20px; }
.records-header h2 { font-size: 20px; }

.records-list { display: flex; flex-direction: column; gap: 12px; }

.record-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}
.record-card:hover { border-color: var(--brand-blue); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(22, 119, 255, 0.08); }

.record-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.record-title { display: flex; align-items: center; gap: 8px; }
.record-company { font-size: 15px; font-weight: 600; }
.record-industry { font-size: 11px; color: var(--brand-blue); background: rgba(22, 119, 255, 0.1); padding: 2px 8px; border-radius: 4px; }

.record-badges { display: flex; gap: 6px; }

.status-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}
.status-badge.completed { background: rgba(82, 196, 26, 0.1); color: var(--success); }
.status-badge.active { background: rgba(22, 119, 255, 0.1); color: var(--brand-blue); }
.status-badge.reviewed { background: rgba(250, 173, 20, 0.1); color: var(--warning); }
.status-badge.pending { background: rgba(107, 107, 128, 0.1); color: var(--text-muted); }

.record-card-body { display: flex; flex-direction: column; gap: 8px; }

.record-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); }

.record-supervisor-preview {
    padding: 8px 12px;
    background: rgba(250, 173, 20, 0.06);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--warning);
    font-size: 12px;
}
.supervisor-label { color: var(--warning); font-weight: 500; margin-right: 6px; }
.supervisor-text { color: var(--text-secondary); }

/* 记录详情弹窗 */
.modal-large { width: 720px; max-height: 85vh; }

.record-detail-header { margin-bottom: 16px; }
.record-detail-info { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }

.record-supervisor-summary {
    background: rgba(250, 173, 20, 0.06);
    border: 1px solid rgba(250, 173, 20, 0.15);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.record-supervisor-summary h4 { font-size: 14px; margin-bottom: 10px; color: var(--warning); }
.record-supervisor-summary.no-review p { font-size: 13px; color: var(--text-muted); }

.supervisor-comment-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.supervisor-comment-item:last-child { border-bottom: none; }
.comment-turn { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.comment-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.record-conversation { margin-bottom: 16px; }
.record-conversation h4 { font-size: 14px; margin-bottom: 12px; }

.record-messages { display: flex; flex-direction: column; gap: 10px; max-height: 400px; overflow-y: auto; }

.record-msg {
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}
.record-msg-role { font-size: 11px; color: var(--brand-blue); margin-bottom: 4px; font-weight: 500; }
.record-msg.msg-ai .record-msg-role { color: var(--purple-end); }
.record-msg-content { font-size: 13px; line-height: 1.5; }
.msg-scores { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.msg-supervisor { font-size: 11px; color: var(--warning); margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(250, 173, 20, 0.2); }

.record-profile-review {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border-color);
}
.record-profile-review h4 { font-size: 14px; margin-bottom: 12px; }

/* ============ 训练看板 ============ */
.dashboard-container { padding: 24px; height: 100%; overflow-y: auto; }
.dashboard-header { margin-bottom: 20px; }
.dashboard-header h2 { font-size: 20px; }

.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.member-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}
.member-card:hover { border-color: var(--brand-blue); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(22, 119, 255, 0.1); }
.member-card .member-name { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.member-card .member-stats { display: flex; justify-content: space-between; }
.member-card .stat { text-align: center; }
.member-card .stat-value { font-size: 20px; font-weight: 700; color: var(--brand-blue); }
.member-card .stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.member-detail { padding: 20px; }

.detail-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}
.detail-section h4 { font-size: 15px; margin-bottom: 16px; color: var(--text-primary); }

.radar-chart { display: flex; flex-direction: column; gap: 8px; }
.radar-bar { display: flex; align-items: center; gap: 8px; }
.radar-bar .label { width: 80px; font-size: 12px; color: var(--text-secondary); text-align: right; }
.radar-bar .bar-bg { flex: 1; height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.radar-bar .bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand-blue), var(--purple-start)); border-radius: 4px; transition: width 0.5s; }
.radar-bar .value { width: 40px; font-size: 12px; font-weight: 600; color: var(--text-primary); }

.trend-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.trend-bar { flex: 1; background: linear-gradient(to top, var(--brand-blue), var(--brand-blue-hover)); border-radius: 4px 4px 0 0; min-height: 4px; position: relative; transition: height 0.3s; }
.trend-bar .trend-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.trend-bar .trend-value { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-primary); font-weight: 600; }

.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg-input); border-radius: var(--radius-sm); cursor: pointer; transition: background 0.2s; }
.conv-item:hover { background: var(--bg-card); }
.conv-item .conv-info { font-size: 13px; }
.conv-item .conv-date { font-size: 12px; color: var(--text-muted); }

/* ============ 知识库 ============ */
.knowledge-container { padding: 24px; height: 100%; overflow-y: auto; }
.knowledge-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.knowledge-header h2 { font-size: 20px; }

.category-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.category-tab { padding: 6px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 20px; font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
.category-tab:hover { border-color: var(--brand-blue); color: var(--text-primary); }
.category-tab.active { background: rgba(22, 119, 255, 0.15); border-color: var(--brand-blue); color: var(--brand-blue); }

.knowledge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.knowledge-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border-color); transition: all 0.2s; }
.knowledge-card:hover { border-color: var(--brand-blue); }
.knowledge-card .k-category { font-size: 11px; color: var(--brand-blue); background: rgba(22, 119, 255, 0.1); padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 8px; }
.knowledge-card .k-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.knowledge-card .k-content { font-size: 13px; color: var(--text-secondary); line-height: 1.6; max-height: 120px; overflow: hidden; white-space: pre-wrap; }
.knowledge-card .k-actions { display: flex; gap: 8px; margin-top: 12px; }
.knowledge-card .k-actions button { padding: 4px 12px; font-size: 12px; border-radius: 4px; cursor: pointer; border: 1px solid var(--border-color); background: transparent; color: var(--text-secondary); transition: all 0.2s; }
.knowledge-card .k-actions button:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

/* ============ 系统设置 ============ */
.settings-container { padding: 24px; max-width: 800px; }
.settings-container h2 { font-size: 20px; margin-bottom: 24px; }
.settings-section { background: var(--bg-card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border-color); margin-bottom: 20px; }
.settings-section h3 { font-size: 16px; margin-bottom: 16px; }

.status-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.status-item:last-child { border-bottom: none; }
.status-item .label { color: var(--text-secondary); }
.status-item .value { color: var(--text-primary); font-weight: 500; }
.status-ok { color: var(--success) !important; }
.status-error { color: var(--danger) !important; }

.form-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-row input { padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; outline: none; }
.form-row input:focus { border-color: var(--brand-blue); }

/* ============ 弹窗 ============ */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); }
.modal-content {
    position: relative;
    width: 560px;
    max-height: 80vh;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { font-size: 16px; }
.modal-close { width: 28px; height: 28px; background: transparent; border: none; color: var(--text-secondary); font-size: 20px; cursor: pointer; border-radius: 4px; }
.modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-body .form-group { margin-bottom: 16px; }
.modal-body label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.modal-body input, .modal-body textarea, .modal-body select {
    width: 100%; padding: 10px 14px;
    background: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 14px; outline: none; font-family: inherit;
}
.modal-body input:focus, .modal-body textarea:focus, .modal-body select:focus { border-color: var(--brand-blue); }
.modal-body select { cursor: pointer; }
.modal-body select option { background: var(--bg-card); color: var(--text-primary); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border-color); }

/* ============ 底部 ============ */
.app-footer { text-align: center; padding: 10px; font-size: 12px; color: var(--text-muted); background: var(--bg-primary); border-top: 1px solid var(--border-color); height: 40px; display: flex; align-items: center; justify-content: center; }

/* ============ 用户列表表格 ============ */
.user-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.user-table th, .user-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-color); }
.user-table th { color: var(--text-muted); font-weight: 500; font-size: 12px; }
.user-table td { color: var(--text-primary); }

.role-badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.role-badge.bd { background: rgba(124, 58, 237, 0.15); color: var(--purple-end); }
.role-badge.supervisor { background: rgba(22, 119, 255, 0.15); color: var(--brand-blue); }

/* ============ 响应式 ============ */
@media (max-width: 1024px) { .scoring-panel { width: 300px; } }
@media (max-width: 768px) {
    .training-layout { flex-direction: column; }
    .scoring-panel { width: 100%; max-height: 40vh; }
    .nav-tabs { display: none; }
    .modal-large { width: 95vw; }
}

/* V4新增：训练选项区域（难度和竞品选择） */
.training-options {
    background: rgba(24, 144, 255, 0.05);
    border: 1px solid rgba(24, 144, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 16px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.training-options .option-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.training-options label {
    font-size: 13px;
    color: #a0a0a0;
    white-space: nowrap;
}

.training-options select {
    background: #1a1a2e;
    border: 1px solid rgba(24, 144, 255, 0.3);
    border-radius: 4px;
    color: #e0e0e0;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.training-options select:hover {
    border-color: #1890FF;
}

.training-options select:focus {
    outline: none;
    border-color: #1890FF;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* ============ V4 语音对话模块样式 ============ */

/* 语音控制栏 */
.voice-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 8px;
    min-height: 36px;
}

.voice-control-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

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

/* 语音模式开关 */
.voice-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.voice-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.voice-toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.voice-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.voice-toggle input:checked + .voice-toggle-slider {
    background: rgba(22, 119, 255, 0.3);
    border-color: var(--brand-blue);
}

.voice-toggle input:checked + .voice-toggle-slider::after {
    transform: translateX(16px);
    background: var(--brand-blue);
    box-shadow: 0 0 6px rgba(22, 119, 255, 0.4);
}

.voice-toggle-label {
    font-size: 13px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.voice-toggle input:checked ~ .voice-toggle-label {
    color: var(--brand-blue);
}

/* 语速控制 */
.voice-speed-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.voice-speed-label {
    font-size: 12px;
    color: var(--text-muted);
}

.voice-speed-control select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.voice-speed-control select:hover {
    border-color: var(--brand-blue);
}

.voice-speed-control select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.voice-speed-control select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* 麦克风按钮 */
.mic-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    white-space: nowrap;
}

.mic-btn:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    background: rgba(22, 119, 255, 0.06);
}

.mic-btn .mic-icon {
    font-size: 16px;
    transition: transform 0.2s;
}

.mic-btn.recording {
    background: rgba(255, 77, 79, 0.12);
    border-color: var(--danger);
    color: var(--danger);
    animation: mic-pulse 1.2s ease-in-out infinite;
}

.mic-btn.recording .mic-icon {
    transform: scale(1.15);
    animation: mic-bounce 0.6s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(255, 77, 79, 0); }
}

@keyframes mic-bounce {
    0%, 100% { transform: scale(1.15); }
    50% { transform: scale(1.25); }
}

/* 语音识别状态提示 */
.voice-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 8px;
    background: rgba(255, 77, 79, 0.06);
    border: 1px solid rgba(255, 77, 79, 0.15);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--danger);
}

.voice-status-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: status-blink 1s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.voice-status-text {
    color: var(--text-secondary);
}

/* 浏览器不支持提示 */
.voice-unsupported {
    width: 100%;
}

.voice-unsupported-text {
    font-size: 12px;
    color: var(--warning);
    background: rgba(250, 173, 20, 0.06);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(250, 173, 20, 0.15);
}
/* ============ V4 学习闯关样式 ============ */

.challenge-container {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.challenge-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.challenge-header h2 {
    margin: 0;
    font-size: 22px;
    color: #e8e8f0;
}

.challenge-desc {
    color: #888;
    font-size: 13px;
    width: 100%;
    margin-top: -8px;
}

/* 文档卡片 */
.challenge-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.challenge-doc-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.challenge-doc-card:hover {
    background: rgba(24,144,255,0.08);
    border-color: rgba(24,144,255,0.3);
    transform: translateY(-2px);
}

.doc-card-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.doc-card-info h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #e8e8f0;
}

.doc-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.doc-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.doc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1890FF, #36cfc9);
    border-radius: 3px;
    transition: width 0.3s;
}

.doc-progress-text {
    font-size: 12px;
    color: #888;
}

/* 章节时间线 */
.chapter-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    transition: all 0.2s;
}

.chapter-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.chapter-item.unlocked {
    cursor: pointer;
}

.chapter-item.unlocked:hover {
    background: rgba(24,144,255,0.08);
    border-color: rgba(24,144,255,0.3);
}

.chapter-item.passed {
    border-left: 3px solid #52c41a;
}

.chapter-item.failed {
    border-left: 3px solid #ff4d4f;
}

.chapter-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(24,144,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #1890FF;
    flex-shrink: 0;
}

.chapter-info {
    flex: 1;
}

.chapter-title-text {
    font-size: 15px;
    color: #e8e8f0;
    margin-bottom: 4px;
}

.chapter-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #888;
}

.chapter-status-badge {
    font-size: 20px;
    flex-shrink: 0;
}

/* 章节学习区 */
.chapter-content-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chapter-reading {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 24px;
    line-height: 1.8;
    color: #c8c8d0;
    font-size: 14px;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.chapter-quiz-area h3 {
    color: #e8e8f0;
    font-size: 18px;
    margin-bottom: 16px;
}

/* 测试题 */
.quiz-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

.quiz-question {
    font-size: 14px;
    color: #e8e8f0;
    margin-bottom: 12px;
    line-height: 1.6;
}

.quiz-num {
    font-weight: bold;
    color: #1890FF;
    margin-right: 4px;
}

.quiz-type-badge {
    display: inline-block;
    background: rgba(24,144,255,0.15);
    color: #1890FF;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.quiz-option:hover {
    background: rgba(24,144,255,0.08);
}

.quiz-option input[type="radio"],
.quiz-option input[type="checkbox"] {
    accent-color: #1890FF;
}

.quiz-option-text {
    font-size: 13px;
    color: #c8c8d0;
}

/* 测试结果 */
.quiz-result {
    margin-top: 20px;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.quiz-passed {
    background: rgba(82,196,26,0.1);
    border: 1px solid rgba(82,196,26,0.3);
}

.quiz-failed {
    background: rgba(255,77,79,0.1);
    border: 1px solid rgba(255,77,79,0.3);
}

.result-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.result-score {
    font-size: 36px;
    font-weight: bold;
    color: #e8e8f0;
    margin-bottom: 4px;
}

.result-text {
    font-size: 14px;
    color: #c8c8d0;
    margin-bottom: 4px;
}

.result-hint {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}

/* 主管管理表格 */
.challenge-table {
    width: 100%;
    border-collapse: collapse;
}

.challenge-table th,
.challenge-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
    color: #c8c8d0;
}

.challenge-table th {
    color: #888;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

.challenge-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* 进度卡片 */
.progress-user-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.progress-user-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: #e8e8f0;
}

.progress-user-summary {
    font-size: 12px;
    color: #1890FF;
    background: rgba(24,144,255,0.1);
    padding: 4px 10px;
    border-radius: 12px;
}


/* ============ V4.1 新增样式 ============ */

/* 进度条式客户状态 */
.customer-state-bar {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(22, 119, 255, 0.06), rgba(124, 58, 237, 0.04));
    border-radius: var(--radius-sm);
    border: 1px solid rgba(22, 119, 255, 0.1);
}

.state-progress-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.state-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 70px;
}

.state-progress-bg {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill.bar-low {
    background: linear-gradient(90deg, #ff4d4f, #ff7875);
}

.progress-fill.bar-mid {
    background: linear-gradient(90deg, #faad14, #ffc53d);
}

.progress-fill.bar-high {
    background: linear-gradient(90deg, #52c41a, #73d13d);
}

.state-percent {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 32px;
    text-align: right;
}

/* 实时通话指示器 */
.voice-call-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(82, 196, 26, 0.1);
    border: 1px solid rgba(82, 196, 26, 0.2);
    border-radius: 16px;
    animation: call-pulse 2s ease-in-out infinite;
}

.call-dot {
    width: 8px;
    height: 8px;
    background: #52c41a;
    border-radius: 50%;
    animation: dot-blink 1s ease-in-out infinite;
}

.call-text {
    font-size: 12px;
    color: #52c41a;
    font-weight: 500;
}

@keyframes call-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.15); }
    50% { box-shadow: 0 0 0 6px rgba(82, 196, 26, 0); }
}

@keyframes dot-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 系统消息气泡优化 */
.system-bubble {
    background: rgba(250, 173, 20, 0.08) !important;
    border: 1px solid rgba(250, 173, 20, 0.15) !important;
    color: var(--warning) !important;
    font-size: 13px !important;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-sm) !important;
}

/* 消息气泡增强 */
.ai-bubble {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(10px);
    border-top-left-radius: 4px !important;
}

.bd-bubble {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark)) !important;
    color: white !important;
    border-top-right-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.2);
}

.ai-avatar {
    background: linear-gradient(135deg, var(--brand-blue), #0050b3) !important;
}

.bd-avatar {
    background: linear-gradient(135deg, var(--purple-start), var(--purple-end)) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: white !important;
}

/* 卡片悬浮增强 */
.record-card:hover {
    box-shadow: 0 8px 32px rgba(22, 119, 255, 0.12);
}

.member-card:hover {
    box-shadow: 0 12px 40px rgba(22, 119, 255, 0.15);
}

.knowledge-card:hover {
    box-shadow: 0 8px 24px rgba(22, 119, 255, 0.08);
}

/* 按钮增强 */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-primary:active::after {
    width: 200px;
    height: 200px;
}

/* 消息入场动画增强 */
.message {
    animation: slideInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

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

/* 评分面板数字动画 */
.score-number {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 顶部渐变条增强 */
.top-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--brand-blue), var(--purple-start), var(--brand-blue));
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 输入框聚焦增强 */
.input-row textarea:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

/* 弹窗增强 */
.modal-content {
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 训练选项区域增强 */
.training-options {
    animation: fadeIn 0.3s ease;
}

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

/* 导航tab增强 */
.nav-tab {
    position: relative;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--brand-blue);
    border-radius: 1px;
}

/* 空状态增强 */
.empty-state {
    animation: fadeIn 0.5s ease;
}

.empty-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 滚动条美化 */
.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--border-color), var(--text-muted));
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--brand-blue);
}

/* 响应式进度条 */
@media (max-width: 768px) {
    .customer-state-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .state-progress-item {
        min-width: 100%;
    }
}

/* 登录页增强 */
#login-page {
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 70%);
}

.login-container {
    animation: loginSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loginSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.login-container:hover {
    border-color: rgba(22, 119, 255, 0.2);
    box-shadow: 0 8px 40px rgba(22, 119, 255, 0.08);
}
