/* 移动端优化样式 */

/* 针对小屏幕设备的额外优化 */
@media (max-width: 480px) {
    /* 字体大小调整 */
    body {
        font-size: 13px;
    }
    
    /* 导航栏 */
    .navbar .logo {
        font-size: 16px;
    }
    
    .navbar nav ul {
        gap: 8px;
    }
    
    .navbar nav a {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* 页面标题 */
    .page-title {
        font-size: 20px;
    }
    
    .page-subtitle {
        font-size: 12px;
    }
    
    /* 按钮 */
    .btn {
        padding: 7px 16px;
        font-size: 12px;
    }
    
    .btn-large {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-small {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    /* 卡片 */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .card-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    /* 表单 */
    .form-control {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .form-label {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    /* 功能卡片 */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
        border-radius: 12px;
    }
    
    .feature-title {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .feature-description {
        font-size: 11px;
    }
    
    /* 上传区域 */
    .upload-area {
        padding: 30px 20px;
    }
    
    .upload-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .upload-text {
        font-size: 13px;
    }
    
    /* 模态框 */
    .modal-content {
        padding: 24px;
        width: 95%;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    /* 表格 */
    .admin-table,
    .records-table {
        font-size: 11px;
    }
    
    .admin-table th,
    .admin-table td,
    .records-table th,
    .records-table td {
        padding: 8px;
    }
    
    /* 图片网格 */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .gallery-image {
        height: 150px;
    }
    
    /* 资源网格 */
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .resource-thumbnail {
        height: 120px;
    }
    
    /* 画册网格 */
    .brochure-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* 筛选器 */
    .filter-section {
        padding: 16px;
    }
    
    .filter-title {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .tag {
        font-size: 10px;
        padding: 3px 10px;
    }
    
    /* 步骤指示器 */
    .step-indicator {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .step {
        width: 100%;
        justify-content: center;
    }
    
    /* 控制按钮 */
    .controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .controls .btn {
        width: 100%;
    }
    
    /* 灯箱 */
    .lightbox-image {
        max-width: 95%;
        max-height: 80%;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 36px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    /* 管理后台 */
    .admin-sidebar {
        width: 60px;
    }
    
    .admin-main {
        margin-left: 60px;
    }
    
    .sidebar-header h2,
    .nav-item span:last-child {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .admin-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .admin-header h1 {
        font-size: 18px;
    }
    
    .admin-content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增加可点击区域 */
    .btn,
    .tag,
    .nav-item,
    .feature-card,
    .gallery-item,
    .resource-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 禁用悬停效果 */
    .card:hover,
    .feature-card:hover,
    .gallery-item:hover,
    .resource-item:hover {
        transform: none;
    }
    
    /* 优化表单输入 */
    .form-control {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .page-header {
        padding: 20px 0 15px;
    }
    
    .page-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        max-height: 85vh;
    }
}

/* 平板设备优化 */
@media (min-width: 481px) and (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .resource-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .brochure-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 滚动优化 */
@media (max-width: 768px) {
    /* 更平滑的滚动 */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 隐藏滚动条但保持功能 */
    .modal-content,
    .admin-sidebar {
        scrollbar-width: thin;
    }
    
    .modal-content::-webkit-scrollbar,
    .admin-sidebar::-webkit-scrollbar {
        width: 4px;
    }
    
    .modal-content::-webkit-scrollbar-thumb,
    .admin-sidebar::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
}

/* 防止文本选择（提升触摸体验） */
@media (max-width: 768px) {
    .btn,
    .tag,
    .nav-item,
    .feature-card,
    .modal-close,
    .lightbox-close,
    .lightbox-nav {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
}

