* {
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

.admin-link {
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 16px;
}

.admin-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════
   名师选择器
═══════════════════════════════════════ */
.master-selection {
    margin-bottom: 20px;
}

.master-selection-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.master-selection-title {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.master-selection-hint {
    font-size: 0.85em;
    color: #888;
}

.master-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.master-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
    background: #fafafa;
    position: relative;
    min-width: 160px;
}

.master-card:hover {
    border-color: #667eea;
    background: #f5f6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.master-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f3ff 0%, #f5f0ff 100%);
    box-shadow: 0 4px 12px rgba(102,126,234,0.2);
}

.master-avatar {
    font-size: 1.6em;
    flex-shrink: 0;
}

.master-info {
    flex: 1;
    min-width: 0;
}

.master-name {
    font-weight: 600;
    font-size: 0.9em;
    color: #222;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
}

.master-method {
    font-size: 0.75em;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.master-badge {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 20px;
    background: #e8e8e8;
    color: #888;
    flex-shrink: 0;
    transition: all 0.2s;
}

.master-badge.active-badge {
    background: #667eea;
    color: white;
}

.master-card .expertise-tag {
    font-size: 0.72em;
    color: #667eea;
    background: #eef1ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
}

.master-card.recommended {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35);
    animation: recommendPulse 2s ease-in-out infinite;
}

@keyframes recommendPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35); }
    50% { box-shadow: 0 4px 30px rgba(102, 126, 234, 0.5); }
}

/* AI 推荐提示 */
.recommendation-toast {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.95em;
    line-height: 1.6;
    animation: slideIn 0.3s ease-out;
}

.recommendation-toast strong {
    color: #ffd700;
}

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

/* ═══════════════════════════════════════
   智能匹配确认弹窗
═══════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.match-confirmation-modal {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
    width: 90%;
    max-width: 480px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.match-confirmation-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.match-confirmation-modal .modal-icon {
    font-size: 1.8em;
}

.match-confirmation-modal .modal-title {
    font-size: 1.2em;
    font-weight: 600;
}

.match-confirmation-modal .modal-body {
    padding: 24px;
}

.match-confirmation-modal .matched-master {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f2ff 0%, #e8eaff 100%);
    border-radius: 12px;
    margin-bottom: 16px;
}

.match-confirmation-modal .master-avatar-large {
    font-size: 3em;
    line-height: 1;
}

.match-confirmation-modal .master-details {
    flex: 1;
}

.match-confirmation-modal .master-name-large {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.match-confirmation-modal .master-method-large {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 6px;
}

.match-confirmation-modal .expertise-tag-large {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8em;
}

.match-confirmation-modal .match-reason {
    font-size: 0.95em;
    color: #444;
    line-height: 1.6;
    margin-bottom: 12px;
}

.match-confirmation-modal .match-stage {
    font-size: 0.9em;
    color: #666;
}

.match-confirmation-modal .modal-footer {
    padding: 16px 24px 24px;
}

.match-confirmation-modal .countdown-hint {
    text-align: center;
    color: #888;
    font-size: 0.85em;
    margin-bottom: 12px;
}

.match-confirmation-modal .modal-buttons {
    display: flex;
    gap: 12px;
}

.match-confirmation-modal .modal-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.match-confirmation-modal .modal-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.match-confirmation-modal .modal-btn-cancel:hover {
    background: #e0e0e0;
}

.match-confirmation-modal .modal-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.match-confirmation-modal .modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.match-confirmation-modal .countdown-bar {
    height: 4px;
    background: #e0e0e0;
}

.match-confirmation-modal .countdown-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* ═══════════════════════════════════════
   Tab 与输入区
═══════════════════════════════════════ */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

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

#conversation-input {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 15px;
}

#industry-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.primary-btn {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.primary-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.primary-btn:disabled {
    background: #b0b8f0;
    cursor: not-allowed;
    transform: none;
}

.upload-area {
    border: 3px dashed #ccc;
    border-radius: 8px;
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

/* ═══════════════════════════════════════
   结果区
═══════════════════════════════════════ */
.results-section {
    margin-top: 40px;
}

/* 当前名师标记 */
.result-master-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.card {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.card h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.closing-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
}

.rate-value {
    font-size: 2.5em;
    font-weight: bold;
}

.rate-value.high { color: #10b981; }
.rate-value.medium { color: #f59e0b; }
.rate-value.low { color: #ef4444; }

.power-dynamics, .subtext {
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* ── 三大诊断模块 ── */
.card-diagnosis {
    background: linear-gradient(135deg, #fff7f0 0%, #fff0f8 100%);
    border: 1px solid #fde0cc;
}

.card-diagnosis h2 {
    color: #e06030;
}

.diagnosis-block {
    background: white;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 14px;
    border-left: 4px solid #ccc;
}

.diagnosis-block:last-child {
    margin-bottom: 0;
}

.diagnosis-block.thinking {
    border-left-color: #ef4444;
}

.diagnosis-block.method {
    border-left-color: #f59e0b;
}

.diagnosis-block.master-script {
    border-left-color: #667eea;
    background: #f8f9ff;
}

.diagnosis-label {
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-bottom: 8px;
}

.diagnosis-block.thinking .diagnosis-label  { color: #ef4444; }
.diagnosis-block.method   .diagnosis-label  { color: #f59e0b; }
.diagnosis-block.master-script .diagnosis-label { color: #667eea; }

.diagnosis-content {
    font-size: 1em;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
}

/* ── 其他结果卡片 ── */
#mistakes-list {
    list-style: none;
}

#mistakes-list li {
    padding: 12px;
    background: white;
    border-left: 4px solid #ef4444;
    margin-bottom: 10px;
    border-radius: 4px;
}

.script-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.script-card h3 {
    margin-bottom: 10px;
    color: #667eea;
}

.copy-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #059669;
}

.scenario-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.tool-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* ── 复制提示 Toast ── */
.copy-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    animation: fadeInOut 1.5s forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes fadeInOut {
    0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
    20%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    80%  { opacity: 1; }
    100% { opacity: 0; }
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

.admin-link {
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 16px;
}

.admin-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

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

#conversation-input {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 15px;
}

#industry-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}
