/* ================================================== */
/* ★★★ index.css - 首頁專屬柔和樣式 (Soft UI) ★★★ */
/* ================================================== */

/* --- 1. 核心變數 (與 view.css 保持色調一致) --- */
@import url('./assets/fonts/nunito.css');


:root {
    /* 背景與基底 */
    --bg-color: #f8f9fa;
    /* 整體背景：極淡灰 */
    --card-bg: #ffffff;
    /* 卡片背景：純白 */

    /* 文字顏色 */
    --text-primary: #2d3748;
    /* 標題：深灰 */
    --text-secondary: #718096;
    /* 描述：中灰 */

    /* 品牌與互動 */
    --brand-color: #3b82f6;
    /* 主色調：現代藍 */
    --brand-hover: #2563eb;
    /* 懸停深藍 */

    /* 狀態色 */
    --tag-bg: #edf2f7;
    /* 標籤背景 */
    --tag-text: #4a5568;
    /* 標籤文字 */
    --tag-active-bg: #3b82f6;
    --tag-active-text: #ffffff;

    /* 狀態燈號 */
    --status-public-bg: #def7ec;
    --status-public-text: #03543f;
    --status-private-bg: #fde8e8;
    --status-private-text: #9b1c1c;

    /* 介面參數 */
    --radius-lg: 16px;
    /* 卡片大圓角 */
    --radius-pill: 50px;
    /* 按鈕膠囊狀圓角 */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. 全域設定 (修正：強制顯示捲軸，防止版面跳動) --- */
html {
    overflow-y: scroll;
    /* 關鍵：永遠預留捲軸空間 */
}

body {
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* 讓文字在 Mac 上更細緻 */
}

*,
*:before,
*:after {
    box-sizing: border-box;
}

/* --- 系統公告欄動畫樣式 --- */
.announcement-bar {
    text-align: center;
    padding: 10px 15px;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    overflow: hidden;
    /* 防止跑馬燈超出邊界 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    /* 確保至少有一定高度，避免單行跳動 */
}

.announcement-content {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* 動畫：跑馬燈 (Marquee) */
.anim-marquee {
    justify-content: flex-start;
    /* 讓文字可以從最右開始推進 */
}

.anim-marquee .announcement-content {
    padding-left: 100%;
    /* 初始位置推到最右邊看不見 */
    animation: marqueeScroll 15s linear infinite;
}

@keyframes marqueeScroll {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

/* 動畫：3D定時翻轉 (Flip) */
.anim-flip {
    perspective: 1000px;
}

.anim-flip .announcement-content {
    animation: flipAnim 6s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes flipAnim {

    0%,
    20%,
    80%,
    100% {
        transform: rotateX(0deg);
    }

    45%,
    55% {
        transform: rotateX(360deg);
    }
}

/* --- 3. 頂部搜尋與標題區 (與 Hero Banner) --- */
.header-content {
    text-align: center;
    padding: 4rem 1.5rem 3rem;
    /* 增加頂部留白，讓視覺不壓迫 */
    max-width: 800px;
    margin: 0 auto;
}

.header-content h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    /* 流體字體大小 */
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

/* ★ Hero Banner 大看板樣式 ★ */
.hero-banner {
    position: relative;
    width: 100%;
    min-height: 480px;
    background-size: cover;
    background-position: center;
    background-color: var(--brand-color);
    /* 沒圖片時的備用色 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    /* 取代原本 header-content 的下留白 */
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 背景顏色與漸層將由 index.php 中動態寫入的 style 控制 */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem 1.5rem;
    width: 100%;
    max-width: 800px;
    animation: fadeUp 0.8s ease-out forwards;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
    /* 強制覆蓋，確保清晰 */
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    /* 增強對比 */
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    opacity: 0.95;
    margin-bottom: 2.5rem;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* 搜尋框容器 */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

/* 搜尋輸入框 - 膠囊狀設計 */
#search-box {
    width: 100%;
    padding: 1.2rem 3rem 1.2rem 2rem;
    border: 2px solid transparent;
    /* 預留邊框空間 */
    border-radius: var(--radius-pill);
    font-size: 1.1rem;
    background-color: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* 浮起陰影 */
    transition: var(--transition);
    color: var(--text-primary);
    outline: none;
}

#search-box:focus {
    box-shadow: 0 4px 25px rgba(59, 130, 246, 0.25);
    border-color: var(--brand-color);
}

#search-box::placeholder {
    color: #cbd5e0;
}

/* 清除按鈕 */
.clear-search {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    color: #718096;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    /* JS 控制顯示 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.clear-search:hover {
    background: #cbd5e0;
    color: #4a5568;
}

.search-container.has-text .clear-search {
    display: flex;
}

/* 在 Hero Banner 裡面的搜尋列需要一些對比，用以在深色底中顯現：毛玻璃設計 */
.hero-banner #search-box {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.hero-banner #search-box::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.hero-banner #search-box:focus {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* 讓清除按鈕在毛玻璃搜尋框上也是半透明的 */
.hero-banner .clear-search {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.hero-banner .clear-search:hover {
    background: rgba(255, 255, 255, 0.4);
    color: white;
}

/* 標籤雲 */
.tag-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.tag-button {
    background-color: var(--tag-bg);
    color: var(--tag-text);
    border: 1px solid transparent;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tag-button:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

/* Hero Banner 專屬標籤雲樣式 (毛玻璃透明質感) */
.hero-banner .tag-button {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-banner .tag-button:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 當標籤被搜尋選中時的樣式 (可搭配 JS 優化，目前僅做 hover 示意) */
.tag-button.active {
    background-color: var(--tag-active-bg);
    color: var(--tag-active-text);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* --- 4. 影片卡片網格 (最終修正：Grid 佈局 + 頂部對齊) --- */
/* 使用 Grid 徹底解決「重疊」問題，這是最穩定的排版 */
.card-container {
    display: grid;
    /* 自動計算欄位：最小寬度 280px，剩下的空間平分 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;

    width: 95%;
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 0 1rem;

    /* ★★★ 核心關鍵：靠上對齊 ★★★ */
    /* 這行能確保當隔壁抽屜變長時，自己不會被強制拉長，也不會重疊 */
    align-items: start;
}

.card-link {
    text-decoration: none;
    display: block;
    height: 100%;
}

/* ★ 新增：卡片進場動畫 */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片與抽屜基礎設定 */
.card,
.drawer-wrapper {
    width: 100%;
    margin-bottom: 0;
    /* 移除所有可能導致重疊的 Masonry 屬性 */
    break-inside: auto;
    page-break-inside: auto;

    background-color: var(--card-bg);
    border-radius: 20px;
    /* 拉大圓角，看起來像圓潤的積木 */
    border: 3px solid #f1f5f9;
    /* 加粗且輕快的邊框 */
    box-shadow: 0 6px 0 #e2e8f0;
    /* 底部粗陰影，像是實體按鍵 */

    /* ★ 修正卡片太滿的問題：增加內距 */
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    /* 防止內部大型裝飾圖示溢出 */

    /* ★ 加入動畫 */
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
    /* 初始隱藏，讓動畫接管 */
}

/* 讓抽屜外框維持原本的乾淨外觀，不套用實體按鍵樣式 */
.drawer-wrapper {
    border: none;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

/* 讓子元素延遲進場，製造瀑布流視覺效果 */
.card-container> :nth-child(1) {
    animation-delay: 0.05s;
}

.card-container> :nth-child(2) {
    animation-delay: 0.1s;
}

.card-container> :nth-child(3) {
    animation-delay: 0.15s;
}

.card-container> :nth-child(4) {
    animation-delay: 0.2s;
}

.card-container> :nth-child(5) {
    animation-delay: 0.25s;
}

.card-container> :first-child~* {
    animation-delay: 0.3s;
    /* 其餘統一延遲 */
}

/* --- ★★★ 抽屜配色與交互 (您喜歡的風格) ★★★ --- */

/* 1. 抽屜標題 (已在下方統一修正，此處留空) */

/* 2. 抽屜標題 (展開時：變身為藍色高對比) */
.drawer-wrapper.open .drawer-header {
    background-color: var(--brand-color);
    /* 變藍色 */
    border-color: var(--brand-color);
    color: white;
    /* 文字變白 */
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);

    /* 展開時，讓下方圓角變直，與內容區接合 */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* 強制改變展開後的內部元素顏色 */
.drawer-wrapper.open .drawer-title h2 {
    color: white !important;
}

.drawer-wrapper.open .drawer-count {
    color: rgba(255, 255, 255, 0.8);
}

.drawer-wrapper.open .drawer-icon {
    color: white;
    transform: rotate(180deg);
}

/* 3. 抽屜內容區 (白色底，藍色邊框) */
.drawer-content {
    display: none;
    background: #fff;
    /* 內容區維持白底，閱讀性最佳 */
    border: 2px solid var(--brand-color);
    /* 藍色邊框呼應標題 */
    border-top: none;
    /* 去掉頂部邊框，看起來像一體的 */

    padding: 1rem;
    flex-direction: column;
    gap: 1rem;

    /* 底部圓角 */
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);

    animation: slideDown 0.3s ease-out;
}

.drawer-wrapper.open .drawer-content {
    display: flex;
}

/* 子卡片 (在抽屜裡的影片) */
.child-card {
    box-shadow: 0 4px 0 #e2e8f0;
    /* 配合實體按鍵設計 */
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    /* 淺灰底區分層次 */
    padding: 1rem;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 1;
    /* 覆蓋父層的 fadeUp 初始狀態 */
    animation: none;
    /* 子卡片不需要進場動畫，跟著抽屜展開即可 */
    margin-bottom: 12px;
    /* 留給底部陰影的空間 */
}

.child-card:hover {
    transform: translateY(2px) rotate(1deg);
    /* 按下並微傾斜 */
    border-color: var(--brand-hover);
    /* 改用懸停色 */
    background: #fff;
    box-shadow: 0 2px 0 #cbd5e0;
    /* 縮小底部陰影 */
}

/* 關閉抽屜內卡片的 ::before 彩帶，避免視覺過度雜亂 */
.child-card::before {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RWD 手機版調整 --- */
@media (max-width: 768px) {
    .card-container {
        grid-template-columns: 1fr;
        /* 手機版強制單欄 */
        gap: 1rem;
    }

    .header-content {
        padding: 3rem 1rem 2rem;
    }

    .card h2 {
        font-size: 1.1rem;
    }
}

/* --- 分區標題與分隔線 --- */
.section-header {
    width: 95%;
    max-width: 1400px;
    margin: 2rem auto 1rem;
    padding: 0 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.section-divider {
    width: 90%;
    max-width: 1200px;
    height: 1px;
    background: repeating-linear-gradient(to right, #e2e8f0, #e2e8f0 10px, transparent 10px, transparent 20px);
    margin: 3rem auto;
}

/* 懸停效果：俏皮實體按鍵壓下效果 */
.card:hover {
    transform: translateY(4px) rotate(-1deg);
    /* 往下壓且微微往左傾斜 */
    box-shadow: 0 2px 0 #e2e8f0;
    /* 陰影縮小，模擬按鈕被按下去 */
    border-color: rgba(59, 130, 246, 0.2);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    /* 加粗彩帶 */
    background: linear-gradient(90deg, var(--brand-color), #f472b6, #fbbf24);
    /* 漸層加入粉紅與黃色，製造青春感 */
    /* 漸變改用懸停色 */
    border-top-left-radius: 20px;
    /* 配合卡片大圓角 */
    border-top-right-radius: 20px;
    opacity: 0.8;
    /* 預設顯示 */
    transition: var(--transition);
}

.card:hover::before {
    opacity: 1;
    height: 8px;
    /* hover 時更粗 */
}

/* 右下角加入大型隱含的播放圖示 */
.card::after {
    content: '\f144';
    /* FontAwesome play-circle 碼 */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 5rem;
    color: var(--brand-color);
    opacity: 0.05;
    /* 若隱若現 */
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 0;
}

.card:hover::after {
    transform: scale(1.1) rotate(15deg);
    /* hover 時偷偷放大旋轉 */
    opacity: 0.15;
}

.card h2,
.child-card h2 {
    font-size: 1.25rem;
    /* 電腦版標題大小 */
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.2rem 0;
    /* 增加標題下方留白 */
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* 修正 lint: 也定義標準的 line-clamp */
    /* 標題最多兩行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 狀態標籤 */
.page-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
}

.page-status.public {
    background-color: var(--status-public-bg);
    color: var(--status-public-text);
}

.page-status.private {
    background-color: var(--status-private-bg);
    color: var(--status-private-text);
}

/* 狀態圖示微調 */
.page-status i {
    font-size: 0.9em;
}

/* 提示訊息 (無資料時) */
.message-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: #fff;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    box-shadow: var(--shadow-soft);
}

.message-box a.button {
    background: var(--brand-color);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    transition: var(--transition);
}

.message-box a.button:hover {
    background: var(--brand-hover);
}



/* --- 高對比抽屜樣式修正 --- */

/* 1. 抽屜標題卡片 (嚴肅、無按鍵感的樣式) */
.drawer-header {
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    transition: all 0.2s ease;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.drawer-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 讓包裹抽屜的容器去掉預設 padding ，由內部的 drawer-header 控制 */
.drawer-wrapper {
    padding: 0;
}

/* 2. 抽屜被展開時 (High Contrast Mode) */
/* 當抽屜被加上 .open class 時，改變標題顏色 */
.drawer-wrapper.open .drawer-header {
    background-color: var(--brand-color);
    /* 使用品牌藍底 (或改成 #2d3748 深灰底) */
    border-color: var(--brand-color);
    color: white;
    /* 強制白字 */
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
    /* 加上藍色暈光 */
}

/* 修正展開後的內部文字顏色 */
.drawer-wrapper.open .drawer-title h2 {
    color: white !important;
    /* 強制標題變白 */
}

.drawer-wrapper.open .drawer-count {
    color: rgba(255, 255, 255, 0.8);
    /* 次要文字變半透明白 */
}

.drawer-wrapper.open .drawer-icon {
    color: white;
    /* 箭頭變白 */
    transform: rotate(180deg);
}

/* 3. 抽屜內容區 (左側線條顏色也跟著變) */
.drawer-content {
    display: none;
    padding-left: 1.5rem;
    border-left: 3px solid var(--brand-color);
    /* 線條加粗並變色 */
    margin-left: 1rem;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    /* 增加與標題的距離 */
    animation: slideDown 0.3s ease-out;
}

.drawer-wrapper.open .drawer-content {
    display: flex;
}

/* 子卡片 (在抽屜裡的影片 - 嚴肅乾淨版) */
.child-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* 安靜的微光陰影 */
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    /* 較為收斂的圓角 */
    margin-bottom: 12px;
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.child-card:hover {
    transform: translateX(4px);
    /* 輕微往右滑動，不上下跳動 */
    border-color: var(--brand-hover);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RWD: 手機版調整 */
@media (max-width: 768px) {
    .drawer-wrapper.open {
        grid-column: 1 / -1;
        /* 手機版展開時佔滿整行 */
    }

    .drawer-content {
        padding-left: 0.5rem;
        margin-left: 0.5rem;
    }
}

/* --- 分區標題與分隔線 --- */

/* 讓每個 card-container 的底部間距變小，由分隔線來控制距離 */
.card-container {
    margin-bottom: 1rem;
}

/* 區塊標題 */
.section-header {
    width: 95%;
    max-width: 1400px;
    margin: 2rem auto 1rem;
    /* 上留白多一點 */
    padding: 0 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #e2e8f0;
    /* 標題下方加上細線 */
    padding-bottom: 0.5rem;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.section-header i {
    color: var(--brand-color);
}

/* 兩個區塊中間的分隔線 (如果不想用標題，這個也會有區隔效果) */
.section-divider {
    width: 90%;
    max-width: 1200px;
    height: 1px;
    background: repeating-linear-gradient(to right,
            #e2e8f0,
            #e2e8f0 10px,
            transparent 10px,
            transparent 20px);
    /* 虛線效果 */
    margin: 3rem auto;
    /* 上下拉開距離 */
}

/* --- 視圖切換按鈕 --- */
.view-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.view-btn {
    background: transparent;
    border: 1px solid transparent;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--brand-color);
    background: #f1f5f9;
}

.view-btn.active {
    color: var(--brand-color);
    background: #e0e7ff;
    border-color: #c7d2fe;
}

/* --- 清單檢視模式 (List View) --- */
body.list-view .card-container {
    grid-template-columns: 1fr;
    /* 單列顯示 */
    gap: 1rem;
}

/* 讓單體卡片變成橫向 */
body.list-view .card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1.2rem 1.5rem;
    text-align: left;
    height: auto;
}

/* 隱藏俏皮的上下底跟按鈕特效 */
body.list-view .card::before,
body.list-view .card::after {
    display: none;
}

body.list-view .card:hover {
    transform: translateX(4px);
    /* 改為平移 */
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

body.list-view .card h2,
body.list-view .child-card h2 {
    margin: 0;
    margin-right: auto;
    font-size: 1.2rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    /* 清單模式標題只佔一行 */
}

body.list-view .page-status {
    margin: 0;
    margin-left: 1rem;
    flex-shrink: 0;
}

body.list-view .tags-display {
    margin: 0;
    margin-left: 1rem;
    justify-content: flex-end;
    flex-shrink: 0;
    min-width: 150px;
    /* 確保標籤區塊留有固定空間 */
}

/* 修正抽屜裡的子卡片橫向排版 */
body.list-view .child-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1.2rem;
    margin-bottom: 0.8rem;
}