/**
 * 价值分析样式表
 * 用于股票详情页的价值分析Tab
 */

/* 报告类型切换按钮 */
.report-type-switch {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.report-type-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.report-type-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.report-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.report-type-btn i {
    font-size: 12px;
}

/* 价值分析容器 */
#valueAnalysisContainer {
    padding: 20px 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 500px !important;
    overflow: visible !important;
    height: auto !important;
}

/* 核心指标卡片 */
.value-metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 100px !important;
}

.value-metric-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.value-metric-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.value-metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.value-metric-value.positive {
    color: #28a745;
}

.value-metric-value.negative {
    color: #dc3545;
}

.value-metric-change {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 分析模块 */
.analysis-section {
    margin-bottom: 30px;
    display: block !important;
    visibility: visible !important;
    min-height: 50px !important;
    overflow: visible !important;
    clear: both;
}

.analysis-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.analysis-header h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-header .badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
    margin-left: auto;
    color: white;
}

.analysis-header .badge.bg-info {
    background-color: #17a2b8;
}

.analysis-header .badge.bg-success {
    background-color: #28a745;
}

.analysis-header .badge.bg-warning {
    background-color: #ffc107;
    color: #212529;
}

/* 数据表格 */
.value-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

.value-data-table thead {
    background: #f8f9fa;
}

.value-data-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
}

.value-data-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.value-data-table tbody tr:hover {
    background: #f8f9fa;
}

.value-data-table .year-column {
    font-weight: 600;
    color: #495057;
    text-align: left;
    padding-left: 15px;
}

.value-data-table .growth-positive {
    color: #28a745;
}

.value-data-table .growth-negative {
    color: #dc3545;
}

/* 平均值行样式 */
.value-data-table .avg-row {
    background: #e3f2fd;
    font-weight: 600;
}

.value-data-table .avg-row td {
    border-top: 2px solid #2196f3;
    border-bottom: 2px solid #2196f3;
}

/* 投资建议卡片 */
.investment-advice {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin-top: 20px;
}

.investment-advice h5 {
    margin: 0 0 15px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.investment-advice ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.investment-advice ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.investment-advice ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 风险提示 */
.risk-warning {
    padding: 15px 20px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    margin-top: 20px;
}

.risk-warning h5 {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.risk-warning p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
}

/* 估值评级 */
.valuation-rating {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

.valuation-rating.undervalued {
    background: #d4edda;
    color: #155724;
}

.valuation-rating.fair {
    background: #fff3cd;
    color: #856404;
}

.valuation-rating.overvalued {
    background: #f8d7da;
    color: #721c24;
}

/* 双评级：绝对PE + 相对行业 */
.valuation-ratings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.valuation-rating-absolute,
.valuation-rating-relative {
    font-size: 12px;
}

.valuation-rating-note {
    width: 100%;
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* 估值方法参考区块 */
.valuation-method-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #dee2e6;
}

.valuation-method-desc {
    margin: 0 0 16px 0;
    padding: 12px 16px;
    background: #f0f7ff;
    border-radius: 6px;
    font-size: 13px;
    color: #495057;
    line-height: 1.5;
}

.valuation-industry-desc {
    margin: 0 0 16px 0;
    padding: 10px 14px;
    background: #e8f4fd;
    border-left: 4px solid #0d6efd;
    border-radius: 4px;
    font-size: 13px;
    color: #0c5460;
    line-height: 1.5;
}

.valuation-price-tip {
    margin: 12px 0 0 0;
    padding: 10px 14px;
    background: #e8f5e9;
    border-radius: 6px;
    font-size: 13px;
    color: #2e7d32;
}

.valuation-method-note {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
    color: #6c757d;
}

/* 各算法参考值表格 */
.valuation-algo-table {
    margin-bottom: 16px;
    max-width: 480px;
}

.valuation-algo-table .algo-name {
    font-weight: 600;
    color: #495057;
}

.valuation-algo-table .algo-hint {
    font-size: 12px;
    color: #6c757d;
}

/* 同行业市值前10只表格 */
.industry-top10-wrap {
    margin-bottom: 20px;
}

.industry-top10-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.industry-top10-title i {
    color: #0d6efd;
}

.industry-top10-table {
    margin-bottom: 0;
}

.industry-top10-table .industry-company-name {
    text-align: left;
    padding-left: 12px;
}

.industry-top10-table tfoot .avg-row td {
    border-top: 2px solid #0d6efd;
    font-weight: 600;
}

/* 历史 PE 区间 */
.historical-pe-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}
.historical-pe-section .analysis-header {
    margin-bottom: 10px;
}
.historical-pe-compare {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
}
.historical-pe-table {
    margin-bottom: 0;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .value-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .value-data-table {
        font-size: 12px;
    }
    
    .value-data-table th,
    .value-data-table td {
        padding: 8px 4px;
    }
}

@media (max-width: 480px) {
    .value-metrics-grid {
        grid-template-columns: 1fr;
    }
}
