/* shared.css - 全局样式表 */

/* 基础重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

body {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

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

/* 主头部样式 */
.main-header {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.main-header .logo img {
    height: 40px;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    position: relative;
    margin-left: 30px;
}

.main-nav ul li a {
    display: block;
    padding: 10px 0;
    color: #333;
    font-weight: 500;
}

.main-nav ul li a:hover {
    color: #007bff;
    text-decoration: none;
}

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 1;
    list-style: none;
    padding: 10px 0;
    border-radius: 4px;
}

.main-nav .dropdown:hover .dropdown-menu {
    display: block;
}

.main-nav .dropdown-menu li {
    margin: 0;
}

.main-nav .dropdown-menu li a {
    padding: 8px 20px;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.menu-toggle {
    display: none; /* 默认隐藏，在移动端显示 */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-left: 20px;
}

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

/* 主内容区域 */
#main-content {
    flex-grow: 1;
    padding: 40px 0;
}

/* 主页脚样式 */
.main-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 50px 0 20px;
    font-size: 0.9rem;
}

.main-footer a {
    color: #ecf0f1;
    text-decoration: none;
}

.main-footer a:hover {
    color: #007bff;
    text-decoration: underline;
}

.main-footer h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
}

.main-footer h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background-color: #007bff;
    margin-top: 10px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-col ul {
    list-style: none;
}

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

.footer-col .social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin-right: 10px;
    color: #ecf0f1;
    transition: background-color 0.3s ease;
}

.footer-col .social-links a:hover {
    background-color: #007bff;
}

.footer-col .social-links i {
    font-size: 18px;
}

.footer-col .contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-col .contact-info i {
    margin-right: 10px;
    color: #007bff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-bottom .copyright, .footer-bottom .beian {
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-nav {
        display: none; /* 隐藏桌面导航 */
        width: 100%;
        order: 3; /* 移动到下一行 */
        margin-top: 15px;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav ul li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .main-nav ul li:last-child {
        border-bottom: none;
    }

    .main-nav ul li a {
        padding: 15px 20px;
        color: #333;
    }

    .main-nav .dropdown-menu {
        position: static;
        display: block;
        box-shadow: none;
        background-color: #f0f0f0;
        padding-left: 20px;
        border-radius: 0;
    }

    .main-header .container {
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: block; /* 显示移动导航按钮 */
    }

    .header-actions .btn {
        margin-right: 15px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col h3::after {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-col .contact-info p {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-header .logo {
        flex-grow: 1; /* 让logo占据更多空间，将按钮推到右边 */
    }
    .header-actions {
        order: 2;
    }
    .menu-toggle {
        order: 3;
        margin-left: 10px;
    }
    .main-header .container {
        flex-wrap: wrap;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
