/* 重置和基本樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* 頂部橫幅 */
.banner {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 20px;
}

.banner-content h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.banner-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 20px;
    padding: 0 20px;
}

/* 左側導航 */
.sidebar {
    background: white;
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo h2 {
    color: #e67e22;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.logo span {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.nav-menu {
    list-style: none;
    margin-top: 30px;
}

.nav-menu li {
    margin-bottom: 10px;
}

.nav-item {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background-color: #e67e22;
    color: white;
    transform: translateX(5px);
}

.search-box {
    margin-top: 30px;
    display: flex;
    gap: 5px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 15px;
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background-color: #d35400;
}

/* 主要內容區 */
.main-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.content-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #2c3e50;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 圖片畫廊 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.image-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.category-tag {
    background-color: #e67e22;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.views {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.page-btn {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.page-btn:hover {
    background-color: #2980b9;
}

.page-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.page-info {
    font-weight: 500;
    color: #2c3e50;
}

/* 右側邊欄 */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.widget h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 2px solid #e67e22;
    padding-bottom: 8px;
}

.hot-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.hot-item:hover {
    background-color: #f8f9fa;
}

.hot-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.hot-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.hot-item-info .views {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.search-widget {
    display: flex;
    gap: 5px;
}

.search-widget input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
}

.search-widget button {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.category-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.stat-item .category {
    font-weight: 500;
}

.stat-item .count {
    background-color: #e67e22;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* 模態框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    background: rgba(0,0,0,0.7);
}

.modal img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-info {
    padding: 20px;
}

.modal-info h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.modal-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 動畫 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 200px 1fr 250px;
        gap: 15px;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .right-sidebar {
        order: 3;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .banner-content h1 {
        font-size: 2rem;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .banner {
        padding: 20px 0;
    }
    
    .banner-content h1 {
        font-size: 1.5rem;
    }
    
    .banner-content p {
        font-size: 1rem;
    }
}

