:root {
    --primary: #0a2540;
    --primary-light: #1e4a7c;
    --accent: #c9a227;
    --accent-dark: #a78a1c;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

h1, h2, h3, h4, .font-serif {
    font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
}

/* ========== Scroll animations ========== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Hero animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

/* ========== Navigation ========== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

#header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ========== Service cards ========== */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ========== Service tabs ========== */
.tab-btn:not(.active) {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.tab-btn.active {
    background-color: var(--accent) !important;
    color: var(--primary) !important;
    border-color: transparent !important;
}

.tab-content {
    transition: opacity 0.3s ease;
}

.tab-content:not(.active) {
    opacity: 0;
}

.tab-content.active {
    opacity: 1;
}

/* ========== Advantages ========== */
.advantage-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.advantage-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* ========== Custom scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========== Selection ========== */
::selection {
    background-color: rgba(201, 162, 39, 0.3);
    color: #0a2540;
}

/* ========== Focus ========== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========== Navigation dropdowns ========== */
.nav-dropdown { position: relative; }
.nav-dropdown > button,
.nav-dropdown > a { background: transparent; border: none; cursor: pointer; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 180px;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(10,37,64,0.12);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 50;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.dropdown-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.dropdown-menu a {
    display: block;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    color: #475569;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}
.dropdown-menu a:hover {
    background-color: #f8fafc;
    color: #0a2540;
}
.dropdown-menu a.active {
    color: #c9a227;
    font-weight: 500;
}
/* 透明桥接：填补父项与菜单间的 8px 间隙，避免鼠标下移时 hover 丢失而收起 */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

/* 移动端下拉菜单 */
.mobile-nav-dropdown { border-bottom: 1px solid #f1f5f9; }
.mobile-dropdown-trigger {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: #475569;
}
.mobile-dropdown-trigger i[data-lucide="chevron-down"] {
    transition: transform 0.2s ease;
}
.mobile-nav-dropdown.open .mobile-dropdown-trigger i[data-lucide="chevron-down"] {
    transform: rotate(180deg);
}
.mobile-dropdown-menu {
    display: none;
    padding-left: 0.75rem;
    padding-bottom: 0.5rem;
    flex-direction: column;
    gap: 0.25rem;
}
.mobile-nav-dropdown.open .mobile-dropdown-menu {
    display: flex;
}
.mobile-dropdown-menu a {
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: #64748b;
}
.mobile-dropdown-menu a:hover {
    color: #0a2540;
} */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu:not(.hidden) {
    animation: slideDown 0.3s ease;
}

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

/* ========== Responsive ========== */
@media (max-width: 640px) {
    .animate-fade-in-up {
        animation-duration: 0.6s;
    }
}

@media (max-width: 768px) {
    .advantage-item {
        text-align: center;
    }
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}