﻿/* ========== blog.css · 文章頁面共享樣式 ========== */

/* ----- 變量定義 ----- */
:root {
    /* 主色調 */
    --primary: #cfa189;
    --primary-hover: #b8866b;
    --primary-shadow: rgba(170, 130, 100, 0.3);
    
    /* 背景色 */
    --bg-body: linear-gradient(145deg, #fdf5f0 0%, #f0e7db 100%);
    --bg-container: rgba(255, 255, 255, 0.9);
    --bg-preview: #f5f0e6;
    --bg-charity: #e9dad1;
    --bg-form: #fff8f2;
    
    /* 文字色 */
    --text-main: #4a3b2c;
    --text-sub: #9b7b6b;
    --text-light: #7a5d4e;
    --text-muted: #6e5440;
    
    /* 功能色 */
    --required: #c44536;
    --positive: #c44536;
    --negative: #1e90ff;
    
    /* 邊框 */
    --border-input: #dccbbd;
    --border-light: #ecdacf;
    --focus-border: #b28b7a;
    --focus-ring: rgba(210, 150, 130, 0.3);
    
    /* 表格 */
    --table-header-bg: #bda79b;
    --table-header-text: white;
    --table-even: #faf3ed;
    --table-border: #ecdacf;
    
    /* 陰影 */
    --shadow-container: 0 12px 30px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 12px 24px rgba(0, 0, 0, 0.1);
    --shadow-btn: 0 8px 16px rgba(170, 130, 100, 0.25);
    --shadow-btn-hover: 0 12px 24px rgba(170, 130, 100, 0.35);
    
    /* 圓角 */
    --radius-container: 32px;
    --radius-card: 20px;
    --radius-button: 48px;
    --radius-item: 24px;
    
    /* 間距 */
    --spacing: 1rem;
}

/* ----- 基礎重置 ----- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    padding: 1rem;
    min-height: 100vh;
}

/* ----- 容器 ----- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-container);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-container);
    box-shadow: var(--shadow-container);
    padding: 2rem 2.5rem;
    border: 1px solid rgba(255, 245, 235, 0.6);
}

/* ----- 網站頭部 ----- */
.site-header {
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    border-bottom: 2px solid var(--border-input);
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.sub {
    text-align: center;
    font-size: 1.2rem;
    color: #836e5f;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* ----- 標題層級 ----- */
h1 {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 2rem;
}

h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 600;
    border-left: 6px solid var(--primary);
    padding-left: 1rem;
    scroll-margin-top: 80px;
    background: linear-gradient(90deg, rgba(207, 161, 137, 0.08) 0%, rgba(207, 161, 137, 0) 100%);
    border-radius: 0 20px 20px 0;
}

h2:first-of-type {
    margin-top: 1rem;
}

h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 600;
}

p {
    margin-bottom: 1.2rem;
}

/* ----- 按鈕 ----- */
.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-button);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-btn);
    text-align: center;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-btn-hover);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-btn);
}

.back-home {
    margin: 0.5rem 0 1.5rem;
}

/* ----- 區塊組件 ----- */
.timeline-block {
    background: var(--bg-preview);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-card);
    margin: 2rem 0;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-card);
}

.belief-box {
    background: #e3f0f5;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-item);
    margin: 2rem 0;
    border-left: 6px solid var(--primary);
}

.personal-story {
    background: #f0e9d8;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-item);
    margin: 2rem 0;
    border-left: 6px solid #b22222;
}

.quote-block {
    background: var(--bg-charity);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-card);
    margin: 2rem 0;
    text-align: center;
    font-size: 1.2rem;
    font-style: italic;
    border-left: 6px solid var(--primary);
}

.term-list {
    background: var(--bg-preview);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-card);
    margin: 1.5rem 0;
}

.term-item {
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px dashed #ccc;
}

.term-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.term-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ----- 卡片網格 ----- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.info-card {
    background: #fefaf5;
    border-radius: var(--radius-card);
    padding: 1.5rem;
    border-top: 4px solid var(--primary);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

.info-card .card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ----- 表格 ----- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

th, td {
    border: 1px solid var(--table-border);
    padding: 0.9rem 1rem;
    text-align: left;
}

th {
    background: var(--table-header-bg);
    color: var(--table-header-text);
    font-weight: 600;
    letter-spacing: 0.3px;
}

tr:nth-child(even) {
    background: var(--table-even);
}

/* ----- 引用與註解 ----- */
.citation {
    font-style: italic;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-light);
}

.small-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

.highlight {
    font-weight: 600;
    color: var(--required);
}

/* ----- 目錄區塊 ----- */
.table-of-contents {
    background: rgba(245, 240, 230, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-item);
    margin: 1.5rem 0 2rem;
    border: 1px solid rgba(207, 161, 137, 0.2);
}

.table-of-contents p {
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.toc-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

/* 目錄按鈕 — 不變色，只浮動 */
.toc-btn {
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1), box-shadow 0.2s;
    display: inline-block;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toc-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.toc-btn:active {
    transform: translateY(0);
    transition: transform 0.05s;
}

/* ----- 卷次導航 ----- */
.volume-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 1.5rem;
    padding: 0.8rem 0;
    border-bottom: 1px dashed var(--border-input);
}

.volume-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
}

.volume-links {
    display: flex;
    gap: 1.5rem;
}

.volume-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    transition: all 0.2s;
}

.volume-link:hover {
    background: var(--bg-preview);
    color: var(--primary);
}

.volume-link.current {
    background: var(--primary);
    color: white;
}

/* ----- 金句區塊 ----- */
.motto {
    text-align: center;
    margin: 2.5rem 0 1rem;
    font-size: 1.4rem;
    font-style: italic;
    color: var(--primary);
}

.sub-motto {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.signature {
    text-align: right;
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* ----- 知識網格 ----- */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2.5rem 0 1.5rem;
}

.knowledge-grid h3 {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 0.5rem;
}

.knowledge-grid .btn {
    margin: 0;
    padding: 0.7rem 0.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* ----- 隱私註解 ----- */
.privacy-note {
    background: #d4edda;
    color: #155724;
    padding: 1rem 2rem;
    border-radius: 60px;
    margin: 1.5rem 0 0.5rem;
    text-align: center;
    font-size: 1rem;
    border-left: 4px solid #28a745;
}

/* ----- 頁尾 ----- */
.footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    border-top: 1px solid var(--border-input);
    padding-top: 2rem;
    line-height: 1.6;
}

/* ----- 手機版響應式 ----- */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        padding: 1.2rem;
        border-radius: 24px;
    }
    
    .site-header {
        font-size: 2rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
        padding-left: 0.8rem;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .knowledge-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .knowledge-grid .btn {
        padding: 0.6rem 0.3rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .timeline-block,
    .belief-box,
    .personal-story,
    .quote-block,
    .term-list {
        padding: 1.2rem 1.5rem;
    }
    
    .table-of-contents {
        padding: 1.2rem 1.5rem;
    }
    
    .toc-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .volume-nav {
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }
    
    .volume-links {
        gap: 0.8rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.6rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .knowledge-grid {
        grid-template-columns: 1fr;
    }
    
    .toc-buttons {
        gap: 0.5rem;
    }
    
    .toc-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}
