/* =========================================
   1. 基础重置与全局样式 (Base Styles)
   ========================================= */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
    background-color: #f9f9f9;
    line-height: 1.6;
}

/* 通用容器 */
.base-container {
    width: 95%;
    max-width: 1400px; /*稍微限制最大宽度，以免在大屏上过散*/
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* =========================================
   2. 顶部导航栏 (Header)
   ========================================= */
.base-header {
    background-color: #fff;
    padding: 0; /* 高度由内容撑开，保持垂直居中 */
    height: 70px; /* 固定高度看起来更专业 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.base-header .base-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Logo 区域 */
.header-left .logo-name a {
    display: flex;
    align-items: center;
}

.logo-name img {
    height: 40px; /* 稍微调小一点，显得精致 */
    width: auto;
}

/* 右侧区域 (导航 + 用户 + 汉堡菜单) */
.header-right {
    display: flex;
    align-items: center;
    height: 100%;
}

/* --- 核心导航菜单 (Nav Links) --- */
.nav-links {
    display: flex;
    align-items: center;
    margin-right: 30px;
    height: 100%;
    gap: 10px; /* 菜单项之间的基础间距 */
}

/* 单个菜单项容器 */
.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px; /* 增加点击热区 */
    cursor: pointer;
}

/* 菜单文字样式 */
.nav-item a.single-link,
.nav-item .dropdown-toggle {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* 悬停/激活颜色 */
.nav-item:hover a.single-link,
.nav-item:hover .dropdown-toggle {
    color: #007bff;
}

/* 下拉箭头小图标 */
.arrow {
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 2px;
    margin-left: 6px;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.3s ease;
}

/* 悬停时箭头旋转 */
.nav-item:hover .arrow {
    transform: rotate(225deg) translateY(-2px);
}

/* --- 下拉菜单容器 (Dropdown Menu) --- */
.dropdown-menu {
    display: none; /* 默认隐藏 */
    position: absolute;
    top: 70px; /* header的高度 */
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 0 0 8px 8px; /* 只有下方圆角 */
    padding: 10px 0;
    z-index: 1100;
    border-top: 2px solid #007bff; /* 顶部装饰线 */
    animation: menuFadeIn 0.2s ease-in-out;
}

/* 动画定义 */
@keyframes menuFadeIn {
    from { opacity: 0; margin-top: 10px; }
    to { opacity: 1; margin-top: 0; }
}

/* 鼠标悬停显示下拉 */
.nav-item:hover .dropdown-menu {
    display: block;
}

/* 下拉菜单内的链接 */
.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #555;
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #f5f8ff;
    color: #007bff;
}

/* --- 用户登录/工作台区域 --- */
.user-section {
    display: flex;
    align-items: center;
    margin-left: 10px;
    font-size: 15px;
}

.login-link {
    color: #007bff;
    font-weight: 500;
    padding: 6px 16px;
    border: 1px solid #007bff;
    border-radius: 20px;
    transition: all 0.3s;
}

.login-link:hover {
    background-color: #007bff;
    color: #fff;
}

.user-dropdown {
    position: relative;
    cursor: pointer;
}

/* 汉堡菜单图标 (默认隐藏) */
.menu-icon {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    height: 18px;
    width: 24px;
    cursor: pointer;
    margin-left: 20px;
    z-index: 1200;
}

.menu-icon span {
    width: 100%;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* =========================================
   3. 内容区域 (Content)
   ========================================= */
.base-content {
    flex: 1; /* 撑满剩余高度 */
    width: 100%;
}

/* =========================================
   4. 底部区域 (Footer)
   ========================================= */
.base-footer {
    background-color: #1a1a1a;
    color: #ccc;
    padding: 60px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    flex: 2;
    min-width: 280px;
}

.footer-section h3,
.footer-links h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.8;
    color: #999;
    text-align: justify;
}

.footer-links {
    flex: 1;
    min-width: 150px;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    color: #999;
    font-size: 14px;
}

.footer-links ul li a:hover {
    color: #fff;
    text-decoration: underline;
}

.wechat-qr {
    flex: 0 0 150px;
    text-align: center;
}

.wechat-qr img {
    width: 120px;
    height: 120px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.wechat-qr p {
    font-size: 13px;
    color: #888;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.footer-bottom a {
    color: #666;
}

.footer-bottom a:hover {
    color: #999;
}

/* =========================================
   5. 响应式设计 (Mobile / Tablet)
   ========================================= */
@media screen and (max-width: 992px) {
    /* 平板尺寸下缩小间距 */
    .nav-links {
        margin-right: 15px;
        gap: 5px;
    }
    .nav-item {
        padding: 0 10px;
    }
}

@media screen and (max-width: 768px) {
    /* 汉堡菜单显示 */
    .menu-icon {
        display: flex;
    }

    /* 导航菜单容器 - 移动端样式 */
    .nav-links {
        display: none; /* JS控制显示 */
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        margin: 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        height: auto;
        max-height: 80vh; /* 防止太长溢出屏幕 */
        overflow-y: auto; /* 内容过多可滚动 */
    }

    .nav-links.show {
        display: flex;
    }

    /* 移动端菜单项 */
    .nav-item {
        width: 100%;
        height: auto;
        display: block; /* 块级显示，方便折叠 */
        padding: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    /* 顶级链接文字 */
    .nav-item a.single-link,
    .nav-item .dropdown-toggle {
        padding: 15px 20px;
        width: 100%;
        box-sizing: border-box;
        font-size: 16px;
        justify-content: space-between; /* 箭头靠右 */
    }

    /* 移动端下拉菜单：默认平铺展开 */
    .dropdown-menu {
        position: static; /* 取消绝对定位 */
        display: block; /* 直接显示 */
        width: 100%;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background-color: #fafafa; /* 浅灰背景区分层级 */
        padding: 0;
        margin: 0;
    }

    .dropdown-menu a {
        padding: 12px 20px 12px 40px; /* 左侧缩进，体现层级 */
        color: #666;
        border-bottom: 1px solid #eee;
    }

    /* 箭头处理 */
    .arrow {
        border-color: #ccc;
        transform: rotate(135deg); /* 默认向下 */
    }
    .nav-item:hover .arrow {
        transform: rotate(135deg); /* 移动端不需要旋转交互 */
    }

    /* 汉堡菜单动画 */
    .nav-links.show ~ .menu-icon span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-links.show ~ .menu-icon span:nth-child(2) {
        opacity: 0;
    }
    .nav-links.show ~ .menu-icon span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Footer 移动端调整 */
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    .footer-section, .footer-links, .wechat-qr {
        width: 100%;
        text-align: left;
    }
    .wechat-qr {
        display: flex;
        align-items: center;
        gap: 20px;
        border-top: 1px solid #333;
        padding-top: 20px;
    }
    .wechat-qr img {
        margin: 0;
        width: 80px;
        height: 80px;
    }
}