/* === 1. 核心变量与重置 === */
:root {
    --bg-color: #ffffff;
    --text-main: #1a1a1a;
    --text-light: #666666;
    --primary-color: #ffb700;
    --accent-color: #ffe169;
    --dark-bg: #0a0e17;
    --dark-card: #141a26;
    --grid-gap: 24px;
    --container-width: 1320px;
    --radius-unified: 12px;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --btn-height-sm: 36px;
    --btn-height-md: 44px;
    --btn-height-lg: 52px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Alibaba PuHuiTi 3.0', 'Alibaba PuHuiTi', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1,
h2,
h3 {
    text-wrap: balance;
}

.skip-link {
    position: fixed;
    z-index: 2000;
    top: max(10px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    padding: 10px 16px;
    transform: translateY(-160%);
    border-radius: 4px;
    background: var(--primary-color);
    color: #10141c;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    transition: transform 0.18s ease;
}

.skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}

img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* === 2. 导航栏 (Navbar) === */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
    position: fixed;
    width: 100%;
    top: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
    z-index: 1000;
    transition: background 0.3s;
    padding-right: env(safe-area-inset-right);
    padding-left: env(safe-area-inset-left);
}

/* 滚动时导航栏变黑背景（可选） */
nav.scrolled {
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-shell {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.logo-icon {
    width: 140px;
    height: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    align-items: center;
    height: 100%;
}

.nav-links>a,
.dropdown-trigger {
    padding: 10px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    color: white;
    cursor: pointer;
}

.nav-links>a:hover,
.dropdown:hover .dropdown-trigger,
.nav-links>a.active,
.dropdown-trigger.active {
    background-color: var(--primary-color);
    color: black;
}

.dropdown-trigger:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: auto;
    cursor: pointer;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
}

.dropdown-trigger::after {
    content: '';
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    display: inline-block;
    padding: 2.5px;
    transform: rotate(45deg);
    margin-top: -2px;
    transition: transform 0.3s;
    border-color: currentColor;
}

.dropdown:hover .dropdown-trigger::after,
.dropdown.is-open .dropdown-trigger::after {
    transform: rotate(225deg);
    margin-top: 2px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
    overflow: hidden;
}

.dropdown-menu::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
}

.dropdown:hover .dropdown-menu,
.dropdown.is-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 0;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
}

.dropdown-item:hover {
    background-color: #f9f9f9;
    color: var(--primary-color);
}

.dropdown-item.active {
    color: var(--primary-color);
    font-weight: bold;
}

.btn-contact {
    padding: 12px 28px;
    background: var(--primary-color);
    color: var(--text-main);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn-contact:hover {
    transform: scale(1.05);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-toggle,
.mobile-menu {
    display: none;
}

/* === 按钮系统 === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
    line-height: 1;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 4px;
}
.btn-sm { height: var(--btn-height-sm); padding: 0 16px; font-size: 13px; }
.btn-md { height: var(--btn-height-md); padding: 0 28px; font-size: 14px; }
.btn-lg { height: var(--btn-height-lg); padding: 0 40px; font-size: 16px; }

.btn-primary { background: var(--primary-color); color: var(--text-main); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,183,0,0.3); }

.btn-secondary { background: var(--text-main); color: white; }
.btn-secondary:hover { background: #333; transform: translateY(-2px); }

.btn-outline { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-outline:hover { background: var(--primary-color); color: var(--text-main); }

.btn-ghost { background: rgba(255,255,255,0.2); color: white; backdrop-filter: blur(4px); }
.btn-ghost:hover { background: var(--primary-color); color: var(--text-main); }

.btn-white-outline { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white; }
.btn-white-outline:hover { background: rgba(255,255,255,0.1); }

.btn-dark-outline { background: transparent; border: 2px solid var(--text-main); color: var(--text-main); }
.btn-dark-outline:hover { background: var(--text-main); color: white; }

/* === 3. 页脚 (Footer) === */
footer {
    padding: 100px 0 max(40px, env(safe-area-inset-bottom));
    background: white;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 60px;
    border-bottom: 1px solid #eee;
}

.footer-brand h4 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px;
}

.footer-col h5 {
    font-size: 16px;
    margin-bottom: 24px;
    color: var(--text-main);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: var(--text-light);
    font-size: 14px;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 40px;
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 13px;
}

/* === 4. 回到顶部按钮 === */
#backToTopBtn {
    position: fixed;
    bottom: max(30px, env(safe-area-inset-bottom));
    right: max(30px, env(safe-area-inset-right));
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: black;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#backToTopBtn:hover {
    background-color: #e5a500;
    transform: translateY(-3px);
}

#backToTopBtn.show {
    opacity: 1;
    visibility: visible;
}

/* === 5. 通用组件样式 === */
.section-header, .section-title {
    text-align: center;
    margin-bottom: 60px;
}
.section-header h2, .section-title h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}
.section-header h2::after, .section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}
.section-header p, .section-title p {
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.section-padding {
    padding: 80px 0;
}

.highlight-box {
    background: #fff8e1;
    padding: 24px;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}
.highlight-box.dark {
    background: rgba(255,255,255,0.1);
}

.cta-section {
    background: var(--dark-bg);
    padding: 80px 0;
    text-align: center;
    color: white;
    border-radius: 4px;
}
.cta-section h2 { margin-bottom: 28px; }
.cta-section p { opacity: 0.8; margin-bottom: 28px; }

/* 工具类 */
.text-left { text-align: left; }
.bg-gray-100 { background: #f9f9f9; }
.bg-gray-200 { background: #f5f5f7; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.mb-30 { margin-bottom: 30px !important; }
.mb-20 { margin-bottom: 20px !important; }

/* 响应式 */
@media (max-width: 900px) {
    body.mobile-menu-open {
        overflow: hidden;
    }

    nav {
        height: 72px;
        background: rgba(10, 14, 23, 0.96);
        backdrop-filter: blur(10px);
    }

    .nav-shell {
        gap: 12px;
    }

    .logo-icon {
        width: 112px;
    }

    .nav-links {
        display: none;
    }

    .btn-contact {
        padding: 10px 14px;
        font-size: 12px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 64px;
        height: 40px;
        padding: 0 10px;
        border: 1px solid rgba(255,255,255,0.22);
        border-radius: 4px;
        background: rgba(255,255,255,0.04);
        color: white;
        font: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }

    .mobile-menu-toggle:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 3px;
    }

    .mobile-menu-icon {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 16px;
    }

    .mobile-menu-icon span {
        display: block;
        width: 100%;
        height: 2px;
        background: currentColor;
        transition: transform 0.2s;
        transform-origin: center;
    }

    .menu-open .mobile-menu-icon span:first-child {
        transform: translateY(3.5px) rotate(45deg);
    }

    .menu-open .mobile-menu-icon span:last-child {
        transform: translateY(-3.5px) rotate(-45deg);
    }

    .mobile-menu:not([hidden]) {
        display: block;
        position: absolute;
        top: 72px;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        border-top: 1px solid rgba(255,255,255,0.1);
        background:
            linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
            #0a0e17;
        background-size: 32px 32px;
        box-shadow: 0 24px 48px rgba(0,0,0,0.34);
        animation: mobileMenuIn 0.22s ease-out;
    }

    .mobile-menu-inner {
        padding-top: 28px;
        padding-bottom: 32px;
    }

    .mobile-menu-heading {
        display: flex;
        flex-direction: column;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        color: white;
    }

    .mobile-menu-heading span,
    .mobile-menu-group-label {
        color: var(--primary-color);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.18em;
    }

    .mobile-menu-heading strong {
        margin-top: 4px;
        font-size: 22px;
    }

    .mobile-menu-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
        padding: 20px 0;
    }

    .mobile-menu-primary,
    .mobile-service-menu {
        display: flex;
        flex-direction: column;
        min-width: 0;
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(20,26,38,0.92);
    }

    .mobile-menu-primary a,
    .mobile-service-menu a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 52px;
        padding: 0 16px;
        border-bottom: 1px solid rgba(255,255,255,0.09);
        color: white;
        font-size: 14px;
        font-weight: 700;
    }

    .mobile-menu-primary a:last-child,
    .mobile-service-menu a:last-child {
        border-bottom: 0;
    }

    .mobile-menu-primary a small {
        color: rgba(255,255,255,0.38);
        font-size: 9px;
        letter-spacing: 0.12em;
    }

    .mobile-menu-primary a.active,
    .mobile-service-menu a.active {
        background: var(--primary-color);
        color: var(--text-main);
    }

    .mobile-menu-primary a.active small {
        color: rgba(0,0,0,0.45);
    }

    .mobile-menu-primary a:focus-visible,
    .mobile-service-menu a:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: -3px;
    }

    .mobile-menu-group-label {
        display: flex;
        align-items: center;
        min-height: 42px;
        padding: 0 16px;
        border-bottom: 1px solid rgba(255,255,255,0.09);
    }

    .mobile-menu-note {
        margin: 0;
        color: rgba(255,255,255,0.5);
        font-size: 12px;
        line-height: 1.6;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 520px) {
    .container {
        padding-right: 18px;
        padding-left: 18px;
    }

    .mobile-menu-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes mobileMenuIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === 滚动动画 === */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal].delay-100 { transition-delay: 0.1s; }
[data-reveal].delay-200 { transition-delay: 0.2s; }
[data-reveal].delay-300 { transition-delay: 0.3s; }
[data-reveal].delay-400 { transition-delay: 0.4s; }
[data-reveal].delay-500 { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
    .skip-link,
    [data-reveal],
    [data-reveal].revealed {
        transition: none;
    }

    [data-reveal],
    [data-reveal].revealed {
        opacity: 1;
        transform: none;
    }

    .mobile-menu:not([hidden]) {
        animation: none;
    }

    .mobile-menu-icon span {
        transition: none;
    }
}
