/* --- style.css (修正版) --- */

/* --- 基本設定 --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    /* 主色：深藍色/寶石藍 */
    background-color: #1A237E; 
    color: white;
    padding: 20px;
    text-align: center;
}

/* --- 導航列樣式 (大螢幕 - 水平排列) --- */
nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex; /* 使用 Flexbox 讓項目水平排列 */
    justify-content: center; /* 置中 */
}

nav ul li a {
    text-decoration: none;
    color: white;
    padding: 10px 15px;
    display: block;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    /* 修正：將舊的懸停色 #5a0073 替換為亮一點的主色 */
    background-color: #2a35a6; 
    border-radius: 5px;
}

/* 額外添加：當前頁面高亮樣式 (active) */
nav ul li a.active {
    /* 輔色：天空藍，用於突出顯示當前頁面 */
    background-color: #4FC3F7; 
    border-radius: 5px;
    /* 確保字體在淺色背景上可讀 */
    color: #1A237E; 
}


/* --- 主要內容區塊 --- */
main {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto; /* 置中 */
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

section {
    margin-bottom: 40px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

h2 {
    /* 標題顏色使用主色 */
    color: #1A237E; 
    /* 裝飾線使用輔色：天空藍 */
    border-left: 5px solid #4FC3F7; 
    padding-left: 10px;
}

/* --- 頁尾 --- */
footer {
    text-align: center;
    padding: 10px;
    /* 頁尾保持深色，可以維持 #333 或改用主色 #1A237E */
    background-color: #333; 
    color: white;
    font-size: 0.9em;
}

/* ------------------------------------------- */
/* --- 響應式設計 (Media Query) 要求 #5 --- */
/* ------------------------------------------- */

/* 當螢幕寬度小於 768px (例如：平板或手機) */
@media (max-width: 768px) {
    /* ... 保持不變 ... */
    nav ul {
        flex-direction: column; 
        align-items: center; 
    }

    nav ul li {
        width: 100%; 
        text-align: center;
        margin-bottom: 5px;
    }

    main {
        margin: 10px;
        padding: 10px;
    }
}
/* 圖表容器的通用樣式 */
.chart-container {
    max-width: 800px; 
    margin: 20px auto; 
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 圓餅圖容器可以稍微小一點 */
.chart-container-small {
    max-width: 500px; 
    margin: 20px auto;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* --- 商品卡片樣式 (周邊商品頁面) --- */
.product-grid {
    display: grid;
    /* ... 保持不變 ... */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    border: 1px solid #ccc;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.product-card button {
    /* 按鈕背景使用主色 */
    background-color: #1A237E; 
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.product-card button:hover {
    /* 修正：將舊的懸停色 #e63900 替換為深一點的主色 */
    background-color: #0d1252;
}

/* 響應式設計補充：在小螢幕上，商品格線改為 1 列 */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}