﻿/* 全域樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', '微軟正黑體', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #DFF0F7 ;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 頁首樣式 */
.header {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header .subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* Excel 導入區域樣式 */
.import-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.import-box {
    text-align: center;
}

.import-box h2 {
    color: #333;
    margin-bottom: 10px;
}

.import-desc {
    color: #666;
    margin-bottom: 20px;
}

.import-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.import-controls input[type="file"] {
    display: none;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

.template-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.4);
}

.import-status {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px auto;
    max-width: 500px;
}

.import-status.success {
    background: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.import-status.error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

.import-status.info {
    background: #bee3f8;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

.import-hint {
    color: #888;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* 數據管理區域樣式 */
.data-management-section {
    margin-bottom: 30px;
}

.data-management-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid #e8ebff;
}

.data-management-box h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3rem;
}

.storage-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.storage-status {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.storage-icon {
    font-size: 2rem;
}

.storage-details {
    flex: 1;
}

#storageStatus {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.storage-meta {
    font-size: 0.9rem;
    color: #666;
}

.storage-actions {
    display: flex;
    gap: 10px;
}

.refresh-btn, .clear-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 101, 101, 0.4);
}

.storage-hint {
    margin-top: 15px;
    color: #666;
    font-size: 0.85rem;
    text-align: center;
    background: #f0f4ff;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .storage-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .storage-status {
        justify-content: center;
        text-align: center;
    }
    
    .storage-actions {
        justify-content: center;
    }
}

/* 查詢區域樣式 */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.search-box label {
    display: block;
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: bold;
}

.search-input-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.search-input-group input {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    padding: 15px 25px;
    font-size: 1.2rem;
    border: 3px solid #667eea;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input-group input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.search-input-group button {
    padding: 15px 35px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-group button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.search-input-group button:active {
    transform: translateY(0);
}

.hint {
    margin-top: 20px;
    color: #888;
    font-size: 0.9rem;
}

/* 錯誤訊息樣式 */
.error-message {
    background: #fff5f5;
    border: 2px solid #fc8181;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    color: #c53030;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* 學生資訊卡片樣式 */
.student-info {
    margin-bottom: 30px;
}

.info-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.info-card h2 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    background: #f8f9ff;
    padding: 15px 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.info-item .label {
    color: #666;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 5px;
}

.info-item .value {
    color: #333;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 圖表區域樣式 */
.charts-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.charts-section h2 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-box {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* 雷達圖 Canvas 樣式 */
#fitnessRadarChart {
    width: 100% !important;
    height: 400px !important;
    max-width: 500px;
    margin: 0 auto;
    display: block;
}

.chart-box h3 {
    color: #555;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* BMI 圖例樣式 */
.bmi-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.bmi-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
}

.bmi-color {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: inline-block;
}

.bmi-color.underweight {
    background: rgba(49, 130, 206, 0.8);
    border: 2px solid rgba(49, 130, 206, 1);
}

.bmi-color.normal {
    background: rgba(72, 187, 120, 0.8);
    border: 2px solid rgba(72, 187, 120, 1);
}

.bmi-color.overweight {
    background: rgba(237, 137, 54, 0.8);
    border: 2px solid rgba(237, 137, 54, 1);
}

.bmi-color.obese {
    background: rgba(229, 62, 62, 0.8);
    border: 2px solid rgba(229, 62, 62, 1);
}

.bmi-note {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f4ff 0%, #fff5f0 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.bmi-note p {
    margin: 5px 0;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
}

/* 體能測試圖例樣式 */
.fitness-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.fitness-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
}

.fitness-color {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: inline-block;
}

.fitness-color.handgrip {
    background: rgba(255, 99, 132, 0.8);
    border: 2px solid rgba(255, 99, 132, 1);
}

.fitness-color.sitreach {
    background: rgba(54, 162, 235, 0.8);
    border: 2px solid rgba(54, 162, 235, 1);
}

.fitness-color.jump {
    background: rgba(255, 205, 86, 0.8);
    border: 2px solid rgba(255, 205, 86, 1);
}

.fitness-color.shuttle15 {
    background: rgba(75, 192, 192, 0.8);
    border: 2px solid rgba(75, 192, 192, 1);
}

.fitness-color.shuttle20 {
    background: rgba(153, 102, 255, 0.8);
    border: 2px solid rgba(153, 102, 255, 1);
}

.fitness-note {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f8ff 0%, #fff0f8 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.fitness-note p {
    margin: 5px 0;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
}

.bmi-note p:first-child {
    margin-top: 0;
}

.bmi-note p:last-child {
    margin-bottom: 0;
}

/* 體能測試評級樣式 */
.grade-excellent {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
}

.grade-good {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.3);
}

.grade-average {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(237, 137, 54, 0.3);
}

.grade-poor {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

/* 表格區域樣式 */
.table-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.table-section h2 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

thead th {
    color: white;
    padding: 18px 15px;
    text-align: center;
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:nth-child(even) {
    background: #f8f9ff;
}

tbody tr:hover {
    background: #e8ebff;
    transform: scale(1.01);
}

tbody td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

tbody td:last-child {
    text-align: left;
    min-width: 800px;
    max-width: 400px;
    white-space: nowrap;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-left: 3px solid #e2e8f0;
    font-size: 0.9rem;
    color: #4a5568;
    font-style: italic;
}

/* BMI 狀態顏色 */
.bmi-normal {
    color: #38a169;
    font-weight: bold;
}

.bmi-overweight {
    color: #dd6b20;
    font-weight: bold;
}

.bmi-underweight {
    color: #3182ce;
    font-weight: bold;
}

.bmi-obese {
    color: #e53e3e;
    font-weight: bold;
}


/* 頁尾樣式 */
.footer {
    text-align: center;
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.footer p {
    color: #666;
    font-size: 0.95rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .search-section {
        padding: 25px;
    }

    .search-input-group {
        flex-direction: column;
        align-items: center;
    }

    .search-input-group input {
        width: 100%;
        max-width: none;
    }

    .search-input-group button {
        width: 100%;
        justify-content: center;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-box {
        min-width: auto;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    thead th,
    tbody td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header .subtitle {
        font-size: 0.9rem;
    }

    .search-box label {
        font-size: 1.1rem;
    }

    .search-input-group input,
    .search-input-group button {
        font-size: 1rem;
        padding: 12px 20px;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-info,
.charts-section,
.table-section {
    animation: fadeIn 0.5s ease-out;
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== 管理員介面Excel上傳區域美化 ==================== */
.import-section {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.1);
}

.import-section h3 {
    color: #ed8936;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.import-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.import-box {
    flex: 1;
    min-width: 300px;
}

.import-box label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem;
}

.import-box input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #ed8936;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.import-box input[type="file"]:hover {
    border-color: #dd6b20;
    background: #fff5f5;
}

.import-box input[type="file"]::-webkit-file-upload-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 15px;
    transition: all 0.3s ease;
}

.import-box input[type="file"]::-webkit-file-upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.template-btn,
.clear-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.template-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

/* ==================== 學生介面美化樣式 ==================== */

/* 查詢區域美化 */
.search-section {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.search-box label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.search-box input[type="text"] {
    padding: 14px 20px;
    font-size: 1.05rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    width: 250px;
    transition: all 0.3s ease;
    background: white;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #48bb78;
    box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.1);
    transform: scale(1.02);
}

.search-box button {
    padding: 14px 30px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.search-box button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

.search-box button:active {
    transform: translateY(-1px);
}

.hint {
    text-align: center;
    color: #718096;
    font-size: 0.95rem;
    padding: 12px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #48bb78;
}

/* 學生資訊卡片美化 */
.student-info {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.6s ease;
    border: 2px solid #e2e8f0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-info h2 {
    color: #2d3748;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #48bb78;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #48bb78;
}

.info-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.info-item .label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    display: block;
    font-size: 1.2rem;
    color: #2d3748;
    font-weight: 700;
}

/* 圖表區域美化 */
.charts-section {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.7s ease;
}

.charts-section h2 {
    color: #2d3748;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #48bb78;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.chart-container h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

/* 表格區域美化 */
.table-section {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.8s ease;
}

.table-section h2 {
    color: #2d3748;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #48bb78;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

thead th {
    color: white;
    padding: 18px 15px;
    text-align: center;
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:nth-child(even) {
    background: #f7fafc;
}

tbody tr:hover {
    background: #e6fffa;
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.2);
}

tbody td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
    color: #2d3748;
}

tbody td:last-child {
    text-align: left;
    max-width: 200px;
}

/* 響應式設計優化 */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input[type="text"] {
        width: 100%;
    }
    
    .search-box button {
        width: 100%;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        min-width: 100%;
    }
}

/* 隱藏元素 */
.hidden {
    display: none;
}

/* ==================== 學校校徽樣式 ==================== */
.student-header {
    position: relative;
    text-align: center;
    padding: 30px 20px;
    background-color: #2E9DD0 ;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.student-header h1 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.student-header .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.school-logo {
    position: absolute;
    top: 15px;
    left: 20px;
    z-index: 10;
}

.school-logo img {
    width: 250px ;
    height: 100px;
    object-fit: contain;
    border-radius: 10px;
    background: white;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.school-logo img:hover {
    transform: scale(1.1);
}

.logo-placeholder {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo-placeholder span {
    font-size: 2rem;
}

.logo-placeholder small {
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
}

/* 響應式校徽調整 */
@media (max-width: 768px) {
    .school-logo {
        position: static;
        margin-bottom: 15px;
    }
    
    .school-logo img,
    .logo-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .logo-placeholder span {
        font-size: 1.5rem;
    }
}

/* 錯誤訊息美化 */
.error-message {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    padding: 18px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 5px solid #e53e3e;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.2);
    animation: shake 0.5s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message span:first-child {
    font-size: 1.5rem;
}

.template-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

.import-status {
    margin-top: 15px;
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 600;
    display: none;
    animation: fadeIn 0.3s ease;
}

.import-status.success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
    display: block;
}

.import-status.error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
    display: block;
}

.import-status.info {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #4299e1;
    display: block;
}

.storage-info {
    margin-top: 15px;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .import-controls {
        flex-direction: column;
    }
    
    .import-box {
        width: 100%;
    }
    
    .template-btn,
    .clear-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== 首頁導航樣式 ==================== */
.portal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.portal-header {
    text-align: center;
    margin-bottom: 50px;
}

.portal-header h1 {
    font-size: 3rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.portal-header p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.portal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.portal-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.portal-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.portal-card .icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.portal-card h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.portal-card p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

.portal-card.student-card {
    border-top: 5px solid #48bb78;
}

.portal-card.student-card:hover {
    border-top-color: #38a169;
}

.portal-card.admin-card {
    border-top: 5px solid #ed8936;
}

.portal-card.admin-card:hover {
    border-top-color: #dd6b20;
}

.portal-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}