/* --- 基礎設定 --- */
:root {
    --primary-red: #d32f2f;
    --dark-text: #1a1a1a;
    --muted-text: #666666;
    --light-bg: #f8f9fa;
    --border-color: #eeeeee;
}

body {
    font-family: 'Segoe UI', Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--dark-text);
    line-height: 1.6;
    background-color: #ffffff;
}

.fw-black { font-weight: 900 !important; }
.tracking-tighter { letter-spacing: -0.05em; }
.text-xs { font-size: 0.75rem; }
.x-small { font-size: 0.7rem; }
.font-mono { font-family: 'Space Mono', monospace; }

.site-header {
    border-top: 4px solid var(--primary-red); 
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -1px;
}

/* 跑馬燈動畫效果 */
#market-ticker {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-animation 50s linear infinite;
}

@keyframes ticker-animation {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

h1, h2, h3, h4 {
    color: var(--dark-text);
}

.border-danger {
    border-color: var(--primary-red) !important;
}

/* 左側邊欄小型新聞 */
.sidebar-news-list .news-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-news-list .news-item:last-child {
    border-bottom: none;
}

.sidebar-news-list .news-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.sidebar-news-list .news-title:hover {
    color: var(--primary-red);
}

/* 主內容大型頭條 (Big Card) */
#big-card-area .card {
    border: none;
    border-radius: 0;
    background: var(--light-bg);
}

#big-card-area .card-title {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 1rem;
}

/* 主列表新聞 (Small Cards) */
#small-card-area .news-card {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    transition: background 0.2s;
}

#small-card-area .news-card:hover {
    background: #fffcfc;
}

.news-card {
    overflow: hidden;
    height: 100%;
}

.news-card img {
    border-radius: 0;
    object-fit: cover;
    height: 180px;
    width: 100%;
}

.img-box {
    height: 100%;
    width: 100%;
}

.news-card .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 10px 0;
    color: var(--dark-text);
}

/* --- 分頁與按鈕 --- */
#pagination .btn {
    border-radius: 0;
    margin: 0 3px;
    font-weight: bold;
    border: 1px solid var(--border-color);
}

#pagination .btn-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

#pagination .btn-outline-primary {
    color: var(--primary-red);
    border-color: var(--border-color);
}

#pagination .btn-outline-primary:hover {
    background-color: var(--primary-red);
    color: #fff;
}

/* --- 頁尾 --- */
footer {
    background-color: #121212;
}

footer a:hover {
    color: #ffffff !important;
}

/* --- 響應式調整 --- */
@media (max-width: 991.98px) {
    .display-5 {
        font-size: 2.5rem;
    }
    #big-card-area .card-title {
        font-size: 1.5rem;
    }
}

/* --- 隱藏式 SEO 輔助 --- */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

#market-ticker {
    display: inline-block;
    white-space: nowrap;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
}

.text-success { color: #00ff88 !important; } 
.text-danger { color: #ff4d4d !important; }

.sidebar-sticky .bg-light {
    background-color: #fdfdfd !important;
    border: 1px solid #eee;
    box-shadow: 2px 2px 0px rgba(211, 47, 47, 0.05);
}

.progress {
    background-color: #e9ecef;
    border-radius: 0;
    overflow: hidden;
}

.progress-bar {
    transition: width 1s ease-in-out;
}

/* detail頁 */
.detail-content p {
    margin-bottom: 1.8rem;
    line-height: 1.8;
    color: #1a1a1a;
}

/* 針對 Site05 的字體風格 */
.fw-black { font-weight: 900 !important; }
.font-mono { font-family: 'Courier New', Courier, monospace; }
.tracking-tighter { letter-spacing: -1px; }

/* 詳情頁專屬裝飾 */
.news-detail-wrapper .img-box {
    border: 1px solid #eee;
    padding: 5px;
    background: #fff;
}

@media (min-width: 992px) {
    .border-end-lg {
        border-right: 1px solid #eee;
    }
}

/* --- News Detail Content Framework --- */
.detail-content {
    line-height: 1.8;
    color: #222;
    font-size: 1.1rem;
}

/* 1. 段落處理 */
.detail-content .paragraph {
    margin-bottom: 1.5rem;
}
.detail-content .first-para {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
    line-height: 1.6;
    margin-bottom: 2rem;
    position: relative;
}

/* 2. 子標題 - Site05 紅線風格 */
.detail-content .sub-title {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    color: #000;
    margin: 2.5rem 0 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #d32f2f;
    display: inline-block;
    letter-spacing: -0.5px;
}

/* 3. 引言 - 專家評論區塊 */
.detail-content .expert-quote {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-left: 5px solid #d32f2f;
    font-style: italic;
    font-weight: 500;
    color: #444;
    position: relative;
}
.detail-content .expert-quote::before {
    content: "\f10d"; /* FontAwesome quote left */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: -10px;
    left: 10px;
    color: #d32f2f;
    background: #f8f9fa;
    padding: 0 5px;
}

/* 4. 數據快照箱 - info-list-box */
.detail-content .info-list-box {
    background: #fff;
    border: 1px solid #dee2e6;
    margin: 2rem 0;
    padding: 0;
}
.detail-content .source-label {
    background: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 5px 15px;
    text-transform: uppercase;
}
.detail-content .custom-list {
    padding: 1.5rem;
    margin: 0;
    list-style: none;
}
.detail-content .custom-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}
.detail-content .custom-list li::before {
    content: "▶";
    color: #d32f2f;
    position: absolute;
    left: 0;
    font-size: 0.8rem;
}

/* 5. 專業數據表格 */
.detail-content .table-container {
    overflow-x: auto;
    margin: 2rem 0;
}
.detail-content .styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border: 1px solid #eee;
}
.detail-content .styled-table th {
    background: #f1f1f1;
    color: #000;
    text-transform: uppercase;
    font-weight: 800;
    padding: 12px;
    border-bottom: 2px solid #d32f2f;
}
.detail-content .styled-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

/* 6. FAQ 區塊 */
.detail-content .faq-section {
    background: #fffcfc;
    border: 1px dashed #d32f2f;
    padding: 1.5rem;
    margin-top: 3rem;
}