/* ==================== 平板适配 (768px - 1024px) ==================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .carousel {
        height: 500px;
    }

    .carousel-caption h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .features-grid,
    .room-grid,
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .booking-form {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .navbar-brand-text {
        font-size: 1.25rem;
    }

    .navbar-nav {
        gap: var(--spacing-md);
    }
}

/* ==================== 手机适配 (< 768px) ==================== */
@media (max-width: 767px) {
    /* 导航栏 */
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-container {
        padding: 0 var(--spacing-md);
    }

    .navbar-brand-text {
        font-size: 1.125rem;
    }

    .navbar-brand-subtitle {
        display: none;
    }

    /* 轮播图 */
    .carousel {
        height: 350px;
    }

    .carousel-caption {
        width: 90%;
    }

    .carousel-caption h1 {
        font-size: 1.75rem;
    }

    .carousel-caption p {
        font-size: 1rem;
    }

    .carousel-indicators {
        bottom: var(--spacing-md);
    }

    .carousel-controls {
        display: none;
    }

    /* 预订模块 */
    .booking-section {
        margin-top: -30px;
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .booking-form {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .btn {
        width: 100%;
    }

    /* 特色模块 */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .feature-card {
        padding: var(--spacing-md);
    }

    .feature-icon {
        width: 48px;
        height: 48px;
    }

    .feature-title {
        font-size: 1rem;
    }

    .feature-description {
        font-size: 0.8125rem;
    }

    /* 客房卡片 */
    .room-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .room-image {
        height: 200px;
    }

    .room-content {
        padding: var(--spacing-md);
    }

    /* 评价卡片 */
    .reviews-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* 页脚 */
    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .footer-qr img {
        width: 120px;
        height: 120px;
    }

    /* 客服按钮 */
    .customer-service {
        right: var(--spacing-md);
        bottom: var(--spacing-md);
    }

    .chat-window {
        width: calc(100% - 2rem);
        right: 1rem;
        bottom: 80px;
    }

    /* 章节标题 */
    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9375rem;
    }
}

/* ==================== 大屏优化 (> 1400px) ==================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1440px;
    }

    .carousel {
        height: 700px;
    }

    .carousel-caption h1 {
        font-size: 4rem;
    }

    .section-title {
        font-size: 3rem;
    }
}

/* ==================== 横屏手机适配 ==================== */
@media (max-width: 767px) and (orientation: landscape) {
    .carousel {
        height: 300px;
    }

    .booking-section {
        margin-top: -20px;
        padding: var(--spacing-sm);
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .navbar,
    .customer-service,
    .booking-section,
    .carousel-controls {
        display: none;
    }

    body {
        background-color: white;
    }

    .carousel {
        height: 400px;
    }
}

/* ==================== 暗黑模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-cream: #1A1A1A;
        --bg-white: #2D2D2D;
        --text-dark: #FFFFFF;
        --text-gray: #B0B0B0;
        --text-light: #808080;
    }

    .navbar,
    .feature-card,
    .room-card,
    .review-card,
    .chat-window {
        background-color: var(--bg-white);
    }

    .form-input,
    .form-select {
        background-color: var(--bg-white);
        color: var(--text-dark);
        border-color: #404040;
    }
}

/* ==================== 触摸设备优化 ==================== */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .cs-button {
        min-height: 48px;
        min-width: 48px;
    }

    .carousel-control {
        width: 48px;
        height: 48px;
    }

    .chat-send-btn {
        width: 48px;
        height: 48px;
    }
}

/* ==================== 高分辨率屏幕优化 ==================== */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .feature-icon,
    .chat-avatar,
    .navbar-logo {
        image-rendering: -webkit-optimize-contrast;
    }
}
