/* ================================
   m_default14 - 响应式样式
   移动端适配，防止横向溢出
   ================================ */

/* ================================
   平板设备 (768px - 1024px)
   ================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    .content-section {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .hero-title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: clamp(1rem, 2vw, 1.25rem);
    }

    .guest-card {
        width: 200px;
    }

    .guest-avatar {
        width: 100px;
        height: 100px;
    }
}

/* ================================
   移动设备 (< 768px)
   ================================ */
@media (max-width: 767px) {
    /* ================================
       关键：防止横向溢出
       ================================ */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        position: relative;
    }

    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ================================
       顶部通栏
       ================================ */
    .topbar {
        padding: 0 var(--spacing-sm);
        height: 56px;
    }

    :root {
        --topbar-height: 56px;
    }

    .topbar-logo {
        font-size: var(--font-size-base);
    }

    .topbar-logo img {
        height: 32px;
    }

    .hamburger-btn {
        display: flex;
    }

    /* ================================
       左侧导航变为抽屉式
       ================================ */
    .sidebar-wrapper {
        transform: translateX(-100%);
        width: 280px;
        z-index: var(--z-modal);
        box-shadow: var(--shadow-xl);
    }

    .sidebar-wrapper.active {
        transform: translateX(0);
    }

    /* 遮罩层显示 */
    .sidebar-overlay {
        display: block;
    }

    /* ================================
       主内容区占满宽度
       ================================ */
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* ================================
       容器调整为全宽
       ================================ */
    .container,
    .container-fluid {
        padding: 0 var(--spacing-sm);
    }

    /* ================================
       Hero 区域
       ================================ */
    .hero-section {
        height: calc(100vh - 56px);
        min-height: 400px;
    }

    .hero-overlay {
        padding: var(--spacing-md);
    }

    .hero-content {
        padding: 0 var(--spacing-sm);
    }

    .hero-title {
        font-size: clamp(1.25rem, 6vw, 2rem);
    }

    .hero-subtitle {
        font-size: clamp(0.875rem, 3vw, 1rem);
        margin-bottom: var(--spacing-md);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
    }

    .btn-hero {
        width: 100%;
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-base);
    }

    .hero-countdown {
        position: relative;
        bottom: auto;
        right: auto;
        margin: var(--spacing-md) auto 0;
        padding: var(--spacing-md);
        max-width: 300px;
    }

    .hero-countdown-number {
        font-size: var(--font-size-3xl);
    }

    /* ================================
       内容区块
       ================================ */
    .content-section {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .section-header {
        margin-bottom: var(--spacing-lg);
        padding: 0 var(--spacing-sm);
    }

    .section-title {
        font-size: var(--font-size-xl);
    }

    .section-subtitle {
        font-size: var(--font-size-base);
    }

    /* ================================
       新闻列表
       ================================ */
    .news-item {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-md);
    }

    .news-date {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding-right: 0;
        padding-bottom: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }

    .news-content {
        padding-left: 0;
    }

    /* ================================
       演讲嘉宾
       ================================ */
    .guests-scroll {
        gap: var(--spacing-md);
        padding: var(--spacing-sm);
    }

    .guest-card {
        width: 160px;
        padding: var(--spacing-md);
    }

    .guest-avatar {
        width: 80px;
        height: 80px;
    }

    .guest-name {
        font-size: var(--font-size-base);
    }

    .guest-title,
    .guest-bio {
        font-size: var(--font-size-xs);
    }

    /* ================================
       日期卡片
       ================================ */
    .dates-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .date-card {
        padding: var(--spacing-md);
    }

    .date-card-value {
        font-size: var(--font-size-xl);
    }

    /* ================================
       侧边栏内容
       ================================ */
    .sidebar-content-section {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .sidebar-content-card {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    /* ================================
       页脚
       ================================ */
    .footer {
        padding: var(--spacing-sm) 0 0;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .footer-bottom {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs) var(--spacing-sm) 0;
        text-align: center;
    }

    /* ================================
       按钮组
       ================================ */
    .btn-group {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* ================================
       卡片
       ================================ */
    .card {
        border-radius: var(--radius-md);
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: var(--spacing-md);
    }

    /* ================================
       语言切换器
       ================================ */
    .lang-switcher {
        transform: scale(0.9);
    }

    .lang-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
}

/* ================================
   小屏手机 (< 480px)
   ================================ */
@media (max-width: 479px) {
    :root {
        --sidebar-width: 100%;
    }

    .sidebar-wrapper {
        width: 100%;
        max-width: 300px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.875rem;
    }

    .hero-countdown {
        padding: var(--spacing-sm);
        max-width: 250px;
    }

    .hero-countdown-number {
        font-size: var(--font-size-2xl);
    }

    .guest-card {
        width: 140px;
        padding: var(--spacing-sm);
    }

    .guest-avatar {
        width: 70px;
        height: 70px;
    }

    /* 超小屏幕隐藏非关键元素 */
    .hero-countdown-label {
        font-size: var(--font-size-xs);
    }

    .section-subtitle {
        display: none;
    }
}

/* ================================
   大屏设备 (>= 1400px)
   ================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .guest-card {
        width: 240px;
    }

    .guest-avatar {
        width: 140px;
        height: 140px;
    }
}

/* ================================
   打印样式
   ================================ */
@media print {
    .topbar,
    .sidebar-wrapper,
    .sidebar-overlay,
    .hamburger-btn,
    .hero-countdown,
    .btn,
    .footer-bottom {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body {
        background-color: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* ================================
   横屏模式优化
   ================================ */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        min-height: 600px;
    }

    .hero-content {
        transform: scale(0.9);
    }
}

/* ================================
   深色模式支持（可选）
   ================================ */
@media (prefers-color-scheme: dark) {
    /* 暂留深色模式样式，可根据需要启用 */
}

/* ================================
   减少动画模式
   ================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ================================
   高对比度模式
   ================================ */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--text-primary);
    }

    .btn {
        border-width: 2px;
    }
}
