* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft JhengHei", "PingFang TC", sans-serif;
}
body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* ========== 顏色變數 ========== */
:root {
    --cyan-light: #e0f7fa;
    --cyan-deep: #0891b2;
    --yellow-light: #fff9c4;
    --yellow-deep: #d97706;
    --red-light: #ffebee;
    --red-deep: #dc2626;
    --purple-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ========== 首頁卡片風格（參考圖樣式） ========== */
.page-home-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-card {
    background: white;
    border-radius: 20px;
    padding: 50px 60px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 420px;
    width: 100%;
}
.home-icon {
    font-size: 64px;
    margin-bottom: 20px;
}
.home-title {
    font-size: 28px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 10px;
}
.home-subtitle {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 36px;
}
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--purple-grad);
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 12px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.4);
}
.btn-secondary {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    color: white;
    background: #374151;
    cursor: pointer;
    transition: 0.2s;
}
.btn-secondary:hover { background: #1f2937; }

/* ========== 一般頁面容器 ========== */
.page-normal {
    padding-top: 40px;
    padding-bottom: 40px;
}
.form-card {
    max-width: 520px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.admin-card {
    max-width: 1200px;
    margin: 0 auto;
}
.back-btn {
    color: white;
    font-size: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    display: inline-block;
    transition: 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.3); }

.page-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 24px;
    text-align: center;
}

/* ========== 表單 ========== */
.form-box { display: flex; flex-direction: column; gap: 18px; }
.form-item { display: flex; flex-direction: column; gap: 8px; }
.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

/* 帶圖示的輸入框 */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    font-size: 18px;
    color: #9ca3af;
    pointer-events: none;
}
.input-with-icon .form-input {
    padding-left: 44px;
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.form-input.short { width: 160px; }

.meal-area {
    border: 1.5px solid #e5e7eb;
    padding: 16px;
    border-radius: 10px;
    background-color: #f9fafb;
}
.checkbox-group {
    display: flex;
    gap: 32px;
    margin-top: 10px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
}

.two-btn-group { display: flex; gap: 12px; margin-top: 8px; }
.btn {
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-green { background: #10b981; color: white; }
.btn-green:hover { background: #059669; }
.btn-gray { background: #9ca3af; color: white; }
.btn-gray:hover { background: #6b7280; }
.btn-dark { background: #374151; color: white; }
.btn-dark:hover { background: #1f2937; }
.btn-blue { background: #3b82f6; color: white; }
.btn-blue:hover { background: #2563eb; }
.btn-red { background: #ef4444; color: white; }
.btn-red:hover { background: #dc2626; }
.btn-orange { background: #f97316; color: white; }
.btn-orange:hover { background: #ea580c; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

.success-tip {
    color: #10b981;
    font-size: 15px;
    text-align: center;
    margin-top: 16px;
    font-weight: 500;
}
.error-tip {
    color: #ef4444;
    font-size: 14px;
    text-align: center;
}

/* ========== 後台 ========== */
.admin-header {
    background: white;
    padding: 24px 28px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.admin-header h2 {
    font-size: 22px;
    font-weight: bold;
    color: #1f2937;
}
.header-btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

.filter-box {
    background: white;
    padding: 18px 24px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.clear-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ========== 統計卡片 ========== */
.stat-overview {
    background: white;
    padding: 24px 28px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.stat-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1f2937;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}
.stat-card {
    background: #f9fafb;
    padding: 14px 10px;
    border-radius: 10px;
    text-align: center;
}
.stat-num {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 4px;
}
.stat-desc { font-size: 13px; color: #6b7280; }
.stat-desc-sm { font-size: 11px; color: #6b7280; }

.three-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* 初一：淺青色 */
.session-cyan {
    background: var(--cyan-light);
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.session-cyan .stat-title { color: var(--cyan-deep); }
.session-cyan .stat-card { background: white; }

/* 十五：淺黃色 */
.session-yellow {
    background: var(--yellow-light);
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.session-yellow .stat-title { color: var(--yellow-deep); }
.session-yellow .stat-card { background: white; }

/* 半天班：淺紅色 */
.session-red {
    background: var(--red-light);
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.session-red .stat-title { color: var(--red-deep); }
.session-red .stat-card { background: white; }

.stat-grid-small {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.stat-grid-small .stat-num { font-size: 20px; }

.meal-subtitle {
    margin-top: 14px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}
.stat-grid-two {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.stat-grid-two .stat-num { font-size: 20px; }

/* ========== 名單列表 ========== */
.list-box {
    background: white;
    padding: 24px 28px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.list-item {
    border: 1.5px solid #f3f4f6;
    padding: 16px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    transition: 0.2s;
}
.list-item:hover {
    border-color: #e5e7eb;
    background: #f9fafb;
}
.list-info h5 {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #1f2937;
}
.list-info p {
    color: #6b7280;
    font-size: 13px;
    margin: 2px 0;
}
.empty-tip {
    text-align: center;
    color: #9ca3af;
    padding: 30px;
    font-size: 14px;
}

/* ========== PDF 導出隱藏區 ========== */
#pdfExportBox {
    background: white;
    padding: 30px;
    color: black;
}
#pdfExportBox h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 10px;
}
#pdfExportBox .pdf-date {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}
#pdfExportBox h3 {
    font-size: 18px;
    margin: 20px 0 10px;
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
}
#pdfExportBox .stat-row {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
#pdfExportBox .stat-item {
    background: #f5f5f5;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
}
#pdfExportBox .stat-item strong { font-size: 16px; }
#pdfExportBox .list-entry {
    border: 1px solid #ccc;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}