/* 响应式样式文件 */

/* 平板端样式 (768px - 1024px) */
@media screen and (max-width: 1024px) {
    :root {
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-xxl: 2.5rem;
    }

    .nav-container {
        padding: 0 var(--spacing-sm);
    }

    .main-content {
        padding: 5rem var(--spacing-sm) 3rem;
    }

    .content-container {
        padding: 0 var(--spacing-sm);
    }

    .sidebar-panel {
        width: 350px;
        right: -350px;
    }

    .domain-text {
        font-size: 1.1rem;
    }

    .main-title {
        font-size: clamp(1.8rem, 4vw, 3rem);
    }

    .main-subtitle {
        font-size: clamp(1.3rem, 3vw, 2rem);
    }
}

/* 移动端样式 (max-width: 768px) */
@media screen and (max-width: 768px) {
    :root {
        --spacing-xs: 0.4rem;
        --spacing-sm: 0.8rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.2rem;
        --spacing-xl: 1.5rem;
        --spacing-xxl: 2rem;
    }

    /* 导航栏优化 */
    .top-nav {
        padding: 1rem 0;
    }

    .nav-container {
        padding: 0 var(--spacing-sm);
    }

    .logo {
        font-size: 1.3rem;
    }

    .mobile-panel-trigger {
        display: flex;
        margin-right: var(--spacing-sm);
    }

    .lang-switch {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    /* 主内容区域优化 */
    .main-content {
        padding: 5rem var(--spacing-sm) 4rem;
        min-height: auto;
        height: auto;
    }

    .content-container {
        padding: 0;
    }

    .main-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
        margin-bottom: var(--spacing-xs);
    }

    .main-subtitle {
        font-size: clamp(1.1rem, 4vw, 1.6rem);
        margin-bottom: var(--spacing-md);
    }

    .domain-content {
        margin-bottom: var(--spacing-md);
        max-height: 30vh;
    }

    .domain-text {
        font-size: clamp(0.8rem, 3.5vw, 0.85rem);
        line-height: 1.5;
        text-indent: 2em;
        margin-bottom: var(--spacing-xs);
    }

    .domain-text:lang(en) {
        text-indent: 0;
    }

    /* 行动区域优化 */
    .action-section {
        margin-top: var(--spacing-lg);
    }

    .cta-button {
        padding: 0.8rem 1.8rem;
        font-size: clamp(0.85rem, 2.5vw, 0.95rem);
        width: 100%;
        max-width: 260px;
        min-width: 180px;
    }

    .button-note {
        font-size: 0.8rem;
    }

    /* 侧边栏隐藏 */
    .sidebar-panel {
        display: none;
    }

    /* 移动端面板内容优化 */
    .mobile-panel-content {
        max-height: calc(85vh - 120px); /* 限制最大高度 */
        overflow-y: auto;
        padding-right: 8px; /* 为滚动条预留空间 */
    }

    /* 平板端侧边栏调整 */
    @media screen and (min-width: 769px) and (max-width: 1024px) {
        .sidebar-panel {
            top: 70px;
            height: calc(100vh - 70px - 50px); /* 减去底部信息栏高度 */
            width: 350px; /* 稍微减小宽度 */
            right: -350px;
        }
        
        .sidebar-panel.active {
            right: 0;
        }
        
        .sidebar-body {
            max-height: calc(100vh - 250px); /* 调整最大高度 */
        }
    }

    /* 移动端面板优化 */
    .mobile-panel {
        height: 85vh;
        border-radius: 0 0 16px 16px;
    }

    .mobile-panel-header {
        padding: var(--spacing-md);
    }

    .mobile-panel-title {
        font-size: 1.2rem;
    }

    .mobile-panel-content {
        padding: var(--spacing-md);
        height: calc(85vh - 70px);
    }

    .mobile-panel-text {
        font-size: 0.9rem;
        line-height: 1.6;
        text-indent: 2em;
        margin-bottom: var(--spacing-sm);
    }

    .mobile-panel-text:lang(en) {
        text-indent: 0;
    }

    .mobile-panel-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .mobile-panel-button-note {
        font-size: 0.8rem;
    }

    /* 底部信息栏优化 */
    .bottom-footer {
        padding: 0.8rem 0;
    }

    .footer-container {
        padding: 0 var(--spacing-sm);
    }

    .footer-text {
        font-size: 0.8rem;
        text-align: center;
        line-height: 1.5;
    }
}

/* 小屏移动端样式 (max-width: 480px) */
@media screen and (max-width: 480px) {
    :root {
        --spacing-xs: 0.3rem;
        --spacing-sm: 0.6rem;
        --spacing-md: 0.8rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.2rem;
        --spacing-xxl: 1.5rem;
    }

    .nav-container {
        padding: 0 var(--spacing-xs);
    }

    .logo {
        font-size: 1.1rem;
    }

    .mobile-panel-trigger {
        width: 20px;
        height: 20px;
    }

    .hamburger-line {
        width: 16px;
        height: 1.5px;
    }

    .lang-switch {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .main-content {
        padding: 4rem var(--spacing-xs) 3rem;
    }

    .main-title {
        font-size: clamp(1.2rem, 6vw, 1.6rem);
    }

    .main-subtitle {
        font-size: clamp(1rem, 5vw, 1.3rem);
    }

    .domain-text {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .cta-button {
        padding: 0.7rem 1.5rem;
        font-size: clamp(0.8rem, 3vw, 0.85rem);
        max-width: 240px;
        min-width: 160px;
    }

    .mobile-panel {
        height: 80vh;
    }

    .mobile-panel-content {
        height: calc(80vh - 70px);
        padding: var(--spacing-sm);
    }

    .mobile-panel-text {
        font-size: 0.85rem;
    }

    .footer-text {
        font-size: 0.75rem;
    }
}

/* 大屏桌面端样式 (min-width: 1440px) */
@media screen and (min-width: 1440px) {
    :root {
        --max-width: 1400px;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
        --spacing-xxl: 4rem;
    }

    .main-title {
        font-size: clamp(3rem, 5vw, 4rem);
    }

    .main-subtitle {
        font-size: clamp(2rem, 4vw, 3rem);
    }

    .domain-text {
        font-size: 1.3rem;
    }

    .cta-button {
        padding: 1.2rem 3rem;
        font-size: 1.2rem;
    }
}

/* 超宽屏样式 (min-width: 1920px) */
@media screen and (min-width: 1920px) {
    :root {
        --max-width: 1800px;
    }

    .main-title {
        font-size: clamp(3.5rem, 4vw, 5rem);
    }

    .main-subtitle {
        font-size: clamp(2.5rem, 3vw, 3.5rem);
    }

    .domain-text {
        font-size: 1.4rem;
    }
}

/* 响应式动画优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .cta-button:hover,
    .sidebar-button:hover,
    .mobile-panel-button:hover,
    .lang-switch:hover {
        transform: none;
    }

    .cta-button:active,
    .sidebar-button:active,
    .mobile-panel-button:active,
    .lang-switch:active {
        transform: scale(0.95);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #ffffff;
        --overlay-bg: rgba(0, 0, 0, 0.8);
        --text-overlay-bg: rgba(0, 0, 0, 0.9);
    }

    .domain-text,
    .sidebar-text,
    .mobile-panel-text {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    }
}

/* 横屏模式优化 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .main-content {
        padding: 3rem var(--spacing-sm) 2rem;
    }

    .mobile-panel {
        height: 90vh;
    }

    .mobile-panel-content {
        height: calc(90vh - 70px);
    }
}

/* 打印样式 */
@media print {
    .background-animation,
    .sidebar-panel,
    .mobile-panel-overlay,
    .top-nav,
    .bottom-footer {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .main-content {
        padding: 2rem 1rem;
        min-height: auto;
    }

    .domain-text {
        text-indent: 0 !important;
        color: black !important;
    }
}