/* styles.css (通用样式) */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    font-size: 16px;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: #2c7a3e;
}

/* 按钮和输入框更适合触摸 */
button, input, textarea, select {
    font-size: 1rem;
    padding: 0.8rem 1rem;
    min-height: 44px; /* 更好的触摸体验 */
}

/* 横幅图片 (被 index.html 和 updates.html 使用) */
.banner {
    width: 100%;
    height: 400px;
    background-image: url('/static/img/potato.png');
    background-size: cover;
    background-position: center 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.banner-content {
    text-align: center;
    color: #333;
    padding: 0 2rem;
    max-width: 800px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 2rem;
}
.banner-content h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #333;
}
.banner-content p {
    font-size: 1.2rem;
    color: #333;
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c7a3e;
    display: flex;
    align-items: center;
}

.site-logo {
    height: 30px;
    margin-right: 10px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #1e5631;
}

.nav-links a.active {
    color: #1e5631;
    font-weight: bold;
    border-bottom: 2px solid #1e5631;
    padding-bottom: 5px;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropbtn {
    font-weight: 500;
    transition: color 0.3s;
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}
.dropbtn::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #2c7a3e;
    transition: all 0.3s ease;
}
.dropbtn:hover::after {
    border-top-color: #1e5631;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: auto;
    width: max-content;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 101;
    border-radius: 4px;
    overflow: hidden;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}
.dropdown-content a {
    color: #2c7a3e;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}
.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #1e5631;
}
.dropdown:hover .dropdown-content {
    display: block;
}
.dropdown:hover .dropbtn::after {
    transform: translateY(-50%) rotate(180deg);
}

/* 导航栏汉堡菜单按钮 */
.menu-toggle {
    display: none;
    width: 30px;
    height: 30px;
    position: relative;
    cursor: pointer;
}
.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #2c7a3e;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}
.menu-toggle span:nth-child(1) { top: 8px; }
.menu-toggle span:nth-child(2) { top: 14px; }
.menu-toggle span:nth-child(3) { top: 20px; }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg); top: 14px; }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg); top: 14px; }


/* 主要内容容器 */
.container {
    max-width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* 页脚 */
footer {
    background-color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 3rem;
    border-top: 1px solid #ddd;
}

.footer-logos {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-logo {
    height: 60px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

.copyright {
    color: #666;
    font-size: 0.9rem;
}


/* 响应式设计 - 通用移动端适配 */
@media (max-width: 768px) {
    /* 横幅调整 */
    .banner {
        height: 250px;
    }
    .banner-content {
        padding: 1rem;
        width: 90%;
    }
    .banner-content h1 {
        font-size: 1.5rem;
    }
    .banner-content p {
        font-size: 0.9rem;
    }
    
    /* 导航栏调整 */
    .navbar {
        padding: 0.8rem 1rem;
    }
    .menu-toggle {
        display: block;
    }
    .nav-links {
        position: fixed;
        top: 60px; /* 假设导航栏高度为60px */
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 99;
    }
    .nav-links.active {
        transform: translateY(0);
    }
    .nav-links li {
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        display: block;
        padding: 0.5rem 0;
    }
    .dropdown {
        width: 100%;
        text-align: center;
    }
    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        display: none;
        transform: none;
        left: auto;
        min-width: unset;
    }
    .dropdown.active .dropdown-content {
        display: block;
    }
    .dropdown:hover .dropbtn::after {
        transform: translateY(-50%) rotate(0deg);
    }
    
    /* 容器调整 */
    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    /* 页脚调整 */
    footer {
        padding: 1.5rem 1rem;
        margin-top: 1.5rem;
    }
    .footer-logos {
        flex-direction: column;
        gap: 1rem;
    }
}

