/* ================================================================
   文件名：futures-diagnosis.css
   版本：v1.0
   说明：期货诊断报告样式
   市场：期货 (Futures)
   依赖：无
   使用场景：在 futures_alerts.html 或其他页面中引用
   ================================================================ */

/* ================================================================
   1. 诊断报告容器
   ================================================================ */

   .futures-diagnosis-report {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin: 12px 0 20px 0;
    max-width: 100%;
    overflow: hidden;
}

/* ================================================================
   2. 报告头部
   ================================================================ */

.diagnosis-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 4px;
}

.diagnosis-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

.diagnosis-meta {
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.diagnosis-meta span {
    white-space: nowrap;
}

.diagnosis-divider {
    margin: 12px 0 16px 0;
    border: none;
    border-top: 1px solid #e8ecf1;
}

/* ================================================================
   3. 各模块通用样式
   ================================================================ */

.diagnosis-section {
    margin-bottom: 24px;
}

.diagnosis-section:last-child {
    margin-bottom: 0;
}

.diagnosis-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #2d3436;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ================================================================
   4. 模块5：品种概览与操作建议
   ================================================================ */

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px 20px;
    background: #f8f9fa;
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid #e8ecf1;
}

.overview-item {
    display: flex;
    flex-direction: column;
    padding: 2px 0;
}

.overview-item .label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.overview-item .value {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.overview-detail {
    margin-top: 10px;
    padding: 12px 16px;
    background: #f0f2f5;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.8;
    color: #555;
}

.overview-detail strong {
    color: #2d3436;
}

/* ================================================================
   5. 模块4：各周期趋势特征表格
   ================================================================ */

.period-table-section .period-table {
    font-size: 13px;
}

.period-table-section .period-table td:first-child {
    font-weight: 500;
}

/* ================================================================
   6. 模块3：全市场特征分布表格
   ================================================================ */

.distribution-table {
    font-size: 13px;
}

.distribution-table thead th {
    font-weight: 500;
    font-size: 12px;
}

/* ================================================================
   7. 模块2：全品种排行表格
   ================================================================ */

.ranking-table {
    font-size: 13px;
}

.ranking-table thead th {
    font-weight: 600;
    font-size: 12px;
    background: #f0f2f5;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.ranking-table tbody tr {
    transition: background 0.15s ease;
}

.ranking-table tbody tr:hover {
    background: #f8f9fa;
}

.ranking-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* ================================================================
   8. 通用表格样式
   ================================================================ */

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e8ecf1;
}

.diagnosis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 500px;
}

.diagnosis-table th,
.diagnosis-table td {
    padding: 8px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.diagnosis-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.diagnosis-table tr:last-child td {
    border-bottom: none;
}

/* ================================================================
   9. 图例
   ================================================================ */

.diagnosis-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    margin-top: 10px;
    padding: 8px 4px;
    font-size: 12px;
    color: #666;
}

.diagnosis-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.diagnosis-note {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    padding: 0 4px;
}

/* ================================================================
   10. 模块6：诊断结论
   ================================================================ */

.conclusion-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 20px;
    border-left: 4px solid #3498db;
}

.conclusion-box p {
    margin: 0;
    line-height: 1.9;
    font-size: 14px;
    color: #333;
}

/* ================================================================
   11. 统计摘要栏
   ================================================================ */

.summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 10px 0 12px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid #e8ecf1;
    font-size: 13px;
}

.summary-bar .summary-label {
    font-weight: 600;
    color: #2d3436;
    margin-right: 4px;
}

/* ================================================================
   12. 响应式设计
   ================================================================ */

@media (max-width: 1024px) {
    .futures-diagnosis-report {
        padding: 12px 14px;
    }
    
    .overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 4px 14px;
        padding: 12px 14px;
    }
    
    .overview-item .value {
        font-size: 14px;
    }
    
    .diagnosis-table {
        font-size: 12px;
        min-width: 400px;
    }
    
    .diagnosis-table th,
    .diagnosis-table td {
        padding: 6px 10px;
    }
    
    .ranking-table {
        font-size: 12px;
        min-width: 500px;
    }
}

@media (max-width: 768px) {
    .futures-diagnosis-report {
        padding: 10px 12px;
        margin: 8px 0 12px 0;
    }
    
    .diagnosis-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .diagnosis-header h2 {
        font-size: 17px;
    }
    
    .diagnosis-meta {
        font-size: 12px;
        gap: 8px 12px;
    }
    
    .diagnosis-meta span {
        white-space: normal;
    }
    
    .diagnosis-section h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px 12px;
        padding: 10px 12px;
    }
    
    .overview-item .value {
        font-size: 13px;
    }
    
    .overview-detail {
        font-size: 12px;
        padding: 10px 12px;
        line-height: 1.6;
    }
    
    .diagnosis-table {
        font-size: 11px;
        min-width: 320px;
    }
    
    .diagnosis-table th,
    .diagnosis-table td {
        padding: 5px 8px;
    }
    
    .ranking-table {
        font-size: 11px;
        min-width: 400px;
    }
    
    .ranking-table thead th {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .ranking-table tbody td {
        padding: 5px 8px;
    }
    
    .conclusion-box {
        padding: 12px 14px;
    }
    
    .conclusion-box p {
        font-size: 13px;
        line-height: 1.7;
    }
    
    .diagnosis-legend {
        font-size: 11px;
        gap: 8px 14px;
    }
    
    .summary-bar {
        font-size: 12px;
        gap: 4px 10px;
        padding: 8px 0 10px 0;
    }
    
    .table-responsive {
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .futures-diagnosis-report {
        padding: 8px 8px;
        border-radius: 8px;
    }
    
    .diagnosis-header h2 {
        font-size: 15px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2px 8px;
        padding: 8px 10px;
    }
    
    .overview-item .label {
        font-size: 10px;
    }
    
    .overview-item .value {
        font-size: 12px;
    }
    
    .diagnosis-table {
        font-size: 10px;
        min-width: 280px;
    }
    
    .diagnosis-table th,
    .diagnosis-table td {
        padding: 4px 6px;
    }
    
    .ranking-table {
        font-size: 10px;
        min-width: 340px;
    }
    
    .ranking-table thead th {
        font-size: 9px;
        padding: 4px 6px;
    }
    
    .ranking-table tbody td {
        padding: 4px 6px;
    }
    
    .conclusion-box {
        padding: 10px 12px;
    }
    
    .conclusion-box p {
        font-size: 12px;
        line-height: 1.6;
    }
}

/* ================================================================
   13. 暗色主题支持（可选）
   ================================================================ */

@media (prefers-color-scheme: dark) {
    .futures-diagnosis-report {
        background: #1e1e2e;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    }
    
    .diagnosis-header h2 {
        color: #e8e8e8;
    }
    
    .diagnosis-meta {
        color: #888;
    }
    
    .diagnosis-section h3 {
        color: #d0d0d0;
    }
    
    .diagnosis-divider {
        border-top-color: #333;
    }
    
    .overview-grid {
        background: #2d2d44;
        border-color: #3d3d55;
    }
    
    .overview-item .label {
        color: #777;
    }
    
    .overview-item .value {
        color: #e8e8e8;
    }
    
    .overview-detail {
        background: #2d2d44;
        color: #aaa;
    }
    
    .overview-detail strong {
        color: #d0d0d0;
    }
    
    .diagnosis-table th {
        background: #2d2d44;
        color: #aaa;
    }
    
    .diagnosis-table td {
        color: #ccc;
        border-bottom-color: #333;
    }
    
    .diagnosis-table tr:hover {
        background: #2d2d44;
    }
    
    .ranking-table thead th {
        background: #2d2d44;
        color: #aaa;
    }
    
    .diagnosis-legend {
        color: #888;
    }
    
    .diagnosis-note {
        color: #666;
    }
    
    .conclusion-box {
        background: #2d2d44;
    }
    
    .conclusion-box p {
        color: #ccc;
    }
    
    .summary-bar {
        border-bottom-color: #333;
        color: #aaa;
    }
    
    .summary-bar .summary-label {
        color: #d0d0d0;
    }
    
    .table-responsive {
        border-color: #333;
    }
}