/* 共用基础 + 移动端 / 平板适配 */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

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

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 移动端页脚文字（桌面端依赖背景图文案） */
.footer-mobile {
    display: none;
}

.footer-mobile p {
    margin: 6px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.7;
}

.footer-mobile a {
    color: rgba(255, 255, 255, 0.85);
}

.footer-mobile .footer-icp {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

/* ========== 平板 ========== */
@media (max-width: 1024px) {
    .nav-links {
        gap: 28px;
    }

    .about-section {
        padding: 60px 40px !important;
    }

    .about-content {
        gap: 40px !important;
    }

    .about-image {
        width: auto !important;
        max-width: 420px;
        min-height: 0 !important;
    }

    .about-image img {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .apply-section .apply-container {
        width: 88% !important;
    }

    .apply-section {
        max-height: none !important;
        padding-bottom: 80px !important;
    }

    .apply-section .apply-container {
        height: auto !important;
        min-height: 320px;
        padding-bottom: 40px;
    }

    .apply-content {
        padding: 48px 24px 24px !important;
    }

    .apply-content > p {
        line-height: 1.9 !important;
    }

    .guarantee {
        height: auto !important;
        min-height: 0 !important;
        padding: 100px 0 60px !important;
    }
}

/* ========== 手机 / 小平板 ========== */
@media (max-width: 768px) {
    header {
        opacity: 1 !important;
    }

    nav {
        height: 56px;
        position: static;
    }

    .logo {
        width: 110px !important;
        height: auto !important;
        flex-shrink: 0;
    }

    .logo img {
        width: 100%;
        height: auto;
        display: block;
    }

    .menu-toggle {
        display: flex;
        margin-left: auto;
    }

    header .nav-links {
        display: none !important;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        gap: 0 !important;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        padding: 8px 0;
        z-index: 1000;
        margin: 0;
    }

    header .nav-links.open {
        display: flex !important;
    }

    header .nav-links li {
        width: 100%;
        text-align: center;
    }

    header .nav-links a {
        display: block;
        font-size: 15px !important;
        padding: 14px 20px !important;
    }

    header .nav-links a.active::after {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        width: 32px !important;
        bottom: 6px;
    }

    /*
     * 子页 Banner（关于我们 / 技师入驻 / 商家入驻）：
     * 宽 100% 完整展示原图，按 3840×1200 比例占位，不裁切
     */
    .sub-banner {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin-top: 56px;
        padding-top: 0 !important;
        background-color: #f6d7bc;
        background-position: center top !important;
        background-size: 100% auto !important;
        background-repeat: no-repeat !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }

    /* 首页 Banner 仍用 cover 铺满 */
    .banner:not(.sub-banner) {
        margin-top: 56px;
        background-size: cover !important;
        background-position: center center !important;
        height: min(62vw, 320px) !important;
        min-height: 200px !important;
    }

    /* 用伪元素按原图比例撑开高度，三页统一 */
    .sub-banner::before {
        content: '';
        display: block;
        width: 100%;
        aspect-ratio: 3840 / 1200;
        flex-shrink: 0;
    }

    /* tip 区压矮，保证低于上方 banner */
    .bannerTip {
        position: relative !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none;
        padding: 6px 16px !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        font-size: 13px !important;
        background: #fffaf7 !important;
        opacity: 1 !important;
        box-sizing: border-box;
    }

    .bannerTip .tipBox {
        flex: none !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        position: static !important;
    }

    /* 图标 28px + 横向间距 20px = text-indent 48px；整组居中 */
    .bannerTip .tipBox .content {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        width: 13em !important;
        max-width: 100% !important;
        height: 28px !important;
        line-height: 28px !important;
        background-size: 28px 28px !important;
        background-position: left center !important;
        background-repeat: no-repeat !important;
        text-indent: 48px !important;
        font-size: 13px !important;
        white-space: nowrap;
        overflow: visible;
        text-align: left;
    }

    /* 关于我们 */
    .about-section {
        padding: 40px 0 !important;
    }

    .about-section .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .about-content {
        flex-direction: column !important;
        gap: 24px !important;
        align-items: stretch !important;
    }

    .about-text {
        max-width: 100% !important;
        min-height: 0 !important;
        width: 100%;
    }

    .about-text h2 {
        font-size: 22px !important;
        margin-bottom: 12px !important;
    }

    .about-text h4 {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }

    .about-text p {
        font-size: 14px !important;
        line-height: 1.8 !important;
        letter-spacing: 0 !important;
    }

    .about-image {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        margin: 0 auto;
    }

    .about-image img {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block;
        margin: 0 auto;
    }

    /* 首页保障区 */
    .guarantee {
        height: auto !important;
        min-height: 0 !important;
        padding: 48px 0 40px !important;
    }

    .section-title {
        font-size: 22px !important;
    }

    .section-subtitle {
        font-size: 14px !important;
        margin-bottom: 32px !important;
    }

    .cards {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .card {
        padding: 36px 20px !important;
    }

    .card-icon {
        width: 88px !important;
        height: 88px !important;
    }

    .card-icon img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
    }

    /* 申请入驻 */
    .apply-section {
        max-height: none !important;
        padding: 0 0 48px !important;
    }

    .apply-section .apply-container {
        width: 100% !important;
        height: auto !important;
        min-height: 0;
        padding: 0 0 24px;
        border-radius: 0;
        box-shadow: none;
    }

    .apply-content {
        padding: 36px 20px 28px !important;
        text-align: left !important;
    }

    .apply-content h2 {
        font-size: 20px !important;
        text-align: center;
        margin-bottom: 16px !important;
    }

    .apply-content > p {
        line-height: 1.8 !important;
        font-size: 14px !important;
        margin-bottom: 12px;
        letter-spacing: 0 !important;
    }

    /*
     * 页脚：移动端不用 bottomBg 图（图里已有文案，会和 HTML 文字重叠），
     * 纯色底 + 真实文案，与首页交互一致（含备案链接）
     */
    footer {
        height: auto !important;
        min-height: 0 !important;
        padding: 36px 16px !important;
        background: #2a2a2a !important;
        background-image: none !important;
    }

    footer .footer-desktop,
    footer .footer-content > p,
    footer .footer-content > a.footerNav,
    footer a.footerNav {
        display: none !important;
    }

    .footer-mobile {
        display: block;
    }

    .footer-mobile .footer-icp a {
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}

@media (max-width: 480px) {
    .apply-content {
        padding: 28px 16px 20px !important;
    }

    .about-text h2 {
        font-size: 20px !important;
    }

    .bannerTip .tipBox .content {
        width: 12em !important;
        font-size: 12px !important;
        height: 26px !important;
        line-height: 26px !important;
        background-size: 26px 26px !important;
        text-indent: 46px !important; /* 26 + 20 */
    }
}
