/* =========================================
   TP官方下载网站 - 响应式样式
   ========================================= */

/* 大屏幕：1200px以上 */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* 中等屏幕：992px - 1199px */
@media (max-width: 1199px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .container {
        gap: 3rem;
    }
    
    .features-grid,
    .news-grid,
    .download-grid,
    .protocols-grid,
    .dex-grid,
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 平板：768px - 991px */
@media (max-width: 991px) {
    /* 导航菜单响应式 */
    .mobile-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--box-shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* 英雄区域响应式 */
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-image {
        order: -1;
    }
    
    .hero-image img {
        max-width: 300px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    /* 通用响应式调整 */
    .features-grid,
    .news-grid,
    .download-grid,
    .protocols-grid,
    .dex-grid,
    .team-grid,
    .tutorial-grid {
        grid-template-columns: 1fr;
    }
    
    .mission-values,
    .stats-grid,
    .security-features,
    .contact-methods {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .defi-stats,
    .dex-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    
    .stat-item .number {
        font-size: 2rem;
    }
}

/* 手机：576px - 767px */
@media (max-width: 767px) {
    /* 基础调整 */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* 英雄区域调整 */
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* 通用卡片调整 */
    .feature-card,
    .platform-card,
    .news-card,
    .protocol-card,
    .dex-card,
    .team-member,
    .tutorial-step {
        padding: 1.5rem;
    }
    
    /* 教程页面调整 */
    .tutorial-step {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto;
    }
    
    /* DeFi页面调整 */
    .defi-stats,
    .dex-stats {
        gap: 1rem;
    }
    
    .stat-item .number {
        font-size: 1.5rem;
    }
    
    .stat-item .label {
        font-size: 0.9rem;
    }
    
    /* DEX页面调整 */
    .swap-container {
        padding: 1.5rem;
    }
    
    .token-select {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .amount-input,
    .amount-output {
        width: 100%;
        text-align: left;
    }
    
    .swap-details {
        padding: 1rem;
    }
    
    /* 新闻页面调整 */
    .news-categories {
        justify-content: center;
    }
    
    .category-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        border-radius: var(--border-radius);
    }
    
    .newsletter-form input {
        margin-bottom: 1rem;
    }
    
    /* 关于页面调整 */
    .mission-values,
    .stats-grid,
    .security-features,
    .contact-methods {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 10px;
    }
    
    .timeline-item {
        padding-left: 40px;
    }
    
    .timeline-date {
        width: 80px;
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* 页脚调整 */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
}

/* 小手机：小于576px */
@media (max-width: 575px) {
    /* 基础调整 */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* 按钮调整 */
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .btn-large {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    /* 卡片内边距调整 */
    .card,
    .feature-card,
    .platform-card,
    .news-card,
    .protocol-card,
    .dex-card,
    .team-member {
        padding: 1.25rem;
    }
    
    /* 教程页面调整 */
    .tutorial-section {
        padding: 1.5rem;
    }
    
    .nav-steps {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-steps .step {
        text-align: center;
    }
    
    /* 文章元信息调整 */
    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* 交易模拟器调整 */
    .swap-from,
    .swap-to {
        padding: 1rem;
    }
    
    /* 社交链接调整 */
    .social-links {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .social-link {
        padding: 0.4rem 1rem;
    }
}

/* 超小屏幕：小于375px */
@media (max-width: 374px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero .subtitle {
        font-size: 0.9rem;
    }
    
    .stat .number {
        font-size: 1.5rem;
    }
    
    .stat .label {
        font-size: 0.8rem;
    }
    
    .news-article,
    .news-detail {
        padding: 1rem;
    }
    
    .article-features {
        flex-wrap: wrap;
    }
    
    .feature-tag {
        font-size: 0.7rem;
    }
}

/* 打印样式 */
@media print {
    #mainHeader,
    #mainFooter,
    .hero-buttons,
    .mobile-toggle,
    .newsletter-section,
    .social-links {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        color: black !important;
        text-decoration: none !important;
    }
    
    .card,
    .feature-card,
    .platform-card,
    .news-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .hero {
        background: white !important;
        color: black !important;
        padding: 1rem 0 !important;
    }
    
    .hero h1 {
        color: black !important;
    }
}

/* 黑暗模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #f8f9fa;
        --light: #1a1a2e;
        --gray-lighter: #2d2d44;
        --white: #2d2d44;
        --black: #ffffff;
    }
    
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .card,
    .feature-card,
    .platform-card,
    .news-card {
        background-color: var(--white);
        color: var(--dark);
    }
    
    .warning-box {
        background: #332701;
        border-color: #b38f00;
    }
    
    .tip-box {
        background: #0c5460;
        border-color: #17a2b8;
    }
    
    .code-block {
        background: #0d1117;
        color: #c9d1d9;
    }
}