:root {
    --primary-color: #3C2A1E;
    --secondary-color: #8B4513;
    --accent-color: #CD853F;
    --light-color: #F5F5DC;
    --text-color: #333;
    --gray-light: #f5f5f5;
    --border-color: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft JhengHei", "Heiti TC", "LiHei Pro", sans-serif;
}

body {
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f9f9f9;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: white;
    color: var(--text-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo i {
    font-size: 2rem;
    color: var(--light-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 3px;
}

nav a:hover {
    background-color: var(--light-color);
    color: var(--secondary-color);
}

/* Banner Slider - 最终响应式优化版本 */
.banner {
    position: relative;
    height: 50vh; /* 使用视口高度单位 */
    max-height: 400px;
    min-height: 200px;
    overflow: hidden;
    margin-bottom: 2rem;
    width: 100%;
    background-color: #f5f5f5;
}

.slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
    width: 100%;
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(1.5rem, 4vw, 2.5rem); /* 响应式字体大小 */
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: scroll;
}

.slide-1 {
    background-image: url('images/25-dao26-banner.jpg');
}

.slide-2 {
    background-image: url('images/tea ceremony banner.jpg.jpg');
}

.slide-3 {
    background-image: url('images/tea ceremony briefing banner.jpg');
}

/* 移动设备横幅优化 - 使用现代CSS策略 */
@media (max-width: 768px) {
    .banner {
        height: 40vh; /* 使用视口高度 */
        max-height: 300px;
        min-height: 200px;
    }
    
    .slide {
        background-size: contain;
        background-color: #f8f9fa;
        background-position: center center;
        font-size: clamp(1.2rem, 3vw, 2rem);
    }
}

@media (max-width: 576px) {
    .banner {
        height: 35vh;
        max-height: 280px;
        min-height: 180px;
    }
    
    .slide {
        background-size: contain;
        background-position: center center;
        font-size: clamp(1.1rem, 2.8vw, 1.8rem);
    }
}

@media (max-width: 480px) {
    .banner {
        height: 30vh;
        max-height: 240px;
        min-height: 160px;
    }
    
    .slide {
        background-size: contain;
        background-position: center center;
        font-size: clamp(1rem, 2.5vw, 1.6rem);
    }
}

@media (max-width: 375px) {
    .banner {
        height: 25vh;
        max-height: 200px;
        min-height: 140px;
    }
    
    .slide {
        background-size: contain;
        background-position: center center;
        font-size: clamp(0.9rem, 2.2vw, 1.4rem);
    }
}

/* 针对横幅图片的智能适应策略 */
.banner-optimized .slide {
    background-size: contain !important;
    background-position: center center !important;
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-width: 768px) {
    .banner {
        height: 200px;
    }
    
    .slide {
        background-size: contain;
        background-position: center center;
    }
}

/* 超小屏幕特殊优化 */
@media (max-width: 320px) {
    .banner {
        height: 180px;
        min-height: 160px;
    }
    
    .slide {
        background-size: contain;
        font-size: 1.3rem;
        background-position: center center;
    }
}

/* 确保横幅图片在各种设备上都能完整显示 */
.banner {
    position: relative;
    overflow: hidden;
}

.slide {
    /* 添加图片加载失败时的备用方案 */
    background-color: #f5f5f5;
}

/* 针对不同图片比例的智能适配 */
@media (max-width: 768px) {
    .slide {
        /* 默认使用contain确保图片完整显示 */
        background-size: contain;
    }
    
    /* 针对宽屏图片的特殊处理 */
    @media (min-aspect-ratio: 16/9) {
        .slide {
            background-size: cover;
            background-position: center top;
        }
    }
}

.banner-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-dot.active {
    background-color: white;
    transform: scale(1.2);
}

/* Quick Navigation */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.quick-nav-item {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-nav-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.quick-nav-item i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.quick-nav-item h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Section Styles */
.section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 600;
    display: inline-block;
    background-color: white;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background-color: var(--accent-color);
    z-index: 1;
}

/* Announcements */
.announcements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.announcement-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.announcement-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-color);
}

.date {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.announcement-card .btn {
    display: block;
    text-align: right;
    margin-left: auto;
    margin-top: 1rem;
    width: fit-content;
    padding: 0.4rem 0.8rem;
}

/* Courses */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.course-image {
    height: 180px;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 1.5rem;
    background-size: cover;
    background-position: center;
    position: relative;
}

.course-image i {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}







.course-content {
    padding: 1.5rem;
}

.course-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.course-tags {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--light-color);
    color: var(--secondary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.btn {
    display: inline-block;
    background: linear-gradient(to right, var(--secondary-color), var(--accent-color));
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Search and Filter */
.search-box {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.filter-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
}

/* FAQ */
.faq-container {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.faq-categories {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.faq-category {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.faq-category.active {
    border-bottom-color: var(--secondary-color);
    color: var(--secondary-color);
    font-weight: 600;
}

.faq-items {
    padding: 1.5rem;
}

.faq-item {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0;
}

.faq-question h3 {
    font-weight: 500;
    color: var(--primary-color);
}

.faq-answer {
    padding: 1rem;
    background-color: var(--gray-light);
    border-radius: 4px;
    margin-top: 0.5rem;
    display: none;
}

.faq-answer.active {
    display: block;
}

/* Regulations */
.regulations-list, .forms-list {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.regulation-item, .form-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.regulation-item:last-child, .form-item:last-child {
    border-bottom: none;
}

.regulation-info, .form-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.regulation-icon, .form-icon {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.contact-item i {
    font-size: 1.2rem;
    color: var(--light-color);
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 992px) {
    .quick-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .banner {
        height: 300px;
    }
    
    .slide {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    nav ul {
        gap: 1rem;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .banner {
        height: 280px;
    }
    
    .slide {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        gap: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .quick-nav {
        grid-template-columns: 1fr;
    }
    
    .banner {
        height: 250px;
        min-height: 200px;
    }
    
    .slide {
        font-size: 1.5rem;
        background-size: contain;
        background-position: center center;
        background-color: #f8f9fa;
    }
    
    .footer-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .banner {
        height: 220px;
        min-height: 180px;
    }
    
    .slide {
        font-size: 1.3rem;
        background-size: contain;
        background-position: center center;
        background-color: #f8f9fa;
    }
    
    .banner-controls {
        bottom: 10px;
    }
    
    .control-dot {
        width: 10px;
        height: 10px;
    }
}

/* 针对超小屏幕的横幅优化 */
@media (max-width: 375px) {
    .banner {
        height: 200px;
        min-height: 160px;
    }
    
    .slide {
        font-size: 1.2rem;
        background-size: contain;
        background-position: center center;
        background-color: #f8f9fa;
    }
}

/* 横幅图片响应式优化 - 确保图片在不同设备上都能完整显示 */
@media (orientation: portrait) and (max-width: 768px) {
    .banner {
        height: 280px;
    }
    
    .slide {
        background-size: contain;
        background-position: center center;
        background-color: #f8f9fa;
    }
}

@media (orientation: landscape) and (max-width: 768px) {
    .banner {
        height: 200px;
    }
    
    .slide {
        background-size: cover;
        background-position: center center;
    }
}

/* 针对横幅图片的特殊优化 - 移动设备优先策略 */
@media (max-width: 768px) {
    .banner {
        position: relative;
        height: auto;
        min-height: 200px;
        aspect-ratio: 16/9;
    }
    
    .slides {
        height: 100%;
    }
    
    .slide {
        /* 在移动设备上优先使用contain确保图片完整显示 */
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center center;
        background-color: #f8f9fa;
    }
    
    /* 针对不同屏幕尺寸的优化 */
    @media (max-width: 480px) {
        .banner {
            aspect-ratio: 4/3;
            min-height: 180px;
        }
        
        .slide {
            background-size: contain;
        }
    }
    
    @media (max-width: 375px) {
        .banner {
            aspect-ratio: 1/1;
            min-height: 160px;
        }
        
        .slide {
            background-size: contain;
        }
    }
}

/* 针对横幅图片的智能缩放策略 */
@media (max-width: 768px) {
    .slide {
        /* 使用object-fit策略的替代方案 */
        background-size: auto 100%;
        background-position: center center;
    }
    
    /* 针对宽屏手机的优化 */
    @media (min-aspect-ratio: 9/16) {
        .slide {
            background-size: 100% auto;
        }
    }
}

/* 确保横幅容器在各种设备上都有合适的尺寸 */
.banner {
    width: 100%;
    overflow: hidden;
}

.slide {
    /* 添加图片加载失败时的备用方案 */
    background-color: #f5f5f5;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.back-to-top.show {
    display: flex;
}