/* ============================================
   深度实训模块样式 v2 — 全模块增强版
   ============================================ */

/* --- 场景选择 --- */
.dt-scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.dt-scenario-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}.dt-scenario-card:hover { border-color: #2F88FF; box-shadow: 0 2px 8px rgba(47,136,255,0.1); transform: none }
.dt-scenario-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}
.dt-scenario-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.dt-difficulty {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.dt-difficulty.basic { background: #dcfce7; color: #166534; }
.dt-difficulty.advanced { background: #fef3c7; color: #92400e; }
.dt-difficulty.expert { background: #fee2e2; color: #991b1b; }
.dt-duration {
    font-size: 13px;
    color: #6b7280;
}
.dt-rounds-info {
    font-size: 13px;
    color: #2F88FF;
    font-weight: 500;
}
.dt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.dt-tag {
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 12px;
    color: #4b5563;
}
.dt-buyer-preview {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

/* --- 流程链可视化 --- */
.dt-process-flow {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
}
.dt-flow-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dt-flow-steps {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
}
.dt-flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    position: relative;
}
.dt-flow-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}
.dt-flow-step.active .dt-flow-dot {
    background: #2F88FF;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(47,136,255,0.2);
}
.dt-flow-step.completed .dt-flow-dot {
    background: #10b981;
    color: #fff;
}
.dt-flow-name {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
}
.dt-flow-step.active .dt-flow-name {
    color: #2F88FF;
    font-weight: 600;
}
.dt-flow-step.completed .dt-flow-name {
    color: #10b981;
}
.dt-flow-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    min-width: 24px;
    margin: 0 4px;
    margin-bottom: 20px;
}

/* --- 状态面板 --- */
.dt-state-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.dt-state-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dt-state-label {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}
.dt-progress-bar {
    flex: 1;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}
.dt-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.dt-progress-fill.satisfaction { background: #10b981; }
.dt-progress-fill.trust { background: #3b82f6; }
.dt-progress-fill.patience { background: #f59e0b; }
.dt-progress-fill.deal { background: #8b5cf6; }
.dt-state-val {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    min-width: 24px;
    text-align: right;
}

/* --- 谈判模块布局 --- */
.dt-negotiation { padding: 0; }
.dt-neg-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.dt-back-btn {
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
}
.dt-back-btn:hover { background: #e5e7eb; }
.dt-neg-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}
.dt-round-indicator {
    font-size: 14px;
    color: #6b7280;
}

/* 谈判左右布局 */
.dt-neg-main-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
}

/* --- 上下文侧边栏 --- */
.dt-context-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dt-context-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.dt-context-card-header {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.dt-context-card-body {
    padding: 12px 14px;
}
.dt-profile-item {
    margin-bottom: 8px;
    font-size: 13px;
}
.dt-profile-item:last-child { margin-bottom: 0; }
.dt-profile-label {
    display: inline-block;
    color: #6b7280;
    min-width: 40px;
    margin-right: 4px;
}
.dt-profile-label::after {
    content: '：';
}
.dt-profile-value {
    color: #1f2937;
    line-height: 1.4;
}
.dt-highlight {
    color: #2F88FF;
    font-weight: 600;
}

/* --- 策略面板 --- */
.dt-strategy-phase {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}
.dt-strategy-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    min-width: 60px;
}
.dt-strategy-value {
    font-size: 13px;
    color: #2F88FF;
    font-weight: 500;
}
.dt-strategy-section {
    margin-bottom: 10px;
}
.dt-strategy-section:last-child { margin-bottom: 0; }
.dt-strategy-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    margin-top: 4px;
}
.dt-strategy-text.dt-success {
    color: #059669;
    font-style: italic;
}
.dt-mistakes-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}
.dt-mistake-item {
    font-size: 13px;
    color: #dc2626;
    padding: 2px 0 2px 16px;
    position: relative;
}
.dt-mistake-item::before {
    content: '!';
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #dc2626;
}

/* --- 对话区 --- */
.dt-neg-chat-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.dt-chat-area {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dt-chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.dt-chat-msg.user {
    justify-content: flex-end;
}
.dt-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2F88FF;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.dt-chat-avatar.user {
    background: #6b7280;
}
.dt-chat-bubble {
    max-width: 70%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
}
.dt-chat-msg.user .dt-chat-bubble {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.dt-chat-sender {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}
.dt-chat-text {
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
}
.dt-chat-text.system {
    color: #6b7280;
    font-style: italic;
}

/* --- 打字动画 --- */
.dt-typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.dt-typing-dots span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}
.dt-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.dt-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* --- 输入区 --- */
.dt-input-area {
    margin-top: 12px;
}
.dt-input-row {
    display: flex;
    gap: 8px;
}
.dt-input-row textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}
.dt-input-row textarea:focus {
    outline: none;
    border-color: #2F88FF;
    box-shadow: 0 0 0 3px rgba(47,136,255,0.1);
}
.dt-send-btn {
    padding: 8px 20px;
    background: #2F88FF;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    align-self: flex-end;
}
.dt-send-btn:hover { background: #1d6fe0; }
.dt-send-btn:disabled { background: #93c5fd; cursor: not-allowed; }
.dt-input-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.dt-round-question {
    font-size: 13px;
    color: #2F88FF;
    font-weight: 500;
}

/* --- 单轮结果 --- */
.dt-round-result {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 4px;
}
.dt-result-header {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
.dt-score-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.dt-score-item {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.dt-score-item.good { background: #dcfce7; color: #166534; }
.dt-score-item.ok { background: #fef3c7; color: #92400e; }
.dt-score-item.bad { background: #fee2e2; color: #991b1b; }
.dt-summary {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

/* --- 最终结果 --- */
.dt-result-panel {
    margin-top: 16px;
}
.dt-final-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin-bottom: 16px;
}
.dt-grade-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 12px;
}
.dt-total-score {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}
.dt-dimension-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.dt-dim-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dt-dim-label {
    font-size: 13px;
    color: #374151;
    min-width: 60px;
}
.dt-dim-bar {
    flex: 1;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}
.dt-dim-fill {
    height: 100%;
    border-radius: 3px;
}
.dt-dim-fill.good { background: #10b981; }
.dt-dim-fill.ok { background: #f59e0b; }
.dt-dim-fill.bad { background: #ef4444; }
.dt-dim-val {
    font-size: 12px;
    color: #6b7280;
    min-width: 32px;
    text-align: right;
}

/* --- 逐轮分析（谈判模块） --- */
.dt-round-analysis {
    margin: 16px 0;
}
.dt-round-analysis h4 {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}
.dt-round-analysis-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.dt-round-analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.dt-round-num {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}
.dt-round-phase {
    font-size: 12px;
    color: #2F88FF;
}
.dt-round-avg {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}
.dt-round-avg.good { background: #dcfce7; color: #166534; }
.dt-round-avg.ok { background: #fef3c7; color: #92400e; }
.dt-round-avg.bad { background: #fee2e2; color: #991b1b; }
.dt-round-analysis-summary {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

/* --- 关键洞察（谈判模块） --- */
.dt-insight-section {
    margin: 16px 0;
}
.dt-insight-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}
.dt-insight-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}
.dt-insight-good {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.dt-insight-improve {
    background: #fefce8;
    border: 1px solid #fef08a;
}
.dt-insight-label {
    font-weight: 600;
    min-width: 60px;
    color: #374151;
}
.dt-insight-value {
    color: #4b5563;
    line-height: 1.4;
}

.dt-final-summary {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
    margin: 16px 0;
}
.dt-restart-btn {
    display: block;
    margin: 16px auto;
    padding: 10px 24px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}
.dt-restart-btn:hover { background: #e5e7eb; }

/* --- 评估框架 --- */
.dt-framework {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.dt-framework h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}
.dt-framework-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.dt-fw-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.dt-fw-weight {
    font-size: 14px;
    font-weight: 700;
    color: #2F88FF;
}
.dt-fw-name {
    font-size: 13px;
    color: #374151;
}

/* --- 资信模块布局 --- */
.dt-credit { padding: 0; }
.dt-credit-main-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
}.dt-credit-sidebar { display: flex; flex-direction: column; gap: 12px; order: 2 }
.dt-credit-main-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- 折叠卡片 --- */
.dt-info-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.dt-info-card.collapsed .dt-info-body {
    display: none;
}
.dt-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.dt-info-header:hover { background: #f3f4f6; }
.dt-collapse-icon {
    font-size: 10px;
    transition: transform 0.2s;
}
.dt-info-card.collapsed .dt-collapse-icon {
    transform: rotate(-90deg);
}
.dt-info-body {
    padding: 12px 14px;
}
.dt-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.dt-info-item {
    display: flex;
    gap: 4px;
    font-size: 13px;
}
.dt-info-label {
    color: #6b7280;
    min-width: 70px;
    flex-shrink: 0;
}
.dt-info-label::after {
    content: '：';
}
.dt-info-value {
    color: #1f2937;
    line-height: 1.4;
}
.dt-full-width {
    grid-column: 1 / -1;
}
.dt-risk-list {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: 13px;
    color: #dc2626;
}
.dt-risk-list li { margin-bottom: 2px; }

/* --- 关键线索面板（资信模块） --- */
.dt-clues-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.dt-clues-header {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.dt-flags-section {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
}
.dt-flags-section:last-child { border-bottom: none; }
.dt-flags-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}
.dt-flags-green { color: #059669; }
.dt-flags-yellow { color: #d97706; }
.dt-flags-red { color: #dc2626; }
.dt-flags-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dt-flags-list li {
    font-size: 13px;
    padding: 3px 0 3px 16px;
    position: relative;
    line-height: 1.4;
    color: #374151;
}
.dt-flag-green li::before {
    content: '+';
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: 700;
}
.dt-flag-yellow li::before {
    content: '?';
    position: absolute;
    left: 0;
    color: #d97706;
    font-weight: 700;
}
.dt-flag-red li::before {
    content: '!';
    position: absolute;
    left: 0;
    color: #dc2626;
    font-weight: 700;
}

/* --- 关键数据点 --- */
.dt-data-points {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 4px;
}
.dt-data-point {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 6px 8px;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}
.dt-dp-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}
.dt-dp-value {
    font-size: 12px;
    font-weight: 600;
    color: #2F88FF;
    text-align: right;
}
.dt-dp-sig {
    grid-column: 1 / -1;
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
}

/* --- 分步引导 --- */
.dt-step-guide {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}
.dt-step-guide h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}
.dt-step-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dt-step-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s;
}
.dt-step-item.active {
    border-color: #2F88FF;
    background: #eff6ff;
}
.dt-step-item.completed {
    border-color: #10b981;
    background: #f0fdf4;
}
.dt-step-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    margin-top: 1px;
}
.dt-step-item.active .dt-step-check {
    border-color: #2F88FF;
    background: #2F88FF;
    box-shadow: inset 0 0 0 3px #fff;
}
.dt-step-item.completed .dt-step-check {
    border-color: #10b981;
    background: #10b981;
}
.dt-step-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.dt-step-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* --- 引导问题 --- */
.dt-guidance-q {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.dt-guidance-q:last-child { border-bottom: none; }
.dt-q-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.dt-q-cat {
    font-size: 11px;
    color: #2F88FF;
    font-weight: 500;
    padding: 1px 6px;
    background: #eff6ff;
    border-radius: 3px;
    flex-shrink: 0;
}
.dt-q-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

/* --- 报告输入区 --- */
.dt-report-area {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
}
.dt-report-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}
.dt-report-hint {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}
.dt-report-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.dt-report-input:focus {
    outline: none;
    border-color: #2F88FF;
    box-shadow: 0 0 0 3px rgba(47,136,255,0.1);
}
.dt-report-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

/* --- 资信评估结果 --- */
.dt-credit-result { padding: 0; }
.dt-grade-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}
.dt-grade-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dt-risk-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.dt-risk-badge.low { background: #dcfce7; color: #166534; }
.dt-risk-badge.medium { background: #fef3c7; color: #92400e; }
.dt-risk-badge.high { background: #fee2e2; color: #991b1b; }
.dt-risk-badge.critical { background: #fecaca; color: #7f1d1d; }

.dt-feedback-section {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.dt-feedback-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
.dt-feedback-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}
.dt-missed-section {
    margin: 16px 0;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}
.dt-missed-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 8px;
}
.dt-missed-section ul {
    padding-left: 16px;
    font-size: 13px;
    color: #7f1d1d;
}
.dt-missed-section li { margin-bottom: 4px; }
.dt-action-section {
    margin: 16px 0;
    padding: 12px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
}
.dt-action-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 8px;
}
.dt-action-section p {
    font-size: 14px;
    color: #1e3a5f;
    line-height: 1.6;
}

/* --- Loading & Error --- */
.dt-loading {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 14px;
}
.dt-error {
    padding: 12px 16px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 14px;
}

/* --- 响应式 --- */
@media (max-width: 900px) {
    .dt-neg-main-layout {
        grid-template-columns: 1fr;
    }
    .dt-context-sidebar {
        order: 2;
    }
    .dt-credit-main-layout {
        grid-template-columns: 1fr;
    }
    .dt-state-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .dt-state-panel {
        grid-template-columns: 1fr;
    }
    .dt-scenario-grid {
        grid-template-columns: 1fr;
    }
}
/* ============================================
   Missing CSS Patch for Deep Training Platform
   Covers: document-workflow, negotiation, credit modules
   ============================================ */

/* === Typing Animation (negotiation) === */
.dt-typing .dt-chat-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}
.dt-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dt-typing-dots span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.dt-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.dt-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.dt-typing-dots span:nth-child(3) { animation-delay: 0s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* === Collapsible Cards (credit) === */
.dt-collapsible {
    cursor: default;
}
.dt-collapsible .dt-info-header {
    cursor: pointer;
    user-select: none;
}
.dt-collapsible.collapsed > .dt-info-body {
    display: none;
}
.dt-collapsible.collapsed .dt-collapse-icon {
    transform: rotate(-90deg);
}
.dt-missed-risk {
    padding: 6px 0 6px 20px;
    position: relative;
    color: #b45309;
    font-size: 13px;
    line-height: 1.5;
}
.dt-missed-risk::before {
    content: '⚠';
    position: absolute;
    left: 0;
    color: #f59e0b;
}

/* === Workflow Container === */
.dt-workflow {
    max-width: 960px;
    margin: 0 auto;
}

/* === Process Flow (mini overview) === */
.dt-process-flow {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.dt-process-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    background: #e2e8f0;
    border-radius: 4px;
    white-space: nowrap;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.dt-process-arrow {
    color: #94a3b8;
    font-size: 14px;
    margin: 0 4px;
    flex-shrink: 0;
}

/* === Workflow Steps (detailed) === */
.dt-flow-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
    flex-shrink: 0;
}
.dt-flow-step-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}
.dt-flow-step-desc {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
.dt-flow-arrow {
    color: #94a3b8;
    font-size: 18px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    flex-shrink: 0;
}

/* === Document Context Card === */
.dt-doc-context-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.dt-context-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.dt-context-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.dt-context-position {
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
}
.dt-context-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.dt-context-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
}
.dt-context-label {
    font-size: 12px;
    color: #64748b;
    min-width: 60px;
    flex-shrink: 0;
}
.dt-context-value {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

/* === Common Mistakes Warning === */
.dt-common-mistakes {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 10px;
    font-size: 13px;
    color: #92400e;
}
.dt-common-mistakes strong {
    display: block;
    margin-bottom: 4px;
}
.dt-common-mistakes ul {
    margin: 4px 0 0 0;
    padding-left: 18px;
}
.dt-common-mistakes li {
    margin-bottom: 2px;
}

/* === Form Card === */
.dt-doc-form {
    margin-bottom: 16px;
}
.dt-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}
.dt-form-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}
.dt-form-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
}
.dt-form-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* === Field Group === */
.dt-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dt-field-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}
.dt-field-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s;
    box-sizing: border-box;
    resize: vertical;
}
.dt-field-input:focus {
    outline: none;
    border-color: #2F88FF;
    box-shadow: 0 0 0 2px rgba(47,136,255,0.12);
}
.dt-auto-hint {
    font-size: 11px;
    color: #2F88FF;
    background: #eff6ff;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 400;
    margin-left: 4px;
}

/* === Field Links === */
.dt-field-links {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #0369a1;
}
.dt-field-links strong {
    display: block;
    margin-bottom: 4px;
}
.dt-field-links ul {
    margin: 0;
    padding-left: 16px;
}
.dt-field-links li {
    margin-bottom: 2px;
}
.dt-link-field {
    font-weight: 600;
    color: #0c4a6e;
}

/* === Action Row === */
.dt-action-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 0;
}
.dt-hint-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.dt-hint-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* === Hint Content === */
.dt-hint-content {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    font-size: 13px;
    color: #1e40af;
}
.dt-hint-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e3a8a;
}
.dt-hint-content p {
    margin: 0 0 8px 0;
}
.dt-hint-content ul {
    margin: 4px 0 0 0;
    padding-left: 18px;
}

/* === Next Doc Button === */
.dt-next-doc-btn {
    padding: 10px 24px;
    background: #2F88FF;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 12px;
}
.dt-next-doc-btn:hover {
    background: #1a6fdb;
}

/* === Review Result === */
.dt-review-result {
    margin: 16px 0;
}
.dt-review-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}
.dt-review-score {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}
.dt-score-big {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}
.dt-review-feedback {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #2F88FF;
}
.dt-review-section {
    margin-top: 16px;
}
.dt-review-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}
.dt-review-section ul {
    margin: 0;
    padding-left: 18px;
}
.dt-review-section li {
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.5;
}

/* === Error Items === */
.dt-error-item {
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin-bottom: 8px;
}
.dt-error-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-right: 8px;
}
.dt-error-badge.error-critical {
    background: #dc2626;
    color: #fff;
}
.dt-error-badge.error-warning {
    background: #f59e0b;
    color: #fff;
}
.dt-error-badge.error-info {
    background: #3b82f6;
    color: #fff;
}
.dt-error-field {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
}
.dt-error-msg {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #6b7280;
}
.dt-correct {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #059669;
    font-weight: 500;
}

/* === Cross Check Items === */
.dt-cross-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}
.dt-cross-item.cross-pass {
    background: #f0fdf4;
    color: #166534;
}
.dt-cross-item.cross-fail {
    background: #fef2f2;
    color: #991b1b;
}
.dt-cross-status {
    font-weight: 700;
    flex-shrink: 0;
}
.dt-cross-tip {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* === Final Audit Report === */
.dt-final-audit {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}
.dt-audit-report {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
}
.dt-audit-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
}
.dt-audit-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}
.dt-audit-grade {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
}
.dt-audit-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.dt-audit-stat {
    text-align: center;
}
.dt-audit-stat-num {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}
.dt-audit-stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.dt-audit-process {
    margin-bottom: 16px;
}
.dt-audit-doc-list {
    display: grid;
    gap: 12px;
}
.dt-audit-doc-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.dt-audit-breakdown {
    margin-top: 16px;
}
.dt-audit-breakdown h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1e293b;
}

/* === Trade Info & Doc Count === */
.dt-trade-info {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}
.dt-doc-count {
    font-size: 12px;
    color: #64748b;
}

/* === Score Breakdown in Review === */
.dt-score-doc,
.dt-score-errs {
    font-size: 13px;
    color: #64748b;
}
.dt-score-val {
    font-weight: 600;
    color: #1e293b;
}

/* === Process Preview (scenario select) === */
.dt-process-preview {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* === Score Label === */
.dt-score-label {
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
}

/* ============================================
   State Classes Patch (done/active/done for workflow)
   ============================================ */

/* === Done state for flow steps (document-workflow uses 'done' instead of 'completed') === */
.dt-flow-step.done .dt-flow-dot {
    background: #10b981;
    color: #fff;
}
.dt-flow-step.done .dt-flow-name {
    color: #10b981;
}
.dt-flow-step.done .dt-flow-step-num {
    background: #10b981;
    color: #fff;
}
.dt-flow-step.done .dt-flow-step-name {
    color: #10b981;
}

/* === Active state for flow-step-num (document-workflow) === */
.dt-flow-step.active .dt-flow-step-num {
    background: #2F88FF;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(47,136,255,0.2);
}
.dt-flow-step.active .dt-flow-step-name {
    color: #2F88FF;
    font-weight: 600;
}
.dt-flow-step.active .dt-flow-step-desc {
    color: #2F88FF;
}

/* === Done state for audit doc items === */
.dt-audit-doc-item.done {
    background: #f0fdf4;
    border-color: #86efac;
}
.dt-audit-doc-item.done::before {
    content: '\2713';
    color: #10b981;
    font-weight: 700;
    font-size: 16px;
    margin-right: 4px;
}

/* === Score item states === */
.dt-score-item.good {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.dt-score-item.ok {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.dt-score-item.bad {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* === Progress fill colors === */
.dt-progress-fill.satisfaction { background: #10b981; }
.dt-progress-fill.trust { background: #3b82f6; }
.dt-progress-fill.patience { background: #f59e0b; }
.dt-progress-fill.deal { background: #8b5cf6; }

/* === Round average colors === */
.dt-round-avg.good { color: #10b981; }
.dt-round-avg.ok { color: #f59e0b; }
.dt-round-avg.bad { color: #ef4444; }

/* === Step item states (credit module step guide) === */
.dt-step-item.done .dt-step-check {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}
.dt-step-item.done .dt-step-check::after {
    content: '\2713';
}
.dt-step-item.done .dt-step-name {
    color: #10b981;
}

/* ============================================================
   v3 - 文档预览/历史记录/限时模式 样式补丁
   ============================================================ */

/* 文档预览 */
.dt-doc-preview-section { margin-top: 24px; }
.dt-doc-preview-section h4 { font-size: 15px; font-weight: 600; color: #0f172a; margin: 0 0 12px; }
.dt-preview-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.dt-preview-tab {
    padding: 6px 14px; border: 1px solid #e2e8f0; border-radius: 6px;
    background: #fff; cursor: pointer; font-size: 12px; color: #64748b;
    transition: all 0.15s;
}
.dt-preview-tab:hover { border-color: #2F88FF; color: #2F88FF; }
.dt-preview-tab.active { background: #2F88FF; color: #fff; border-color: #2F88FF; }
.dt-doc-preview-card {
    border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden;
    background: #fff;
}
.dt-doc-preview-header {
    background: #f8fafc; padding: 16px 20px; border-bottom: 1px solid #e2e8f0;
}
.dt-doc-preview-title { font-size: 16px; font-weight: 700; color: #0f172a; }
.dt-doc-preview-trade { font-size: 12px; color: #64748b; margin-top: 4px; }
.dt-preview-table { width: 100%; border-collapse: collapse; }
.dt-preview-table tr { border-bottom: 1px solid #f1f5f9; }
.dt-preview-table tr:last-child { border-bottom: none; }
.dt-preview-label {
    padding: 10px 20px; font-size: 13px; color: #64748b;
    width: 180px; vertical-align: top; background: #fafbfc;
}
.dt-preview-value {
    padding: 10px 20px; font-size: 13px; color: #0f172a;
    font-weight: 500;
}

/* 限时模式计时器 */
#dt-timer-display {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 18px; font-weight: 700;
    padding: 4px 12px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 6px;
    min-width: 80px; text-align: center;
}

/* 历史记录按钮 */
.dt-history-btn {
    padding: 6px 16px; border: 1px solid #e2e8f0; border-radius: 6px;
    background: #fff; cursor: pointer; font-size: 13px; color: #64748b;
    transition: all 0.15s;
}
.dt-history-btn:hover { border-color: #2F88FF; color: #2F88FF; }

/* 缺失类补充 */
.dt-hint-box {
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
    padding: 20px; margin: 16px 0; text-align: center;
}
.dt-hint-box h4 { margin: 0 0 8px; font-size: 16px; color: #1e40af; }
.dt-hint-box p { margin: 0 0 12px; font-size: 14px; color: #64748b; }

.dt-history-list { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.dt-history-empty { text-align: center; padding: 40px; color: #94a3b8; }
.dt-history-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.dt-history-item:hover { background: #f8fafc; }
.dt-history-item:last-child { border-bottom: none; }

.dt-timer-toggle {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: #64748b; cursor: pointer;
}

.dt-history-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
.dt-timer-display {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 18px; font-weight: 700;
    padding: 4px 12px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 6px;
    min-width: 80px; text-align: center;
}

/* ============================================
   Enhanced Mobile Responsive (2026-07-25 v2)
   ============================================ */

/* === Tablet improvements (<=900px) === */
@media (max-width: 900px) {
    .dt-doc-form-container {
        padding: 16px;
    }
    .dt-chat-messages {
        min-height: 300px;
    }
}

/* === Mobile (<=600px) - Comprehensive === */
@media (max-width: 600px) {
    /* Layout */
    .dt-neg-main-layout,
    .dt-credit-main-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .dt-context-sidebar,
    .dt-credit-sidebar {
        order: 2;
    }

    /* Page header */
    .dt-page-header {
        padding: 20px 16px;
    }
    .dt-page-title {
        font-size: 22px;
    }
    .dt-page-desc {
        font-size: 14px;
    }

    /* Scenario cards */
    .dt-scenario-card {
        padding: 16px;
        margin-bottom: 12px;
    }
    .dt-scenario-title {
        font-size: 16px;
    }
    .dt-scenario-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Chat */
    .dt-chat-messages {
        min-height: 250px;
        max-height: 400px;
        padding: 12px;
    }
    .dt-chat-bubble {
        max-width: 90%;
        font-size: 14px;
        padding: 10px 14px;
    }
    .dt-chat-input-area {
        padding: 12px;
    }
    .dt-chat-input {
        font-size: 15px;
        min-height: 44px;
    }
    .dt-chat-send-btn {
        min-width: 80px;
        min-height: 44px;
    }

    /* Document form */
    .dt-doc-form-container {
        padding: 12px;
    }
    .dt-doc-form-table {
        display: block;
        overflow-x: auto;
    }
    .dt-doc-form-table th,
    .dt-doc-form-table td {
        min-width: 120px;
        font-size: 13px;
    }

    /* Score display */
    .dt-score-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    .dt-score-item {
        font-size: 12px;
        padding: 4px 8px;
    }
    .dt-total-score {
        font-size: 20px;
    }

    /* Buttons - touch friendly */
    .dt-btn-primary,
    .dt-btn-secondary {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 44px;
    }

    /* State meters */
    .dt-state-meter-bar {
        height: 8px;
    }
    .dt-state-label {
        font-size: 12px;
    }

    /* Credit sidebar */
    .dt-credit-sidebar {
        padding: 12px;
    }
    .dt-credit-clue-item {
        font-size: 13px;
        padding: 8px;
    }

    /* History modal */
    .dt-history-modal-content {
        width: 95vw;
        max-width: none;
        max-height: 80vh;
        margin: 5vh auto;
    }
    .dt-history-table th,
    .dt-history-table td {
        font-size: 12px;
        padding: 6px 8px;
    }

    /* Preview tabs */
    .dt-preview-tabs {
        flex-wrap: wrap;
    }
    .dt-preview-tab {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Timer */
    .dt-timer-display {
        font-size: 14px;
    }

    /* Report */
    .dt-report-section {
        padding: 16px;
    }
    .dt-feedback-text {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* === Small mobile (<=400px) === */
@media (max-width: 400px) {
    .dt-page-title {
        font-size: 18px;
    }
    .dt-scenario-card {
        padding: 12px;
    }
    .dt-chat-bubble {
        max-width: 95%;
        font-size: 13px;
    }
    .dt-score-item {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* === Touch-friendly (any device with touch) === */
@media (hover: none) and (pointer: coarse) {
    .dt-btn-primary,
    .dt-btn-secondary,
    .dt-scenario-card,
    .dt-history-btn,
    .dt-preview-tab,
    .dt-doc-submit-btn,
    .dt-chat-send-btn,
    .dt-export-btn {
        min-height: 44px;
        min-width: 44px;
    }
    input[type="text"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px;
    }
}

/* === Export Button === */
.dt-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #2F88FF;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s;
}
.dt-export-btn:hover {
    background: #1a6fd4;
}
.dt-export-btn:active {
    background: #1560b8;
}


/* ==================== LOADING SKELETON ==================== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}
.skeleton-title {
  height: 20px;
  margin-bottom: 12px;
  width: 40%;
}
.skeleton-card {
  height: 120px;
  margin-bottom: 12px;
}
.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #2F88FF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Email Writing Training Module Styles
   ============================================ */
.ew-wrapper { padding: 0 0 40px; }

.ew-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 20px;
}
.ew-header-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}
.ew-header-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}
.ew-header-stats {
  display: flex;
  gap: 24px;
}
.ew-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}
.ew-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #2F88FF;
}
.ew-stat-label {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Layout */
.ew-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

/* Sidebar */
.ew-sidebar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.ew-sidebar-title {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 16px 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 8px;
}
.ew-scene-group { margin-bottom: 2px; }
.ew-scene-group.active .ew-scene-header { background: #f0f7ff; }
.ew-scene-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
}
.ew-scene-header:hover { background: #f8fafc; }
.ew-scene-arrow {
  flex-shrink: 0;
  color: #94a3b8;
  display: flex;
  align-items: center;
}
.ew-scene-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}
.ew-scene-badge {
  font-size: 11px;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 10px;
}
.ew-scene-items { padding: 2px 0 8px; }
.ew-exercise-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 16px 8px 32px;
  cursor: pointer;
  transition: background 0.15s;
}
.ew-exercise-item:hover { background: #f8fafc; }
.ew-exercise-item.selected { background: #eff6ff; }
.ew-exercise-item.completed .ew-item-title { color: #64748b; }
.ew-item-status {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.ew-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}
.ew-item-title {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.4;
}
.ew-item-score {
  font-size: 11px;
  color: #2F88FF;
  font-weight: 500;
  margin-top: 2px;
}

/* Main area */
.ew-main { min-width: 0; }

/* Task section */
.ew-task-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.ew-task-header { margin-bottom: 16px; }
.ew-task-scene-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #2F88FF;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.ew-task-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.ew-task-bg {
  background: #f8fafc;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.ew-task-bg-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ew-task-bg p {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.6;
  margin: 0;
}
.ew-task-reqs { margin-top: 0; }
.ew-task-reqs-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ew-task-reqs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.ew-task-reqs li {
  font-size: 13px;
  color: #475569;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}
.ew-task-reqs li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2F88FF;
}

/* Editor layout */
.ew-editor-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  align-items: start;
}

/* Editor column */
.ew-editor-col {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.ew-editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
}
.ew-word-count {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}
.ew-editor-actions {
  display: flex;
  gap: 8px;
}
.ew-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.ew-btn-primary {
  background: #2F88FF;
  color: #fff;
}
.ew-btn-primary:hover { background: #1a6fe0; }
.ew-btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.ew-btn-secondary:hover { background: #e2e8f0; }

.ew-textarea {
  width: 100%;
  min-height: 400px;
  padding: 20px 24px;
  border: none;
  outline: none;
  resize: vertical;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
}
.ew-textarea::placeholder {
  color: #cbd5e1;
  line-height: 1.8;
}
.ew-textarea:focus {
  box-shadow: inset 0 0 0 2px #2F88FF20;
}

/* Checklist */
.ew-checklist {
  padding: 14px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.ew-checklist-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}
.ew-checklist-hint {
  font-weight: 400;
  color: #94a3b8;
  font-size: 11px;
}
.ew-checklist-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.ew-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  padding: 3px 0;
}
.ew-check-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid #cbd5e1;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ew-check-item.passed .ew-check-box {
  background: #22c55e;
  border-color: #22c55e;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.ew-check-item.passed span { color: #16a34a; }

/* Tools column */
.ew-tools-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ew-tool-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.ew-tool-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  transition: background 0.15s;
}
.ew-tool-panel-header:hover { background: #f8fafc; }
.ew-panel-arrow { transition: transform 0.2s; transform: rotate(-90deg); }
.ew-tool-count {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
}
.ew-tool-panel-body {
  padding: 0 14px 14px;
  max-height: 300px;
  overflow-y: auto;
}

/* Template */
.ew-template-content { }
.ew-tpl-item {
  margin-bottom: 10px;
}
.ew-tpl-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  display: block;
  margin-bottom: 3px;
}
.ew-tpl-item code {
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1.5;
  display: block;
  word-break: break-word;
  font-family: inherit;
}

/* Phrases */
.ew-phrases-list { display: flex; flex-direction: column; gap: 6px; }
.ew-phrase-item {
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.ew-phrase-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.ew-phrase-zh {
  font-size: 12px;
  color: #475569;
  margin-bottom: 2px;
}
.ew-phrase-en {
  font-size: 11.5px;
  color: #2F88FF;
  font-weight: 500;
}

/* Quick refs */
.ew-quick-refs { }
.ew-qr-group { margin-bottom: 10px; }
.ew-qr-title {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 4px;
}
.ew-qr-item {
  font-size: 12px;
  color: #475569;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.ew-qr-item:hover {
  background: #eff6ff;
  color: #2F88FF;
}

/* Score result */
.ew-score-result {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 24px;
  margin-top: 16px;
}
.ew-score-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.ew-score-total {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}
.ew-score-total-label {
  font-size: 16px;
  font-weight: 400;
  color: #94a3b8;
}
.ew-score-feedback {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
}
.ew-score-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.ew-score-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ew-score-bar-label {
  font-size: 12px;
  color: #64748b;
  width: 60px;
  flex-shrink: 0;
  text-align: right;
}
.ew-score-bar-track {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}
.ew-score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.ew-score-bar-val {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
  width: 40px;
  flex-shrink: 0;
}
.ew-score-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
}
.ew-score-suggestions {
  margin-top: 12px;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
}
.ew-sug-title {
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 6px;
}
.ew-score-suggestions ul {
  margin: 0;
  padding: 0 0 0 16px;
}
.ew-score-suggestions li {
  font-size: 12px;
  color: #78350f;
  line-height: 1.6;
  margin-bottom: 2px;
}

/* Welcome */
.ew-welcome {
  text-align: center;
  padding: 40px 20px;
}
.ew-welcome-icon {
  margin-bottom: 16px;
}
.ew-welcome h3 {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 8px;
}
.ew-welcome > p {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 28px;
}
.ew-scene-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 700px;
  margin: 0 auto;
}
.ew-scene-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
.ew-scene-card:hover {
  border-color: #2F88FF;
  box-shadow: 0 2px 8px rgba(47,136,255,0.08);
}
.ew-scene-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}
.ew-scene-card-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 8px;
}
.ew-scene-card-count {
  font-size: 11px;
  color: #2F88FF;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
  .ew-layout { grid-template-columns: 1fr; }
  .ew-sidebar { position: static; max-height: none; }
  .ew-editor-layout { grid-template-columns: 1fr; }
  .ew-tools-col { order: -1; }
  .ew-scene-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ew-header-bar { flex-direction: column; gap: 16px; align-items: flex-start; }
  .ew-task-reqs ul { grid-template-columns: 1fr; }
  .ew-scene-cards { grid-template-columns: 1fr; }
  .ew-checklist-items { grid-template-columns: 1fr; }
}
