/* ================================================
   VALUCIA 基础样式 - Rem转换 & 移动端适配
   ================================================ */

/* 基础Rem转换 - 1rem = 16px */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    html {
        font-size: 13px;
    }
}

/* ================================================
   汉堡菜单样式
   ================================================ */
.hamburger {
    display: none;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: 1.5rem;
    height: 0.125rem;
    background: #fff;
    border-radius: 0.0625rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-line:nth-child(1) {
    top: 0.625rem;
}

.hamburger-line:nth-child(2) {
    top: 50%;
    margin-top: -0.0625rem;
}

.hamburger-line:nth-child(3) {
    bottom: 0.625rem;
}

.hamburger-line + .hamburger-line {
    /* removed - using absolute positioning now */
}

.hamburger.is-active .hamburger-line:nth-child(1) {
    transform: translateX(-50%) rotate(45deg);
    top: 50%;
    margin-top: 0;
}

.hamburger.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
    transform: translateX(-50%) rotate(-45deg);
    bottom: 50%;
    margin-bottom: 0;
}

/* 移动端导航遮罩层 */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.is-active {
    display: block;
    opacity: 1;
}

/* 移动端导航菜单 */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -85%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: linear-gradient(180deg, #0c1929 0%, #09101c 100%);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.35s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav.is-active {
    display: block;
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-logo {
    height: 1.75rem;
    width: auto;
}

@media (max-width: 768px) {
    .mobile-nav-logo {
        height: 1.25rem;
        width: auto;
    }
}

.mobile-nav-close {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-link.is-active {
    color: #d4af37;
}

.mobile-nav-submenu {
    display: none;
    padding: 0.5rem 0;
    background: rgba(0, 0, 0, 0.2);
}

.mobile-nav-submenu.is-open {
    display: block;
}

.mobile-nav-subitem {
    display: block;
    padding: 0.625rem 1.25rem 0.625rem 2rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-nav-subitem:hover {
    color: #d4af37;
}

.mobile-nav-arrow {
    transition: transform 0.2s ease;
}

.mobile-nav-item.is-open > .mobile-nav-link .mobile-nav-arrow {
    transform: rotate(180deg);
}

.mobile-nav-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-lang-switch {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0.375rem;
    color: #fff;
    font-size: 0.875rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-lang-switch:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 移动端导航激活状态 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .main-nav {
        display: none !important;
    }

    .lang-switch {
        display: none;
    }

    body.is-nav-open {
        overflow: hidden;
    }
}

/* ================================================
   响应式基础适配
   ================================================ */
@media (max-width: 768px) {
    /* 头部 */
    .site-header {
        position: relative;
        z-index: 100;
    }

    .header-inner {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        justify-content: space-between !important;
    }

    .header-inner .brand {
        width: auto;
        justify-content: flex-start;
    }

    .brand img {
        height: 1.25rem;
        width: auto;
    }

    /* 通用容器 */
    section,
    .container,
    .section-inner {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* 网格布局 */
    .grid,
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }

    /* 字体大小 */
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    p {
        font-size: 0.875rem !important;
    }
}

@media (max-width: 520px) {
    .grid,
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    h1 {
        font-size: 1.25rem !important;
    }

    h2 {
        font-size: 1.125rem !important;
    }
}
