/* 响应式设计 */

/* 大屏幕设备 (1200px+) */
@media (min-width: 1200px) {
    .navbar-container {
        max-width: 1400px;
    }
    
    .profile-card {
        max-width: 600px;
        padding: 4rem 3rem;
    }
    
    .profile-name {
        font-size: 3rem;
    }
    
    .avatar {
        width: 140px;
        height: 140px;
    }
}

/* 平板设备 (768px - 1199px) */
@media (max-width: 1199px) {
    .navbar-container {
        padding: 0 1.5rem;
    }
    
    .desktop-nav {
        gap: 1.5rem;
    }
    
    .nav-link {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    .profile-card {
        max-width: 450px;
        padding: 2.5rem 2rem;
    }
}

/* 移动设备 (768px以下) */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    /* 顶部导航栏移动端适配 */
    .top-navbar {
        height: 70px;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
        gap: 10px;
    }
    
    .brand-logo {
        width: 35px;
        height: 35px;
    }
    
    /* 隐藏桌面导航，显示移动端菜单按钮 */
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
    
    /* 移动端导航菜单 */
    .mobile-nav {
        top: 70px;
    }
    
    .mobile-nav-content {
        padding: 0.5rem;
    }
    
    .mobile-nav-link {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    /* 主容器移动端适配 */
    .container {
        min-height: calc(100vh - 70px);
        padding: 1rem;
        justify-content: flex-start;
        padding-top: 2rem;
    }
    
    /* 个人资料卡片移动端适配 */
    .profile-card {
        max-width: 100%;
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: 20px;
    }
    
    .avatar-container {
        margin-bottom: 1.5rem;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .profile-name {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .profile-subtitle {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    /* 社交链接移动端适配 */
    .social-links {
        gap: 1rem;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
    }
    
    .social-link i {
        font-size: 1.2rem;
    }
    
    /* 页脚移动端适配 */
    .footer {
        padding: 1.5rem 0;
        font-size: 0.85rem;
    }
    
    /* 返回顶部按钮移动端适配 */
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
}

/* 小屏幕移动设备 (480px以下) */
@media (max-width: 480px) {
    body {
        padding-top: 65px;
    }
    
    .top-navbar {
        height: 65px;
    }
    
    .navbar-container {
        padding: 0 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
        gap: 8px;
    }
    
    .brand-logo {
        width: 32px;
        height: 32px;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        padding: 6px;
    }
    
    .hamburger-line {
        width: 22px;
        height: 2px;
    }
    
    .mobile-nav {
        top: 65px;
    }
    
    .container {
        min-height: calc(100vh - 65px);
        padding: 0.75rem;
        padding-top: 1.5rem;
    }
    
    .profile-card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }
    
    .avatar {
        width: 90px;
        height: 90px;
    }
    
    .profile-name {
        font-size: 1.8rem;
    }
    
    .profile-subtitle {
        font-size: 0.9rem;
    }
    
    .social-links {
        gap: 0.8rem;
    }
    
    .social-link {
        width: 42px;
        height: 42px;
    }
    
    .social-link i {
        font-size: 1.1rem;
    }
    
    .footer {
        padding: 1rem 0;
        font-size: 0.8rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 42px;
        height: 42px;
    }
}

/* 超小屏幕设备 (360px以下) */
@media (max-width: 360px) {
    .navbar-container {
        padding: 0 0.5rem;
    }
    
    .container {
        padding: 0.5rem;
        padding-top: 1rem;
    }
    
    .profile-card {
        padding: 1.25rem 0.75rem;
    }
    
    .avatar {
        width: 80px;
        height: 80px;
    }
    
    .profile-name {
        font-size: 1.6rem;
    }
    
    .social-links {
        gap: 0.6rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
}

/* 横屏模式适配 */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding-top: 60px;
    }
    
    .top-navbar {
        height: 60px;
    }
    
    .mobile-nav {
        top: 60px;
    }
    
    .container {
        min-height: calc(100vh - 60px);
        padding-top: 1rem;
    }
    
    .profile-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .avatar-container {
        margin-bottom: 1rem;
    }
    
    .avatar {
        width: 80px;
        height: 80px;
    }
    
    .profile-name {
        font-size: 1.8rem;
    }
    
    .social-links {
        margin-bottom: 1rem;
    }
    
    .footer {
        padding: 1rem 0;
    }
}

/* 高分辨率屏幕适配 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .brand-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-link:hover,
    .social-link:hover,
    .theme-toggle:hover,
    .back-to-top:hover {
        transform: none;
    }
    
    .nav-link:active,
    .social-link:active,
    .theme-toggle:active,
    .back-to-top:active {
        transform: scale(0.95);
    }
    
    .avatar:hover {
        transform: scale(1.05) rotate(360deg) !important;
    }
    
    .avatar:active {
        transform: scale(0.95) rotate(360deg) !important;
    }
}

/* 减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particles {
        display: none;
    }
    
    /* 保持头像环动画 */
    .avatar-ring {
        animation: avatarRotate 2s linear infinite !important;
    }
}

/* 打印样式 */
@media print {
    .top-navbar,
    .theme-toggle,
    .back-to-top,
    .mobile-nav,
    .particles {
        display: none !important;
    }
    
    body {
        padding-top: 0;
        background: white !important;
        color: black !important;
    }
    
    .background {
        display: none;
    }
    
    .profile-card {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .social-links {
        display: none;
    }
}

/* 可访问性增强 */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
        --border: 2px solid #000;
    }
    
    .nav-link,
    .social-link,
    .theme-toggle {
        border: 2px solid currentColor;
    }
}

/* 焦点可见性增强 */
@media (prefers-reduced-motion: no-preference) {
    .nav-link:focus,
    .social-link:focus,
    .theme-toggle:focus,
    .mobile-menu-toggle:focus,
    .back-to-top:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}