/* --- 1. 全局變數與重置 --- */
:root {
    /* 配合您 HTML 中的 color: green，設定一致的品牌綠色 */
    --primary: #2E7D32;
    /* 深綠色 (Forest Green) */
    --secondary: #43A047;
    /* 中綠色 */
    --accent: #E8F5E9;
    /* 極淺綠色背景 */
    --highlight: #F9A825;
    /* 金黃色 (重點強調) */
    --text: #333;
    --white: #fff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans HK', sans-serif;
    color: var(--text);
    margin: 0;
    line-height: 1.8;
    background-color: #FAFAFA;
}

h1,
h2,
h3,
h4 {
    font-family: 'Noto Serif TC', serif;
    color: #2c2c2c;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    padding: 0;
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.underline {
    width: 50px;
    height: 3px;
    background: var(--primary);
    margin: 15px auto;
}

.highlight-bg {
    background-color: var(--accent);
}

/* --- 2. 導航欄 --- */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
}

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

.nav-links a {
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary);
}

/* WhatsApp 按鈕樣式 */
.btn-nav {
    border: 1px solid #25D366;
    padding: 8px 20px;
    border-radius: 4px;
    color: #25D366 !important;
    font-weight: bold;
}

.btn-nav:hover {
    background: #25D366;
    color: var(--white) !important;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* --- 3. Hero Section (典雅書房風 - 綠色系適配) --- */
.hero {
    min-height: 85vh;
    /* 背景圖：暖色書房 */
    background: url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    padding-top: 60px;
}

/* 漸層遮罩：左白 -> 右透明，確保文字清晰 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 40%, rgba(255, 255, 255, 0.85) 60%, rgba(255, 255, 255, 0.2) 100%);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text {
    flex: 1;
    max-width: 600px;
    padding-left: 10px;
}

/* 標籤設計 */
.badge-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.badge {
    background: var(--primary);
    color: #fff;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

/* 日期標籤 (包含時間) */
.date-badge {
    padding: 5px 15px;
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.date-badge i {
    color: var(--primary);
}

.hero h1 {
    font-size: 3.2rem;
    margin-bottom: 15px;
    color: #1a1a1a;
    letter-spacing: -1px;
    line-height: 1.2;
}

.book-title {
    color: var(--primary);
    display: block;
    margin-top: 5px;
}

.hero .author {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
    font-family: 'Noto Sans HK';
}

.hero-details {
    border-top: 1px solid #ddd;
    padding-top: 20px;
    margin-bottom: 30px;
}

.hero-details p {
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-details i {
    color: var(--primary);
    min-width: 20px;
    text-align: center;
}

/* 按鈕 */
.hero-btns {
    display: flex;
    gap: 15px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: bold;
}

.btn-primary:hover {
    background: #1b5e20;
    transform: translateY(-3px);
}

.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
}

/* 右側書本圖片區域 (包含圓形裝飾) */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

/* 裝飾性淺綠色圓圈 */
.hero-image::before {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    background: rgba(46, 125, 50, 0.08);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.hero-image img {
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border-radius: 5px;
    transform: rotateY(-10deg);
    transition: transform 0.5s ease;
}

.hero-image:hover img {
    transform: rotateY(0deg) scale(1.02);
}


/* --- 4. About Section --- */
.about-section {
    background-color: #fff;
    padding: 100px 0;
}

.about-wrapper {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-image {
    flex: 1;
    position: relative;
    max-width: 450px;
}

.about-image img {
    width: 100%;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    filter: sepia(10%);
}

.about-image .image-border {
    position: absolute;
    top: 20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary);
    z-index: 1;
    border-radius: 5px;
    opacity: 0.2;
}

.about-content-styled {
    flex: 1.2;
}

.about-content-styled h2 {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--primary);
}

/* Mission Quote */
.mission-quote {
    position: relative;
    padding-left: 30px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary);
}

.mission-quote i {
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.05);
    z-index: -1;
}

.mission-quote p {
    font-size: 1.3rem;
    font-weight: bold;
    color: #444;
    line-height: 1.5;
    margin: 0;
    font-family: 'Noto Serif TC';
}

.text-body p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 15px;
    text-align: justify;
}

.signature {
    margin-top: 40px;
    font-family: 'Noto Serif TC';
    font-style: italic;
    text-align: right;
    color: #888;
}


/* --- 5. Info Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: 100%;
    box-sizing: border-box;
}

.icon-box {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.location-tips {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #eee;
    font-size: 0.9rem;
    color: #666;
}

.location-tips ul {
    padding-left: 20px;
    list-style: disc;
    margin: 10px 0;
}


/* --- 6. 讀書會流程表 (Schedule Table) --- */
.schedule-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* 固定佈局 */
}

/* 欄位寬度設定 (桌面版) */
.schedule-table th:nth-child(1) {
    width: 25%;
}

/* 時間 */
.schedule-table th:nth-child(2) {
    width: 15%;
}

/* 分鐘 */
.schedule-table th:nth-child(3) {
    width: 60%;
}

/* 內容 */

.schedule-table th {
    background: var(--primary);
    color: #fff;
    padding: 15px 20px;
    text-align: left;
    font-weight: 500;
    font-size: 1.1rem;
}

.schedule-table td {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    /* 允許文字換行，不 Scroll */
    word-wrap: break-word;
    white-space: normal;
    vertical-align: top;
}

/* 斑馬紋 */
.schedule-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* 時間欄位 */
.time-col {
    font-family: 'Noto Sans HK', monospace;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

/* 小休行 */
.break-row {
    background-color: #E8F5E9 !important;
    color: var(--primary);
    font-weight: bold;
}


/* --- 7. Archive (書單表格) - 已修正為 Wrap Text --- */
.search-container {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.search-container input {
    width: 100%;
    padding: 12px 20px 12px 40px;
    border: 1px solid #ccc;
    border-radius: 30px;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
}

.search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(46, 125, 50, 0.2);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    /* 移除 overflow 捲軸 */
}

.book-table {
    width: 100%;
    border-collapse: collapse;
    /* 使用固定佈局以支援換行 */
    table-layout: fixed;
}

/* 設定欄位寬度 (桌面版) */
.book-table th:nth-child(1) {
    width: 12%;
}

/* 屆數 */
.book-table th:nth-child(2) {
    width: 20%;
}

/* 日期 */
.book-table th:nth-child(3) {
    width: 38%;
}

/* 書目 */
.book-table th:nth-child(4) {
    width: 30%;
}

/* 作者 */

.book-table th {
    text-align: left;
    padding: 15px;
    background: var(--primary);
    color: white;
    font-weight: normal;
}

.book-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #555;
    /* 允許文字換行 */
    word-wrap: break-word;
    white-space: normal;
    vertical-align: top;
}

.book-table tr:hover {
    background-color: #f9f9f9;
}

/* 隱藏原本卡片模式用的標籤 */
.mobile-label {
    display: none;
}


/* --- 8. Footer --- */
footer {
    background: #E8F5E9;
    border-top: 5px solid var(--primary);
    text-align: center;
    padding: 40px 0;
    margin-top: 0;
}

.copyright {
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}


/* --- 9. RWD 手機響應式 --- */
@media (max-width: 900px) {

    /* Nav */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 20px 0;
        text-align: center;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    /* Hero */
    .hero {
        background-position: right center;
    }

    .hero-overlay {
        background: rgba(255, 255, 255, 0.92);
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-text {
        padding-left: 0;
    }

    .badge-wrapper {
        justify-content: center;
    }

    .date-badge {
        width: 100%;
        justify-content: center;
    }

    .hero-details {
        display: inline-block;
        text-align: left;
    }

    .hero-image::before {
        width: 250px;
        height: 250px;
    }

    .hero-image img {
        max-width: 200px;
        transform: rotateY(0deg);
    }

    .hero-btns {
        justify-content: center;
    }

    /* About */
    .about-wrapper {
        flex-direction: column;
        gap: 40px;
    }

    .about-image {
        width: 90%;
        margin: 0 auto;
    }

    .about-image .image-border {
        left: 10px;
        top: 10px;
    }

    /* Schedule Table (Mobile) */
    .schedule-table th,
    .schedule-table td {
        padding: 10px 8px;
        /* 縮小內距 */
        font-size: 0.9rem;
    }

    .schedule-table th:nth-child(1) {
        width: 30%;
    }

    /* 時間 */
    .schedule-table th:nth-child(2) {
        width: 15%;
        text-align: center;
    }

    /* 分鐘 */
    .schedule-table td:nth-child(2) {
        text-align: center;
    }

    .schedule-table th:nth-child(3) {
        width: 55%;
    }

    /* 內容 */
    .time-col {
        font-size: 0.85rem;
    }

    /* Book Archive Table (Mobile - 壓縮表格) */
    /* 在手機上也保持表格佈局，並縮小間距 */
    .book-table th,
    .book-table td {
        padding: 10px 5px;
        font-size: 0.9rem;
    }

    /* 手機版欄位寬度重新分配 */
    .book-table th:nth-child(1) {
        width: 12%;
        text-align: center;
    }

    /* 屆數 */
    .book-table th:nth-child(2) {
        width: 23%;
    }

    /* 日期 */
    .book-table th:nth-child(3) {
        width: 40%;
    }

    /* 書目 */
    .book-table th:nth-child(4) {
        width: 25%;
    }

    /* 作者 */

    .book-table td:nth-child(1) {
        text-align: center;
    }
}

/* --- 桌面版預設設定 --- */
/* 電腦版時，隱藏嵌入的 ID 和 作者 */
.mobile-id-info,
.mobile-author-info {
    display: none;
}

/* --- RWD 手機版書單表格極致優化 (雙欄模式) --- */
@media (max-width: 900px) {

    /* 1. 隱藏「獨立屆數(Col 1)」與「獨立作者(Col 4)」 */
    .book-table th:nth-child(1),
    .book-table td:nth-child(1),
    .book-table th:nth-child(4),
    .book-table td:nth-child(4) {
        display: none;
    }

    /* 2. 顯示嵌入在日期裡的 ID */
    .mobile-id-info {
        display: block;
        font-weight: bold;
        color: var(--primary);
        font-size: 0.9rem;
        margin-bottom: 4px;
    }

    /* 3. 顯示嵌入在書名裡的 作者 */
    .mobile-author-info {
        display: block;
        font-weight: normal;
        /* 書名是粗體，作者改回正常 */
        color: #666;
        /* 灰色字 */
        font-size: 0.85rem;
        /* 字體小一點 */
        margin-top: 6px;
        /* 與書名拉開距離 */
    }

    .mobile-author-info i {
        font-size: 0.8em;
        margin-right: 3px;
    }

    /* 4. 重新分配寬度：變成兩欄 (35% : 65%) */

    /* 左欄：日期 + ID */
    .book-table th:nth-child(2) {
        width: 35%;
        vertical-align: top;
    }

    /* 右欄：書名 + 作者 */
    .book-table th:nth-child(3) {
        width: 65%;
        vertical-align: top;
    }

    /* 調整內距讓版面更緊湊 */
    .book-table th,
    .book-table td {
        padding: 12px 8px;
    }
}

/* --- 書單狀態標籤 --- */

/* 1. 未來「預告」 (保持金黃色) */
.future-badge {
    display: inline-block;
    background-color: var(--highlight);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 5px;
    vertical-align: middle;
    font-weight: normal;
}

/* 2. 本次「今期」 (使用品牌綠色) */
.current-badge {
    display: inline-block;
    background-color: var(--primary);
    /* 深綠色 */
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 5px;
    vertical-align: middle;
    font-weight: normal;
}

/* 3. 行的背景色區分 */
.future-row {
    background-color: #fffde7 !important;
}

/* 預告：淺黃底 */
.current-row {
    background-color: #e8f5e9 !important;
}

/* 今期：淺綠底 */

/* --- 4. 待定標籤 (灰色) --- */
.tbd-badge {
    display: inline-block;
    background-color: #9E9E9E; /* 灰色 */
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 5px;
    vertical-align: middle;
    font-weight: normal;
}