/* =========================================
   RESPONSIVE SYSTEM - WEDDING INVITATION
   ========================================= */

/* --- 1. 基础全局适配 --- */
:root {
    --header-height: 84px;
}

@media (max-width: 1400px) {
    .container-fluid { width: 100% !important; }
}

/* --- 2. 桌面/平板过渡 (1100px - 1360px) --- */
@media (max-width: 1360px) {
    .hero-container {
        grid-template-columns: 1fr 2fr 1fr;
    }
    .hero-character img { width: min(100%, 540px); }
    .hero-character-left { transform: translateX(-8%); }
    .hero-character-right { transform: translateX(8%); }
}

@media (max-width: 1100px) {
    .details-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .blessing-list {
        column-count: 2;
    }
    .dream-gallery-shell {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .dream-gallery-left {
        position: relative;
        top: 0;
    }
    .dream-gallery-stage {
        max-width: 500px;
        margin: 0 auto;
    }
}

/* --- 3. 核心布局转折点 (860px) --- 
   此阶段导航控制器从侧边点控转为手机菜单 */
@media (max-width: 860px) {
    :root { --header-height: 72px; }

    /* 导航栏重塑 - 浮窗菜单 */
    .site-nav-controller {
        position: fixed;
        top: 80px;
        right: 20px;
        left: 20px;
        bottom: auto;
        transform: translateY(-20px) scale(0.95);
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 20px;
        border-radius: 28px;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(20px) saturate(160%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 99;
    }

    .site-nav-controller.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .site-nav-controller::before, 
    .site-nav-controller::after { display: none; }

    .controller-link {
        width: 100%;
        background: rgba(255, 255, 255, 0.5);
        border: 1px solid rgba(232, 203, 210, 0.3);
        border-radius: 16px;
        padding: 10px;
        justify-content: flex-start;
        gap: 12px;
    }

    .controller-link .controller-text {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-soft);
    }

    .controller-link::before { display: none; } /* 隐藏气泡提示 */

    /* 手机版 Hamburger 按钮显示 */
    .nav-toggle {
        display: none;
    }

    /* 布局压平 */
    .hero-container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .hero-content {
        order: 1;
        width: 100%;
        padding: 40px 24px;
    }

    .hero-character {
        order: 2;
        min-height: auto;
        width: 88%;
        justify-content: center;
    }

    .hero-character img {
        width: min(45vw, 240px);
    }

    .hero-character-left { transform: translateX(10%) rotate(-5deg); }
    .hero-character-right { transform: translateX(-10%) rotate(5deg); margin-top: -30px; }

    .rsvp-grid, .blessing-top {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* --- 4. 标准手机适配 (640px) --- */
@media (max-width: 640px) {
    .section-shell { padding: 70px 0; }

    /* 字体流体化 */
    .hero-title {
        font-size: clamp(34px, 9vw, 52px);
    }

    .section-heading h2 {
        font-size: 2.2rem;
    }

    /* 故事轴简化 */
    .chapter-journey::before { left: 20px; }
    .chapter-row::before { left: 20px; }
    
    .chapter-row, .chapter-row.is-reverse {
        grid-template-columns: 1fr;
        padding-left: 0px;
        justify-items: center;
    }

    .chapter-figure-frame {
        max-width: 260px;
        margin: 0 auto 1.5rem 0;
    }

    .chapter-panel {
        padding: 20px;
    }

    .chapter-panel-body { padding-left: 0; }
    .chapter-no { position: relative; top: 0; font-size: 2.4rem; display: block; margin-bottom: 5px; }

    /* 流程步骤优化 */
    .schedule-step, .schedule-step.is-reverse {
        grid-template-columns: 175px 1fr;
        gap: 15px;
    }

    .schedule-step-card { padding: 18px 14px; }
    .schedule-step-card h3 { font-size: 1.2rem; }
    .schedule-step-time { font-size: 1.1rem; }

    /* 移除手机上复杂的 S 型连接线，改为简洁视觉 */
    .schedule-step:not(:last-child)::after {
        width: 2px;
        height: 30px;
        left: 185px;
        bottom: -25px;
        background: var(--pink);
        transform: none;
    }

    /* 相册卡片适配 */
    .dream-gallery-thumbs {
        grid-template-columns: repeat(2, 1fr);
    }

    .dream-gallery-thumb {
        grid-template-columns: 1fr;
        padding: 8px;
        text-align: center;
    }

    .dream-gallery-thumb-media { width: 100%; margin-bottom: 8px; }
    .dream-gallery-thumb-copy { display: none; } /* 极窄屏隐藏缩略图文字 */

    /* 音乐切换器精简 */
    .music-toggle {
        top: 15px;
        right: 15px;
        padding: 10px;
    }
    .music-text { display: none; }
}

/* --- 5. 小屏手机微调 (430px) --- */
@media (max-width: 430px) {
    .container { width: calc(100% - 1.5rem); }

    .hero-badge span { font-size: 10px; letter-spacing: 0.15em; }

    .hero-tags span { font-size: 11px; padding: 6px 12px; }

    .hero-actions .btn { min-width: 100%; }

    .blessing-list { column-count: 1; }

    .final-signature { font-size: 1.2rem; }
}

/* --- 6. 性能与减速模式 --- */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
    .reveal, .fade-up {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}