/* --- Global & Typography Overrides --- */
.text-brand {
    color: var(--brand-primary) !important;
}

.tracking-wider {
    letter-spacing: 0.1em;
}

.tiny {
    font-size: 0.85rem;
}

.cursor-pointer {
    cursor: pointer;
}

/* Custom Card Style */
.card-custom {
    background-color: var(--bg-card, #151922);
    border: 1px solid var(--border-color, #2a2e39);
    border-radius: 12px;
    font-weight: 600;
}

.card-label {
    font-size: 1.0rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

/* Header Stats */
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 700;
}

/* Pill Groups (Chart Controls) */
.pill-group {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 3px;
    border-radius: 20px;
    display: inline-flex;
    border: 1px solid var(--border-color);
}

.pill-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 16px;
    transition: 0.2s;
}

.pill-item.active {
    background-color: var(--brand-primary);
    color: white;
}

a .pill-item:hover:not(.active) {
    color: white;
}

/* Badges */
.badge-up-outline {
    background: rgba(38, 166, 154, 0.1);
    color: var(--trend-up, #26a69a);
    border: 1px solid color-mix(in srgb, var(--trend-up, #26a69a) 70%, transparent);
    font-size: 0.9rem;
    font-weight: 700;
}

.badge-down-outline {
    background: rgba(61, 113, 234, 0.1);
    color: var(--trend-down);
    border: 1px solid color-mix(in srgb, var(--trend-down, #26a69a) 70%, transparent);
    font-size: 0.9rem;
    font-weight: 700;
}

/* Health Dash Group */
.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    color: var(--text-main)
    font-size: 0.9rem;
}

.dash-group {
    display: flex;
    align-items: center;
    width: 50%;
    gap: 5px;
}

.dash {
    height: 5px;
    flex: 1;
    background: var(--border-color);
    border-radius: 2px;
}

.dash.active {
    background: var(--brand-primary);
}


/* Stats Box (For Institutional & Vitality) */
.stat-box-inner {
    background-color: var(--bg-block);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    transition: 0.2s;
}

a .stat-box-inner:hover {
    transform: translateY(-2px) scale(1.03);
    border-color: var(--brand-primary);
}

/* RWD Borders */
@media (min-width: 992px) {
    .border-end-lg {
        border-right: 1px solid var(--border-color) !important;
    }
}

.section-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.4rem;
}

/* News Section Hover */
/* .news-hero {
    cursor: pointer;
    transition: 0.2s;
}

.news-hero:hover {
    background: linear-gradient(90deg, transparent 0%, rgba(61, 113, 234, 0.05) 100%);
}

.news-list-item {
    cursor: pointer;
    transition: 0.2s;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.news-list-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.view-all-hover:hover {
    background-color: rgba(255, 255, 255, 0.02);
} */

/* SVG Chart / Radar settings */
.radar-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 300px;
}

/* Bar Chart (Stakeholder) */
.bar-chart-display {
    max-width: 400px;
    margin: 0 auto;
}

.bar-pillar {
    transition: height 0.5s ease;
}


/* Mini Tickers (Focal Stocks Bottom Row) */
.mini-ticker {
    background-color: var(--bg-block);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    color: var(--text-main);
    font-size: 1.0rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: 0.2s;
    flex: 1 1 200px;
    min-width: 150px;
    max-width: 100%;
}

a .mini-ticker:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--brand-primary);
}

/* Sector Performance Highlight Cards */
.sector-card {
    background-color: var(--bg-block);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: 0.2s;
}

.sector-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
}

a .sector-card:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--brand-primary);
}

.border-trend-up::before { background-color: var(--trend-up); }
.border-trend-down::before { background-color: var(--trend-down); }

/* Mini Sector Grids */
.mini-sector {
    background-color: var(--bg-block);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1.0rem;
    font-weight: 600;
    transition: 0.2s;
    cursor: pointer;
}

a .mini-sector:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--brand-primary);
}

.badge-leader-pill {
    display: inline-block;
    background: rgba(0, 122, 255, 0.15);
    color: var(--brand-primary);
    font-size: 0.95rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}


/* --- Ranking Tabs (依據圖片需求補充) --- */

.rank-tabs-container {
    border: 0;
    position: relative;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
}

.rank-tabs-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-image: var(--hr-gradient);
}

.nav-rank {
    display: flex;
    gap: 2.5rem; /* 控制選項間距 */
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-rank .nav-item {
    margin-bottom: -1px; /* 讓 active 底線與 container 邊框重疊 */
}

.nav-rank .nav-link {
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    transition: 0.2s; /* 共用你的 0.2s transition */
    cursor: pointer;
}

/* Hover 狀態：複用你的 hover 邏輯，提升亮度 */
.nav-rank .nav-link:hover {
    color: var(--text-main);
}

/* Active 狀態：使用藍色底線指標 */
.nav-rank .nav-link.active {
    color: var(--text-main) !important;
}

.nav-rank .nav-link.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--brand-primary); /* 共用藍色主色 */
    border-radius: 2px 2px 0 0;
}

.nav-time {
    display: flex;
    gap: 1.5rem; /* 比主選單稍微緊湊一點 */
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-time .nav-link {
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0.4rem 0; /* 上下 padding 小一點 */
    font-size: 1rem; /* 字體稍微縮小區分層級 */
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: 0.2s;
    cursor: pointer;
    letter-spacing: 0.05rem;
}

.nav-time .nav-link:hover {
    color: var(--text-main);
}

.nav-time .nav-link.active {
    color: var(--text-main) !important;
    font-weight: 700; /* 選中時加粗 */
}

/* 子選單專屬的白色底線 */
.nav-time .nav-link.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px; /* 比主選單的 3px 稍微細一點 */
    background-color: var(--text-main, #ffffff); /* 白色底線 */
    border-radius: 2px 2px 0 0;
}