/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-numeric);
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    transition: all 0.3s var(--easing-standard);
}

/* 全局禁用滚动锚定，避免切换标签页时视口突跳 */
html, body {
    overflow-anchor: none;
}


/* 主容器 */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 1rem 2rem;
    display: grid;
    grid-template-columns: minmax(320px, 35%) 1fr;
    gap: 2rem;
    align-items: start;
    /* 确保容器能适应调试面板高度 */
    min-height: auto;
    /* 禁止容器作为滚动锚点 */
    overflow-anchor: none;
}

/* 输入区域和结果区域样式 */
.input-section,
.result-section {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    transition: all 0.3s var(--easing-standard);
    /* 防止切换 Tab 时浏览器进行滚动锚定，导致视口跳动 */
    overflow-anchor: none;
}

.input-section h2,
.result-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--bg-primary);
    padding-bottom: 0.5rem;
}

/* 输入组样式 */
.input-group {
    margin-bottom: 1.2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid var(--border-primary);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.3s var(--easing-standard);
}

.input-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 计算按钮样式 */
.calculate-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--easing-standard);
}

.calculate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 错误信息样式 */
.error-message {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #fee;
    color: #d63031;
    border: 1px solid #fab1a0;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* 详细分析导航区域 */
.analysis-navigation {
    margin-top: 1.5rem;
    text-align: center;
}

.detailed-analysis-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.detailed-analysis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.detailed-analysis-btn:active {
    transform: translateY(0);
}

/* 结果卡片样式 */
.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-card {
    background: var(--bg-surface-secondary);
    padding: 1.2rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-primary);
    transition: all 0.3s var(--easing-standard);
}

.result-card:hover {
    transform: translateY(-2px);
}

.result-card.risk-card {
    border-color: #ffa726;
    background: #fff8e1;
}

.result-card h3 {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: var(--font-variant-numeric);
    font-family: var(--font-numeric);
}

.result-value.profit {
    color: var(--status-profit);
}

.result-value.loss {
    color: var(--status-loss);
}

/* 风险建议样式 */
.advice-section {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.advice-section h3 {
    color: #2e7d32;
    margin-bottom: 0.8rem;
}

.advice-content {
    color: #2e7d32;
    line-height: 1.5;
    white-space: pre-line;
}

/* 仓位表格样式 */
.positions-table-container {
    margin-bottom: 2rem;
}

.positions-table-container h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.table-responsive {
    overflow-x: auto;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-primary);
}

.positions-table th {
    background: var(--bg-primary);
    color: var(--text-inverse);
    padding: 0.8rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.positions-table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.positions-table tbody tr:hover {
    background: var(--bg-surface-secondary);
}

.positions-table tbody tr:last-child td {
    border-bottom: none;
}

/* 图表容器样式 */
.chart-container {
    margin-bottom: 2rem;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.chart-placeholder {
    background: var(--bg-surface-secondary);
    border: 2px dashed var(--border-secondary);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.chart-info {
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-tertiary);
}


/* 配置说明样式 */
.config-note {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2196f3;
}

/* ==================================
   模式切换标签页样式
   ================================== */

.mode-switcher {
    display: flex;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #e9ecef;
}

.mode-tab {
    flex: 1;
    padding: 0.8rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
}

.mode-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.mode-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 反推模式特殊样式 */
.reverse-highlight {
    position: relative;
}

.reverse-highlight::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-radius: 2px;
}

.reverse-highlight label {
    color: #e67e22;
    font-weight: 700;
}

.risk-level-select {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.risk-level-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ==================================
   推荐方案样式
   ================================== */

.recommended-solutions {
    background: #fff8e1;
    border: 2px solid #ffa726;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: slideInUp 0.4s ease-out;
}

.recommended-solutions h3 {
    color: #e65100;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.best-solution-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 20%, #fff3e0 100%);
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.solution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.solution-grade {
    background: #4caf50;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.solution-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e65100;
}

.solution-params {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
}

.param-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.param-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.param-value {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.param-value.loss {
    color: #dc3545;
}

/* 方案对比表格 */
.solutions-comparison {
    margin-top: 1rem;
}

.solutions-comparison h4 {
    color: #e65100;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.solutions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.solutions-table th {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 0.8rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.solutions-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    font-size: 0.9rem;
}

.solutions-table tbody tr:hover {
    background: #fff8e1;
}

.grade-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.grade-badge.grade-a {
    background: #4caf50;
}

.grade-badge.grade-b {
    background: #2196f3;
}

.grade-badge.grade-c {
    background: #ff9800;
}

.apply-solution-btn {
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-solution-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

/* ==================================
   现代化策略表格样式 - 替代卡片系统
   ================================== */

.strategy-table-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    animation: slideInUp 0.4s ease-out;
}

/* 最优方案突出显示区域 */
.optimal-solution-highlight {
    position: relative;
    overflow: hidden;
}

.optimal-solution-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 12px 12px 0 0;
}

/* 策略对比表格容器 */
.strategy-comparison-table {
    margin-top: 1.5rem;
}

/* 表格响应式设计增强 */
.strategy-comparison-table table {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.strategy-comparison-table th {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    z-index: 10;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.strategy-comparison-table td {
    vertical-align: middle;
    min-height: 3rem;
}

/* 状态指示器样式 */
.strategy-comparison-table .status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 序号徽章增强 */
.strategy-comparison-table .rank-badge {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 悬停效果增强 */
.strategy-comparison-table tbody tr {
    transition: all 0.2s ease;
}

.strategy-comparison-table tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 按钮样式增强 */
.strategy-comparison-table button {
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.strategy-comparison-table button:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.strategy-comparison-table button:active {
    transform: scale(0.98);
}

/* 旧版卡片样式保持向后兼容 */
.strategy-options {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: slideInUp 0.4s ease-out;
}

.strategy-options h3 {
    color: #0056b3;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    text-align: center;
}

.strategy-description {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* 卡片网格布局 */
.strategy-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

/* 单个策略卡片 */
.strategy-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.strategy-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.strategy-card.optimal {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #ffffff 100%);
}

.strategy-card.optimal::before {
    content: "✓ 推荐";
    position: absolute;
    top: 0;
    right: 0;
    background: #28a745;
    color: white;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-bottom-left-radius: 8px;
}

.strategy-card.unavailable {
    background: #f8f9fa;
    border-color: #dc3545;
    opacity: 0.7;
}

/* 卡片头部 */
.card-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-badge {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.multiplier-info {
    text-align: right;
}

.multiplier-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.9;
}

.multiplier-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

/* 卡片内容 */
.card-content {
    padding: 1.2rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.metric-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.metric-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.metric-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.metric-value.breakeven {
    color: #ffc107;
}

.metric-value.multiplier {
    color: #17a2b8;
}

.metric-value.loss {
    color: #dc3545;
}

/* 偏差信息 */
.deviation-info {
    margin-top: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    text-align: center;
}

.deviation-label {
    font-size: 0.75rem;
    color: #856404;
    font-weight: 500;
}

/* 无可行解内容 */
.unavailable-content {
    text-align: center;
    color: #666;
}

.unavailable-message {
    padding: 1rem;
}

.unavailable-message span {
    font-size: 1.1rem;
    color: #dc3545;
    font-weight: 600;
}

.unavailable-message p {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #999;
}

/* 卡片底部 */
.card-footer {
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.select-strategy-btn {
    width: 100%;
    padding: 0.6rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-strategy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.select-strategy-btn.optimal-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.select-strategy-btn.optimal-btn:hover {
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* 方案说明 */
.strategy-legend {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.strategy-legend h4 {
    margin-bottom: 0.8rem;
    color: #333;
    font-size: 1rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
}

.legend-dot.optimal {
    background: #28a745;
    border-color: #28a745;
}

.legend-dot.acceptable {
    background: #007bff;
    border-color: #007bff;
}

.legend-dot.unavailable {
    background: #dc3545;
    border-color: #dc3545;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .strategy-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-header {
        padding: 0.8rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .strategy-cards-grid {
        gap: 0.8rem;
    }
    
    .metric-row {
        margin-bottom: 0.6rem;
    }
    
    .metric-label {
        font-size: 0.8rem;
    }
    
    .metric-value {
        font-size: 0.85rem;
    }
}

/* 回撤分析摘要样式 */
.drawdown-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #dee2e6;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    font-weight: 600;
    color: #666;
}

.summary-item .value {
    font-weight: 700;
    color: #333;
}

.summary-item .value.loss {
    color: #dc3545;
}

/* 占位符样式 */
.placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 响应式设计 */

/* 大屏幕优化 (1400px及以上) */
@media (min-width: 1400px) {
    .container {
        grid-template-columns: minmax(380px, 30%) 1fr;
        max-width: 1800px;
        gap: 2.5rem;
    }
}

/* 中等屏幕适配 (1024px-1399px) */
@media (min-width: 1024px) and (max-width: 1399px) {
    .container {
        grid-template-columns: minmax(350px, 32%) 1fr;
    }
}

/* 小屏幕切换为单列布局 */
@media (max-width: 1023px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .result-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    
    .container {
        padding: 1rem 0.5rem 1rem;
    }
    
    .input-section,
    .result-section {
        padding: 1.5rem;
    }
    
    .result-cards {
        grid-template-columns: 1fr;
    }
    
    /* 新增：移动端模式切换优化 */
    .mode-tab {
        font-size: 0.85rem;
        padding: 0.7rem 0.8rem;
    }
    
    /* 新增：推荐方案移动端优化 */
    .solution-params {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    
    .solutions-table {
        font-size: 0.8rem;
    }
    
    .solutions-table th,
    .solutions-table td {
        padding: 0.6rem 0.3rem;
    }
    
    .positions-table {
        font-size: 0.8rem;
    }
    
    .positions-table th,
    .positions-table td {
        padding: 0.6rem 0.4rem;
    }
}

@media (max-width: 480px) {
    
    .input-section,
    .result-section {
        padding: 1rem;
    }
    
    .result-card {
        padding: 1rem;
    }
    
    .result-value {
        font-size: 1.1rem;
    }
    
    
    .positions-table th,
    .positions-table td {
        padding: 0.5rem 0.3rem;
        font-size: 0.75rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-cards,
.advice-section,
.positions-table-container,
.chart-container {
    animation: fadeInUp 0.4s ease-out;
}

/* 滚动条样式 */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* ==================================
   调试面板重构样式 - v2.0
   ================================== */

/* 调试面板整体样式 */
.debug-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #f39c12;
    animation: slideInDown 0.4s ease-out;
    /* 解决调试面板被挤压问题 */
    min-height: 600px;
    height: auto;
    flex-shrink: 0;
}

/* 调试面板头部 */
.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f39c12;
}

.debug-header h2 {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
}

.debug-header-controls {
    display: flex;
    gap: 0.5rem;
}

.view-mode-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-mode-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
}

.view-mode-btn.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}


.debug-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.debug-btn.primary {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.debug-btn.secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.debug-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.debug-btn:active {
    transform: translateY(0);
}

.debug-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==================================
   智能网格布局系统
   ================================== */

.debug-grid-container {
    display: grid;
    gap: 1.2rem;
    /* 调整为单列布局：图表占满 100% 宽度 */
    grid-template-areas:
        "primary"
        "fullwidth";
    grid-template-columns: 1fr;
    padding: 0;
}


.debug-primary-section {
    grid-area: primary;
}

.debug-secondary-section {
    grid-area: secondary;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    /* 优化次要区域布局 */
    min-height: fit-content;
}

.debug-fullwidth-section {
    grid-area: fullwidth;
}

/* ==================================
   调试卡片系统
   ================================== */

.debug-card {
    background: #fefefe;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    /* 优化内容密度 */
    padding: 1rem;
    margin-bottom: 0;
}

.debug-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* 优先级颜色编码 */
.debug-card.priority-critical {
    border-left: 4px solid #e74c3c;
}

.debug-card.priority-important {
    border-left: 4px solid #f39c12;
}

.debug-card.priority-optional {
    border-left: 4px solid #3498db;
}

/* 卡片头部 */
.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.card-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #495057;
    font-weight: 600;
}

.toggle-icon {
    font-size: 0.8rem;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

/* 卡片内容 */
.card-content {
    padding: 1rem;
    background: white;
}

/* ==================================
   图表网格系统
   ================================== */

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.chart-item h4 {
    margin: 0 0 0.8rem 0;
    font-size: 0.9rem;
    color: #495057;
    text-align: center;
    font-weight: 600;
}

.chart-container-echarts {
    width: 100%;
    height: 500px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: height 0.3s ease;
}

/* ==================================
   紧凑模式样式优化
   ================================== */

.debug-summary-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
}

.summary-item .value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #495057;
}

.summary-item .label.error,
.summary-item .value.error {
    color: #dc3545;
}

.error-list-compact {
    background: #fff5f5;
    border-radius: 4px;
    padding: 0.8rem;
    margin-top: 0.8rem;
    border: 1px solid #fed7d7;
}

.error-item-compact {
    color: #c53030;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.error-item-compact:last-child {
    margin-bottom: 0;
}

/* ==================================
   快捷操作按钮网格
   ================================== */

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6rem;
}

.action-btn {
    padding: 0.5rem 0.8rem;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(23, 162, 184, 0.3);
}

/* ==================================
   改进的表格样式
   ================================== */

.verification-table-responsive {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.debug-table-improved {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.85rem;
}

.debug-table-improved th {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    padding: 0.7rem 0.8rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    border: none;
}

.debug-table-improved td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #f8f9fa;
    vertical-align: top;
}

.debug-table-improved tbody tr:hover {
    background: #f8f9fa;
}

.debug-table-improved tbody tr:last-child td {
    border-bottom: none;
}

.formula-cell {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.4rem 0.6rem !important;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #495057;
    max-width: 250px;
    word-break: break-all;
}

.status-badge-improved {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge-improved.ok {
    background: #d1f2eb;
    color: #0a6e4b;
    border: 1px solid #a3d9cc;
}

.status-badge-improved.warning {
    background: #fef9e7;
    color: #b7741f;
    border: 1px solid #f6e05e;
}

/* ==================================
   全屏功能样式
   ================================== */

/* 全屏图表容器样式 - 简化版本 */
.fullscreen-chart-container {
    /* 样式通过JavaScript内联设置，确保最高优先级和一致性 */
}

/* 调试切换按钮样式 */
.debug-toggle-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.8rem;
    transition: all 0.3s ease;
}

.debug-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.3);
}

.debug-toggle-btn.active {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

/* ==================================
   精细化响应式断点系统
   ================================== */

/* 大屏桌面端 (>1400px) - 最大网格优化，充分利用横向空间 */
@media (min-width: 1400px) {
    .debug-grid-container {
        /* 全宽显示 */
        grid-template-areas:
            "primary"
            "fullwidth";
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* 大屏：为避免横向挤压，改为纵向一列 */
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container-echarts {
        height: 600px;
    }
}

/* 超宽屏优化 (>1920px) - 专为4K和超宽显示器优化 */
@media (min-width: 1920px) {
    .debug-modal-content {
        width: 98%;
        max-width: 2200px;
        max-height: 94vh;
    }
    
    .debug-grid-container {
        /* 全宽显示 + 适度内边距 */
        grid-template-areas:
            "primary"
            "fullwidth";
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 1rem 2rem 1.5rem;
    }
    
    .debug-card {
        padding: 1.2rem;
    }
    
    .chart-container-echarts {
        height: 650px;
    }
}

/* 标准桌面端 (1200px-1400px) - 平衡布局，优化空间利用 */
@media (min-width: 1200px) and (max-width: 1399px) {
    .debug-grid-container {
        grid-template-areas:
            "primary"
            "fullwidth";
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* 标准桌面：纵向一列以提升可读性 */
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container-echarts {
        height: 450px;
    }
}

/* 平板横屏端 (992px-1199px) - 2栏优化布局，提升内容密度 */
@media (min-width: 992px) and (max-width: 1199px) {
    .debug-grid-container {
        grid-template-areas:
            "primary"
            "fullwidth";
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    
    .chart-container-echarts {
        height: 280px;
    }
    
    
    .debug-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 平板竖屏端 (768px-991px) - 优化单列布局 */
@media (min-width: 768px) and (max-width: 991px) {
    .debug-section {
        padding: 1rem;
    }
    
    .debug-grid-container {
        grid-template-areas:
            "primary"
            "fullwidth";
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .debug-secondary-section {
        flex-direction: row;
        gap: 1rem;
    }
    
    .debug-card {
        flex: 1;
    }
    
    .chart-container-echarts {
        height: 260px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .action-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机横屏端 (576px-767px) - 紧凑布局 */
@media (min-width: 576px) and (max-width: 767px) {
    .debug-section {
        padding: 0.8rem;
        margin-top: 1rem;
    }
    
    .debug-header {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
    }
    
    .debug-grid-container {
        grid-template-areas:
            "primary"
            "fullwidth";
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .debug-secondary-section {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .chart-container-echarts {
        height: 220px;
    }
    
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .debug-table-improved {
        font-size: 0.75rem;
    }
    
    .debug-table-improved th,
    .debug-table-improved td {
        padding: 0.4rem 0.3rem;
    }
    
    .formula-cell {
        max-width: 150px;
        font-size: 0.7rem;
    }
}

/* 小屏手机端 (<576px) - 最小化布局 */
@media (max-width: 575px) {
    .debug-section {
        padding: 0.6rem;
        margin-top: 0.8rem;
        border-radius: 8px;
    }
    
    .debug-header {
        flex-direction: column;
        gap: 0.4rem;
        margin-bottom: 0.8rem;
        padding-bottom: 0.6rem;
    }
    
    .debug-header h2 {
        font-size: 1.2rem;
    }
    
    .view-mode-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .debug-grid-container {
        grid-template-areas:
            "primary"
            "secondary"
            "fullwidth";
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    
    .debug-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .chart-container-echarts {
        height: 380px;
    }
    
    .card-header {
        padding: 0.6rem 0.8rem;
    }
    
    .card-content {
        padding: 0.6rem;
    }
    
    .action-buttons-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    
    .action-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .debug-table-improved {
        font-size: 0.7rem;
    }
    
    .debug-table-improved th,
    .debug-table-improved td {
        padding: 0.3rem 0.2rem;
    }
    
    .formula-cell {
        max-width: 120px;
        font-size: 0.65rem;
    }
    
    .status-badge-improved {
        padding: 0.1rem 0.4rem;
        font-size: 0.65rem;
    }
    
    /* 移动端全屏优化已通过JavaScript内联样式实现 */
}

/* ==================================
   移动端手势友好优化
   ================================== */

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .debug-btn,
    .action-btn,
    .view-mode-btn {
        min-height: 44px; /* iOS推荐的最小触摸目标尺寸 */
        min-width: 44px;
    }
    
    .card-header {
        min-height: 48px;
        padding: 0.8rem 1rem;
    }
    
    .toggle-icon {
        font-size: 1rem; /* 更大的触摸目标 */
    }
    
    
    .action-buttons-grid {
        gap: 0.8rem;
    }
}

/* 滚动优化 */
.debug-section {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.verification-table-responsive {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 防止意外缩放 */
.debug-section input,
.debug-section button,
.debug-section select {
    touch-action: manipulation;
}

/* 长按菜单禁用（对于按钮） */
.debug-btn,
.action-btn,
.view-mode-btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ==================================
   正向分析引导界面样式
   ================================== */

.strategy-guidance-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    animation: slideInUp 0.4s ease-out;
}

.strategy-guidance-section h3 {
    color: #334155;
    font-weight: 700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .strategy-guidance-section {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .strategy-guidance-section .max-w-2xl {
        max-width: 100%;
    }
    
    .strategy-guidance-section .max-w-lg {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .strategy-guidance-section {
        padding: 1rem;
    }
    
    .strategy-guidance-section h3 {
        font-size: 1.1rem;
    }
    
    .strategy-guidance-section .text-lg {
        font-size: 1rem;
    }
}

/* ==================================
   方案对比表格响应式优化 - 修复换行问题
   ================================== */

/* 表格防换行和最小宽度控制 */
.strategy-comparison-table table {
    /* 设置足够的最小宽度确保所有列能正常显示 */
    min-width: 900px;
}

.strategy-comparison-table th,
.strategy-comparison-table td {
    /* 防止文本换行 */
    white-space: nowrap;
    /* 确保内容不被过度挤压 */
    min-width: fit-content;
}

/* 各列最小宽度分配 */
.strategy-comparison-table th:nth-child(1), /* 状态 */
.strategy-comparison-table td:nth-child(1) {
    min-width: 80px;
}

.strategy-comparison-table th:nth-child(2), /* 序号 */
.strategy-comparison-table td:nth-child(2) {
    min-width: 60px;
}

.strategy-comparison-table th:nth-child(3), /* 倍数指数 */
.strategy-comparison-table td:nth-child(3) {
    min-width: 90px;
}

.strategy-comparison-table th:nth-child(4), /* 首次手数 */
.strategy-comparison-table td:nth-child(4) {
    min-width: 90px;
}

.strategy-comparison-table th:nth-child(5), /* 回本点数 */
.strategy-comparison-table td:nth-child(5) {
    min-width: 90px;
}

.strategy-comparison-table th:nth-child(6), /* 仓位放大 */
.strategy-comparison-table td:nth-child(6) {
    min-width: 90px;
}

.strategy-comparison-table th:nth-child(7), /* 实际止损 */
.strategy-comparison-table td:nth-child(7) {
    min-width: 100px;
}

.strategy-comparison-table th:nth-child(8), /* 偏差 */
.strategy-comparison-table td:nth-child(8) {
    min-width: 80px;
}

.strategy-comparison-table th:nth-child(9), /* 操作 */
.strategy-comparison-table td:nth-child(9) {
    min-width: 100px;
}

/* ==================================
   策略表格响应式设计
   ================================== */

/* 桌面端 (>1024px) - 完整表格显示 */
@media (min-width: 1025px) {
    .strategy-table-section {
        padding: 2.5rem;
    }
    
    .strategy-comparison-table table {
        font-size: 0.95rem;
        /* 桌面端可以增加最小宽度 */
        min-width: 1000px;
    }
    
    .strategy-comparison-table th {
        padding: 1rem 1.5rem;
        font-size: 0.8rem;
    }
    
    .strategy-comparison-table td {
        padding: 1.25rem 1.5rem;
    }
}

/* 平板端 (769px-1024px) - 紧凑显示 */
@media (min-width: 769px) and (max-width: 1024px) {
    .strategy-table-section {
        padding: 1.5rem;
    }
    
    .strategy-comparison-table th {
        padding: 0.75rem 1rem;
        font-size: 0.7rem;
    }
    
    .strategy-comparison-table td {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .strategy-comparison-table button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* 移动端 (<=768px) - 卡片式表格 */
@media (max-width: 768px) {
    .strategy-table-section {
        padding: 1rem;
        border-radius: 12px;
    }
    
    /* 最优方案在移动端保持卡片形式 */
    .optimal-solution-highlight {
        margin-bottom: 2rem;
    }
    
    .optimal-solution-highlight .grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    /* 隐藏复杂表格，显示简化列表 */
    .strategy-comparison-table .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .strategy-comparison-table table {
        min-width: 800px; /* 确保表格可以水平滚动 */
        font-size: 0.8rem;
    }
    
    .strategy-comparison-table th {
        padding: 0.5rem;
        font-size: 0.6rem;
        white-space: nowrap;
    }
    
    .strategy-comparison-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    .strategy-comparison-table button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        min-width: 80px;
    }
    
    /* 移动端表格滚动提示 */
    .strategy-comparison-table::after {
        content: "👆 左右滑动查看更多信息";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: #64748b;
        margin-top: 0.5rem;
        font-style: italic;
    }
}

/* 小屏手机 (<=480px) - 最小化设计 */
@media (max-width: 480px) {
    .strategy-table-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .optimal-solution-highlight {
        padding: 1rem;
    }
    
    .optimal-solution-highlight .grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .optimal-solution-highlight button {
        width: 100%;
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .strategy-comparison-table table {
        min-width: 700px;
        font-size: 0.75rem;
    }
    
    .strategy-comparison-table th {
        padding: 0.4rem 0.3rem;
        font-size: 0.55rem;
    }
    
    .strategy-comparison-table td {
        padding: 0.6rem 0.3rem;
    }
    
    .strategy-comparison-table .rank-badge {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
    }
    
    .strategy-comparison-table button {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        min-width: 70px;
    }
}

/* 表格说明区域的响应式 */
@media (max-width: 768px) {
    .strategy-table-section .bg-slate-50 {
        padding: 1rem;
    }
    
    .strategy-table-section .bg-slate-50 .grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .strategy-comparison-table button {
        min-height: 44px; /* iOS推荐的最小触摸目标 */
        padding: 0.75rem 1rem;
    }
    
    .strategy-comparison-table tbody tr:hover {
        transform: none; /* 禁用悬停动画，避免触摸问题 */
    }
}

/* ==================================
   调试面板模态框样式 - v3.0
   ================================== */

/* 模态框遮罩层 */
.debug-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 模态框内容容器 - 专为调试面板优化 */
.debug-modal-content {
    background: white;
    border-radius: 12px;
    width: 96%;
    max-width: 1800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.4s ease-out;
    /* 优化宽高比，减少竖向拉伸感 */
    aspect-ratio: auto;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 模态框头部 */
.debug-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border-bottom: 2px solid #d35400;
    /* 减少头部高度，留出更多空间给内容 */
    flex-shrink: 0;
}

.debug-modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.debug-modal-controls {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

/* 模态框关闭按钮 */
.debug-modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.debug-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}


.debug-modal-content .debug-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem 1.5rem;
    -webkit-overflow-scrolling: touch;
    /* 优化空间利用，减少不必要的内边距 */
}

/* 适应模态框的图表容器 */
.debug-modal-content .chart-container-echarts {
    height: 80vh;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

/* 禁用body滚动 */
.debug-modal-active {
    overflow: hidden;
    height: 100vh;
}

/* ==================================
   模态框响应式设计
   ================================== */

/* 大屏桌面端 (>1200px) - 数据密集型界面优化 */
@media (min-width: 1200px) {
    .debug-modal-content {
        width: 98%;
        max-width: 1900px;
        max-height: 92vh;
    }
    
    .debug-modal-content .chart-container-echarts {
        height: 75vh;
    }
    
    .debug-modal-content .charts-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* 平板端 (768px-1199px) - 提升空间利用率 */
@media (min-width: 768px) and (max-width: 1199px) {
    .debug-modal-content {
        width: 96%;
        max-width: 1600px;
        max-height: 88vh;
    }
    
    .debug-modal-header {
        padding: 1.2rem 1.5rem;
    }
    
    
    .debug-modal-content .debug-grid-container {
        padding: 1.2rem 1.5rem 1.5rem;
    }
    
    .debug-modal-content .chart-container-echarts {
        height: 70vh;
    }
}

/* 平板端全屏图表优化已通过JavaScript响应式内联样式实现 */

/* 手机端 (<768px) */
@media (max-width: 767px) {
    .debug-modal-overlay {
        padding: 10px;
    }
    
    .debug-modal-content {
        width: 100%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .debug-modal-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }
    
    .debug-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .debug-modal-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .debug-modal-close {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    
    .debug-modal-content .debug-grid-container {
        padding: 1rem;
        grid-template-areas:
            "primary"
            "secondary"
            "fullwidth";
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .debug-modal-content .chart-container-echarts {
        height: 400px;
    }
    
    
    .debug-modal-content .debug-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.85rem;
    }
}

/* 超小屏幕 (<480px) */
@media (max-width: 479px) {
    .debug-modal-overlay {
        padding: 5px;
    }
    
    .debug-modal-content {
        max-height: 98vh;
        border-radius: 6px;
    }
    
    .debug-modal-header {
        padding: 0.8rem;
    }
    
    .debug-modal-header h2 {
        font-size: 1.1rem;
    }
    
    .debug-modal-content .debug-grid-container {
        padding: 0.8rem;
    }
    
    .debug-modal-content .chart-container-echarts {
        height: 350px;
    }
    
    .view-mode-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .debug-modal-close {
        min-width: 44px;
        min-height: 44px;
    }
    
    .debug-modal-content .debug-btn,
    .debug-modal-content .action-btn {
        min-height: 44px;
    }
}

/* ==================================
   ECharts 增强Tooltip响应式优化
   ================================== */

/* 移动端tooltip优化 */
@media (max-width: 768px) {
    /* ECharts tooltip在小屏幕上的响应式调整 */
    .chart-container-echarts {
        position: relative;
    }
    
    /* 通过CSS变量定义移动端tooltip样式 */
    :root {
        --tooltip-mobile-width: 240px;
        --tooltip-mobile-font-size: 11px;
        --tooltip-mobile-padding: 8px 12px;
    }
    
    /* 移动端图表容器优化 */
    .chart-container,
    .chart-container-echarts {
        /* 确保图表在移动端有足够空间显示tooltip */
        margin: 10px 0;
        position: relative;
        overflow: visible;
    }
}

/* 超小屏幕tooltip优化 */
@media (max-width: 480px) {
    :root {
        --tooltip-mobile-width: 220px;
        --tooltip-mobile-font-size: 10px;
        --tooltip-mobile-padding: 6px 10px;
    }
    
    /* 图表容器在小屏幕上的额外优化 */
    .chart-container-echarts {
        margin: 5px 0;
    }
}

/* ==================================
   DCA回撤分析主题色彩定义
   ================================== */

:root {
    /* 盈亏状态颜色 */
    --profit-color: #28a745;
    --loss-color: #dc3545;
    --neutral-color: #667eea;
    
    /* 风险等级颜色 */
    --low-risk-color: #28a745;
    --medium-risk-color: #ffa726;
    --high-risk-color: #dc3545;
    
    /* tooltip主题颜色 */
    --tooltip-bg-color: rgba(255, 255, 255, 0.95);
    --tooltip-border-color: #667eea;
    --tooltip-text-color: #333;
    --tooltip-secondary-text-color: #666;
    --tooltip-highlight-bg: #f8f9fa;
}

/* ==================================
   图表交互增强样式
   ================================== */

/* 确保图表在调试模式下的最佳显示 */
.debug-modal-content .chart-container-echarts {
    /* 模态框中的图表tooltip优化 */
    position: relative;
    z-index: 1;
}

/* 图表悬停状态优化 */
.chart-container:hover,
.chart-container-echarts:hover {
    /* 轻微提升图表容器，暗示交互性 */
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* 图表loading状态样式 */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.9rem;
}

.chart-loading::before {
    content: "📊";
    margin-right: 8px;
    font-size: 1.2rem;
}

/* ==================================
   高对比度和可访问性优化
   ================================== */

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --profit-color: #006400;
        --loss-color: #8B0000;
        --tooltip-border-color: #000;
        --tooltip-text-color: #000;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    .chart-container:hover,
    .chart-container-echarts:hover {
        transform: none;
        transition: none;
    }
}
