
/* common.css - 全局样式 */

/* 1. CSS Reset / Normalize */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* 平滑滚动 */
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8; /* 治愈系背景色 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: #6a8e7a; /* 治愈系链接色 */
    transition: color 0.3s ease;
}

a:hover {
    color: #4a6e5a;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 2. 容器和布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 3. 按钮样式 */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap; /* 防止按钮文字换行 */
}

.btn-primary {
    background-color: #6a8e7a; /* 主色调 */
    color: #fff;
    border: 2px solid #6a8e7a;
}

.btn-primary:hover {
    background-color: #5a7e6a;
    border-color: #5a7e6a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: transparent;
    color: #6a8e7a;
    border: 2px solid #6a8e7a;
}

.btn-secondary:hover {
    background-color: #6a8e7a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-text {
    color: #6a8e7a;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
}

.btn-text:hover {
    color: #4a6e5a;
}

/* 4. 标题样式 */
h1, h2, h3, h4 {
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

h1 { font-size: 2.8em; }
h2 { font-size: 2.2em; }
h3 { font-size: 1.8em; }
h4 { font-size: 1.4em; }

p {
    margin-bottom: 1em;
}

/* 5. Header */
.main-header {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header .logo {
    display: flex;
    align-items: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #6a8e7a;
}

.main-header .logo img {
    height: 40px; /* Adjust logo size */
    margin-right: 10px;
}

.main-nav .nav-list {
    display: flex;
    gap: 30px;
}

.main-nav .nav-list a {
    color: #555;
    font-weight: 600;
    font-size: 1.1em;
    padding: 5px 0;
    position: relative;
}

.main-nav .nav-list a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #6a8e7a;
    transition: width 0.3s ease;
}

.main-nav .nav-list a:hover::after,
.main-nav .nav-list a.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none; /* 默认隐藏，在移动端显示 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* 移动菜单打开时的动画 */
.mobile-menu-toggle.open span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.open span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 6. Footer */
.main-footer {
    background-color: #333;
    color: #eee;
    padding: 50px 0;
    font-size: 0.9em;
}

.main-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.main-footer .footer-col {
    flex: 1;
    min-width: 250px;
}

.main-footer .footer-logo {
    height: 50px;
    margin-bottom: 15px;
}

.main-footer h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.main-footer ul li {
    margin-bottom: 10px;
}

.main-footer ul li a {
    color: #ccc;
}

.main-footer ul li a:hover {
    color: #fff;
}

.main-footer .social-links {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.main-footer .social-links img {
    height: 24px;
    width: 24px;
    filter: invert(100%) brightness(80%); /* 让图标变浅色 */
    transition: filter 0.3s ease;
}

.main-footer .social-links img:hover {
    filter: invert(100%) brightness(100%); /* 鼠标悬停时变亮 */
}

/* 7. 通用页面英雄区 */
.page-hero {
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* 半透明遮罩 */
    z-index: 1;
}

.page-hero .container {
    position: relative;
    z-index: 2;
}

.page-hero h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.page-hero p {
    font-size: 1.3em;
    max-width: 800px;
    margin: 0 auto;
    color: #eee;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 { font-size: 2.2em; }
    h2 { font-size: 1.8em; }
    h3 { font-size: 1.5em; }
    h4 { font-size: 1.2em; }

    .main-nav .nav-list {
        display: none; /* 默认隐藏导航列表 */
        flex-direction: column;
        position: absolute;
        top: 70px; /* 调整为header高度 */
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        text-align: center;
        transition: all 0.3s ease-in-out;
        transform: translateY(-100%); /* 初始状态隐藏在上方 */
        opacity: 0;
    }

    .main-nav .nav-list.open {
        display: flex;
        transform: translateY(0);
        opacity: 1;
    }

    .main-nav .nav-list li {
        margin: 10px 0;
    }

    .main-nav .nav-list a {
        font-size: 1.2em;
        color: #333;
        padding: 10px 0;
        display: block;
    }

    .main-nav .nav-list a::after {
        background-color: #6a8e7a;
        height: 1px;
        bottom: -5px;
    }

    .mobile-menu-toggle {
        display: block; /* 在移动端显示汉堡菜单 */
    }

    .main-footer .container {
        flex-direction: column;
        text-align: center;
    }

    .main-footer .footer-col {
        min-width: unset;
        width: 100%;
        margin-bottom: 20px;
    }

    .main-footer .social-links {
        justify-content: center;
    }

    .page-hero h1 {
        font-size: 2.5em;
    }
    .page-hero p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .main-header .logo span {
        display: none; /* 在更小的屏幕上隐藏logo文字 */
    }
    .main-header .logo img {
        height: 35px;
    }
    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}