/* =========================================
   1. 基礎設定 (Base & Reset)
   ========================================= */
body, html {
    margin: 0; padding: 0;
    font-family: 'Noto Sans TC', sans-serif;
    /* 預設背景色，各頁面可由自己的 <style> 覆蓋 */
    background-color: #f8f9fa; 
    color: #333;
    /* 預設捲動行為 */
    scroll-behavior: smooth;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }
iframe { border: none; display: block; width: 100%; height: 100%; }


/* =========================================
   2. 導覽列與選單 (Navbar & Drawer)
   ========================================= */
.navbar {
    position: sticky; top: 0; left: 0; width: 100%;
    background: rgba(220, 236, 219, 0.95);
    backdrop-filter: blur(10px);
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; box-sizing: border-box;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.nav-logo img { height: 40px; display: block; }
@media (max-width: 768px) { .nav-logo img { height: 35px; } } /* 不一樣的 */

.menu-toggle { font-size: 24px; cursor: pointer; color: #2F5D48; padding: 5px; }

/* 抽屜選單容器 */
.menu-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1050;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.menu-backdrop.active { opacity: 1; pointer-events: auto; }

.drawer-menu {
    position: fixed; top: 0; right: -350px; width: 350px; height: 100vh;
    background: #2F5D48; z-index: 1100;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: right 0.3s ease; box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}
.drawer-menu.active { right: 0; }

.close-btn { position: absolute; top: 20px; right: 20px; color: white; font-size: 30px; cursor: pointer; }

.menu-link {
    color: white; font-size: 22px; font-weight: 700; margin: 20px 0;
    text-decoration: none; position: relative;
}
.menu-link::after {
    content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 50%;
    background: #C07858; transition: 0.3s; transform: translateX(-50%);
}
.menu-link:hover::after { width: 100%; }

@media (max-width: 768px) { .drawer-menu { width: 85%; right: -85%; } }

/* =========================================
   3. App 模式骨架 (App Layout)
   適用於: Booking, Schedule, ClassCheck, PrivateCheck
   ========================================= */
/* 鎖定高度，讓 Iframe 自適應 */
body.app-mode {
    height: 100vh;
    overflow: hidden;
    background-color: #dcecdb; /* 統一綠底 */
    display: flex;
    flex-direction: column;
}

/* App 模式下的導覽列微調 (不用 sticky) */
body.app-mode .navbar {
    position: relative; 
    flex: 0 0 auto;
    border-bottom: 1px solid #c5d6c6;
    padding: 10px 15px;
}

/* Iframe 滿版容器 */
.app-frame-container, .iframe-container {
    flex: 1 1 auto; width: 100%; position: relative; 
    overflow: hidden; background: white;
}

/* =========================================
   4. 共用元件: Tabs & Info Box (說明框)
   ========================================= */
/* Tabs 頁籤 */
.tabs-container {
    background: #dcecdb; flex: 0 0 auto;
    display: flex; justify-content: center; padding: 10px 0 0 0;
}
.tab-btn {
    text-decoration: none; padding: 8px 20px;
    font-size: 14px; font-weight: 700; color: #555;
    background: rgba(255,255,255,0.4);
    border-top-left-radius: 10px; border-top-right-radius: 10px;
    margin: 0 2px; transition: 0.2s; position: relative; top: 1px;
    border: 1px solid transparent;
}
.tab-btn.active {
    background: white; color: #2F5D48;
    border-color: #c5d6c6; border-bottom-color: white; z-index: 2;
}
.tab-btn:hover { background: rgba(255,255,255,0.7); color: #2F5D48; }

/* 控制列 (標題與說明開關) */
.controls-bar {
    background-color: #fff; flex: 0 0 auto;
    padding: 8px 10px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #c5d6c6; position: relative; z-index: 1;
}
.page-title { font-size: 16px; font-weight: 900; color: #2F5D48; padding-left: 5px; }

/* 說明開關按鈕 */
.btn-style-outline {
    background: transparent; border: 1px solid #1F4E5F; color: #1F4E5F;
    padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: bold;
    cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.btn-style-outline.active {
    border-color: #8E3535; color: #8E3535; background-color: rgba(142, 53, 53, 0.05);
}

/* 說明框容器 */
.info-wrapper {
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out;
    width: 100%; flex: 0 0 auto; 
    background: white; /* 預設白色 */
}
.info-wrapper.open { max-height: 2000px; border-bottom: 1px dashed #2F5D48; }

/* 內容排版 */
.content-inner { padding: 10px; text-align: center; }

/* Quick Tips 清單 */
.quick-tips {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 15px;
    font-size: 13px; color: #333; line-height: 1.6;
    background: #f9f9f9; padding: 10px; border-radius: 8px;
    max-width: 800px; margin: 0 auto; border: 1px dashed #c5d6c6; text-align: left;
}
.tip-box { flex: 1; min-width: 200px; }
.tip-title { font-weight: 900; color: #2F5D48; display: block; margin-bottom: 5px; border-bottom: 2px solid #c5d6c6; }
.tip-list li { padding-left: 14px; position: relative; margin-bottom: 3px; }
.tip-list li::before { content: '•'; position: absolute; left: 0; color: #1F4E5F; font-weight: bold; }
.highlight-label { font-weight: 700; color: #1F4E5F; }

@media (max-width: 767px) {
    .quick-tips { flex-direction: column; gap: 10px; }
    .info-wrapper.open { max-height: 80vh; overflow-y: auto; }
}

/* 🟢 例外處理: 綠色背景主題 (給 Schedule 頁面用) */
.info-wrapper.theme-green { background: #dcecdb; }
.info-wrapper.theme-green .quick-tips { background: rgba(255,255,255,0.5); }
.controls-bar.theme-green { background: #dcecdb; }

/* 老師與管理員專用標題列 (改用深藍色區分)*/
.header-teacher { 
    background: #1F4E5F; 
    color: white; 
    padding: 8px; 
    text-align: center; 
    font-weight: bold; 
    font-size: 16px; 
    flex: 0 0 auto; 
}