/* 基礎設定 */
body {
    margin: 0;
    font-family: "Microsoft JhengHei", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f4f4;
}

.top-banner {
    background-color: #800000; /* 雄女紅 */
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 下拉選單 */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
}
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}
.dropdown-content a:hover { background-color: #f1f1f1; }
.show { display: block; }

/* 佈局控制 */
.main-layout { flex: 1; }
.module-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 1100px;
    margin: 20px auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Footer */
.main-footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
}
.footer-links a { color: #ccc; text-decoration: none; margin: 0 10px; }
.footer-links a:hover { color: white; }

/* Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
}
.modal-content {
    background: white;
    margin: 10% auto;
    padding: 20px;
    width: 400px;
    border-radius: 10px;
}

/* --- 公告列表專用樣式 --- --- */

/* 1. 斑馬條紋：設定偶數列背景 */
#newsTableBody tr:nth-child(even) {
    background-color: #fcfcfc;
}

/* 2. 滑鼠懸停效果 */
#newsTableBody tr:hover {
    background-color: #f5f5f5;
    transition: background-color 0.2s ease-in-out;
}

/* 3. 公告標題與內容區塊 */
.news-title {
    font-weight: bold;
    color: #800000;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.news-html-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
    color: #333;
    font-size: 0.95em;
    white-space: pre-wrap;
}

/* 4. 公告內含表格的樣式美化 */
.news-html-content table {
    width: 100% !important;
    border-collapse: collapse;
    margin: 10px 0;
    background-color: #fff;
}

.news-html-content table td, 
.news-html-content table th {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.news-html-content table th {
    background-color: #f9f9f9;
}

/* 5. 圖片自適應設定 */
.news-html-content img {
    max-width: 100%;
    height: auto;
}

/* 6. 表頭專用色 */
.news-header-row {
    background-color: #800000;
    color: white;
}

/* 7. 管理員按鈕樣式 */
.btn-edit {
    padding: 5px 10px;
    cursor: pointer;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.btn-admin-add {
    background: #800000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* 容器 */
.my-records-container { padding: 10px; }

/* 頁籤設計 */
.custom-tabs { display: flex; gap: 5px; margin-bottom: 20px; border-bottom: 2px solid #eee; }
.tab-btn {
    padding: 10px 20px; border: none; background: none; cursor: pointer;
    font-size: 16px; color: #666; transition: 0.3s;
}
.tab-btn.active { color: #c0392b; border-bottom: 3px solid #c0392b; font-weight: bold; }

/* 查詢卡片 */
.filter-card {
    background: #f8f9fa; border-radius: 8px; padding: 20px;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); margin-bottom: 20px;
}
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.custom-select, .custom-input { padding: 8px; border: 1px solid #ddd; border-radius: 4px; }
.btn-search {
    background: #c0392b; color: white; border: none; padding: 8px 20px;
    border-radius: 4px; cursor: pointer; margin-left: 10px;
}

/* 統計數據 */
.summary-stats { margin-bottom: 20px; }
.stat-item {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: white; padding: 15px 25px; border-radius: 10px; display: inline-block;
}
.stat-label { font-size: 14px; opacity: 0.9; display: block; }
.stat-value { font-size: 24px; font-weight: bold; }

/* 表格設計 */
.styled-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.styled-table thead tr { background-color: #f2f2f2; text-align: left; }
.styled-table th, .styled-table td { padding: 12px 15px; border-bottom: 1px solid #ddd; }
.styled-table tbody tr:hover { background-color: #f9f9f9; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background-color: #eee;
    border: 1px solid #ddd;
}
.calendar-day {
    background-color: #fff;
    min-height: 60px;
    padding: 5px;
    text-align: center;
}
.calendar-day.header {
    background-color: #f0f0f0;
    font-weight: bold;
    min-height: 30px;
}
.calendar-day.empty {
    background-color: #fafafa;
}