/* ========================================
   视觉小说工作室官网 - 响应式样式
   ======================================== */

/* --------------------
   大屏桌面 (1280px+)
   -------------------- */
@media (min-width: 1280px) {
    .hero-title {
        font-size: var(--text-7xl);
    }
    
    .works-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .team-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --------------------
   桌面 (1024px - 1279px)
   -------------------- */
@media (max-width: 1279px) {
    .hero-content {
        gap: var(--space-12);
    }
    
    .character-container {
        width: 350px;
        height: 440px;
    }
}

/* --------------------
   平板横屏 (768px - 1023px)
   -------------------- */
@media (max-width: 1023px) {
    :root {
        --nav-height: 3.5rem;
        --section-padding-y: 4rem;
    }
    
    /* 游戏区域在平板上的适配 */
    .game-preview {
        max-width: 720px;
    }
    
    .game-info {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .nav-menu {
        gap: var(--space-6);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-8);
    }
    
    .hero-text {
        order: 2;
    }
    
    .hero-character {
        order: 1;
    }
    
    .hero-title {
        font-size: var(--text-5xl);
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .character-container {
        width: 280px;
        height: 350px;
    }
    
    .speech-bubble {
        right: -20px;
        max-width: 180px;
    }
    
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-container {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .contact-info {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .info-card {
        flex: 1;
        min-width: 200px;
    }
}

/* --------------------
   平板竖屏 (640px - 767px)
   -------------------- */
@media (max-width: 767px) {
    :root {
        --container-padding: 1rem;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--space-8);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-link {
        font-size: var(--text-xl);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
    
    .section-title {
        font-size: var(--text-3xl);
    }
    
    .works-grid {
        grid-template-columns: 1fr;
    }
    
    .works-filter {
        gap: var(--space-2);
    }
    
    .filter-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .recruit-options {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        flex-direction: column;
    }
    
    .info-card {
        min-width: auto;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: var(--space-4);
    }
}

/* --------------------
   手机 (小于640px)
   -------------------- */
@media (max-width: 639px) {
    :root {
        --section-padding-y: 3rem;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-actions {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .character-container {
        width: 240px;
        height: 300px;
    }
    
    .speech-bubble {
        position: relative;
        top: auto;
        right: auto;
        margin-top: var(--space-4);
        max-width: 100%;
    }
    
    .speech-bubble::before {
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        top: -10px;
        bottom: auto;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .section-header {
        margin-bottom: var(--space-10);
    }
    
    .section-label {
        font-size: var(--text-xs);
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .section-desc {
        font-size: var(--text-base);
    }
    
    .work-card {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .recruit-card {
        padding: var(--space-6);
    }
    
    .dialog-box {
        padding: var(--space-4);
    }
    
    .easter-egg-modal .modal-content {
        padding: var(--space-6);
        margin: var(--space-4);
    }
    
    .theater-scene h3 {
        font-size: var(--text-xl);
    }
    
    /* 灵动岛移动端适配 */
    .main-nav.scrolled {
        width: calc(100% - 32px);
        max-width: 400px;
    }
}

/* --------------------
   小屏手机 (小于380px)
   -------------------- */
@media (max-width: 379px) {
    .hero-title {
        font-size: var(--text-2xl);
    }
    
    .nav-logo .logo-text {
        display: none;
    }
    
    .character-container {
        width: 200px;
        height: 250px;
    }
    
    .section-title {
        font-size: var(--text-xl);
    }
}

/* --------------------
   触控设备优化
   -------------------- */
@media (hover: none) and (pointer: coarse) {
    .hover-lift:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .hover-scale:hover {
        transform: none;
    }
    
    .hover-rotate:hover {
        transform: none;
    }
    
    .team-card:hover .team-card-inner {
        transform: none;
    }
    
    .team-card-inner {
        transform: none !important;
    }
    
    .team-card-back {
        display: none;
    }
    
    .speech-bubble {
        opacity: 1;
        transform: none;
    }
}

/* --------------------
   高DPI屏幕优化
   -------------------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .pattern-overlay {
        background-size: 30px 30px;
    }
}

/* --------------------
   横屏手机优化
   -------------------- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: calc(var(--nav-height) + var(--space-8)) 0 var(--space-8);
    }
    
    .character-container {
        width: 180px;
        height: 225px;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* --------------------
   打印样式
   -------------------- */
@media print {
    .sakura-canvas,
    .loading-screen,
    .main-nav,
    .scroll-indicator,
    .hero-character,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .hero-section {
        min-height: auto;
        padding: var(--space-8) 0;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .work-card,
    .team-card,
    .recruit-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* --------------------
   减少动画偏好
   -------------------- */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .character-glow {
        animation: none;
    }
    
    .loading-screen {
        display: none;
    }
}

/* --------------------
   深色模式支持
   -------------------- */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
        color: #e8e8e8;
    }
    
    .section-title {
        color: #f8f8f8;
    }
    
    .hero-title {
        color: #f8f8f8;
    }
    
    .work-card,
    .team-card-front,
    .recruit-card,
    .dialog-box {
        background: rgba(30, 30, 46, 0.9);
        color: #e8e8e8;
    }
    
    .nav-link {
        color: #e8e8e8;
    }
}
