/* 移动端响应式优化 */

/* 平板适配 */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机适配 */
@media (max-width: 768px) {
    /* 侧边栏改为底部导航 */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        top: auto;
        flex-direction: row;
        padding: 8px 0;
        z-index: 1000;
    }
    
    .sidebar-header,
    .sidebar-footer,
    .nav-title {
        display: none;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        padding: 0;
    }
    
    .nav-section {
        display: contents;
    }
    
    .nav-item {
        flex-direction: column;
        padding: 8px 12px;
        margin: 0;
        gap: 4px;
    }
    
    .nav-icon {
        font-size: 20px;
        width: auto;
    }
    
    .nav-text {
        font-size: 11px;
        margin: 0;
    }
    
    .nav-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        padding: 2px 6px;
        font-size: 10px;
    }
    
    /* 主内容区调整 */
    .main-content {
        margin-left: 0;
        margin-bottom: 70px;
    }
    
    /* 顶部栏简化 */
    .top-bar {
        padding: 10px 15px;
        height: auto;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .search-box {
        display: none;
    }
    
    /* 统计卡片单列 */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    /* 仪表盘单列 */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    /* 任务列表简化 */
    .task-list-header {
        display: none;
    }
    
    .task-item {
        grid-template-columns: 40px 1fr 30px;
        padding: 12px;
    }
    
    .task-platform,
    .task-time {
        display: none;
    }
    
    /* 快速操作区调整 */
    .quick-actions-section {
        gap: 15px;
    }
    
    .platform-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .create-buttons {
        gap: 8px;
    }
    
    .create-btn {
        padding: 10px;
    }
    
    .create-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    /* 内容卡片单列 */
    .content-grid,
    .knowledge-grid,
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    /* 日历调整 */
    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .day-event {
        font-size: 9px;
        padding: 1px 2px;
    }
    
    /* 模态框全屏 */
    .modal-overlay .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    /* 筛选器横向滚动 */
    .task-filters,
    .content-filters,
    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 提词器全屏优化 */
    .teleprompter-container.fullscreen .control-bar {
        display: none;
    }
    
    /* 客户咨询统计简化 */
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-box {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    /* 隐藏一些次要信息 */
    .usage-count,
    .template-category {
        font-size: 10px;
    }
    
    /* 触摸优化 */
    button,
    .nav-item,
    .task-card,
    .content-card,
    .template-card {
        min-height: 44px;
    }
    
    /* 输入框优化 */
    input,
    select,
    textarea {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

/* 小屏手机 */
@media (max-width: 375px) {
    .page-container {
        padding: 15px;
    }
    
    .nav-text {
        font-size: 10px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

/* 横屏模式 */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        height: 50px;
    }
    
    .main-content {
        margin-bottom: 50px;
    }
    
    .nav-text {
        display: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a2e;
        color: #fff;
    }
    
    .dashboard-card,
    .task-card,
    .content-card,
    .template-card,
    .knowledge-card {
        background: #16213e;
        color: #fff;
    }
    
    .sidebar {
        background: linear-gradient(180deg, #0f0f23 0%, #1a1a3e 100%);
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    .top-bar,
    .control-bar,
    .template-actions,
    .consultation-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* 动画性能优化 */
.task-card,
.content-card,
.template-card,
.knowledge-card {
    will-change: transform;
    transform: translateZ(0);
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
