/* ============================================
   Responsive Styles - Mobile First
   ============================================ */

/* Extra large screens */
@media (min-width: 1700px) {
    .about-grid {
        gap: var(--space-20);
    }
    
    .about-visual {
        width: 400px;
    }
    
    .about-content-wrapper {
        width: 800px;
    }
}

/* Large screens */
@media (max-width: 1400px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium screens - Tablet */
@media (max-width: 1024px) {
    .section {
        padding: var(--space-4);
    }
    
    .about-grid {
        flex-direction: column;
        gap: var(--space-6);
    }
    
    .about-visual {
        order: -1;
        width: auto;
    }
    
    .profile-card {
        max-width: 280px;
    }
    
    .skills-simple {
        gap: var(--space-6);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .main-nav {
        display: none;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* Small screens - Mobile */
@media (max-width: 1024px) {
    :root {
        --text-4xl: 1.75rem;
        --text-5xl: 2rem;
        --text-6xl: 2.5rem;
        --text-7xl: 3rem;
    }
    
    .section {
        padding: var(--space-3);
        padding-top: 70px;
    }
    
    /* Hero - 简化 */
    .hero-title {
        font-size: var(--text-3xl);
        line-height: 1.2;
        margin-bottom: var(--space-4);
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--space-6);
        line-height: 1.6;
    }
    
    .hero-actions {
        flex-direction: row;
        gap: var(--space-3);
        margin-bottom: var(--space-8);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-actions .btn {
        flex: 1;
        min-width: 120px;
        max-width: 160px;
        justify-content: center;
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }
    
    .hero-stats {
        display: none;
    }
    
    /* Section headers - 简化，全部左对齐 */
    .section-header {
        margin-bottom: var(--space-6);
        text-align: left !important;
    }
    
    .section-header .section-tag {
        justify-content: flex-start !important;
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .section-desc {
        font-size: var(--text-sm);
        text-align: left !important;
    }
    
    /* Works - 单列简化 */
    .works-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .work-image {
        height: 160px;
    }
    
    .work-info {
        padding: var(--space-3);
    }
    
    .work-title {
        font-size: var(--text-base);
    }
    
    .work-desc {
        font-size: var(--text-sm);
        display: none;
    }
    
    /* Skills - 简化，保持居中 */
    .section-skills .section-header {
        text-align: center !important;
    }
    
    .section-skills .section-header .section-tag {
        justify-content: center !important;
    }
    
    .section-skills .section-desc {
        text-align: center !important;
    }
    
    /* 关于我页面 - 隐藏 highlights */
    .about-highlights {
        display: none !important;
    }
    
    .skills-simple {
        gap: var(--space-4);
    }
    
    .skill-group h3 {
        font-size: var(--text-base);
        margin-bottom: var(--space-3);
    }
    
    .skill-tags {
        gap: var(--space-2);
    }
    
    .skill-tag {
        padding: var(--space-1) var(--space-3);
        font-size: var(--text-sm);
    }
    
    /* Contact - 简化 */
    .contact-notice {
        display: none;
    }
    
    .contact-item {
        max-width: 100%;
        padding: var(--space-3);
    }
    
    .contact-icon {
        width: 40px;
        height: 40px;
    }
    
    .social-links {
        margin-top: var(--space-4);
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .contact-form-wrapper {
        display: none;
    }
    
    /* 小屏横屏时显示联系信息 */
    .contact-links-landscape,
    .social-links-landscape {
        display: none;
    }
    
    /* Footer */
    .section-footer {
        margin-top: var(--space-6);
        padding-bottom: var(--space-4);
    }
    
    .section-footer p {
        font-size: var(--text-xs);
    }
    
    /* About - 简化 + 局部滚动 */
    .section-about .section-content {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding-right: var(--space-2);
        margin-right: calc(-1 * var(--space-2));
    }
    
    .section-about .section-content::-webkit-scrollbar {
        width: 4px;
    }
    
    .section-about .section-content::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .section-about .section-content::-webkit-scrollbar-thumb {
        background: var(--border-strong);
        border-radius: var(--radius-full);
    }
    
    .section-about .section-content::-webkit-scrollbar-thumb:hover {
        background: var(--text-tertiary);
    }
    
    .about-grid {
        display: flex;
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .about-visual {
        display: none;
    }
    
    .about-content-wrapper {
        max-width: 100%;
    }
    
    .about-content-scroll {
        overflow: visible;
    }
    
    .about-highlights {
        gap: var(--space-2);
    }
    
    .highlight-item {
        padding: var(--space-3);
    }
    
    .highlight-icon {
        width: 36px;
        height: 36px;
    }
    
    .highlight-content h4 {
        font-size: var(--text-sm);
    }
    
    .highlight-content p {
        font-size: var(--text-xs);
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .section {
        padding: var(--space-2);
        padding-top: 60px;
    }
    
    .hero-title {
        font-size: var(--text-2xl);
    }
    
    .logo span {
        display: none;
    }
    
    .work-image {
        height: 140px;
    }
}

/* Touch devices - 简化交互 */
@media (pointer: coarse) {
    .work-card {
        position: relative;
    }
    
    .work-overlay {
        opacity: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 70%);
        align-items: flex-end;
        padding: var(--space-3);
        transition: opacity 0.3s ease;
    }
    
    .work-card:active .work-overlay,
    .work-card:focus-within .work-overlay {
        opacity: 1;
    }
    
    .view-btn {
        transform: translateY(10px);
        width: 100%;
        justify-content: center;
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
        transition: transform 0.3s ease;
    }
    
    .work-card:active .view-btn,
    .work-card:focus-within .view-btn {
        transform: translateY(0);
    }
    
    .scroll-hint {
        display: none;
    }
    
    /* 小屏导航按钮 */
    .mobile-nav {
        position: fixed;
        right: var(--space-4);
        bottom: var(--space-20);
        display: none;
        flex-direction: column;
        gap: var(--space-2);
        z-index: 100;
    }
    
    /* 移动设备显示导航按钮 */
    body.is-mobile .mobile-nav {
        display: flex;
    }
    
    .mobile-nav-btn {
        width: 44px;
        height: 44px;
        border-radius: var(--radius-full);
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        color: var(--text-primary);
    }
    
    .mobile-nav-btn:hover {
        background: var(--glass-bg-hover);
        border-color: var(--glass-border-hover);
    }
    
    .mobile-nav-btn:active {
        transform: scale(0.95);
    }
    
    .mobile-nav-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .mobile-nav-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }
}

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

/* Landscape mode on mobile - higher max-height for modern phones */
@media (max-height: 700px) and (orientation: landscape) {
    .hero-stats {
        display: none;
    }
    
    .hero-actions {
        margin-bottom: var(--space-4);
    }
    
    .section-header {
        margin-bottom: var(--space-4);
    }
    
    /* Contact section in landscape - 左右布局：左边标题，右边联系方式 */
    .section-contact .section-content {
        position: relative !important;
    }
    
    .section-contact .section-content .contact-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas: "left right" !important;
        gap: var(--space-8) !important;
        align-items: start !important;
        padding-top: var(--space-8);
    }
    
    /* 左边：标题和描述 */
    .section-contact .section-content .contact-info {
        grid-area: left !important;
        display: flex !important;
        flex-direction: column !important;
        padding-top: 0 !important;
        margin-top: calc(-1 * var(--space-8)) !important;
        align-self: start !important;
    }
    
    .section-contact .section-content .contact-info .section-header {
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .section-contact .section-content .contact-info .section-header.centered .section-tag {
        justify-content: flex-start !important;
    }
    
    .section-contact .section-content .contact-info .section-desc {
        text-align: left !important;
        margin: 0 !important;
    }
    
    /* 隐藏提示 */
    .section-contact .section-content .contact-notice {
        display: none !important;
    }
    
    /* 隐藏左边的联系信息和社交链接 */
    .section-contact .section-content .contact-info .contact-links,
    .section-contact .section-content .contact-info .social-links {
        display: none !important;
    }
    
    /* 右边：显示联系信息和社交链接 */
    .section-contact .section-content .contact-form-wrapper {
        display: flex !important;
        flex-direction: column !important;
        grid-area: right !important;
        padding: 0 !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        gap: var(--space-3) !important;
    }
    
    .section-contact .section-content .contact-form-wrapper form {
        display: none !important;
    }
    
    /* 社交链接横排 */
    .section-contact .section-content .contact-form-wrapper .social-links-landscape {
        display: flex !important;
        flex-direction: row !important;
        gap: var(--space-3) !important;
        order: -1;
    }
    
    .section-contact .section-content .contact-form-wrapper .social-links-landscape .social-link {
        width: 36px !important;
        height: 36px !important;
    }
    
    /* 联系信息 */
    .section-contact .section-content .contact-form-wrapper .contact-links-landscape {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--space-2) !important;
    }
    
    .section-contact .section-content .contact-form-wrapper .contact-links-landscape .contact-item {
        padding: var(--space-2) !important;
    }
    
    .section-contact .section-content .contact-form-wrapper .contact-links-landscape .contact-icon {
        width: 32px !important;
        height: 32px !important;
    }
    
    .section-contact .section-footer {
        position: absolute;
        bottom: var(--space-4);
        left: 0;
        right: 0;
        margin-top: 0 !important;
        padding-bottom: 0 !important;
    }
}
