/**
 * Header SMACSS Styles
 * 统一导航系统 - 响应式设计
 *
 * 结构：
 * 1. Base - 基础样式
 * 2. Layout - 布局模块
 * 3. Module - 组件模块
 * 4. State - 状态样式
 * 5. Theme - 主题样式
 */

/* ============================================
   1. BASE - 基础样式
   ============================================ */

/* 隐藏checkbox */
.nav-checkbox {
    display: none;
}

/* header基础样式 - 使用min-height限制容器高度 */
.header {
    position: relative;
    background: #fff;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-height: 3.125rem;
    display: flex;
    align-items: center;
}

/* 覆盖旧CSS的伪元素 */
.header::after {
    display: none;
}

/* 品牌logo样式 - 继承header高度 */
.header__logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    height: 3.125rem;
    max-height: 3.125rem;
    overflow: hidden;
}

/* Logo图片 - 高度跟随容器 */
.header .header__logo-img {
    display: block;
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* 导航基础样式 */
.nav-main {
    position: relative;
    background: #41bb58;
    z-index: 999;
    box-sizing: border-box;
}

/* 导航列表重置 */
.nav-main__list,
.nav-main__submenu,
.nav-main__subsubmenu {
    margin: 0;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
}

/* 导航链接基础样式 */
.nav-main__link,
.nav-main__sublink,
.nav-main__subsublink {
    display: block;
    text-decoration: none;
    color: #231815;
    transition: all 0.5s;
    box-sizing: border-box;
}

.nav-main__link:hover,
.nav-main__sublink:hover,
.nav-main__subsublink:hover {
    color: #41bb58;
}

/* ============================================
   2. LAYOUT - 布局模块
   ============================================ */

/* 桌面端布局（≥48rem） */
@media (min-width: 768px) {
    .header {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem 2rem;
    }

    .nav-main {
        display: block;
        width: 100%;
    }

    /* 桌面端隐藏按钮 */
    .nav-toggle-open,
    .nav-toggle-close {
        display: none !important;
    }
}

/* 移动端布局（<48rem） */
@media (max-width: 767px) {
    .header {
        padding: 1rem;
        position: relative;
    }

    .header__logo {
        float: left;
    }

    /* 打开按钮：在header右上角 */
    .nav-toggle-open {
        display: flex !important;
        position: absolute;
        top: 50%;
        right: 0.9375rem;
        transform: translateY(-50%);
        width: 3.125rem;
        height: 3.125rem;
        cursor: pointer;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.375rem;
        background: #41bb58;
        border-radius: 0.3125rem;
        z-index: 1003;
    }

    .nav-toggle-open .nav-toggle__bar {
        display: block;
        width: 1.875rem;
        height: 0.1875rem;
        background: #fff;
        border-radius: 0.09375rem;
    }

    /* 关闭按钮：默认隐藏 */
    .nav-toggle-close {
        display: none !important;
        position: fixed;
        top: 0.9375rem;
        right: 0.9375rem;
        width: 3.125rem;
        height: 3.125rem;
        cursor: pointer;
        justify-content: center;
        align-items: center;
        background: #41bb58;
        border-radius: 0.3125rem;
        z-index: 1002;
    }

    .nav-toggle-close .nav-toggle__icon {
        font-size: 2rem;
        color: #fff;
        line-height: 1;
    }

    /* 移动端导航默认隐藏 */
    .nav-main {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #fff;
        z-index: 1001;
        overflow-y: auto;
        padding-top: 3rem;
    }

    /* 移动端菜单展开状态 */
    .nav-checkbox:checked ~ .nav-main {
        display: block;
    }

    /* 菜单展开时：隐藏打开按钮 */
    .nav-checkbox:checked ~ .header .nav-toggle-open {
        display: none !important;
    }

    /* 菜单展开时：显示关闭按钮 */
    .nav-checkbox:checked ~ .header .nav-toggle-close {
        display: flex !important;
    }
}

/* ============================================
   3. MODULE - 组件模块
   ============================================ */

/* === 主导航 === */

/* 桌面端主导航 */
@media (min-width: 768px) {
    .nav-main {
        position: relative;
        background: #41bb58;
        z-index: 999;
    }

    .nav-main__list {
        display: flex;
        justify-content: space-between;
        align-items: stretch;
        gap: 0;
        width: 100%;
        max-width: 100%;
    }

    .nav-main__item {
        position: relative;
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-main__link {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem 0.5rem;
        font-size: 0.75rem;
        color: #fff;
        line-height: 1.2;
        min-height: 2.75rem;
        width: 100%;
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .nav-main__link:hover {
        color: #fff;
        background: rgba(0, 0, 0, 0.1);
    }

    /* 当前激活项 */
    .nav-main__item--active > .nav-main__link {
        color: #fff;
        font-weight: bold;
        background: rgba(0, 0, 0, 0.15);
    }

    /* 二级菜单 */
    .nav-main__submenu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 12.5rem;
        background: #fff;
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-0.625rem);
        transition: all 0.3s;
        pointer-events: none;
    }

    .nav-main__item:hover > .nav-main__submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-main__subitem {
        position: relative;
    }

    .nav-main__sublink {
        padding: 1rem 1rem;
        font-size: 0.75rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-main__sublink:hover {
        background: #f9f9f9;
    }

    /* 三级菜单 */
    .nav-main__subsubmenu {
        position: absolute;
        top: 0;
        left: 100%;
        min-width: 10rem;
        background: #fff;
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateX(-0.625rem);
        transition: all 0.3s;
        pointer-events: none;
    }

    .nav-main__subitem:hover > .nav-main__subsubmenu {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-main__subsublink {
        padding: 1rem 1rem;
        font-size: 0.75rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-main__subsublink:hover {
        background: #f9f9f9;
    }
}

/* 移动端主导航 */
@media (max-width: 767px) {
    .nav-main__item {
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-main__link {
        padding: 1rem 1rem;
        font-size: 1rem;
        color: #231815;
    }

    .nav-main__item--active > .nav-main__link {
        color: #41bb58;
        font-weight: bold;
    }

    /* 移动端二级菜单 */
    .nav-main__submenu {
        background: #f9f9f9;
    }

    .nav-main__subitem {
        border-bottom: 1px solid #e0e0e0;
    }

    .nav-main__sublink {
        padding: 1rem 1rem 1rem 2rem;
        font-size: 1rem;
    }

    /* 移动端三级菜单 */
    .nav-main__subsubmenu {
        background: #f0f0f0;
    }

    .nav-main__subsublink {
        padding: 1rem 1rem 1rem 3rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   4. STATE - 状态样式
   ============================================ */

/* 有子菜单的标记 */
@media (min-width: 768px) {
    .nav-main__item--has-children > .nav-main__link::after {
        content: '';
        display: inline-block;
        margin-left: 0.5rem;
        border: 1px solid transparent;
        border-top-color: #fff;
        vertical-align: middle;
    }

    .nav-main__item--has-children:hover > .nav-main__link::after {
        border-top-color: #fff;
    }

    /* 二级菜单的子菜单标记 */
    .nav-main__subitem--has-children > .nav-main__sublink::after {
        content: '';
        display: inline-block;
        margin-left: 0.5rem;
        border: 1px solid transparent;
        border-left-color: #666;
        vertical-align: middle;
    }

    .nav-main__subitem--has-children:hover > .nav-main__sublink::after {
        border-left-color: #41bb58;
    }
}

@media (max-width: 767px) {
    .nav-main__item--has-children > .nav-main__link::after {
        content: '+';
        float: right;
        font-size: 1.25rem;
        color: #666;
    }
}

/* ============================================
   5. THEME - 主题样式
   ============================================ */

/* 页面滚动时的header样式（可选） */
.header--fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* ============================================
   6. SECTION TITLE - 区块标题统一样式
   ============================================ */

.section-title {
    font-size: 1.5em;
    font-weight: bold;
    line-height: 1.5;
    color: #333;
    text-align: center;
    margin: 0 0 1rem 0;
    padding: 0;
}

.section-title::after {
    display: block;
    width: 4rem;
    height: 0.1875rem;
    background: #41bb58;
    content: '';
    margin: 1rem auto 0;
}

/* h3标题样式 */
.section-title--h3 {
    font-size: 1.17em;
}

.section-title--h3::after {
    width: 3rem;
    height: 0.125rem;
}

/* ============================================
   7. PAGE LAYOUT - 页面板块间距优化
   ============================================ */

/* 轮播图 - 减少顶部空白 */
.slide-content {
    margin-top: 0 !important;
}

/* 服务板块(SEO培训/咨询) - 优化间距 */
.services {
    padding: 2rem 0;
}

/* 服务卡片图片 - 放大尺寸 */
.service-card__img {
    max-width: 17.5rem;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

/* 公司简介板块 */
.company {
    padding: 3rem 0;
}

.company__content {
    text-align: center;
    max-width: 50rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.company__text {
    margin-top: 1rem;
}

/* 文章列表板块 */
.articles {
    padding: 2rem 0;
    background: #fff;
}

.articles__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.articles__section {
    width: calc(33.333% - 1.25rem);
    min-width: 18rem;
    background: #f9f9f9;
    border-radius: 0.5rem;
    padding: 1rem;
}

.articles__title {
    font-size: 1rem;
    font-weight: bold;
    color: #41bb58;
    border-bottom: 1px solid #41bb3px;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.articles__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.articles__item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.articles__item:last-child {
    border-bottom: none;
}

.articles__item a {
    color: #555;
    text-decoration: none;
    font-size: 0.875rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.articles__item a:hover {
    color: #41bb58;
}

.articles__more {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.articles__more a {
    color: #41bb58;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-block;
}

.articles__more a:hover {
    text-decoration: underline;
    color: #3aa04d;
}

/* 奇商案例板块 */
.cases {
    padding: 2rem 0;
    background: #fff;
}

.cases__list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.cases__item {
    text-align: center;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.cases__item:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.cases__item img {
    max-width: 6.25rem;
    height: auto;
    margin-bottom: 1rem;
}

.cases__item span {
    display: block;
    font-size: 0.875rem;
    color: #555;
    margin-top: 1rem;
}

/* 友情链接 */
.friend-links {
    margin: 2rem 0;
    padding: 1rem 0;
    background: #f9f9f9;
}

.friend-links__header {
    text-align: center;
    margin-bottom: 1rem;
}

.friend-links__title {
    font-size: 1.125rem;
    color: #333;
    margin: 0 0 1rem 0;
}

.friend-links__body {
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.friend-links__item {
    color: #666;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.friend-links__item:hover {
    color: #41bb58;
}

/* ============================================
   8. LINK STANDARDS - 链接文字标准
   ============================================ */

/* 链接文字大小标准
   - 正文链接: 0.875rem (14px) - 继承父元素或小一号
   - 导航链接: 1rem (16px) - 标准大小
   - 强调链接: 1rem (16px) - 标准大小
   - 按钮链接: 1rem (16px) - 标准大小
*/

/* 响应式调整 */
@media (max-width: 768px) {
    .services {
        padding: 1.5rem 0;
    }

    .articles__section {
        width: 100%;
        min-width: auto;
    }

    .company {
        padding: 2rem 0;
    }

    .cases {
        padding: 1.5rem 0;
    }
}
