:root {
    /* 主色調 - 基於 LOGO 色彩 */
    --primary-beige: #f0dfc6;
    --primary-beige-dark: #e6d1b5;
    --primary-beige-light: #f7e8d4;
    
    /* 輔助色調 */
    --text-primary: #2c2c2c;
    --text-secondary: #6b6b6b;
    --text-accent: #8b7355;
    
    /* 背景色調 */
    --bg-primary: #ffffff;
    --bg-secondary: #fefcf8;
    --bg-tertiary: #f9f6f0;
    
    /* 功能色彩 */
    --success: #4ade80;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* 現代化陰影系統 */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* 圓角系統 */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    
    /* 間距系統 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
}

/* 固定標題區域 */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(240, 223, 198, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fixed-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}


.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fixed-header.scrolled .header-content {
    padding: 5px 15px;
}


/* 閱讀進度條 */
.reading-progress {
    width: 100%;
    height: 6px;  /* 從 3px 調整為 6px */
    background: rgba(240, 223, 198, 0.3);
    border-radius: var(--radius-xs);
    overflow: hidden;
    margin-top: var(--space-sm);
    position: relative;
}

.fixed-header.scrolled .reading-progress {
    height: 4px;  /* 從 2px 調整為 4px */
    margin-top: var(--space-xs);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-beige) 0%, var(--primary-beige-dark) 100%);
    border-radius: var(--radius-xs);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(240, 223, 198, 0.4);  /* 增加陰影讓進度條更立體 */
}

/* 進度條閃爍效果 */
.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* 進度指示器 */
.progress-indicator {
    position: absolute;
    top: -6px;  /* 調整位置配合新的高度 */
    right: -6px;
    width: 12px;  /* 從 8px 調整為 12px */
    height: 12px;  /* 從 8px 調整為 12px */
    background: var(--primary-beige-dark);
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.8);
}

.progress-bar:not([style*="width: 0"]) .progress-indicator {
    opacity: 1;
    transform: scale(1);
}

.fixed-header.scrolled .progress-indicator {
    width: 10px;  /* 從 6px 調整為 10px */
    height: 10px;  /* 從 6px 調整為 10px */
    top: -5px;  /* 調整位置 */
    right: -5px;
}

/* 進度百分比顯示 */
.reading-progress::before {
    content: attr(data-progress);
    position: absolute;
    right: var(--space-sm);
    top: -20px;  /* 調整位置配合新的高度 */
    font-size: 11px;  /* 稍微調大字體 */
    color: var(--text-secondary);
    font-weight: 600;  /* 加粗字體 */
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.reading-progress.show-progress::before {
    opacity: 1;
}

.fixed-header.scrolled .reading-progress::before {
    top: -18px;
    font-size: 10px;
}

/* 更新 banner 樣式 */
.fixed-header .banner {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.fixed-header.scrolled .banner {
    margin-bottom: 5px;
}

.fixed-header .banner-img {
    max-height: 120px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fixed-header.scrolled .banner-img {
    max-height: 80px;
}

/* 更新導航按鈕容器 */
.fixed-header .navigation-buttons {
    gap: 8px;
    margin: 0;
    padding: 6px;
    background: rgba(255, 245, 238, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fixed-header.scrolled .navigation-buttons {
    padding: 4px;
    gap: 6px;
}

/* 更新導航按鈕 */
.fixed-header .nav-button {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fixed-header.scrolled .nav-button {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 32px;
}

/* 更新返回按鈕 */
.fixed-header .back-button {
    position: absolute;
    top: 10px;
    right: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fixed-header.scrolled .back-button {
    top: 5px;
    right: 5px;
    padding: 4px 12px;
    font-size: 12px;
}

/* 基本重置和全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #fefcf8 0%, #f9f6f0 100%);
    background-attachment: fixed;
    line-height: 1.6;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* 內容容器設定 */
.center-container {
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    margin-top: 280px;  /* 大幅增加間距 */
    transition: margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-lg);
    border: 1px solid rgba(240, 223, 198, 0.3);
}

/* Banner 區域樣式 */
.banner {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.banner-image {
    width: 100%;
    height: auto;
    overflow: hidden;
    position: relative;
}

.banner-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    max-height: 200px;
}

/* 返回按鈕樣式 */
.back-button {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 16px;
    background-color: rgba(244, 164, 96, 0.9);
    border: none;
    border-radius: 5px;
    color: #000;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 2;
}

.back-button:hover {
    background-color: rgba(222, 184, 135, 0.9);
}

/* 導航按鈕樣式 */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin: var(--space-md) 0 0 0;  /* 完全移除下方間距 */
    padding: var(--space-xs);
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
}

.nav-button {
    padding: var(--space-md) var(--space-lg);
    font-size: 15px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-button:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-button.active {
    background: var(--primary-beige);
    color: var(--text-primary);
    font-weight: 600;
}

.nav-button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-beige-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-button.active::before {
    width: 80%;
}

/* 內容區域樣式 */
.section-content {
    display: none;
    background: transparent;
    border-radius: 0;
    margin-top: 0;  /* 完全移除上方間距 */
    box-shadow: none;
    padding: var(--space-lg) var(--space-lg);
    min-height: 400px;
}

.section-content.active {
    display: block;
}

/* 題解區域樣式 */
.explain-text {
    padding: 0;
}

.explain-section {
    margin-bottom: 20px;
}

.explain-title {
    font-size: 18px;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #DEB887;
}

.explain-content {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    padding: 5px 0;
}

/* 作者區域樣式 */
.author-text {
    padding: 0;
}

.author-section {
    margin-bottom: 20px;
}

.author-title {
    font-size: 18px;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #DEB887;
}

.author-content {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    padding: 5px 0;
}

/* 課文區域樣式 */
.content-text {
    padding: 0;
}

.content-section {
    position: relative;
    margin-bottom: 25px;
    padding: 30px 15px 15px;
    background-color: #FFF;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #F5F5DC;
}

.content-number {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 32px;
    height: 32px;
    background-color: #F4A460;
    color: #FFF;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.content-controls {
    position: static;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0 15px 0;
    padding-top: 15px;
    border-top: 1px solid #F0F0F0;
}

.content-button {
    flex: 1;
    text-align: center;
}

.content-button {
    padding: 6px 16px;
    background-color: #F4A460;
    border: none;
    border-radius: 5px;
    color: #000;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.content-button:hover {
    background-color: #DEB887;
    transform: translateY(-1px);
}

.content-button.active {
    background-color: #8B4513;
    color: #FFF;
}

.content-main {
    margin-top: 20px;
}

.content-paragraph {
    margin-bottom: 12px;
    line-height: 1.8;
    font-size: 16px;
    text-align: justify;
    color: #333;
}

/* 段旨和段析內容樣式 */
.purpose-content,
.analysis-content {
    margin-top: 15px;
    padding: 15px;
    background-color: #FFF8DC;
    border-radius: 8px;
    border-left: 4px solid #DEB887;
}

.analysis-title {
    font-size: 16px;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 8px;
}

.analysis-text {
    line-height: 1.7;
    color: #333;
    font-size: 15px;
}

.analysis-text ul {
    margin: 0;
    padding-left: 20px;
}

.analysis-text li {
    margin-bottom: 8px;
}

/* 高亮樣式 */
.highlight {
    color: #8B4513;  /* 改為跟標題一樣的深咖啡色 */
    font-weight: 700;
    position: relative;
}


/* 練習題按鈕容器樣式 */
.practice-button-container {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #F0F0F0;
}

.practice-button {
    padding: 10px 25px;
    background-color: #F4A460;
    border: none;
    border-radius: 5px;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.practice-button:hover {
    background-color: #DEB887;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 練習題區域樣式 */
.practice-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #F0F0F0;
}

.question-container {
    background-color: #FFF8DC;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #DEB887;
}

.question-container:last-of-type {
    margin-bottom: 10px;
}

.question-text {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #8B4513;
    line-height: 1.5;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

/* 一般選項按鈕樣式 */
.option-button {
    padding: 12px 15px;
    font-size: 15px;
    text-align: left;
    background-color: #FFF;
    border: 2px solid #DEB887;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.option-button:hover:not(:disabled) {
    background-color: #FFF5EE;
    transform: translateX(5px);
}

.option-button.selected {
    background-color: #DEB887;
    color: #000;
    font-weight: 500;
}

.option-button.correct {
    background-color: #90EE90;
    border-color: #90EE90;
    color: #000;
    font-weight: 500;
}

.option-button.incorrect {
    background-color: #FFB6C1;
    border-color: #FFB6C1;
    color: #000;
    font-weight: 500;
}

.option-button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* 排序題特定樣式 */
.sequence-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sequence-button {
    position: relative;
    transition: all 0.3s ease;
    padding: 12px 45px 12px 15px;
}

.sequence-number {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-color: #8B4513;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.sequence-button.sequence-selected {
    background-color: #8B4513;
    color: white;
    font-weight: 500;
}

.sequence-button.sequence-selected .sequence-number {
    display: flex;
    background-color: white;
    color: #8B4513;
}

.sequence-button.correct {
    background-color: #90EE90;
    color: black;
}

.sequence-button.incorrect {
    background-color: #FFB6C1;
    color: black;
}

/* 檢查答案按鈕樣式 */
.check-answer-button {
    padding: 10px 25px;
    background-color: #8B4513;
    color: #FFF;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin: 15px 0 10px 0;
}

.check-answer-button:not(:disabled) {
    opacity: 1;
}

.check-answer-button:not(:disabled):hover {
    background-color: #A0522D;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.check-answer-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background-color: #999;
}

/* 答案區域樣式 */
.answer-section {
    background-color: #F0F8FF;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #B0C4DE;
}

.result-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #8B4513;
}

.correct-answer {
    font-weight: bold;
    margin-bottom: 8px;
    color: #2E8B57;
    font-size: 16px;
}

.answer-explanation {
    line-height: 1.6;
    color: #333;
    font-size: 15px;
}

/* 關閉按鈕樣式 */
.close-practice-button {
    display: none;
    margin: 15px auto 0;
    padding: 8px 20px;
    background-color: #8B4513;
    border: none;
    border-radius: 5px;
    color: #FFF;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-practice-button:hover {
    background-color: #A0522D;
    transform: translateY(-1px);
}

/* 無障礙支援 */
.nav-button:focus,
.option-button:focus,
.practice-button:focus,
.content-button:focus,
.check-answer-button:focus,
.close-practice-button:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* 動態效果偏好支援 */
@media (prefers-reduced-motion: reduce) {
    .nav-button,
    .option-button,
    .practice-button,
    .content-button,
    .check-answer-button,
    .close-practice-button {
        transition: none;
        transform: none;
    }
}

/* 列印樣式 */
@media print {
    .practice-section,
    .navigation-buttons,
    .content-controls,
    .practice-button-container {
        display: none;
    }
    
    .content-wrapper {
        padding: 0;
        max-width: none;
    }
    
    .explain-content,
    .author-content,
    .content-paragraph {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .section-content {
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .center-container {
        padding: 5px;
		margin-top: 180px;
    }
    
    .content-wrapper {
        padding: 0 10px;
    }
    
    .banner-img {
        max-height: 150px;
    }
    
    .back-button {
        top: 10px;
        right: 10px;
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .navigation-buttons {
        gap: 10px;
        margin: 10px 0 5px 0;
    }
    
    .nav-button {
        padding: 8px 20px;
        font-size: 16px;
    }
    
    .section-content {
        padding: 15px;
        margin-top: 5px;
    }
    
    .explain-title,
    .author-title,
    .analysis-title {
        font-size: 16px;
    }
    
    .explain-content,
    .author-content,
    .content-paragraph {
        font-size: 14px;
    }
    
    .analysis-text {
        font-size: 14px;
    }
    
    .option-button {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .content-button {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .content-number {
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: -10px;
        left: -10px;
    }
    
    .content-section {
        padding: 25px 12px 12px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .navigation-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 8px;
    }
    
    .nav-button {
        flex: 1;
        min-width: 80px;
        max-width: 120px;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .back-button {
        top: 5px;
        right: 5px;
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .content-controls {
        position: static;
        margin-bottom: 15px;
        justify-content: center;
    }
    
    .content-main {
        margin-top: 15px;
    }
    
    .question-text {
        font-size: 15px;
    }
    
    .option-button {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .sequence-button {
        padding: 10px 40px 10px 12px;
    }
    
    .sequence-number {
        width: 20px;
        height: 20px;
        font-size: 11px;
        right: 10px;
    }
}

/* ϶ */
.site-footer{
    background: rgba(0,0,0,.4);
    color:#fff;
    padding: 12px 16px;
    text-align:center;
    font-size: .9em;
    margin-top: 20px;
    position: relative;
    z-index: 10;
}
  
/* uvnvs */
.site-footer .footer-link{
    margin-left: 8px;
    background: transparent;
    border: 0;
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}
  
/* qWƥXO */
.copyright-panel{
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    background: #fff;
    color: #333;
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
    transition: bottom .35s ease-out;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    z-index: 2000;
    max-height: 80vh;
    overflow-y: auto;
}
.copyright-panel.active{ bottom: 0; }
  
.copyright-panel .panel-content{
    padding: 20px;
    max-width: 800px;
    margin: auto;
    line-height: 1.7;
}
.copyright-panel h3{ margin-top: 0; }
  
.copyright-panel .close-btn{
    position: absolute;
    right: 16px;
    top: 10px;
    border: 0;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
    color: #333;
}
