/*
Theme Name: G SPORT
Theme URI: https://example.com/g-sport
Author: G SPORT Team
Author URI: https://example.com
Description: G SPORT WordPress theme.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: g-sport
*/

/* --- 1. 基礎設定 (Reset & Variables) --- */
:root {
    --primary-color: #0047AB; /* 經典運動藍 */
    --accent-color: #FF4500;  /* 熱血橘 (用於重點/比分) */
    --dark-bg: #1a1a1a;
    --light-bg: #f4f6f8;
    --text-main: #333;
    --text-light: #777;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-main);
    padding-bottom: 0;
}

/* 隱藏一般會員的 WordPress 管理工具列 */
/* 只對非管理員用戶隱藏 */
body:not(.wp-admin) #wpadminbar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 當管理工具列隱藏時，調整 body 的 padding-top */
body.admin-bar:not(.wp-admin) {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* 確保管理工具列不會影響頁面佈局 */
html:not(.wp-admin) {
    margin-top: 0 !important;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- 2. 頂部導航 (Navbar) --- */
.navbar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.brand span { color: var(--accent-color); margin-left: 5px; }

.brand img {
    height: 36px;
    width: auto;
    display: block;
}

.navbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none; /* 避免擋住選單點擊 */
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover { opacity: 0.8; }

/* 手機漢堡選單 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.bar {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* 漢堡轉叉叉動畫 */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: rotate(-45deg);
}


/* --- 3. 賽事跑馬燈 (Ticker) --- */
.ticker-wrap {
    background: var(--dark-bg);
    color: white;
    overflow: hidden;
    height: 40px;
    line-height: 40px;
    font-size: 0.9rem;
    position: relative;
}
.ticker {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker 20s linear infinite;
}
.ticker-item {
    display: inline-block;
    padding: 0 20px;
}
.ticker-item span { color: var(--accent-color); font-weight: bold; }

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* --- 4. 分類滑動列 (Mobile Friendly) --- */
.category-scroller {
    background: white;
    padding: 10px 15px;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid #eee;
    -webkit-overflow-scrolling: touch; /* iOS 滑動優化 */
}

/* 隱藏滾動條但保留功能 */
.category-scroller::-webkit-scrollbar { display: none; }

.cat-chip {
    display: inline-block;
    padding: 6px 16px;
    background: #eee;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 600;
    transition: all 0.3s;
}

.cat-chip.active {
    background: var(--primary-color);
    color: white;
}

/* --- 5. 主要內容區 (Grid Layout) --- */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: 2fr 1fr; /* 左邊文章，右邊側欄 */
    gap: 20px;
    min-width: 0;
}

.main-content {
    min-width: 0;
}

/* --- 焦點文章 (Hero) --- */
.hero-card {
    grid-column: 1 / -1; /* 佔滿整行 */
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 300px;
    margin-bottom: 10px;
}

.hero-carousel {
    grid-column: 1 / -1;
    position: relative;
    height: 300px;
    margin-bottom: 10px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-slide.is-active {
    opacity: 1;
    z-index: 1;
}

.hero-main-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.hero-card:hover .hero-title {
    text-decoration: underline;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.hero-card:hover .hero-img { transform: scale(1.05); }

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 20px;
    color: white;
}

.badge {
    background: var(--accent-color);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

.hero-title {
    font-size: 1.5rem;
    margin: 10px 0;
    line-height: 1.3;
}

/* --- 文章列表 --- */
.article-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    height: 155px; /* 增加高度，避免文字過於擁擠 */
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.card-main-link {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.article-card:hover .card-title {
    color: var(--primary-color);
}

.card-img-wrap {
    width: 35%; /* 稍微縮小圖片佔比，騰出更多空間給文字 */
    height: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-content {
    flex: 1; /* 讓內容區塊自動填滿右側所有剩餘空間 */
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* 支援文字截斷（line-clamp） */
}


.card-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px; /* 與標題拉開距離 */
}

.card-title {
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 8px; /* 與摘要內文拉開距離 */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制兩行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.analysis-tag {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 縮減為兩行，避免與標題重疊 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* --- 單篇文章 --- */
.single-article {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.single-header {
    margin-bottom: 16px;
}

.single-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.single-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.single-meta-right {
    display: flex;
    align-items: center;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f0f2f5;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.view-count svg {
    color: var(--primary-color);
}

.single-title {
    font-size: 1.6rem;
    line-height: 1.3;
}

.single-featured {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.single-featured img {
    width: 100%;
    height: auto;
    display: block;
}

.single-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-main);
}

.single-content p {
    margin-bottom: 1rem;
}

.single-tags {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-tag {
    font-size: 0.85rem;
    color: var(--primary-color);
    background: #eaf0ff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s;
}

.post-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* --- 推薦文章 --- */
.recommended-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-top: 20px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.recommended-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.recommended-controls {
    display: flex;
    gap: 6px;
}

.recommended-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--light-bg);
    color: var(--text-main);
    cursor: pointer;
    font-weight: bold;
}

.recommended-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.recommended-slider::-webkit-scrollbar {
    display: none;
}

.recommended-card {
    flex: 0 0 220px;
    background: var(--light-bg);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-main);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
    box-sizing: border-box;
    scroll-snap-align: start;
}

.recommended-thumb {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #eaeef5;
    aspect-ratio: 16 / 9;
}

.recommended-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.recommended-title {
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .recommended-card {
        flex-basis: 200px;
    }
}

/* --- 本日賽果 --- */
.scores-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin: 10px 0 20px;
    width: 100%;
}

.scores-header .section-title {
    margin-bottom: 10px;
}

.scores-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.scores-tab {
    border: none;
    background: #eee;
    color: var(--text-main);
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.scores-tab.is-active {
    background: var(--primary-color);
    color: white;
}

/* --- 賽果次分頁 (未來/今日/過去) --- */
.scores-subtabs {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 0 5px;
    border-bottom: 1px solid #eee;
    justify-content: center;
}

.scores-subtab {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 5px;
    position: relative;
    transition: all 0.3s ease;
}

.scores-subtab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 3px 3px 0 0;
}

.scores-subtab.is-active {
    color: var(--primary-color);
}

.scores-subtab.is-active::after {
    width: 100%;
}

.scores-subpanel {
    display: none;
}

.scores-subpanel.is-active {
    display: block;
}

.scores-panel {
    display: none;
}

.scores-panel.is-active {
    display: block;
}

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

.score-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.score-row {
    border-bottom: none;
    padding: 10px 12px;
    background: var(--light-bg);
    border-radius: 10px;
    row-gap: 6px;
}

.score-row.is-hidden {
    display: none;
}

.scores-panel.is-expanded .score-row.is-hidden {
    display: grid;
}

.score-row:last-child {
    border-bottom: none;
}

.team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.team-away {
    justify-content: flex-end;
}

.team-name {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.team-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.score-center {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    color: var(--accent-color);
    white-space: nowrap;
    min-width: 80px;
    justify-content: center;
    font-size: 0.9rem;
}

.score-status {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: 6px;
    font-weight: 500;
}

.score-date {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.scores-empty {
    color: var(--text-light);
    font-size: 0.9rem;
}

.scores-toggle {
    margin-top: 12px;
    width: 100%;
    border: none;
    background: #eef2fb;
    color: var(--primary-color);
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    text-align: center;
}

/* --- 側邊欄 (Sidebar) --- */
.sidebar-section {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.sidebar {
    display: none;
}

.section-title {
    font-size: 1.1rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    margin-bottom: 15px;
}

.match-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.team-score { font-weight: bold; }
.win-tag { color: #2ecc71; }

/* --- Footer --- */
footer {
    background: var(--primary-color);
    color: #eaf0ff;
    text-align: center;
    padding: 20px;
    margin-top: 0;
    font-size: 0.9rem;
}

/* --- 所有文章頁面 (All Articles Template) --- */
.container-fullwidth {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.main-content-fullwidth {
    width: 100%;
}

.article-search-wrap {
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.article-search-form {
    display: flex;
    position: relative;
    background: white;
    border-radius: 30px;
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 2px;
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    outline: none;
    font-size: 1rem;
}

.search-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-submit:hover {
    background: #003a8c;
}

.tags-filter-wrap {
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.articles-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* 所有文章頁面使用橫式卡片（手機版優先） */
.articles-grid .article-card {
    margin-bottom: 0;
    height: 155px; /* 同步增加高度 */
    overflow: hidden;
}

.articles-grid .card-main-link {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    align-items: stretch;
}

.articles-grid .card-img-wrap {
    width: 40%; /* 與首頁一致 */
    max-width: 150px;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.articles-grid .card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.articles-grid .card-content {
    flex: 1;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直置中對齊內容 */
    min-width: 0;
}

.articles-grid .card-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px; /* 增加與標題間距 */
}

.articles-grid .card-date,
.articles-grid .card-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.articles-grid .card-date svg,
.articles-grid .card-views svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

.articles-grid .card-title {
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.4;
    margin: 0 0 8px 0; /* 增加與內文間距 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main);
}

.articles-grid .analysis-tag {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 縮短內文顯示，為標題騰出空間 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.card-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-wrapper {
    grid-column: 1 / -1;
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination-wrapper .page-numbers {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-wrapper .page-numbers li {
    margin: 0;
}

.pagination-wrapper .page-numbers a,
.pagination-wrapper .page-numbers span {
    display: block;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.pagination-wrapper .page-numbers a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination-wrapper .page-numbers .current {
    background: var(--primary-color);
    color: white;
}

.no-posts-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* --- RWD Media Queries --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 1rem;
    }

    .navbar-center {
        font-size: 0.95rem;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-links {
        display: none; /* 手機版預設隱藏 */
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-color) 0%, #002a66 100%);
        padding: 100px 40px 40px;
        z-index: 1000;
        text-align: left;
        overflow-y: auto;
    }

    .nav-links li:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }


    .nav-links.active {
        display: flex;
        animation: fadeIn 0.3s ease-out;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 18px 0;
        list-style: none;
    }

    .nav-links a {
        font-size: 1.3rem;
        font-weight: 700;
        color: white;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        letter-spacing: 0.5px;
    }

    /* 可以在分類名稱前加個小箭頭 */
    .nav-links a::after {
        content: '›';
        font-size: 1.5rem;
        opacity: 0.5;
    }


    .menu-toggle {
        display: flex;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    body.menu-open {
        overflow: hidden; /* 防止選單打開時捲動背景 */
    }

    .container {
        grid-template-columns: 1fr; /* 變回單欄 */
    }

    .hero-card { height: 250px; }
    .hero-carousel { height: 250px; }
    .hero-title { font-size: 1.2rem; }

    /* 手機版側邊欄放在文章下面或隱藏 */
    .sidebar { order: 2; }
    .main-content { order: 1; }

    .scores-table {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
    }

    .score-row {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 8px 10px;
    }

    .team,
    .team-away {
        justify-content: center;
    }

    /* 所有文章頁面 - 手機版 */
    .page-title {
        font-size: 1.5rem;
    }

    .article-card,
    .articles-grid .article-card {
        height: 135px; /* 增加手機版高度，避免文字裁切 */
    }

    .card-img-wrap,
    .articles-grid .card-img-wrap {
        width: 120px; /* 稍微增加圖片寬度平衡比例 */
        min-width: 120px;
        height: 100%;
    }

    .card-content,
    .articles-grid .card-content {
        padding: 8px 12px; /* 稍微縮小內距，騰出垂直空間 */
        flex: 1;
        justify-content: center;
    }


    .card-title,
    .articles-grid .card-title {
        font-size: 0.95rem; /* 稍微調大一點標題 */
        margin-bottom: 4px;
        line-height: 1.3;
    }

    .analysis-tag,
    .articles-grid .analysis-tag {
        font-size: 0.8rem; /* 稍微調大字級提升可讀性 */
        line-height: 1.4;
        -webkit-line-clamp: 2;
    }


}

/* --- 會員登入/註冊頁面 --- */
/* 覆蓋 .container 的 grid 佈局，改為 flex 置中 */
.container.member-login-container {
    display: flex !important;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 40px 15px;
    grid-template-columns: none;
    gap: 0;
}

.login-wrapper {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 35px;
    text-align: center;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.login-desc {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.6;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Super Socializer 外掛容器 */
.social-login-shortcode-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Super Socializer LINE 按鈕樣式覆蓋 */
.social-login-shortcode-wrap .theChampLineLogin,
.social-login-shortcode-wrap i.theChampLineLogin,
.social-login-shortcode-wrap .theChampLineBackground,
.social-login-shortcode-wrap a[href*="line"],
.social-login-shortcode-wrap .theChampSocialLogin,
.social-login-shortcode-wrap button[class*="line"],
.social-login-shortcode-wrap div[class*="line"] a,
.social-login-shortcode-wrap ul.the_champ_login_ul li i.theChampLineLogin {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 56px !important;
    padding: 16px 24px !important;
    background: #06C755 !important; /* LINE 官方綠色 */
    color: white !important;
    border-radius: var(--radius) !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(6, 199, 85, 0.2) !important;
    border: none !important;
    cursor: pointer !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
    height: auto !important;
    position: relative !important;
    overflow: visible !important;
}

/* 添加 LINE 按鈕文字（使用偽元素） */
.social-login-shortcode-wrap i.theChampLineLogin::after {
    content: "LINE 快速登入" !important;
    display: inline-block !important;
    margin-left: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: white !important;
    white-space: nowrap !important;
}

/* 確保 SVG 圖標正確顯示 */
.social-login-shortcode-wrap .theChampLineLoginSvg,
.social-login-shortcode-wrap ss.theChampLineLoginSvg,
.social-login-shortcode-wrap i.theChampLineLogin ss {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    flex-shrink: 0 !important;
    background-size: 91% !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M28%2014.304c0-5.37-5.384-9.738-12-9.738S4%208.936%204%2014.304c0%204.814%204.27%208.846%2010.035%209.608.39.084.923.258%201.058.592.122.303.08.778.04%201.084l-.172%201.028c-.05.303-.24%201.187%201.04.647s6.91-4.07%209.43-6.968c1.737-1.905%202.57-3.842%202.57-5.99zM11.302%2017.5H8.918c-.347%200-.63-.283-.63-.63V12.1c0-.346.283-.628.63-.628.348%200%20.63.283.63.63v4.14h1.754c.35%200%20.63.28.63.628%200%20.347-.282.63-.63.63zm2.467-.63c0%20.347-.284.628-.63.628-.348%200-.63-.282-.63-.63V12.1c0-.347.282-.63.63-.63.346%200%20.63.284.63.63v4.77zm5.74%200c0%20.27-.175.51-.433.596-.065.02-.132.032-.2.032-.195%200-.384-.094-.502-.25l-2.443-3.33v2.95c0%20.35-.282.63-.63.63-.347%200-.63-.282-.63-.63V12.1c0-.27.174-.51.43-.597.066-.02.134-.033.2-.033.197%200%20.386.094.503.252l2.444%203.328V12.1c0-.347.282-.63.63-.63.346%200%20.63.284.63.63v4.77zm3.855-3.014c.348%200%20.63.282.63.63%200%20.346-.282.628-.63.628H21.61v1.126h1.755c.348%200%20.63.282.63.63%200%20.347-.282.628-.63.628H20.98c-.345%200-.628-.282-.628-.63v-4.766c0-.346.283-.628.63-.628h2.384c.348%200%20.63.283.63.63%200%20.346-.282.628-.63.628h-1.754v1.126h1.754z%22%2F%3E%3C%2Fsvg%3E') !important;
}

.social-login-shortcode-wrap .theChampLineLogin:hover,
.social-login-shortcode-wrap i.theChampLineLogin:hover,
.social-login-shortcode-wrap .theChampLineBackground:hover,
.social-login-shortcode-wrap a[href*="line"]:hover,
.social-login-shortcode-wrap .theChampSocialLogin:hover,
.social-login-shortcode-wrap button[class*="line"]:hover,
.social-login-shortcode-wrap div[class*="line"] a:hover,
.social-login-shortcode-wrap ul.the_champ_login_ul li i.theChampLineLogin:hover {
    background: #05B048 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(6, 199, 85, 0.3) !important;
}

.social-login-shortcode-wrap .theChampLineLogin:active,
.social-login-shortcode-wrap i.theChampLineLogin:active,
.social-login-shortcode-wrap .theChampLineBackground:active,
.social-login-shortcode-wrap a[href*="line"]:active,
.social-login-shortcode-wrap .theChampSocialLogin:active,
.social-login-shortcode-wrap button[class*="line"]:active,
.social-login-shortcode-wrap div[class*="line"] a:active,
.social-login-shortcode-wrap ul.the_champ_login_ul li i.theChampLineLogin:active {
    transform: translateY(0) !important;
}

/* 確保 LINE 按鈕容器正確顯示 */
.social-login-shortcode-wrap ul.the_champ_login_ul {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.social-login-shortcode-wrap ul.the_champ_login_ul li {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* 確保容器不會切斷按鈕 */
.social-login-shortcode-wrap .the_champ_login_container {
    width: 100% !important;
    overflow: visible !important;
}

.social-login-shortcode-wrap > div {
    width: 100% !important;
    overflow: visible !important;
}

.social-login-shortcode-wrap img {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    vertical-align: middle !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

/* LINE 登入按鈕樣式 */
.line-login-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 56px !important;
    padding: 16px 24px !important;
    background: #06C755 !important; /* LINE 官方綠色 */
    color: white !important;
    border-radius: var(--radius) !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(6, 199, 85, 0.2) !important;
    border: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.line-login-btn:hover {
    background: #05B048 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(6, 199, 85, 0.3) !important;
    color: white !important;
}

.line-login-btn:active {
    transform: translateY(0) !important;
}

.line-login-btn:focus {
    outline: 2px solid rgba(6, 199, 85, 0.5) !important;
    outline-offset: 2px !important;
}

.line-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
}

.line-icon svg {
    width: 24px !important;
    height: 24px !important;
    fill: white !important;
    display: block !important;
}

/* 登入說明文字 */
.login-note {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-note p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* 響應式設計 - 登入頁面 */
@media (max-width: 768px) {
    .container.member-login-container {
        min-height: calc(100vh - 150px);
        padding: 30px 15px;
        display: flex !important;
    }

    .login-card {
        padding: 30px 25px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-desc {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    .line-login-btn {
        padding: 14px 20px !important;
        font-size: 1rem !important;
        min-height: 52px !important;
    }
    
    .social-login-shortcode-wrap .theChampLineLogin,
    .social-login-shortcode-wrap a[href*="line"],
    .social-login-shortcode-wrap .theChampSocialLogin {
        padding: 14px 20px !important;
        font-size: 1rem !important;
        min-height: 52px !important;
    }
}

/* --- 會員中心頁面 --- */
/* 覆蓋 .container 的 grid 佈局，改為 flex 置中 */
body .container.member-center-container,
.container.member-center-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: calc(100vh - 200px) !important;
    padding: 40px 15px !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

.member-center-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.member-center-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 35px;
    position: relative;
}

/* 會員頭像和資訊區域 */
.member-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 800;
}

.member-info {
    flex: 1;
    display: none !important; /* 隱藏會員資訊區塊（email、LINE ID等） */
}

.member-name-only {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-name-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.member-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}

.member-level-badge {
    font-size: 0.75rem !important;
    padding: 5px 12px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    margin-left: 0 !important;
    vertical-align: middle;
    display: inline-block;
    text-transform: none !important;
    letter-spacing: 0.3px;
}

.member-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.member-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.member-stat-item .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.member-email {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.member-line-id {
    font-size: 0.85rem;
    color: var(--text-light);
    font-family: monospace;
}

/* 功能按鈕區域 */
.member-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.member-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.member-action-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.member-action-btn .btn-text {
    flex: 1;
    text-align: left;
}

/* 通知按鈕 */
.notification-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 71, 171, 0.2);
}

.notification-btn:hover {
    background: #003d99;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 71, 171, 0.3);
}

.notification-badge {
    background: var(--accent-color);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

/* 登出按鈕 */
.logout-btn {
    background: #f5f5f5;
    color: var(--text-main);
    border: 1px solid #e0e0e0;
}

.logout-btn:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
    transform: translateY(-2px);
}

/* 通知 Modal Overlay */
.notification-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 通知面板 Modal */
.notification-modal,
.notification-panel {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 16px 16px 0 0;
}

.notification-panel-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.close-notification {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}

.close-notification:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
}

.close-notification:active {
    transform: rotate(90deg) scale(0.95);
}

.notification-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
    max-height: calc(80vh - 80px); /* 減去 header 的高度 */
    /* 自訂滾動條樣式 */
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 #f0f0f0;
}

.notification-panel-content::-webkit-scrollbar {
    width: 6px;
}

.notification-panel-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.notification-panel-content::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.notification-panel-content::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.notification-list {
    padding: 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: white;
}

.notification-item:hover {
    background: #f9f9f9;
    transform: translateX(2px);
}

.notification-item:active {
    transform: translateX(0);
    background: #f0f0f0;
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-item.unread:hover {
    background: #e3f2fd;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

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

.notification-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-item.unread .notification-icon {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.notification-item:hover .notification-icon {
    transform: scale(1.1);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.6;
    word-wrap: break-word;
    font-weight: 500;
}

.notification-item.read .notification-message {
    color: #666;
    font-weight: 400;
}

.notification-time {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-time::before {
    content: '🕐';
    font-size: 10px;
    opacity: 0.7;
}

.notification-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.notification-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.notification-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.notification-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.notification-empty-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.notification-empty-hint {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

/* 響應式設計 - 會員中心頁面 */
@media (max-width: 768px) {
    .container.member-center-container {
        min-height: calc(100vh - 150px);
        padding: 20px 15px;
    }

    .member-center-card {
        padding: 30px 25px;
    }

    .member-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .member-avatar {
        width: 100px;
        height: 100px;
    }

    .member-name {
        font-size: 1.3rem;
    }

    .member-name-wrapper {
        justify-content: center;
    }

    .member-stats {
        justify-content: center;
    }

    .member-stat-item .stat-value {
        font-size: 1.1rem;
    }

    .notification-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .notification-modal,
    .notification-panel {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        animation: modalSlideUpMobile 0.3s ease;
    }

    @keyframes modalSlideUpMobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .notification-panel-header {
        padding: 16px 18px;
    }

    .notification-panel-header h3 {
        font-size: 1.1rem;
    }

    .notification-item {
        padding: 14px 18px;
    }

    .notification-empty {
        padding: 50px 20px;
        min-height: 150px;
    }

    .notification-empty-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }

    .notification-empty-text {
        font-size: 15px;
    }

    .notification-empty-hint {
        font-size: 13px;
    }
}

