/* 重置樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基礎設定 */
:root {
    --primary-color: #2E8B8B;      /* 深藍綠色 */
    --secondary-color: #40E0D0;    /* 藍綠色 */
    --accent-color: #20B2AA;       /* 淺海綠色 */
    --light-bg: #E0F2F1;          /* 很淡的藍綠背景 */
    --text-primary: #2C3E50;      /* 深灰色文字 */
    --text-secondary: #5D6D7E;    /* 中灰色文字 */
    --white: #FFFFFF;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 8px;
    /* 新增缺失的變數 */
    --background-primary: #F8F9FA;
    --background-secondary: #E9ECEF;
    --success-color: #2ed573;
}

body {
    font-family: 'Microsoft YaHei UI', '微軟正黑體', sans-serif;
    font-size: 18px; /* 增大基礎字型 */
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    min-height: 100vh;
}

/* 頂部導航 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2E9A9A 100%);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 480px;
    margin: 0 auto;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.home-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.home-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.home-btn svg {
    width: 28px;
    height: 28px;
}

.title {
    color: var(--white);
    font-size: 24px; /* 增大標題字型 */
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
    position: relative;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.notification-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.notification-btn svg {
    width: 28px;
    height: 28px;
}

/* 漢堡按鈕 */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
}

.hamburger-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: var(--white);
    transition: all 0.3s;
    border-radius: 2px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* 側邊選單 */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.side-menu.active {
    visibility: visible;
    opacity: 1;
}

.side-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.side-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}

.side-menu.active .side-menu-content {
    transform: translateX(0);
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.side-menu-header h2 {
    color: var(--white);
    font-size: 22px; /* 增大字型 */
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.close-btn, .back-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.close-btn:hover, .back-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.close-btn svg, .back-btn svg {
    width: 24px;
    height: 24px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.menu-list li {
    margin: 0;
}

.menu-item {
    display: block;
    color: var(--white);
    text-decoration: none;
    padding: 18px 20px; /* 增加內距 */
    font-size: 20px; /* 增大字型 */
    font-weight: 500;
    transition: background-color 0.3s;
    border-left: 4px solid transparent;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.menu-item:hover {
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--white);
}

/* 主要內容 */
.main-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
}

/* 公告跑馬燈 */
.announcement-section {
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.announcement-ticker {
    background-color: var(--white);
    padding: 15px 0;
    overflow: hidden;
    position: relative;
}

.announcement-ticker .announcement-content {
    white-space: nowrap;
    animation: scroll 15s linear infinite;
}

.announcement-text {
    color: var(--primary-color);
    font-size: 20px; /* 增大字型 */
    font-weight: 600;
    padding-left: 100%;
}

@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 圖片輪播區 */
.carousel-section {
    margin-bottom: 30px;
}

.carousel-container {
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 30px 20px 20px;
    color: var(--white);
}

.slide-caption p {
    margin: 0;
    font-size: 18px; /* 增大字型 */
    font-weight: 500;
    text-align: center;
}

/* 輪播控制 */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: var(--white);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background-color: #ddd;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active,
.dot:hover {
    background-color: var(--primary-color);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(46, 139, 139, 0.8);
    border: none;
    color: var(--white);
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--primary-color);
}

.carousel-btn.prev {
    left: 15px;
}

.carousel-btn.next {
    right: 15px;
}

/* 快速入口區 */
.quick-links-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: 20px 15px;
    border-radius: var(--border-radius);
    transition: all 0.3s;
    background: var(--light-bg);
    border: 2px solid transparent;
}

.quick-link-item:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.quick-link-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px; /* 增大字型 */
    font-weight: bold;
    margin-bottom: 12px;
    transition: transform 0.3s;
}

.quick-link-item:hover .quick-link-icon {
    background: var(--white);
    color: var(--primary-color);
    transform: scale(1.1);
}

.quick-link-item span {
    font-size: 16px; /* 增大字型 */
    font-weight: 500;
    text-align: center;
}

/* 響應式設計 */
@media (min-width: 481px) and (max-width: 768px) {
    .main-content {
        max-width: 600px;
        padding: 25px;
    }
    
    .nav-container {
        max-width: 600px;
        padding: 18px 25px;
    }
    
    .title {
        font-size: 26px;
    }
    
    .carousel-wrapper {
        height: 320px;
    }
    
    .quick-links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .quick-link-icon {
        width: 70px;
        height: 70px;
        font-size: 26px;
    }
    
    .menu-item {
        font-size: 22px;
        padding: 20px 25px;
    }
}

@media (min-width: 769px) {
    .main-content {
        max-width: 800px;
        padding: 30px;
    }
    
    .nav-container {
        max-width: 800px;
        padding: 20px 30px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .carousel-wrapper {
        height: 400px;
    }
    
    .quick-links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .quick-link-icon {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }
    
    .side-menu-content {
        width: 320px;
    }
    
    .menu-item {
        font-size: 24px;
        padding: 22px 30px;
    }
}

/* 高對比度和可讀性增強 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #1B5E20;
        --secondary-color: #2E7D32;
        --text-primary: #000000;
        --shadow: 0 2px 15px rgba(0,0,0,0.2);
    }
}

/* 無障礙支援 */
@media (prefers-reduced-motion: reduce) {
    .announcement-ticker .announcement-content {
        animation: none;
    }
    
    .carousel-slide {
        transition: none;
    }
    
    * {
        transition: none !important;
    }
}
