:root {
    --sta-valuation-bg: #ffffff;
    --sta-valuation-border: #e5e7eb;
    --sta-valuation-primary: #2563eb;
    --sta-valuation-positive: #16a34a;
    --sta-valuation-negative: #dc2626;
    --sta-valuation-neutral: #64748b;
}

.sta-valuation-overview {
    background: var(--sta-valuation-bg);
    border: 1px solid var(--sta-valuation-border);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #0f172a;
}

.sta-valuation-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
}

.sta-valuation-hero {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 16px;
    padding: 24px;
    display: grid;
    gap: 16px;
}

.sta-hero-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sta-hero-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sta-hero-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sta-hero-focus {
    font-family: "Fira Code", monospace;
    font-size: 0.95rem;
    color: #0f172a;
    background: rgba(15, 23, 42, 0.08);
    padding: 4px 10px;
    border-radius: 8px;
}

.sta-hero-benchmark {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 0.95rem;
    color: #1e293b;
}

.sta-hero-label {
    color: rgba(30, 41, 59, 0.7);
}

.sta-hero-body p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #0f172a;
}

.sta-valuation-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.sta-valuation-layout > .sta-valuation-benchmark {
    grid-column: 1 / -1;
}

.sta-section-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.sta-focus-comparison {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sta-focus-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sta-focus-identity {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.sta-focus-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #be185d;
}

.sta-focus-code {
    font-family: "Fira Code", monospace;
    font-size: 0.9rem;
    color: #9d174d;
}

.sta-focus-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: #9d174d;
    font-size: 0.85rem;
}

.sta-focus-mode {
    background: rgba(236, 72, 153, 0.15);
    color: #be185d;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.sta-focus-date {
    color: #b91c1c;
}

.sta-focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.sta-focus-card {
    background: #ffffff;
    border: 1px solid rgba(190, 24, 93, 0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 6px 16px rgba(190, 24, 93, 0.08);
}

.sta-focus-card--baseline {
    border-color: #f472b6;
    box-shadow: 0 10px 24px rgba(190, 24, 93, 0.16);
}

.sta-focus-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sta-focus-metric {
    font-weight: 600;
    color: #9d174d;
    font-size: 1rem;
}

.sta-focus-stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
    color: #4c0519;
}

.sta-focus-stats li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sta-focus-stats span {
    color: rgba(76, 5, 25, 0.7);
}

.sta-focus-stats strong {
    font-weight: 600;
    color: #86198f;
}

.sta-valuation-summary {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sta-valuation-benchmark {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sta-benchmark-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sta-valuation-benchmark h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0c4a6e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sta-benchmark-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    font-size: 0.8rem;
}

.sta-benchmark-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.sta-benchmark-tabs button {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #0369a1;
    cursor: pointer;
    transition: all 0.18s ease;
}

.sta-benchmark-tabs button:hover {
    background: rgba(14, 165, 233, 0.12);
    color: #0c4a6e;
}

.sta-benchmark-tabs button.active {
    background: #0ea5e9;
    color: #fff;
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.25);
}

.sta-benchmark-chart {
    position: relative;
    width: 100%;
    min-height: 260px;
}

.sta-valuation-benchmark canvas {
    width: 100%;
    height: 100%;
}

.sta-benchmark-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 6px 0 4px;
}

.sta-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #0f172a;
}

.sta-legend-item input[type="checkbox"] {
    accent-color: #0ea5e9;
    width: 16px;
    height: 16px;
}

.sta-legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.sta-legend-label {
    white-space: nowrap;
}

.sta-valuation-scorecard {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.sta-valuation-scorecard .sta-score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sta-valuation-primary);
}

.sta-valuation-scorecard .sta-rating {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sta-valuation-neutral);
}

.sta-valuation-scorecard .sta-meta {
    margin-left: auto;
    font-size: 0.9rem;
    color: #475569;
}

.sta-baseline h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.sta-baseline-stats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    font-size: 0.95rem;
    color: #1f2937;
}

.sta-insights,
.sta-alerts {
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px dashed var(--sta-valuation-border);
}

.sta-insights h4,
.sta-alerts h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
}

.sta-insights ul,
.sta-alerts ul {
    list-style: disc inside;
    margin: 0;
    padding-left: 8px;
    color: #475569;
}

.sta-valuation-highlights {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sta-valuation-highlights .sta-section-title {
    color: #9a3412;
}

.sta-highlight-column h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #9a3412;
}

.sta-highlight-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 6px;
}

.sta-highlight-list li {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 100px 80px 70px;
    gap: 8px;
    align-items: baseline;
    font-size: 0.95rem;
}

.sta-highlight-list .sta-code {
    font-family: "Fira Code", monospace;
    color: #6b7280;
}

.sta-highlight-list .sta-value {
    color: var(--sta-valuation-neutral);
}

.sta-highlight-list .sta-percentile {
    color: var(--sta-valuation-primary);
    font-weight: 600;
}

.sta-empty {
    margin: 0;
    color: #6b7280;
    font-style: italic;
}

.sta-valuation-chart {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
}

.sta-valuation-chart h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0c4a6e;
}

.sta-valuation-chart canvas {
    display: block;
    width: 100%;
    max-height: 360px;
}

.sta-chart-toolbar {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sta-chart-toolbar button {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #38bdf8;
    background: #e0f2fe;
    color: #0c4a6e;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease-in-out;
}

.sta-chart-toolbar button.active,
.sta-chart-toolbar button:hover {
    background: #0ea5e9;
    color: #fff;
}

.sta-valuation-table {
    background: #fff;
    border: 1px solid var(--sta-valuation-border);
    border-radius: 12px;
    padding: 20px;
}

.sta-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.sta-channel-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.sta-channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sta-channel-metric {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.sta-channel-stats {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.sta-channel-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: #1f2937;
}

.sta-channel-label {
    color: rgba(30, 41, 59, 0.6);
}

.sta-channel-value {
    font-weight: 600;
    color: #0f172a;
}

.sta-channel-empty {
    padding: 12px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
    text-align: center;
}

.sta-valuation-table h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.sta-table-scroll {
    overflow-x: auto;
}

.sta-valuation-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.sta-valuation-table th,
.sta-valuation-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--sta-valuation-border);
    text-align: left;
    font-size: 0.95rem;
}

.sta-valuation-table thead {
    background: #f1f5f9;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: #475569;
}

.sta-stock-name {
    display: block;
    font-weight: 600;
}

.sta-stock-code {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
}

.sta-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 6px;
}

.sta-status-undervalued {
    background: rgba(22, 163, 74, 0.12);
    color: var(--sta-valuation-positive);
}

.sta-status-overvalued {
    background: rgba(220, 38, 38, 0.12);
    color: var(--sta-valuation-negative);
}

.sta-status-fair {
    background: rgba(100, 116, 139, 0.12);
    color: var(--sta-valuation-neutral);
}

.sta-status-unknown {
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
}

.sta-metric-value {
    color: #0f172a;
}

.sta-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 0.7rem;
    font-weight: 600;
}

.sta-valuation-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #991b1b;
    padding: 16px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .sta-valuation-overview {
        padding: 18px;
    }
    .sta-valuation-layout {
        grid-template-columns: 1fr;
    }
    .sta-valuation-layout > .sta-valuation-benchmark {
        grid-column: 1 / -1;
    }
    .sta-valuation-hero {
        padding: 18px;
    }
    .sta-focus-grid {
        grid-template-columns: 1fr;
    }
    .sta-highlight-list li {
        grid-template-columns: minmax(120px, 1fr) 90px 70px 60px;
    }
    .sta-benchmark-tabs {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .sta-benchmark-legend {
        flex-direction: column;
        align-items: flex-start;
    }
    .sta-valuation-benchmark canvas {
        min-height: 220px;
    }
}
