/* =========================================
   UUTW — LA Times 風格新聞網站
   Mobile-first RWD
   ========================================= */

/* --- CSS Variables --- */
:root {
    --color-black: #000000;
    --color-dark: #1a1a1a;
    --color-gray-900: #222222;
    --color-gray-700: #444444;
    --color-gray-500: #666666;
    --color-gray-400: #888888;
    --color-gray-300: #aaaaaa;
    --color-gray-200: #d0d0d0;
    --color-gray-100: #e8e8e8;
    --color-gray-50: #f4f4f4;
    --color-white: #ffffff;
    --color-accent: #0072bc;
    --color-accent-hover: #005a96;
    --color-urgent: #d32f2f;
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f0;

    /* 字體 — LA Times: 英文 Old English 風格 masthead + 襯線標題 + 無襯線內文 */
    --font-masthead: 'Noto Serif TC', 'Georgia', serif;
    --font-headline: 'Noto Serif TC', 'Georgia', 'Times New Roman', serif;
    --font-body: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-label: 'Noto Sans TC', sans-serif;

    --text-xs: 0.6875rem;    /* 11px */
    --text-sm: 0.8125rem;    /* 13px */
    --text-base: 0.9375rem;  /* 15px */
    --text-lg: 1.0625rem;    /* 17px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.375rem;    /* 38px */

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    --max-width: 1140px;
    --content-width: 680px;

    --border-thin: 1px solid #ddd;
    --border-section: 1px solid #ccc;
    --transition: 0.15s ease;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-dark);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-dark); text-decoration: none; }
a:hover { color: var(--color-black); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* =====================
   HEADER — LA Times 風格
   固定 header + 置中 logo + 左 Sections + 右 Login
   ===================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-white);
}

/* 登入後的頂部歡迎列（靠右、細緻、不搶眼） */
.header-top {
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid #eee;
    padding: 0.3rem 0;
    background: #fafafa;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-label);
    font-size: var(--text-xs);
    color: var(--color-gray-700);
    letter-spacing: 0.03em;
}
.header-actions span {
    color: var(--color-gray-500);
}
.header-actions a {
    color: var(--color-gray-700);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-left: 1px solid #ddd;
    transition: color var(--transition);
}
.header-actions a:first-of-type {
    border-left: none;
}
.header-actions a:hover {
    color: var(--color-accent);
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 120px;
}

.header-right {
    justify-content: flex-end;
}

/* 漢堡選單按鈕 */
.sections-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: 1px solid #ccc;
    padding: 0.375rem 0.75rem;
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-gray-700);
    cursor: pointer;
    letter-spacing: 0.02em;
}

.sections-btn:hover {
    border-color: var(--color-black);
    color: var(--color-black);
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hamburger-icon span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: currentColor;
}

/* Masthead — 報頭（置中） */
.masthead {
    text-align: center;
    flex: 1;
    position: relative;
}

/* 漢堡按鈕 — 預設桌面隱藏 */
.nav-toggle {
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 10px 8px;
    cursor: pointer;
    z-index: 50;
}
.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    margin: 5px 0;
    background: #c8102e;
    border-radius: 2px;
    transition: all 0.2s;
}
.nav-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
    line-height: 1;
}
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 98;
}
.nav-backdrop.show { display: block; }

.masthead h1 {
    line-height: 1;
    margin: 0;
}

.masthead h1 a {
    display: inline-block;
}

.masthead-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

@media (min-width: 768px) {
    .masthead-logo {
        height: 72px;
    }
}

@media (min-width: 1024px) {
    .masthead-logo {
        height: 84px;
    }
}

/* =====================
   HERO — 置頂新聞區
   ===================== */
.hero-section {
    padding: var(--space-lg) 0;
    border-bottom: var(--border-thin);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    align-items: start;
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 7fr 3fr;
    }
}

/* 左邊主新聞不跟隨右側側欄高度 */
.hero-main { align-self: start; }

.hero-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    align-items: start;
}

@media (min-width: 768px) {
    .hero-main {
        grid-template-columns: 1fr 2fr;
    }
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--space-sm);
}

.hero-img {
    width: 100%;
}
.hero-img img,
.hero-image {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    display: block;
}

.hero-category {
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-headline);
    font-size: var(--text-2xl);
    font-weight: 900;
    line-height: 1.2;
}

.hero-title a { color: inherit; }
.hero-title a:hover { color: var(--color-gray-500); }

.hero-excerpt {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    line-height: 1.5;
}

.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    border-left: none;
    padding-left: 0;
}

@media (min-width: 768px) {
    .hero-sidebar {
        border-left: var(--border-thin);
        padding-left: var(--space-lg);
    }
}

.hero-sidebar-item {
    padding-bottom: var(--space-sm);
    border-bottom: var(--border-thin);
}

.hero-sidebar-item:last-child {
    border-bottom: none;
}

.hero-sidebar-item h3 {
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.3;
    margin-top: var(--space-xs);
}

.hero-sidebar-item h3 a { color: inherit; }
.hero-sidebar-item h3 a:hover { color: var(--color-gray-500); }

.item-category {
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-accent);
}

/* =====================
   VIDEO EMBED — 影片嵌入（16:9 比例）
   ===================== */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;  /* 16:9 */
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-embed-sm {
    max-height: 220px;
}

/* Login 按鈕 */
.login-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-gray-700);
    border: 1px solid #ccc;
    background: none;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.login-btn:hover {
    border-color: var(--color-black);
    color: var(--color-black);
}

.search-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
    color: var(--color-gray-700);
    padding: 0.25rem;
}

/* 手機版搜尋圖示按鈕（預設桌機隱藏） */
.mobile-search-toggle {
    display: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 10px 8px;
    cursor: pointer;
    color: #c8102e;
    z-index: 50;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}
.mobile-search-toggle:hover { opacity: 0.75; }

/* 手機版搜尋展開框（預設隱藏） */
.mobile-search-bar {
    display: none;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}
.mobile-search-bar form {
    display: flex;
    padding: 0.55rem var(--space-md, 1rem);
    gap: 0;
}
.mobile-search-bar input[type="text"] {
    flex: 1;
    border: 1px solid #ccc;
    border-right: none;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    border-radius: 4px 0 0 4px;
    outline: none;
    min-width: 0;
    font-family: var(--font-body);
}
.mobile-search-bar input[type="text"]:focus {
    border-color: #c8102e;
}
.mobile-search-bar button[type="submit"] {
    background: #c8102e;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
    font-family: var(--font-label);
}
.mobile-search-bar button[type="submit"]:hover { background: #a50d26; }

/* Category Nav — 分類導覽列 */
.category-nav {
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-nav ul {
    display: flex;
    justify-content: center;
    gap: 0;
    white-space: nowrap;
}

.category-nav li a {
    display: block;
    padding: 0.6rem 1rem;
    font-family: var(--font-label);
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-gray-700);
    letter-spacing: 0.03em;
    transition: color var(--transition);
}

.category-nav li a:hover,
.category-nav li a.active {
    color: var(--color-black);
}

/* =====================
   TOP STORIES — LA Times 風格
   標題在左 + 圖在右，下方 bullet 列表
   ===================== */
.top-stories {
    padding: var(--space-lg) 0 var(--space-xl);
}

.top-stories-header {
    font-family: var(--font-headline);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: var(--border-section);
}

.top-story-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.top-story-text .story-label {
    display: inline-block;
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gray-500);
    margin-bottom: var(--space-sm);
}

.top-story-text .story-label.live {
    color: var(--color-white);
    background: var(--color-urgent);
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    letter-spacing: 0.1em;
}

.top-story-text h2 {
    font-family: var(--font-headline);
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-black);
    margin-bottom: var(--space-sm);
}

.top-story-text h2 a { color: inherit; }
.top-story-text h2 a:hover { color: var(--color-gray-700); }

.top-story-text .story-excerpt {
    font-size: var(--text-base);
    color: var(--color-gray-700);
    line-height: 1.55;
}

.top-story-image img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

/* Bullet sub-stories */
.top-stories-bullets {
    padding-top: var(--space-md);
    border-top: var(--border-thin);
}

.top-stories-bullets li {
    padding: 0.375rem 0;
    padding-left: 1rem;
    position: relative;
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.35;
}

.top-stories-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-urgent);
}

.top-stories-bullets li a { color: var(--color-dark); }
.top-stories-bullets li a:hover { color: var(--color-gray-500); }

/* =====================
   NEWS GRID — 三欄新聞卡片
   LA Times 風格：圖 + 粗標題
   ===================== */
.news-grid-section {
    padding: var(--space-lg) 0;
}

.news-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: var(--border-section);
}

.news-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.news-card img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

.news-card h3 {
    font-family: var(--font-headline);
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-black);
}

.news-card h3 a { color: inherit; }
.news-card h3 a:hover { color: var(--color-gray-500); }

/* 文字卡片（無圖，4 欄 grid） */
.news-grid-4-text {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: var(--border-thin);
    margin-top: var(--space-lg);
}

.news-card-text h3 {
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-black);
}

.news-card-text h3 a { color: inherit; }
.news-card-text h3 a:hover { color: var(--color-gray-500); }

/* =====================
   SECTION — 分類區塊
   LA Times 風格：細線 + 粗體區塊名
   ===================== */
.section-block {
    padding: var(--space-md) 0 var(--space-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    margin-bottom: var(--space-md);
    border-top: var(--border-section);
}

.section-header h2 {
    font-family: var(--font-headline);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-black);
}

.section-header .more-link {
    font-family: var(--font-headline);
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

.section-header .more-link::after {
    content: ' ›';
}

.section-header .more-link:hover {
    color: var(--color-black);
}

/* =====================
   共用時間樣式
   ===================== */
.meta-time {
    font-size: var(--text-xs);
    color: var(--color-gray-400);
}

/* =====================
   排版 A — 大圖上下排 + 第二排圖文左右並排卡片
   ===================== */
.lay-a-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
    .lay-a-top {
        grid-template-columns: 2fr 3fr;
    }
}

.lay-a-top__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-xs);
}

.lay-a-top__img img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

.lay-a-title {
    font-family: var(--font-headline);
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: 1.25;
}
.lay-a-title a { color: inherit; }
.lay-a-title a:hover { color: var(--color-gray-500); }

.lay-a-excerpt {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    line-height: 1.5;
}

/* =====================
   排版 B — 圖文左右並排（大），可翻轉
   圖片一側 + 標題摘要另一側
   ===================== */
.lay-side {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
    .lay-side {
        grid-template-columns: 3fr 2fr;
    }
}

.lay-side__img img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

.lay-side__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-sm);
}

.lay-side__text h3 {
    font-family: var(--font-headline);
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: 1.25;
}
.lay-side__text h3 a { color: inherit; }
.lay-side__text h3 a:hover { color: var(--color-gray-500); }

.lay-side__text p {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    line-height: 1.5;
}

/* 翻轉：文字在左、圖片在右 */
@media (min-width: 768px) {
    .lay-side--flip .lay-side__img { order: 2; }
    .lay-side--flip .lay-side__text { order: 1; }
}

/* =====================
   圖文橫排卡片列（共用）
   每張卡片 = 小圖左 + 標題摘要右
   ===================== */
.lay-hrow {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding-top: var(--space-sm);
    border-top: var(--border-thin);
}

@media (min-width: 768px) {
    .lay-hrow {
        grid-template-columns: repeat(3, 1fr);
    }
}

.lay-hcard {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
}

.lay-hcard__img {
    flex: 0 0 100px;
}

.lay-hcard__img img {
    width: 100px;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.lay-hcard__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.lay-hcard__body h4 {
    font-family: var(--font-headline);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
}
.lay-hcard__body h4 a { color: inherit; }
.lay-hcard__body h4 a:hover { color: var(--color-gray-500); }

.lay-hcard__excerpt {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    line-height: 1.4;
}

/* =====================
   排版 C — 三等分卡片（圖上文下 + 摘要）
   ===================== */
.lay-c {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .lay-c {
        grid-template-columns: repeat(3, 1fr);
    }
}

.lay-c__card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.lay-c__img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

.lay-c__card h4 {
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.3;
}
.lay-c__card h4 a { color: inherit; }
.lay-c__card h4 a:hover { color: var(--color-gray-500); }

.lay-c__excerpt {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    line-height: 1.4;
}

/* =====================
   純文字標題列（下方共用）
   ===================== */
.row-text-only {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: var(--space-sm);
    margin-top: var(--space-md);
    border-top: var(--border-thin);
}

@media (min-width: 768px) {
    .row-text-only {
        grid-template-columns: repeat(3, 1fr);
    }
}

.row-text-item {
    padding: var(--space-xs) var(--space-sm);
    border-bottom: var(--border-thin);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

@media (min-width: 768px) {
    .row-text-item {
        border-bottom: none;
        border-right: var(--border-thin);
    }
    .row-text-item:last-child {
        border-right: none;
    }
}

.row-text-item h4 {
    font-family: var(--font-headline);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
}

.row-text-item h4 a { color: inherit; }
.row-text-item h4 a:hover { color: var(--color-gray-500); }

/* 保留 article-card 供其他頁面使用 */
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.article-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.article-card .card-image {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

.article-card .card-title {
    font-family: var(--font-headline);
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-black);
}

.article-card .card-title a { color: inherit; }
.article-card .card-title a:hover { color: var(--color-gray-500); }

.article-card .card-excerpt {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    line-height: 1.5;
}

.article-card .card-meta {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
}

/* 置頂新聞區的時間 */
.hero-meta,
.item-meta {
    font-size: var(--text-xs);
    color: var(--color-gray-400);
}

/* 側欄最新新聞的時間 */
.sidebar .card-meta {
    font-size: var(--text-xs);
    color: var(--color-gray-400);
}

.article-card .card-category {
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 橫排卡片 */
.article-card-horizontal {
    display: flex;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: var(--border-thin);
}

.article-card-horizontal .card-image {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.article-card-horizontal .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.article-card-horizontal .card-title {
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-black);
}

/* =====================
   MAIN LAYOUT — 兩欄（內容 + 側欄）
   ===================== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr 300px;
    }
}

.sidebar {
    padding-top: var(--space-lg);
    border-top: var(--border-section);
}

@media (min-width: 768px) {
    .sidebar {
        border-top: none;
        border-left: var(--border-thin);
        padding-left: var(--space-lg);
        padding-top: 0;
    }
}

/* 側欄 — "In Case You Missed It" 風格 */
.sidebar-widget {
    margin-bottom: var(--space-xl);
}

.sidebar-widget h3 {
    font-family: var(--font-headline);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: var(--space-md);
    padding-top: var(--space-sm);
    border-top: var(--border-section);
}

/* "The Latest" 列表 */
.latest-list-item {
    padding: var(--space-sm) 0;
    border-bottom: var(--border-thin);
}

.latest-list-item h4 {
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-black);
}

.latest-list-item h4 a { color: inherit; }
.latest-list-item h4 a:hover { color: var(--color-gray-500); }

.latest-list-item .latest-excerpt {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    line-height: 1.4;
    margin-top: var(--space-xs);
}

/* =====================
   EDITOR'S PICKS — 編輯精選（黑底白字）
   LA Times "Timeless Archive" 風格
   ===================== */
.editor-picks {
    background: #1a1a1a;
    color: #ffffff;
    padding: var(--space-lg);
    margin: var(--space-md) 0;
}

.section-header-dark {
    border-top: 2px solid #ffffff;
    padding-top: var(--space-md);
    margin-bottom: var(--space-lg);
}

.section-header-dark h2 {
    color: #ffffff;
    font-family: var(--font-headline);
}

.editor-picks-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .editor-picks-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: var(--space-md);
    }
}

.ep-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.ep-image {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    margin-bottom: var(--space-xs);
}

.ep-category {
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 700;
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ep-title {
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.3;
}

.ep-title a {
    color: #ffffff;
}

.ep-title a:hover {
    color: #cccccc;
}

.ep-card:first-child .ep-title {
    font-size: var(--text-xl);
}

.ep-meta {
    font-size: var(--text-xs);
    color: #888888;
}

/* =====================
   FEATURED SECTION — 週末好去處
   LA Times "Festival of Books" 橫向捲動風格
   ===================== */
.featured-section {
    padding: var(--space-xl) 0;
}

.featured-section .section-header {
    border-top: var(--border-section);
    padding-top: var(--space-md);
    margin-bottom: var(--space-lg);
}

.featured-scroll {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-sm);
}

.featured-scroll::-webkit-scrollbar {
    height: 4px;
}

.featured-scroll::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
}

.featured-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 768px) {
    .featured-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.featured-list-item {
    padding: var(--space-sm) var(--space-sm);
    border-bottom: var(--border-thin);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

@media (min-width: 768px) {
    .featured-list-item {
        border-bottom: none;
        border-right: var(--border-thin);
    }
    .featured-list-item:last-child {
        border-right: none;
    }
}

.featured-list-item h3 {
    font-family: var(--font-headline);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
}
.featured-list-item h3 a { color: inherit; }
.featured-list-item h3 a:hover { color: var(--color-gray-500); }

.featured-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    margin-bottom: var(--space-sm);
}

.featured-card h3 {
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-black);
}

.featured-card h3 a { color: inherit; }
.featured-card h3 a:hover { color: var(--color-gray-500); }

.featured-card .card-excerpt {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    margin-top: var(--space-xs);
}

.featured-card .card-meta {
    font-size: var(--text-xs);
    color: var(--color-gray-400);
}

/* =====================
   ARTICLE PAGE — LA Times 風格文章內頁
   ===================== */

/* 文章標頭（全寬） */
.art-header {
    padding: var(--space-lg) 0 var(--space-md);
    border-bottom: var(--border-thin);
    margin-bottom: var(--space-md);
}

.art-category {
    display: inline-block;
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
}
.art-category:hover { color: var(--color-black); }

.art-title {
    font-family: var(--font-headline);
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-black);
}

@media (min-width: 768px) {
    .art-title {
        font-size: var(--text-4xl);
    }
}

/* 雙欄佈局 */
.art-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .art-layout {
        grid-template-columns: 1fr 300px;
    }
}

/* 文章圖片 */
.art-featured-img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    margin-bottom: var(--space-md);
}

/* 時間 + 分享 */
.art-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    padding-bottom: var(--space-md);
    border-bottom: var(--border-thin);
    margin-bottom: var(--space-lg);
}

.art-share {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.art-share a {
    color: var(--color-gray-500);
    font-size: var(--text-xs);
    font-weight: 600;
}
.art-share a:hover { color: var(--color-black); }

/* 內文 */
.art-body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-gray-900);
}
/* 保險絲：強制清掉 Email/貼文帶進來的背景色（Outlook/Word/Gmail 常見問題）*/
.art-body, .art-body * {
    background-color: transparent !important;
    background-image: none !important;
}

/* 強制所有內文元素字級一致（覆蓋舊站內嵌 <font size>、style="font-size"、<small> 等）*/
.art-body p,
.art-body div,
.art-body span,
.art-body font,
.art-body small,
.art-body li,
.art-body td,
.art-body b,
.art-body strong,
.art-body em {
    font-size: 1.0625rem !important;
    line-height: 1.85 !important;
}
.art-body h1, .art-body h2, .art-body h3, .art-body h4 {
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
}

.art-body p { margin-bottom: var(--space-md); }
/* 強制所有文章圖片都用大張統一尺寸（覆蓋舊站內嵌的 width/height） */
.art-body img {
    display: block;
    margin: var(--space-lg) auto;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    border-radius: 2px;
}
.art-body a { color: var(--color-accent); text-decoration: underline; }

/* ===== 封面圖（外層）===== */
.art-cover {
    margin: 0 0 1.25rem 0;
}
.art-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 0;
}
/* 封面圖說：緊貼在封面圖下方 */
.art-caption {
    display: block;
    font-size: 0.875rem;         /* ~14px，比內文小 */
    line-height: 1.55;
    color: var(--color-gray-500);
    text-align: center;
    margin: 0.25rem 0 0 0;       /* 緊貼圖片，不留大間距 */
    padding: 0 0.5rem;
    font-style: normal;
}
.art-caption::before {
    content: '▲';
    color: #e60012;               /* 紅色 */
    margin-right: 0.35em;
    font-size: 0.9em;
    display: inline-block;
}

/* 首圖圖說（DB thumb_caption 欄位，爬蟲自動填入或後台手動覆寫）
   <figcaption class="thumb-caption"> 緊貼在 <img> 下方，figure 的 margin-bottom 負責與下方元素的間距 */
.thumb-caption {
    display: block;
    font-size: 0.875rem;           /* ≈14px，與內文 figcaption 一致 */
    color: var(--color-gray-500);  /* #666666 */
    text-align: center;
    margin: 0.35rem 0 0 0;         /* 緊貼圖片下方；底部間距由 .art-cover margin-bottom 負責 */
    padding: 0 0.5rem;
    line-height: 1.55;
    font-style: normal;
    font-weight: 400;
}

/* ===== 內文中的圖片說明（figcaption）— 比內文字小、灰色、置中 ===== */
.art-body figure {
    margin: var(--space-lg) 0 !important;
    padding: 0 !important;
}
.art-body figure img {
    display: block !important;
    margin: 0 auto !important;   /* 圖在 figure 內緊貼底部，讓圖說緊接在下 */
    width: 100% !important;
    height: auto !important;
    border-radius: 2px;
}
.art-body figcaption,
.art-body figure figcaption {
    display: block !important;
    font-size: 0.875rem !important;  /* ~14px，比內文 17px 小 */
    line-height: 1.55 !important;
    color: var(--color-gray-500) !important;
    text-align: center !important;
    margin: 0.25rem 0 0 0 !important;  /* 緊貼圖片 */
    padding: 0 0.5rem !important;
    font-style: normal !important;
    font-weight: 400 !important;
}
.art-body figcaption::before {
    content: '▲';
    color: #e60012;
    margin-right: 0.35em;
    font-size: 0.9em;
    display: inline-block;
}

/* 來源 */
.art-source {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: var(--border-thin);
}

/* 底部相關新聞 */
.art-related {
    padding: var(--space-lg) 0;
    border-top: var(--border-section);
    margin-top: var(--space-lg);
}

/* 保留舊 class 相容其他頁面 */
.article-page {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

/* =====================
   CATEGORY PAGE
   ===================== */
.category-page { padding: var(--space-lg) 0; }

.category-page .page-title {
    font-family: var(--font-headline);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-black);
}

/* ===== 分類子頁 — 置頂文章（文字左 + 圖右）===== */
.cat-lead {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: var(--border-thin);
    margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
    .cat-lead {
        grid-template-columns: 2fr 3fr;
    }
}

.cat-lead__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-sm);
}

.cat-lead__text h2 {
    font-family: var(--font-headline);
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.2;
}
.cat-lead__text h2 a { color: inherit; }
.cat-lead__text h2 a:hover { color: var(--color-gray-500); }

.cat-lead__text p {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    line-height: 1.5;
}

.cat-lead__img img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

/* ===== 分類子頁 — 3 欄文章網格 ===== */
.cat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding-top: var(--space-md);
}

@media (min-width: 768px) {
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.cat-grid__ad {
    grid-column: 1 / -1;
}

.cat-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.cat-card__img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

.cat-card h3 {
    font-family: var(--font-headline);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.3;
}
.cat-card h3 a { color: inherit; }
.cat-card h3 a:hover { color: var(--color-gray-500); }

.cat-card p {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    line-height: 1.4;
}

/* ===== 側欄 — 最多閱讀（編號列表）===== */
.sidebar-list-item {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    padding: var(--space-sm) 0;
    border-bottom: var(--border-thin);
}

.sidebar-list-item:last-child {
    border-bottom: none;
}

.sidebar-list-num {
    font-family: var(--font-headline);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-gray-300);
    flex: 0 0 1.5rem;
    line-height: 1;
}

.sidebar-list-item h4 {
    font-family: var(--font-headline);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
}
.sidebar-list-item h4 a { color: inherit; }
.sidebar-list-item h4 a:hover { color: var(--color-gray-500); }

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: var(--border-thin);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 var(--space-sm);
    font-size: var(--text-sm);
    border: 1px solid #ddd;
    color: var(--color-gray-700);
}

.pagination a:hover { background: var(--color-gray-50); border-color: var(--color-black); }
.pagination .current { background: var(--color-black); color: var(--color-white); border-color: var(--color-black); }

/* =====================
   FOOTER — 深色底 footer
   ===================== */
.site-footer {
    background: var(--color-dark);
    color: var(--color-gray-300);
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: var(--space-2xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;  /* mobile: 單欄 */
    gap: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
}

.footer-col h4 {
    font-family: var(--font-label);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: var(--space-md);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-col a {
    display: block;
    color: var(--color-gray-300);
    font-size: var(--text-sm);
    padding: var(--space-xs) 0;
}

.footer-col a:hover { color: var(--color-white); }

.footer-bottom {
    border-top: 1px solid var(--color-gray-700);
    padding-top: var(--space-md);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-gray-500);
}

/* =====================
   ADVERTISEMENTS
   ===================== */
/* 廣告輪播（.promo-* 是繞 Samsung Internet 廣告攔截器用的中性別名，首頁套新名、文章頁舊名保留） */
.ad-carousel,
.promo-carousel {
    position: relative;
    text-align: center;
    margin: var(--space-sm) 0;
}

.ad-carousel__slide,
.promo-carousel__slide {
    display: none;
}

.ad-carousel__slide.active,
.promo-carousel__slide.active {
    display: block;
}

.ad-carousel__slide img,
.promo-carousel__slide img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    margin: 0 auto;
}

.ad-banner {
    text-align: center;
    padding: var(--space-sm) 0;
    margin: var(--space-md) 0;
}

.ad-banner .ad-label {
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-gray-400);
    margin-bottom: var(--space-xs);
}

.ad-banner img { max-width: 100%; margin: 0 auto; }

/* 側欄廣告 — 精緻小標 + 圓角 */
.sidebar-ad {
    background: var(--color-gray-50);
    border-radius: 4px;
    padding: var(--space-sm);
}
.sidebar-ad .ad-label {
    display: block;
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-gray-400);
    margin-bottom: var(--space-xs);
    text-align: right;
}
.sidebar-ad img {
    border-radius: 2px;
    max-height: 280px;
    width: 100%;
    object-fit: contain;
}

/* 手機版文章頁客戶廣告區塊：desktop 預設隱藏（因為 sidebar 已經有了） */
.mobile-ads-block { display: none; }

/* =====================
   LOGIN MODAL
   ===================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--color-white);
    padding: var(--space-xl);
    width: 90%;
    max-width: 380px;
}

.modal-box h2 {
    font-family: var(--font-headline);
    font-size: var(--text-xl);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.form-group { margin-bottom: var(--space-md); }

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-xs);
    color: var(--color-gray-700);
}

.form-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    font-size: var(--text-base);
    font-family: var(--font-body);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-black);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-label);
    font-size: var(--text-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-black);
    color: var(--color-white);
    width: 100%;
    padding: 0.75rem;
}

.btn-primary:hover { background: #333; }

/* =====================
   SEARCH BAR
   ===================== */
.search-bar { display: flex; gap: 0; }

.search-bar input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-right: none;
    font-size: var(--text-sm);
}

.search-bar button {
    padding: 0.5rem 0.75rem;
    background: var(--color-black);
    color: var(--color-white);
    border: 1px solid var(--color-black);
    cursor: pointer;
    font-size: var(--text-sm);
}

/* =====================
   UTILITIES
   ===================== */
.text-center { text-align: center; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* =====================
   RESPONSIVE — 平板 (768px+)
   ===================== */
@media (min-width: 768px) {
    /* 桌面版隱藏手機穿插廣告（避免與側欄廣告重複）*/
    .inline-ad,
    .inline-promo { display: none !important; }

    :root {
        --text-3xl: 2.25rem;
        --text-2xl: 1.75rem;
        --text-xl: 1.375rem;
    }

    .masthead h1 { font-size: 2.25rem; }

    .top-story-main {
        grid-template-columns: 1fr 1fr;
    }

    .news-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .news-grid-4-text {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);  /* tablet 以上：2 欄 */
    }

    .article-card-horizontal .card-image {
        width: 160px;
        min-width: 160px;
    }
}

/* =====================
   RESPONSIVE — 桌面 (1024px+)
   ===================== */
@media (min-width: 1024px) {
    :root {
        --text-3xl: 2.625rem;
        --text-2xl: 2rem;
        --text-xl: 1.5rem;
        --text-base: 1rem;
    }

    .masthead h1 { font-size: 2.625rem; }

    .main-layout {
        grid-template-columns: 1fr 280px;
    }

    .sidebar {
        padding-top: 0;
        border-top: none;
        border-left: var(--border-thin);
        padding-left: var(--space-xl);
    }

    .news-grid-4-text {
        grid-template-columns: repeat(4, 1fr);
    }

    .article-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);  /* desktop 維持 2 欄 */
    }

    .article-page .article-title {
        font-size: var(--text-4xl);
    }

    .featured-card {
        flex: 0 0 220px;
    }
}

/* =====================
   RESPONSIVE — 大螢幕 (1280px+)
   ===================== */
@media (min-width: 1280px) {
    .top-story-text h2 {
        font-size: var(--text-4xl);
    }
}

/* =====================
   GOOGLE ADSENSE 廣告容器
   ===================== */
.adsense-container {
    margin: var(--space-lg) 0;
    text-align: center;
    overflow: hidden;
}

.adsense-container ins {
    display: block;
}

/* 頁首橫幅 */
.adsense-header {
    margin: var(--space-md) 0;
}

/* 側欄 */
.adsense-sidebar {
    margin: 0 0 var(--space-md);
}

/* 文章列表間（融入排版） */
.adsense-infeed {
    margin: var(--space-md) 0;
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--color-gray-100);
    border-bottom: 1px solid var(--color-gray-100);
}

/* 文章內文 */
.adsense-article {
    margin: var(--space-xl) 0;
}

/* 頁尾 */
.adsense-footer {
    margin: 0;
    padding: var(--space-md) 0;
    background: var(--color-bg-alt);
}

/* 開發階段佔位區塊 */
.adsense-placeholder {
    background: var(--color-gray-50);
    border: 2px dashed var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.adsense-placeholder span {
    font-family: var(--font-label);
    font-size: var(--text-xs);
    color: var(--color-gray-400);
    letter-spacing: 0.05em;
}

/* =====================
   MOBILE FIXES — 手機版專屬修正
   ===================== */
@media (max-width: 767px) {
    /* 廣告間距 */
    .adsense-container {
        margin: var(--space-md) 0;
    }

    /* 手機版 masthead：改為 flex 三欄，不再靠 absolute 定位 */
    .masthead {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }
    .masthead h1 {
        flex: 1;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }
    /* 顯示漢堡按鈕和搜尋圖示 */
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: static;
        transform: none;
        top: auto;
        left: auto;
        flex-shrink: 0;
        width: 44px;
    }
    .mobile-search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: static;
        transform: none;
        top: auto;
        right: auto;
        flex-shrink: 0;
        width: 44px;
    }
    .mobile-search-bar.open { display: block; }

    /* 手機版分類 nav → 改成從左滑出的抽屜選單 */
    .category-nav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 78%;
        max-width: 320px;
        background: #fff;
        border-right: 1px solid #e0e0e0;
        border-bottom: none;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 99;
        padding: 3.5rem 0 1rem;
        box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    }
    .category-nav.open { transform: translateX(0); }
    .nav-close { display: block; }
    .category-nav ul {
        display: block;
        white-space: normal;
    }
    .category-nav li { border-bottom: 1px solid #f0f0f0; }
    .category-nav li a {
        display: block;
        font-size: 1.05rem;
        padding: 0.95rem 1.25rem;
        font-weight: 500;
    }
    .category-nav li a.active {
        color: #c8102e;
        font-weight: 700;
    }

    /* 手機版：點 logo 區左側有漢堡，標題稍微留空間 */
    .masthead h1 { padding-left: 2.4rem; padding-right: 2.4rem; }

    /* 手機版：隱藏側邊欄（廣告改穿插在新聞中間）*/
    .sidebar {
        display: none !important;
    }

    /* 手機版新聞間穿插廣告：乾淨樣式，不加邊框（2026-04-22 拔框） */
    .inline-ad,
    .inline-promo {
        margin: var(--space-lg) 0;
        padding: 0;
        background: transparent;
        min-height: 140px;
    }
    .inline-ad .ad-label,
    .inline-promo .promo-label {
        display: block;
        font-size: 0.6875rem;
        letter-spacing: 0.2em;
        color: var(--color-gray-400);
        text-transform: uppercase;
        margin-bottom: 0.35rem;
        text-align: center;
    }
    .inline-ad a,
    .inline-promo a {
        display: block;
        text-align: center;
    }
    .inline-ad img,
    .inline-promo img {
        width: 100%;
        height: auto;
        display: block;
        min-height: 100px;
        object-fit: contain;
    }
    /* 手機版首頁頂部客戶宣傳輪播（無邊框、保留 min-height 避免圖片未載完時塌陷） */
    #adCarouselTop,
    #promoCarouselTop {
        min-height: 100px;
        margin: var(--space-md) 0;
        padding: 0;
    }
    #adCarouselTop .ad-carousel__slide img,
    #promoCarouselTop .promo-carousel__slide img {
        min-height: 80px;
        object-fit: contain;
    }

    /* 手機版文章頁客戶廣告區塊（放在文章本文下方、sidebar 之前） */
    .mobile-ads-block {
        display: block;
        margin: var(--space-xl) 0;
    }
    .mobile-ads-block__item {
        margin: 0 0 var(--space-md) 0;
        padding: 0;
        background: transparent;
        text-align: center;
    }
    .mobile-ads-block__item:last-child { margin-bottom: 0; }
    .mobile-ads-block__item .ad-label {
        display: block;
        font-size: 0.6875rem;
        letter-spacing: 0.2em;
        color: var(--color-gray-400);
        text-transform: uppercase;
        margin-bottom: 0.35rem;
    }
    .mobile-ads-block__item a { display: block; }
    .mobile-ads-block__item img {
        width: 100%;
        max-height: 220px;
        height: auto;
        display: block;
        min-height: 60px;
        object-fit: contain;
    }
    .mobile-ads-block #adCarouselArtMobile { margin: 0; }
    .mobile-ads-block #adCarouselArtMobile .ad-carousel__slide img {
        min-height: 100px;
        object-fit: contain;
    }

    /* 手機版字體放大（提升可讀性）*/
    html {
        font-size: 17px; /* 從 16px 提升到 17px，所有 rem 字都會變大 */
    }
    body {
        font-size: 1rem; /* 約 17px */
        line-height: 1.7;
    }

    /* 文章內文字體加大 — 強制覆蓋舊站內嵌 <font size>、style="font-size"、<small> 等 */
    .art-body,
    .art-body p,
    .art-body div,
    .art-body span,
    .art-body font,
    .art-body small,
    .art-body li,
    .art-body td,
    .art-body b,
    .art-body strong,
    .art-body em {
        font-size: 1.0625rem !important; /* ~18px 全文一致 */
        line-height: 1.85 !important;
    }
    .art-body h1, .art-body h2, .art-body h3, .art-body h4 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
    }

    /* 圖片說明（手機版也保持比內文小）*/
    .art-body figcaption,
    .art-body figure figcaption,
    .art-caption,
    .thumb-caption {
        font-size: 0.9rem !important;   /* 約 15.3px，比內文 ~18px 小 */
        line-height: 1.55 !important;
    }

    /* 側欄、卡片標題放大 */
    .sidebar-list-item h4,
    .lay-hcard__body h4,
    .row-text-item h4,
    .lay-c__card h4 {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Hero 標題與摘要 */
    .hero-title { font-size: 1.6rem; line-height: 1.3; }
    .hero-excerpt { font-size: 1rem; line-height: 1.6; }
    .hero-sidebar-item h3 { font-size: 1.05rem; line-height: 1.4; }

    /* 分類區塊標題 */
    .section-header h2 { font-size: 1.35rem; }
    .lay-a-title { font-size: 1.3rem; line-height: 1.35; }
    .lay-side__text h3 { font-size: 1.25rem; line-height: 1.35; }

    /* 時間標籤 */
    .meta-time,
    .item-meta,
    .hero-meta {
        font-size: 0.85rem;
    }

    /* Footer 3 欄手機版：縮小欄位字體避免擠 */
    .footer-col h4 {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }
    .footer-col a {
        font-size: 0.8125rem;
        padding: 0.15rem 0;
        line-height: 1.4;
    }
}

/* =====================
   PRINT
   ===================== */
@media print {
    /* ── 隱藏非內容區域 ── */
    .site-header,
    .site-footer,
    .category-nav,
    .sidebar,
    .mobile-ads-block,
    .ad-banner,
    .adsense-container,
    .adsense-sidebar,
    .art-share,
    .art-related,
    .pagination,
    .section-header,
    nav,
    button { display: none !important; }

    /* ── 版面展開為單欄 ── */
    body {
        font-size: 12pt;
        color: #000 !important;
        background: #fff !important;
    }
    .article-page {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    .art-layout {
        display: block !important;   /* 取消 grid 雙欄，讓內文佔滿整頁寬 */
    }
    .art-content {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ── 文字 ── */
    .art-body,
    .art-body p,
    .art-body div,
    .art-body span,
    .art-body li,
    .art-body td {
        font-size: 12pt !important;
        line-height: 1.7 !important;
        color: #000 !important;
    }
    .art-body a {
        color: #000 !important;
        text-decoration: underline;
    }
    .article-title {
        font-size: 20pt !important;
        color: #000 !important;
    }

    /* ── 圖片 ── */
    .art-cover img,
    .art-body img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }

    /* ── 避免段落被切斷 ── */
    p, figure, h2, h3, h4 {
        page-break-inside: avoid;
        orphans: 3;
        widows: 3;
    }

    /* ── 顯示網址來源（列印後可追溯）── */
    a[href]::after {
        content: none;   /* 不顯示 URL，維持版面乾淨 */
    }
}
