/* ================================================
   Deep Dive Theme — Main Stylesheet
   ================================================ */

/* === VARIABLES === */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #686880;
    --border: rgba(255, 255, 255, 0.06);
    --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #1a1a3e 50%, #0a0a0f 100%);
    --gradient-accent: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --gradient-card: linear-gradient(145deg, rgba(26, 26, 46, 0.8), rgba(18, 18, 26, 0.9));
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --nav-bg: rgba(10, 10, 15, 0.85);
    --card-placeholder-bg: linear-gradient(135deg, var(--bg-card), #2a2a4e);
    --code-bg: rgba(255, 255, 255, 0.08);
    --blockquote-bg: rgba(108, 92, 231, 0.05);
    --hero-h1-gradient: linear-gradient(135deg, #fff 30%, var(--accent-secondary) 100%);
}

/* === LIGHT THEME === */
[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #e9ecef;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f3f5;
    --accent-primary: #5b4cdb;
    --accent-secondary: #6c5ce7;
    --accent-glow: rgba(108, 92, 231, 0.2);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border: rgba(0, 0, 0, 0.06);
    --gradient-hero: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    --gradient-accent: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(248, 249, 250, 0.95));
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --card-placeholder-bg: linear-gradient(135deg, #e9ecef, #dee2e6);
    --code-bg: rgba(0, 0, 0, 0.04);
    --blockquote-bg: rgba(108, 92, 231, 0.05);
    --hero-h1-gradient: linear-gradient(135deg, #111827 30%, var(--accent-primary) 100%);
}

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

body {
    font-family: 'Noto Sans TC', 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* === NAVIGATION === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 900;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-logo span {
    font-weight: 300;
    opacity: 0.7;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.1);
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-search:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.nav-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 180px;
    font-family: inherit;
}

.nav-search input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow-card);
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: block;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(108, 92, 231, 0.1);
}

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

.search-result-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.search-result-cat {
    font-size: 0.7rem;
    color: var(--accent-secondary);
    margin-top: 0.2rem;
}

/* === HERO === */
.hero {
    background: var(--gradient-hero);
    padding: 6rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(162, 155, 254, 0.06) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(2%, 1%) rotate(1deg);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 900;
    background: var(--hero-h1-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.hero-stat {
    text-align: center;
}

.hero-stat-num {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* === SECTIONS === */
.section {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* 解決直接接在 Navbar 下方的 Section 被遮擋的問題 */
.pt-nav {
    padding-top: 7.5rem !important; 
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 28px;
    border-radius: 2px;
    background: var(--gradient-accent);
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* === VIEW & SORT CONTROLS === */
.view-controls {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.2rem;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.sort-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sort-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.sort-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.sort-btn:hover {
    color: var(--text-secondary);
}

.sort-btn.active {
    color: var(--accent-secondary);
    border-color: var(--accent-primary);
}

/* === CATEGORY TABS === */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cat-tab {
    padding: 0.5rem 1.2rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.cat-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.cat-tab.active {
    background: var(--gradient-accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* === GALLERY === */
.gallery {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-placeholder-bg);
    font-size: 3rem;
}

.card-body {
    padding: 1.4rem;
}

.card-cat {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
    margin-bottom: 0.7rem;
}

.card-cat-lg {
    font-size: 0.8rem;
    padding: 0.3rem 0.9rem;
}

.cat-好書精讀與總結 {
    background: rgba(46, 213, 115, 0.12);
    color: #2ed573;
}

.cat-人物研究 {
    background: rgba(255, 165, 2, 0.12);
    color: #ffa502;
}

.cat-科技趨勢 {
    background: rgba(0, 206, 209, 0.12);
    color: #00ced1;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-meta-icons {
    display: flex;
    gap: 1rem;
}

.card-meta-icon {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Gallery List View */
.gallery.view-list {
    grid-template-columns: 1fr;
}

.gallery.view-list .card a {
    display: flex;
    align-items: stretch;
}

.gallery.view-list .card-img, 
.gallery.view-list .card-img-placeholder {
    display: none;
}

.gallery.view-list .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery.view-list .card-meta {
    margin-top: auto;
}

@media (max-width: 768px) {
    .gallery.view-list .card a {
        flex-direction: column;
    }
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.page-link {
    padding: 0.6rem 1.5rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.page-link:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === AD BANNER === */
.ad-banner {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(162, 155, 254, 0.05));
    border: 1px dashed rgba(108, 92, 231, 0.3);
    border-radius: var(--radius);
    text-align: center;
    position: relative;
}

.ad-banner-label {
    position: absolute;
    top: -10px;
    left: 20px;
    padding: 0.15rem 0.8rem;
    border-radius: 100px;
    background: var(--bg-card);
    border: 1px solid rgba(108, 92, 231, 0.3);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ad-banner h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-secondary);
}

.ad-banner p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.ad-cta {
    display: inline-block;
    padding: 0.6rem 1.8rem;
    border-radius: 100px;
    background: var(--gradient-accent);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-decoration: none;
}

.ad-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* === ARTICLE PAGE === */
.article-header {
    padding: 6rem 2rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.article-breadcrumb a {
    color: var(--accent-secondary);
}

.article-header h1 {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1.3;
    margin: 0.5rem 0 1rem;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer-views {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.tag-link {
    color: var(--accent-secondary);
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

.tag-link:hover {
    text-decoration: underline;
}

.article-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
}

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

.article-sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
}

/* Summary Chart */
.summary-chart {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.summary-chart:hover {
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-primary);
}

/* YouTube Embed */
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

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

/* Podcast Link */
.podcast-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(30, 215, 96, 0.08), rgba(30, 215, 96, 0.02));
    border: 1px solid rgba(30, 215, 96, 0.2);
    margin-bottom: 2rem;
    color: var(--text-primary);
    transition: all 0.3s;
}

.podcast-link:hover {
    border-color: rgba(30, 215, 96, 0.5);
    box-shadow: 0 4px 20px rgba(30, 215, 96, 0.1);
}

.podcast-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1ed760, #1db954);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.podcast-info {
    flex: 1;
}

.podcast-platform {
    font-size: 0.7rem;
    color: #1ed760;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.podcast-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.podcast-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Book Info */
.book-info {
    background: rgba(108, 92, 231, 0.05);
    border: 1px solid rgba(108, 92, 231, 0.15);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.book-info h2 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--accent-secondary);
}

.book-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Article Body */
.article-body {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(108, 92, 231, 0.2);
}

.article-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.8rem;
}

.article-body p {
    margin-bottom: 1.2rem;
}

.article-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--accent-primary);
    background: var(--blockquote-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

.article-body ul,
.article-body ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body code {
    background: var(--code-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-body pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-body pre code {
    background: none;
    padding: 0;
}

.article-body img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin: 1rem 0;
}

.article-body a {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.article-body a:hover {
    color: var(--accent-primary);
}

/* Sidebar */
.sidebar-section {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.sidebar-toc {
    font-size: 0.85rem;
}

.sidebar-toc nav>ul {
    list-style: none;
    padding: 0;
}

.sidebar-toc li {
    margin-bottom: 0.3rem;
}

.sidebar-toc a {
    display: block;
    padding: 0.4rem 0.8rem;
    border-left: 2px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.sidebar-toc a:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: rgba(108, 92, 231, 0.05);
}

.sidebar-toc ul ul a {
    padding-left: 1.5rem;
    font-size: 0.8rem;
}

.sidebar-ad {
    text-align: center;
    padding: 1.5rem 1rem;
}

.sidebar-ad-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.sidebar-ad-content {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.08), rgba(255, 0, 0, 0.02));
    border: 1px dashed rgba(255, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
}

.sidebar-ad-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.yt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    background: rgba(255, 0, 0, 0.15);
    color: #ff4444;
    font-size: 0.75rem;
    font-weight: 600;
}

.related-link {
    display: block;
    padding: 0.5rem 0;
    color: var(--accent-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
}

.related-link:hover {
    color: var(--text-primary);
}

.related-link:last-child {
    border-bottom: none;
}

/* Comments */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.comments-placeholder {
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.comments-placeholder p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.comments-hint {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    margin-top: 0.3rem;
}

/* === ABOUT PAGE === */
.about-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.about-page h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* === FOOTER === */
.footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* === THEME TOGGLE === */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.3rem 0.35rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    width: 64px;
    height: 32px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.theme-toggle-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.theme-toggle-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-accent);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(32px);
}

.theme-toggle-icons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 5px;
    position: absolute;
    top: 0;
    font-size: 0.7rem;
    pointer-events: none;
}

/* === LIGHT THEME — category label overrides === */
[data-theme="light"] .card-cat {
    background: rgba(108, 92, 231, 0.1);
}

[data-theme="light"] .cat-好書精讀與總結 {
    background: rgba(46, 213, 115, 0.15);
    color: #1a8a48;
}

[data-theme="light"] .cat-人物研究 {
    background: rgba(255, 165, 2, 0.15);
    color: #b87800;
}

[data-theme="light"] .cat-科技趨勢 {
    background: rgba(0, 206, 209, 0.15);
    color: #008b8d;
}

[data-theme="light"] .cat-tab:not(.active) {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .sort-btn:not(.active) {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .comments-placeholder {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .sidebar-ad-content {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.04), rgba(255, 0, 0, 0.01));
}

[data-theme="light"] .podcast-platform {
    color: #1db954;
}

[data-theme="light"] .ad-banner {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.04), rgba(162, 155, 254, 0.02));
}

[data-theme="light"] .ad-banner-label {
    background: var(--bg-card);
}

/* Smooth theme transition */
body,
.nav,
.card,
.hero,
.sidebar-section,
.ad-banner,
.comments-placeholder,
.book-info,
.podcast-link,
.article-body blockquote,
.article-body pre,
.article-body code {
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* === ANIMATIONS === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:nth-child(1) {
    animation-delay: 0.05s;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.15s;
}

.card:nth-child(4) {
    animation-delay: 0.2s;
}

.card:nth-child(5) {
    animation-delay: 0.25s;
}

.card:nth-child(6) {
    animation-delay: 0.3s;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .article-content {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        display: none;
    }

    .nav-search {
        display: none;
    }

    .article-header h1 {
        font-size: 1.6rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .theme-toggle {
        width: 52px;
        height: 28px;
    }

    .theme-toggle-thumb {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    [data-theme="light"] .theme-toggle-thumb {
        transform: translateX(24px);
    }
}