/* ========================================
   談鏈說幣 - 精美樣式表 v2.1
   優化版：動畫、漸變、玻璃質感 + 返回按鈕
   ======================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS 變量 - 8種主題 */
:root {
    --bg-color: #000000;
    --title-color: #FFFFFF;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

/* 1. 柔和藍色主題 */
body[data-theme="blue"] {
    --glow-start: #0A1929;
    --glow-end: #1A3A52;
    --glow-accent: #42A5F5;
    --text-color: #E3F2FD;
    --accent-color: #42A5F5;
    --accent-gradient: linear-gradient(135deg, #42A5F5, #1E88E5);
    --secondary-color: #B0BEC5;
    --card-bg: rgba(66, 165, 245, 0.08);
}

/* 2. 深靛藍主題 */
body[data-theme="indigo"] {
    --glow-start: #0F1C3F;
    --glow-end: #1A2F5A;
    --glow-accent: #5C9FE5;
    --text-color: #E3F2FD;
    --accent-color: #5C9FE5;
    --accent-gradient: linear-gradient(135deg, #5C9FE5, #3F51B5);
    --secondary-color: #BBDEFB;
    --card-bg: rgba(92, 159, 229, 0.08);
}

/* 3. 優雅紫色主題 */
body[data-theme="purple"] {
    --glow-start: #1A0A28;
    --glow-end: #2D1B3D;
    --glow-accent: #B39DDB;
    --text-color: #F3E5F5;
    --accent-color: #B39DDB;
    --accent-gradient: linear-gradient(135deg, #B39DDB, #7E57C2);
    --secondary-color: #D1C4E9;
    --card-bg: rgba(179, 157, 219, 0.08);
}

/* 4. 清新綠色主題 */
body[data-theme="green"] {
    --glow-start: #0D1F12;
    --glow-end: #1B3A26;
    --glow-accent: #66BB6A;
    --text-color: #E8F5E9;
    --accent-color: #66BB6A;
    --accent-gradient: linear-gradient(135deg, #66BB6A, #43A047);
    --secondary-color: #C8E6C9;
    --card-bg: rgba(102, 187, 106, 0.08);
}

/* 5. 溫暖橙色主題 */
body[data-theme="orange"] {
    --glow-start: #1F1410;
    --glow-end: #3D2415;
    --glow-accent: #FFA726;
    --text-color: #FFF3E0;
    --accent-color: #FFA726;
    --accent-gradient: linear-gradient(135deg, #FFA726, #FB8C00);
    --secondary-color: #FFCCBC;
    --card-bg: rgba(255, 167, 38, 0.08);
}

/* 6. 玫瑰粉色主題 */
body[data-theme="pink"] {
    --glow-start: #1F0A14;
    --glow-end: #3D1528;
    --glow-accent: #F06292;
    --text-color: #FCE4EC;
    --accent-color: #F06292;
    --accent-gradient: linear-gradient(135deg, #F06292, #E91E63);
    --secondary-color: #F8BBD0;
    --card-bg: rgba(240, 98, 146, 0.08);
}

/* 7. 冷色青綠主題 */
body[data-theme="teal"] {
    --glow-start: #0A1F1F;
    --glow-end: #164E4D;
    --glow-accent: #26A69A;
    --text-color: #E0F2F1;
    --accent-color: #26A69A;
    --accent-gradient: linear-gradient(135deg, #26A69A, #00897B);
    --secondary-color: #B2DFDB;
    --card-bg: rgba(38, 166, 154, 0.08);
}

/* 8. 中性灰色主題 */
body[data-theme="gray"] {
    --glow-start: #1A1A1D;
    --glow-end: #2D2D30;
    --glow-accent: #9E9E9E;
    --text-color: #F5F5F5;
    --accent-color: #9E9E9E;
    --accent-gradient: linear-gradient(135deg, #9E9E9E, #757575);
    --secondary-color: #E0E0E0;
    --card-bg: rgba(158, 158, 158, 0.08);
}

/* ========================================
   載入動畫
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 40px var(--accent-color), 0 0 80px var(--accent-color);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 60px var(--accent-color), 0 0 120px var(--accent-color);
        opacity: 0.9;
    }
}

/* ========================================
   基礎樣式
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    animation: fadeIn 0.6s ease-out;
}

/* 背景光暈 - 增強版 */
.background-glow {
    position: fixed;
    bottom: -30%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(
        ellipse at center,
        var(--glow-accent) 0%,
        var(--glow-end) 30%,
        var(--glow-start) 60%,
        transparent 80%
    );
    opacity: 0.4;
    filter: blur(100px);
    z-index: -2;
    pointer-events: none;
    animation: pulse 8s ease-in-out infinite;
}

/* 第二層光暈 */
.background-glow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    background: radial-gradient(
        circle at center,
        var(--accent-color) 0%,
        transparent 70%
    );
    opacity: 0.3;
    filter: blur(60px);
    transform: translate(-50%, -50%);
}

/* 幾何網格線 - 增強版 */
.geometric-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* ========================================
   佈局容器
   ======================================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 24px;
    min-height: 100vh;
}

/* ========================================
   頁頭 - 增強版
   ======================================== */
.header {
    text-align: center;
    margin-bottom: 70px;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
}

.header-center {
    margin-bottom: 56px;
}

/* 返回按鈕 */
.back-link {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--title-color);
    transform: translateX(-4px);
    border-color: rgba(255, 255, 255, 0.1);
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--accent-gradient);
    border-radius: 20px;
    font-size: 36px;
    margin-bottom: 24px;
    box-shadow: 
        0 0 40px var(--accent-color), 
        0 0 80px var(--accent-color),
        inset 0 0 20px rgba(255,255,255,0.2);
    animation: glow-pulse 3s ease-in-out infinite;
    position: relative;
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: var(--accent-gradient);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.5;
    filter: blur(10px);
}

.header h1 {
    font-size: 52px;
    font-weight: 800;
    color: var(--title-color);
    margin-bottom: 14px;
    letter-spacing: -0.03em;
    color: var(--title-color);
    margin-bottom: 14px;
    letter-spacing: -0.03em;
    /* background: linear-gradient(135deg, var(--title-color) 0%, var(--accent-color) 100%); */
    /* -webkit-background-clip: text; */
    /* -webkit-text-fill-color: transparent; */
    /* background-clip: text; */
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.subtitle {
    font-size: 18px;
    color: var(--secondary-color);
    opacity: 0.9;
    font-weight: 400;
}

.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-color);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.date-badge:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.02);
}

/* ========================================
   主內容區
   ======================================== */
.main-content {
    max-width: 720px;
    margin: 0 auto;
}

.index-page {
    max-width: 800px;
}

/* ========================================
   章節標題 - 增強版
   ======================================== */
.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: fadeInUp 0.6s ease-out;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    opacity: 0.3;
}

/* ========================================
   核心摘要卡片 - 增強版
   ======================================== */
.summary-card {
    background: linear-gradient(135deg, var(--card-bg), rgba(255, 255, 255, 0.03));
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 56px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: fadeInUp 0.7s ease-out;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.summary-list {
    list-style: none;
}

.summary-item {
    font-size: 15px;
    line-height: 1.9;
    padding: 16px 0;
    padding-left: 28px;
    position: relative;
    transition: all 0.3s ease;
}

.summary-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent-gradient);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
}

.summary-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-item:hover {
    padding-left: 32px;
    color: var(--title-color);
}

/* ========================================
   分類區塊 - 增強版
   ======================================== */
.category-section {
    margin-bottom: 64px;
    animation: fadeInUp 0.8s ease-out;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.category-icon {
    font-size: 36px;
}

.category-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--title-color);
    flex: 1;
    letter-spacing: -0.01em;
}

.category-count {
    padding: 6px 16px;
    background: var(--accent-gradient);
    color: #000;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ========================================
   資訊卡片網格 - 增強版
   ======================================== */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border-radius: 16px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: left 0.6s ease;
}

.news-card:hover {
    background: linear-gradient(135deg, var(--card-bg), rgba(255, 255, 255, 0.02));
    border-color: var(--accent-color);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 20px var(--card-bg);
}

.news-card:hover::before {
    left: 100%;
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 14px;
}

.news-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--title-color);
    flex: 1;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.news-card:hover .news-title {
    color: var(--accent-color);
}

.item-link {
    padding: 8px 20px;
    background: var(--accent-gradient);
    color: #000;
    text-decoration: none;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.item-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.entry-link:focus-visible,
.back-link:focus-visible,
.item-link:focus-visible,
.podcast-player:focus-visible,
.video-player:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
}

.news-summary {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 18px;
    opacity: 0.9;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--card-bg);
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* ========================================
   關鍵詞頁腳 - 增強版
   ======================================== */
.keywords-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 50px;
    animation: fadeIn 0.8s ease-out;
}

.keywords-footer p {
    color: var(--secondary-color);
    font-size: 13px;
    opacity: 0.8;
}

/* ========================================
   空狀態
   ======================================== */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    animation: fadeInUp 0.6s ease-out;
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 24px;
}

.empty-state h2 {
    font-size: 28px;
    color: var(--title-color);
    margin-bottom: 18px;
    font-weight: 700;
}

.empty-state p {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* ========================================
   索引頁 - 增強版
   ======================================== */
.index-section {
    margin-bottom: 50px;
    animation: fadeInUp 0.7s ease-out;
}

.index-entries {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.index-entry {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.index-entry:hover {
    border-color: var(--accent-color);
    transform: translateX(8px);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        -4px 0 0 var(--accent-color);
}

.entry-link {
    display: block;
    padding: 24px 28px;
    text-decoration: none;
}

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

.entry-date {
    font-size: 17px;
    font-weight: 600;
    color: var(--title-color);
}

.entry-arrow {
    font-size: 22px;
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

.index-entry:hover .entry-arrow {
    transform: translateX(6px);
}

.entry-summary {
    color: var(--secondary-color);
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.empty-message {
    text-align: center;
    padding: 80px 20px;
    color: var(--secondary-color);
    font-size: 16px;
}

/* ========================================
   頁腳 - 增強版
   ======================================== */
.footer {
    text-align: center;
    padding: 50px 20px;
    margin-top: 70px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
    color: var(--secondary-color);
    font-size: 13px;
    opacity: 0.7;
}

/* ========================================
   響應式設計 - 增強版
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 30px 18px;
    }

    .header h1 {
        font-size: 36px;
    }

    .logo-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .header-center {
        margin-bottom: 40px;
    }
    
    .back-link {
        position: static;
        display: inline-flex;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .category-title {
        font-size: 22px;
    }

    .summary-card {
        padding: 24px;
        border-radius: 16px;
    }

    .news-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .item-link {
        align-self: flex-start;
    }

    .news-card {
        padding: 22px;
    }

    .index-entries {
        gap: 12px;
    }

    .entry-link {
        padding: 18px 20px;
    }

    .background-glow {
        width: 120%;
        height: 60%;
        bottom: -15%;
        right: -15%;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 28px;
    }

    .summary-card {
        padding: 20px;
    }

    .news-card {
        padding: 18px;
        border-radius: 12px;
    }

    .date-badge {
        font-size: 12px;
        padding: 8px 16px;
    }

    .category-icon {
        font-size: 28px;
    }

    .category-title {
        font-size: 20px;
    }
}

/* ========================================
   深色模式滾動條
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   選取文字樣式
   ======================================== */
::selection {
    background: var(--accent-color);
    color: #000;
}

/* ========================================
   Podcast Player Styles (NotebookLM)
   ======================================== */
.podcast-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.podcast-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
}

.podcast-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
    letter-spacing: 0.5px;
}

.podcast-icon {
    font-size: 20px;
    animation: pulse 2s infinite ease-in-out;
}

.podcast-player {
    width: 100%;
    height: 40px;
    border-radius: 20px;
}

.video-player {
    width: 100%;
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.back-link:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
