/* 基礎樣式 */
body { font-family: "Microsoft JhengHei", Arial, sans-serif; background-color: #f0f2f5; margin: 0; }

/* 導覽列核心排版 */
.navbar {
    display: flex;
    justify-content: space-between; /* 讓 left 和 right 撐到最兩端 */
    align-items: center;
    padding: 0 30px;
    background: #007bff;
    color: white;
    height: 65px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 左側標題區 */
.nav-left { display: flex; align-items: center; }
.logo-link { text-decoration: none; color: white; }
.logo { font-size: 1.4rem; font-weight: bold; }
.logo small { font-size: 0.9rem; font-weight: normal; opacity: 0.8; margin-left: 5px; }

/* 右側選單區 */
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-link { color: white; text-decoration: none; font-weight: bold; }
.user-info { font-size: 0.9rem; color: #eefbff; }

/* 下拉選單樣式 */
.dropdown { position: relative; display: inline-block; }
.dropbtn { background-color: #0056b3; color: white; padding: 8px 16px; border: none; cursor: pointer; border-radius: 4px; }
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a { color: #333 !important; padding: 12px 16px; text-decoration: none; display: block; border-bottom: 1px solid #eee; }
.dropdown-content a:hover { background-color: #f1f1f1; }

/* 按鈕美化 */
.btn-nav-login { background: #28a745; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; }
.btn-nav-reg { background: #17a2b8; color: white; text-decoration: none; padding: 8px 15px; border-radius: 4px; margin-left: 5px; }
.btn-submit { width: 100%; padding: 12px; background: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; }
.logout-btn { background: #dc3545; color: white; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 0.85rem; }

/* 內容容器 */
.container { width: 95%; max-width: 1100px; margin: 30px auto; padding: 25px; background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.news-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.news-table th { background: #007bff; color: white; padding: 12px; text-align: left; }
.news-table td { border: 1px solid #eee; padding: 12px; }
.hidden { display: none !important; }

.reg-container { max-width: 600px; margin: 40px auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.form-row { display: flex; gap: 20px; margin-bottom: 15px; }
.form-group { flex: 1; display: flex; flex-direction: column; }
.form-group label { margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group select { padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
.required::after { content: " *"; color: red; }

/* --- index.php 整合樣式 --- */
:root { 
    --primary-color: #800000; 
    --dark-bg: #333; 
    --light-bg: #f4f4f4; 
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: "Microsoft JhengHei", sans-serif; 
}

body { 
    background: var(--light-bg); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

/* 頂部橫幅 */
.top-banner { 
    width: 100%; 
    background: var(--primary-color); 
    color: white; 
    padding: 15px 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
}

.user-info { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

/* 主佈局 */
.main-layout { 
    display: flex; 
    flex: 1; 
}

/* 側邊欄 */
#sidebar { 
    width: 220px; 
    background: var(--dark-bg); 
    color: white; 
    min-height: calc(100vh - 60px); 
}

.nav-item { 
    padding: 15px 25px; 
    cursor: pointer; 
    border-bottom: 1px solid #444; 
    transition: 0.3s; 
}

.nav-item:hover, .nav-item.active { 
    background: #555; 
    color: #ffeb3b; 
}

/* 內容區 */
#content { 
    flex: 1; 
    padding: 30px; 
    overflow-y: auto; 
}

.module-card { 
    background: white; 
    padding: 25px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
}

/* 彈窗樣式 */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.6); 
}

.modal-content { 
    background: white; 
    margin: 10% auto; 
    padding: 30px; 
    width: 400px; 
    border-radius: 8px; 
}

/* 表單通用元件 */
input[type="text"], 
input[type="password"], 
input[type="email"], 
select { 
    width: 100%; 
    padding: 10px; 
    margin: 10px 0; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
}

.btn-main { 
    background: var(--primary-color); 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    cursor: pointer; 
    border-radius: 4px; 
    width: 100%; 
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-main:hover {
    background: #a00000;
}

/* Google 登入按鈕 */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #444;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 15px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-google:hover {
    background: #f8f8f8;
}

.btn-google img {
    width: 18px;
    margin-right: 10px;
}

/* 分隔線 */
.or-divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
    color: #888;
    font-size: 0.9em;
}
.or-divider::before, .or-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}
.or-divider::before { left: 0; }
.or-divider::after { right: 0; }

/* 下拉選單基礎樣式 */
.dropdown { position: relative; display: inline-block; }

.dropdown-content {
    display: none; /* 預設隱藏 */
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    border-radius: 4px;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #eee;
}

.dropdown-content a:hover { background-color: #f1f1f1; }

/* 顯示選單的 Class */
.show { display: block !important; }

/* 下拉選單補強：確保 JS 切換時能正確顯示 */
.dropdown-content.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

/* 讓 Modal 在 JS 控制下正常顯示/隱藏 */
/* Modal 基礎背景 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
}

/* 補填資料的輸入框樣式 */
.form-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}