/* ==========================================================================
   StockRadar — 双平台社交情绪共振雷达（独立页面模板样式）
   暗黑量化终端风 / 与主题样式完全解耦，仅作用于 .sr- 前缀元素
   ========================================================================== */

.sr-page {
    background: #0b0f19;
    color: #e2e8f0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 60vh;
}

.sr-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 16px 72px;
}

/* ---- Header ---- */

.sr-header {
    text-align: center;
    margin-bottom: 32px;
}

.sr-title {
    margin: 0;
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.sr-update {
    margin: 10px 0 0;
    font-size: 1.4rem;
    color: #64748b;
}

#sr-update-time {
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
}

.sr-gauge {
    max-width: 420px;
    margin: 8px auto 0;
}

/* ---- Tabs ---- */

.sr-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.sr-tab {
    padding: 10px 18px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #1e293b;
    border-radius: 999px;
    transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sr-tab:hover {
    color: #e2e8f0;
    border-color: #334155;
}

.sr-tab.is-active {
    color: #f8fafc;
    background: rgba(56, 189, 248, 0.08);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* ---- Cards grid ---- */

.sr-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

/* grid children default to min-width:auto; without this a fixed-width
   ApexCharts svg (initialized on a wider viewport) stretches the column */
.sr-cards-grid > * {
    min-width: 0;
}

.sr-trend .apexcharts-canvas,
.sr-trend svg {
    max-width: 100%;
}

.sr-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: #131b2e;
    border: 1px solid #1e293b;
    border-radius: 12px;
}

.sr-card-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
}

.sr-card-symbol {
    margin: 0;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #f8fafc;
    font-variant-numeric: tabular-nums;
}

.sr-card-company {
    margin: 2px 0 0;
    font-size: 1.3rem;
    color: #64748b;
}

.sr-heat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

/* ---- 舆情与股价联动信号（stock.signal 缺失时不渲染） ---- */

.sr-card-badges {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.sr-signal-badge {
    padding: 4px 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #c4b5fd;
    white-space: nowrap;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 999px;
}

.sr-signal-badge--lead {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    animation: sr-signal-lead-pulse 2.4s ease-in-out infinite;
}

@keyframes sr-signal-lead-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
    50% { box-shadow: 0 0 12px 2px rgba(245, 158, 11, 0.28); }
}

.sr-signal-badge--risk {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.sr-signal-badge--div {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.4);
}

.radar-signal-box {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 14px;
    padding: 10px 12px;
    font-size: 1.3rem;
    line-height: 1.6;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 10px;
}

.signal-tag {
    flex-shrink: 0;
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
}

.signal-desc { color: #cbd5e1; }

.drawer-signal-banner {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
}

.banner-title {
    margin-bottom: 6px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fbbf24;
}

.banner-content {
    font-size: 1.35rem;
    line-height: 1.7;
    color: #e2e8f0;
}

.sr-tip {
    padding: 4px 6px;
    font-size: 12px;
    line-height: 1.6;
}

.sr-tip b {
    display: block;
    margin-bottom: 2px;
    color: #f8fafc;
}

@media (prefers-reduced-motion: reduce) {
    .sr-signal-badge--lead { animation: none; }
}

/* ---- Dual rails (bull / bear bars) ---- */

.sr-rails {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sr-rail {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 1.2rem;
}

.sr-rail-label {
    flex-shrink: 0;
    width: 52px;
    color: #94a3b8;
    font-weight: 600;
}

.sr-rail-track {
    display: flex;
    flex: 1;
    height: 14px;
    overflow: hidden;
    background: #0b0f19;
    border-radius: 999px;
}

.sr-rail-bull {
    background: #10b981;
    border-radius: 999px 0 0 999px;
}

.sr-rail-bear {
    background: #ef4444;
    border-radius: 0 999px 999px 0;
}

.sr-rail-pct {
    flex-shrink: 0;
    width: 58px;
    color: #cbd5e1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---- Focus ---- */

.sr-focus h4 {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #38bdf8;
}

.sr-focus p {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.65;
    color: #cbd5e1;
}

/* ---- Trend chart ---- */

.sr-trend {
    border: 1px solid #1e293b;
    border-radius: 8px;
    overflow: hidden;
}

.sr-trend-head {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #1e293b;
}

.sr-trend-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #94a3b8;
}

.sr-time-btns {
    display: flex;
    gap: 4px;
}

.sr-time-btn {
    padding: 3px 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid transparent;
    border-radius: 999px;
    transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sr-time-btn:hover {
    color: #e2e8f0;
}

.sr-time-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.sr-new-badge {
    padding: 3px 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 999px;
}

/* ---- Detail drawer (slide-over) ---- */

.sr-card-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.sr-deep-link {
    font-size: 1.3rem;
    font-weight: 700;
    color: #38bdf8;
    cursor: pointer;
}

.sr-card {
    cursor: pointer;
}

.sr-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    width: 100%;
    max-width: 512px;
    padding: 0 20px 32px;
    overflow-y: auto;
    background: #0f172a;
    border-left: 1px solid #1e293b;
    transition: transform 0.3s ease;
}

.sr-drawer.translate-x-full {
    transform: translateX(100%);
}

.sr-drawer.translate-x-0 {
    transform: translateX(0);
}

.sr-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.sr-drawer-backdrop.hidden {
    display: none;
}

.sr-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 0 14px;
    margin-bottom: 8px;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
}

.sr-drawer-title-area .sr-card-symbol {
    font-size: 2.6rem;
}

.sr-drawer-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    font-size: 2.8rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.sr-drawer-close:hover {
    color: #e2e8f0;
}

.sr-drawer-body {
    font-size: 1.4rem;
}

.sr-drawer-section {
    margin-bottom: 24px;
}

.sr-drawer-section h4 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #38bdf8;
}

.sr-drawer-bullets {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
    color: #cbd5e1;
}

.sr-drawer-bullets li {
    margin-bottom: 8px;
    line-height: 1.65;
}

.sr-src-item {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(11, 15, 25, 0.6);
    border-radius: 8px;
}

.sr-src-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 999px;
}

.sr-src-badge--reddit {
    color: #f97316;
    background: rgba(249, 115, 22, 0.12);
}

.sr-src-badge--x {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

.sr-src-main {
    min-width: 0;
}

.sr-src-title {
    color: #e2e8f0;
    line-height: 1.5;
}

.sr-src-meta {
    margin-top: 2px;
    font-size: 1.2rem;
    color: #64748b;
}

/* ---- Quotes (bull vs bear voices) ---- */

.sr-quotes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sr-quote {
    padding: 12px 14px;
    background: rgba(11, 15, 25, 0.6);
    border-radius: 8px;
}

.sr-quote-bull {
    border-left: 3px solid #10b981;
}

.sr-quote-bear {
    border-left: 3px solid #ef4444;
}

.sr-quote-tag {
    display: block;
    margin-bottom: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.sr-quote p {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.sr-quote cite {
    display: block;
    margin-top: 6px;
    font-size: 1.2rem;
    font-style: normal;
    color: #64748b;
}

/* ---- Loading / error placeholders ---- */

.sr-placeholder {
    grid-column: 1 / -1;
    padding: 48px 20px;
    font-size: 1.5rem;
    color: #64748b;
    text-align: center;
    border: 1px dashed #1e293b;
    border-radius: 12px;
}

.sr-retry-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 24px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: #38bdf8;
    border: 0;
    border-radius: 999px;
}

/* ---- Responsive ---- */

@media (max-width: 767px) {
    .sr-main {
        padding: 28px 14px 56px;
    }

    .sr-title {
        font-size: 2.4rem;
    }

    .sr-cards-grid {
        grid-template-columns: 1fr;
    }

    .sr-quotes-grid {
        grid-template-columns: 1fr;
    }

    .sr-tab {
        padding: 8px 14px;
        font-size: 1.3rem;
    }

    .sr-trend {
        min-height: 0;
    }
}
