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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* ========== 顶栏 ========== */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.brand h1 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}
.brand .subtitle {
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.88;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}
.nav-tab {
    background: transparent;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    opacity: 0.85;
}
.nav-tab:hover { opacity: 1; background: rgba(255,255,255,0.12); }
.nav-tab.active {
    background: white;
    color: #667eea;
    opacity: 1;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    font-size: 14px;
}
.loading-user { opacity: 0.8; }
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.user-name { font-weight: 500; }
.user-role-badge {
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    font-size: 12px;
}
.btn-user-action {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.btn-user-action:hover { background: rgba(255,255,255,0.32); }

/* ========== 主体布局 ========== */
main { padding: 24px; max-width: 1400px; margin: 0 auto; }

.view-container { min-height: calc(100vh - 140px); }

.container {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    min-height: calc(100vh - 160px);
}

.panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.panel h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: #1a1a2e; }
.panel h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #1a1a2e; }

/* ========== 策略列表 ========== */
.strategy-list { display: flex; flex-direction: column; gap: 10px; }
.strategy-card {
    padding: 14px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.strategy-card:hover { border-color: #667eea; background: #f8f9ff; transform: translateY(-1px); }
.strategy-card.active {
    border-color: #667eea;
    background: #f0f3ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.strategy-card .name { font-weight: 600; font-size: 15px; color: #333; display: flex; align-items: center; gap: 6px; }
.strategy-card .desc { font-size: 13px; color: #666; margin-top: 4px; line-height: 1.5; }

/* ========== 表单 ========== */
.input-form { margin-top: 22px; border-top: 1px solid #eee; padding-top: 20px; }
.input-form h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #1a1a2e; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #444; }
.form-group .hint { font-size: 12px; color: #888; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background: white;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-group textarea { min-height: 80px; resize: vertical; }

.mode-switch {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #e0e6ff;
}
.mode-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; cursor: pointer; color: #555;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-primary:hover { opacity: 0.93; box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* ========== 结果区 ========== */
.result-area { min-height: 400px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-right-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-right-header h2 { margin-bottom: 0; }

.placeholder {
    display: flex; align-items: center; justify-content: center;
    min-height: 300px; color: #999; font-size: 14px;
}

.loading-spinner {
    display: flex; align-items: center; justify-content: center;
    min-height: 300px; flex-direction: column; gap: 16px;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid #e8e8e8;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 流式输出的光标效果 */
.stream-text-block {
    padding: 16px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #e0e6ff;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 16px;
    min-height: 140px;
}
.stream-cursor::after {
    content: "▋";
    color: #667eea;
    margin-left: 2px;
    animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.result-section { margin-bottom: 20px; }
.result-section h3 {
    font-size: 15px; font-weight: 600; color: #1a1a2e;
    margin-bottom: 10px; padding-bottom: 6px;
    border-bottom: 2px solid #667eea;
}

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-card {
    padding: 14px; border-radius: 10px;
    background: #f8f9ff; border-left: 4px solid #667eea;
}
.result-card.strengths { border-left-color: #52c41a; background: #f6ffed; }
.result-card.weaknesses { border-left-color: #faad14; background: #fffbe6; }
.result-card.opportunities { border-left-color: #1890ff; background: #e6f7ff; }
.result-card.threats { border-left-color: #ff4d4f; background: #fff2f0; }
.result-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #555; }
.result-card ul { list-style: none; padding: 0; }
.result-card li { font-size: 13px; padding: 4px 0; color: #444; line-height: 1.55; }
.result-card li::before { content: "• "; font-weight: bold; }

.result-summary {
    padding: 16px; background: #f8f9ff; border-radius: 10px;
    font-size: 14px; line-height: 1.8; color: #333;
}
.result-recommendations {
    padding: 16px;
    background: linear-gradient(135deg, #f0f3ff 0%, #f8f0ff 100%);
    border-radius: 10px;
}
.result-recommendations li { font-size: 14px; padding: 6px 0; line-height: 1.65; }

/* ========== 表格：风险 / 方案对比 / 成本收益 ========== */
.risk-table, .compare-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}
.risk-table th, .risk-table td,
.compare-table th, .compare-table td {
    padding: 10px 12px; text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.risk-table thead, .compare-table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
.risk-table th, .compare-table th { font-weight: 600; }
.risk-table tbody tr:hover, .compare-table tbody tr:hover { background: #fafbff; }

.compare-table th, .compare-table td { text-align: center; }

.badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 12px; font-size: 12px; font-weight: 500;
}
.badge-high { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.badge-medium { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.badge-low { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-very-high { background: #7f0000; color: #fff; }

.score-bar {
    display: inline-block; height: 8px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px; min-width: 20px;
}

.error-message {
    padding: 14px 16px; background: #fff2f0;
    border: 1px solid #ffccc7; border-radius: 10px;
    color: #ff4d4f; font-size: 14px; line-height: 1.6;
}

/* ========== 深度分析 ========== */
.deep-chain-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deep-chain-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, #e0e7ff, #f0e7ff);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    margin-bottom: 4px;
}
.deep-chain-header h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: #4338ca;
}
.deep-chain-header .deep-chain-desc {
    margin: 0;
    font-size: 13px;
    color: #6366f1;
}

.deep-round-block {
    border: 1px solid #e6e0f7;
    border-left: 4px solid #7c3aed;
    border-radius: 12px;
    background: #fbfaff;
    overflow: hidden;
}

.deep-round-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f3e8ff, #ede9fe);
    border-bottom: 1px solid #e9d5ff;
    flex-wrap: wrap;
}

.deep-round-badge {
    display: inline-block;
    padding: 4px 14px;
    background: #7c3aed;
    color: #fff;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
}
.deep-round-badge.deep-badge-root {
    background: linear-gradient(135deg, #059669, #10b981);
}
.deep-round-time {
    font-size: 12px;
    color: #7c3aed;
}
.deep-round-status {
    font-size: 12px;
    color: #888;
    padding: 2px 10px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.deep-round-status.deep-status-ok { color: #10b981; border-color: #a7f3d0; background: #ecfdf5; }
.deep-round-status.deep-status-fail { color: #ef4444; border-color: #fecaca; background: #fef2f2; }

.deep-round-body {
    padding: 16px;
}
.deep-round-body .result-section { margin-bottom: 14px; }
.deep-round-meta {
    padding: 10px 14px;
    background: #fff;
    border: 1px dashed #d8b4fe;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b21a8;
    line-height: 1.7;
}

/* 触发器（按钮 + 输入面板） */
.deep-trigger-wrap {
    border: 2px dashed #c4b5fd;
    border-radius: 12px;
    background: #faf5ff;
    padding: 14px;
}
.deep-trigger-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-deep-toggle {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}
.btn-deep-toggle:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35); }
.btn-deep-toggle.active { background: linear-gradient(135deg, #5b21b6, #4c1d95); }
.deep-trigger-hint {
    font-size: 13px;
    color: #7c3aed;
}

.deep-input-panel {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #ddd6fe;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.deep-input-row { display: flex; flex-direction: column; gap: 6px; }
.deep-label {
    font-size: 13px;
    font-weight: 600;
    color: #4c1d95;
}
.deep-supplemental {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}
.deep-supplemental:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
.deep-file-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.deep-file-input {
    font-size: 13px;
    flex: 1;
    min-width: 200px;
}
.deep-file-name {
    font-size: 13px;
    color: #6d28d9;
    font-weight: 500;
}
.deep-file-clear {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.deep-input-options {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.btn-deep-start {
    background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
}
.btn-deep-start:disabled { opacity: 0.6; cursor: not-allowed; }

/* 深度分析三栏细化卡片 */
.deep-grid { grid-template-columns: repeat(3, 1fr) !important; }
.deep-card {
    border-left: 4px solid #7c3aed;
    background: #faf5ff;
    border-radius: 8px;
    padding: 12px;
}
.deep-card.deep-validated { border-left-color: #10b981; background: #ecfdf5; }
.deep-card.deep-corrected { border-left-color: #ef4444; background: #fef2f2; }
.deep-card.deep-deepened { border-left-color: #7c3aed; background: #faf5ff; }

/* 跨策略深化徽章 */
.deep-round-badge.deep-badge-cross {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}
.deep-input-strategy-row {
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
}
.deep-input-strategy-row .deep-label {
    color: #0369a1;
}
.deep-next-strategy {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #0c4a6e;
    cursor: pointer;
}
.deep-next-strategy:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.deep-strategy-hint {
    font-size: 12px;
    color: #0284c7;
    line-height: 1.5;
}

/* 分析链可视化（树图）容器 */
.deep-chain-viz-box {
    margin: 12px 0 4px 0;
    padding: 12px;
    background: linear-gradient(135deg, #f5f3ff, #ecfeff);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
}
.chain-viz-chart {
    width: 100%;
    height: 280px;
    min-height: 220px;
}

.deep-confidence .result-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.deep-stream-text {
    max-height: 320px;
    overflow-y: auto;
    background: #1e1b2e;
    color: #e0e7ff;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    font-family: "Consolas", "Monaco", monospace;
}

/* 历史记录中的深度分析标记 */
.strategy-tag-deep {
    background: #7c3aed !important;
    color: #fff !important;
    border: 1px solid #6d28d9 !important;
}
.history-round-badge {
    display: inline-block;
    padding: 1px 8px;
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
}

@media (max-width: 900px) {
    .deep-grid { grid-template-columns: 1fr !important; }
    .deep-input-options { flex-direction: column; align-items: stretch; }
    .deep-input-options .btn-primary { width: 100%; }
}

/* ========== 响应式 ========== */
@media (max-width: 1000px) {
    .container { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; align-items: flex-start; }
}

/* ========== 历史记录弹窗 ========== */
.btn-secondary {
    padding: 8px 14px;
    background: white;
    color: #667eea;
    border: 1px solid #d0d8ff;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.btn-secondary:hover:not(:disabled) { background: #f0f3ff; border-color: #667eea; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; color: #bbb; border-color: #eee; }

.modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.modal-content {
    position: relative; background: white; border-radius: 14px;
    width: 90%; max-width: 700px; max-height: 82vh; overflow-y: auto;
    padding: 24px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.22s ease-out;
}
.modal-large { max-width: 880px; }
.modal-small { max-width: 440px; }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px; padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.modal-header h2 { font-size: 18px; font-weight: 600; color: #1a1a2e; }
.modal-close {
    background: none; border: none; font-size: 26px; cursor: pointer;
    color: #999; padding: 2px 10px; line-height: 1; border-radius: 6px;
}
.modal-close:hover { color: #333; background: #f5f5f5; }

.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border: 1px solid #e8e8e8; border-radius: 10px;
    cursor: pointer; transition: all 0.2s;
}
.history-item:hover { border-color: #667eea; background: #f8f9ff; }
.history-item .info { flex: 1; min-width: 0; }
.history-item .info .strategy-tag {
    display: inline-block; padding: 2px 10px;
    background: #f0f3ff; color: #667eea; border-radius: 12px;
    font-size: 12px; font-weight: 500; margin-right: 8px;
}
.history-item .info .summary { font-size: 13px; color: #555; margin-top: 4px; }
.history-item .time { font-size: 12px; color: #999; white-space: nowrap; margin-left: 12px; }
.history-item .actions { margin-left: 12px; display: flex; gap: 4px; }
.btn-delete, .btn-edit {
    background: none; border: none; cursor: pointer;
    font-size: 16px; padding: 4px 8px; border-radius: 6px;
    color: #bbb; transition: all 0.15s;
}
.btn-delete:hover { color: #ff4d4f; background: #fff2f0; }
.btn-edit:hover { color: #667eea; background: #f0f3ff; }
.history-empty { text-align: center; padding: 48px 24px; color: #999; font-size: 14px; }

.record-saved {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; background: #f6ffed; border: 1px solid #b7eb8f;
    border-radius: 10px; font-size: 13px; color: #389e0d;
    margin-bottom: 16px;
}

/* ========== 文件上传 ========== */
.file-input-section {
    margin-bottom: 16px; border: 1px solid #e8e8e8;
    border-radius: 10px; overflow: hidden;
}
.file-tabs { display: flex; border-bottom: 1px solid #e8e8e8; }
.file-tab {
    flex: 1; padding: 8px 12px; background: #fafafa;
    border: none; cursor: pointer; font-size: 13px;
    color: #666; transition: all 0.2s;
}
.file-tab.active {
    background: white; color: #667eea; font-weight: 600;
    border-bottom: 2px solid #667eea;
}
.file-tab-content { padding: 12px; }
.upload-area { position: relative; min-height: 80px; }
.file-input-hidden {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0;
    opacity: 0; cursor: pointer; z-index: 2;
}
.upload-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; border: 2px dashed #ddd; border-radius: 10px;
    color: #999; text-align: center; transition: border-color 0.2s;
}
.upload-placeholder:hover { border-color: #667eea; }
.upload-placeholder p { margin: 4px 0; font-size: 13px; }
.upload-placeholder .hint { font-size: 12px; color: #bbb; }
.upload-preview {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: #f0f3ff; border-radius: 8px; font-size: 13px;
}
.upload-preview .file-name { font-weight: 500; color: #333; }
.upload-preview .file-size { color: #999; font-size: 12px; }
.btn-remove-file {
    margin-left: auto; background: none; border: none;
    color: #999; cursor: pointer; font-size: 20px; padding: 0 6px;
}
.btn-remove-file:hover { color: #ff4d4f; }

.browse-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.btn-browse-nav {
    padding: 4px 10px; background: #f0f3ff; border: 1px solid #d0d8ff;
    border-radius: 6px; cursor: pointer; font-size: 12px; color: #667eea;
}
.btn-browse-nav:hover { background: #e0e6ff; }
.browse-path { font-size: 12px; color: #999; }
.file-browser { max-height: 200px; overflow-y: auto; }
.file-browser-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-bottom: 1px solid #f0f0f0;
    cursor: pointer; font-size: 13px; transition: background 0.15s;
}
.file-browser-item:hover { background: #f8f9ff; }
.file-browser-item .item-icon { margin-right: 8px; font-size: 14px; }
.file-browser-item .item-name { flex: 1; color: #333; }
.file-browser-item .item-size { color: #bbb; font-size: 12px; }
.file-browser-item.selected { background: #f0f3ff; border-left: 3px solid #667eea; }
.file-browser-empty { padding: 20px; text-align: center; color: #999; font-size: 13px; }

/* ========== 登录表单 ========== */
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-hint {
    font-size: 12px; color: #999; line-height: 1.6;
    padding: 8px 10px; background: #f8f9fa; border-radius: 6px;
}

/* ========== 用户管理 ========== */
.usermgr-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px; gap: 8px; flex-wrap: wrap;
}
.user-list table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    border-radius: 10px; overflow: hidden;
}
.user-list th, .user-list td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0;
}
.user-list thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
.user-list th { font-weight: 600; }
.user-list tbody tr:hover { background: #fafbff; }

.role-display {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 500;
}
.role-display.admin { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.role-display.manager { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }
.role-display.user { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }

/* ========== 仪表盘 ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-areas:
        "overview strategy"
        "daily    daily"
        "llm      llm";
    gap: 24px;
    align-items: start;
}
.dashboard-card { min-height: 320px; }
.dashboard-card:nth-child(1) { grid-area: overview; }
.dashboard-card:nth-child(2) { grid-area: strategy; }
.dashboard-card:nth-child(3) { grid-area: daily; }
.dashboard-card:nth-child(4) { grid-area: llm; }
.chart-card { }
.chart-card-wide { }
.chart-box { width: 100%; height: 340px; }

.stat-overview { display: flex; flex-direction: column; gap: 14px; }
.stat-overview .stat-item {
    padding: 16px; border-radius: 12px;
    background: linear-gradient(135deg, #f0f3ff 0%, #f8f0ff 100%);
    border: 1px solid #e0e6ff;
}
.stat-overview .stat-item .label { font-size: 13px; color: #667eea; font-weight: 500; }
.stat-overview .stat-item .value {
    font-size: 28px; font-weight: 700; color: #1a1a2e;
    margin-top: 6px;
}
.stat-overview .stat-strategy-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.stat-overview .stat-strategy-row {
    display: flex; justify-content: space-between;
    align-items: center; font-size: 13px; color: #555;
    padding: 6px 10px; background: white; border-radius: 8px;
}
.stat-overview .stat-strategy-row .count { font-weight: 600; color: #667eea; }

/* LLM 调用成本卡片 */
.llm-cost-overview { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.llm-cost-overview .stat-item {
    flex: 1 1 200px;
    padding: 14px 16px; border-radius: 12px;
    background: linear-gradient(135deg, #fff7ed 0%, #fef2f2 100%);
    border: 1px solid #fed7aa;
}
.llm-cost-overview .stat-item .label { font-size: 13px; color: #f59e0b; font-weight: 500; }
.llm-cost-overview .stat-item .value {
    font-size: 24px; font-weight: 700; color: #b45309;
    margin-top: 6px;
}
.stat-sub { margin-top: 6px; font-size: 12px; color: #92400e; opacity: 0.85; }

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "overview"
            "strategy"
            "daily"
            "llm";
    }
    .chart-box { height: 280px; }
}

/* ========== PEST 专用 ========== */
.pest-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.pest-card {
    padding: 14px; border-radius: 10px;
    background: #fafcff; border-left: 4px solid #667eea;
}
.pest-card.political { border-left-color: #722ed1; background: #f9f0ff; }
.pest-card.economic  { border-left-color: #d48806; background: #fffbe6; }
.pest-card.social    { border-left-color: #13c2c2; background: #e6fffb; }
.pest-card.technological { border-left-color: #2f54eb; background: #f0f5ff; }
.pest-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #444; }
.pest-card table { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.pest-card th, .pest-card td { padding: 5px 6px; border-bottom: 1px dashed #eee; vertical-align: top; }
.pest-card th { color: #777; font-weight: 500; }

/* ========== 五力雷达图 ========== */
.radar-chart-box { width: 100%; height: 360px; }

/* ========== 敏感性瀑布/情景表 ========== */
.sens-chart-box, .dt-chart-box { width: 100%; height: 340px; }
.sens-variable-card {
    border: 1px solid #eef0fa; border-radius: 10px;
    padding: 12px 14px; margin-bottom: 12px; background: #fcfcff;
}
.sens-variable-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.sens-variable-head h5 { font-size: 14px; font-weight: 600; color: #333; }
.sens-table {
    width: 100%; font-size: 12.5px; border-collapse: collapse;
}
.sens-table th, .sens-table td {
    padding: 6px 8px; border: 1px solid #eef0fa;
    text-align: center;
}
.sens-table th { background: #f0f3ff; color: #555; font-weight: 500; }

/* ========== 决策树路径 ========== */
.dt-path-card {
    border: 1px solid #eef0fa; border-radius: 10px;
    padding: 14px; margin-bottom: 12px; background: #fcfcff;
}
.dt-path-card h5 {
    font-size: 14px; font-weight: 600; margin-bottom: 8px;
    color: #333; padding-bottom: 4px;
    border-bottom: 1px dashed #e0e6ff;
}
.dt-meta-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px; margin-bottom: 8px;
}
.dt-meta-cell {
    padding: 8px 10px; background: #f0f3ff;
    border-radius: 8px; text-align: center;
}
.dt-meta-cell .lbl { font-size: 11px; color: #888; margin-bottom: 3px; }
.dt-meta-cell .val { font-size: 14px; font-weight: 600; color: #1a1a2e; }

/* 通用 loading 文字 */
.loading { color: #888; font-size: 13px; padding: 16px; text-align: center; }

/* ========== Mock 测试数据下拉菜单 ========== */
.mock-dropdown {
    position: relative;
    display: inline-block;
}
.btn-mock {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
}
.btn-mock:hover {
    background: linear-gradient(135deg, #ff7e3d 0%, #ff4f73 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 106, 136, 0.35);
}
.mock-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    padding: 4px 0;
}
.mock-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}
.mock-menu-item:hover {
    background: linear-gradient(90deg, #fff5f0 0%, #fff0f6 100%);
    color: #d63384;
}
.mock-menu-item span {
    font-size: 16px;
}

/* Mock 测试数据横幅 */
.mock-banner {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0e6 100%);
    border: 1px solid #ffb088;
    border-left: 4px solid #ff6a88;
    color: #8a3b1a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
}
.mock-banner strong {
    color: #d63384;
}
