/* ==================== 手机端响应式布局 ==================== */

/* ---- 全局 ---- */
@media (max-width: 768px) {
    html, body { overflow-x: hidden !important; overflow-y: auto !important; height: auto !important; }
    body { font-size: 14px; }
    * { max-width: 100vw !important; }
    input, button, select, textarea { font-size: 16px !important; }
    button, .btn, [onclick] { min-height: 44px; min-width: 44px; cursor: pointer; }
    table { font-size: 12px; display: block; overflow-x: auto; }
    table th, table td { padding: 6px 8px; }
    .header { height: auto !important; padding: 12px 10px !important; flex-wrap: wrap; }
    .header h1 { font-size: 16px !important; max-width: 100% !important; }
    .header-logo { position: static !important; transform: none !important; height: 36px !important; margin-bottom: 5px; }
    .header-logo img { height: 36px !important; max-width: 120px !important; }
    .user-controls { position: static !important; transform: none !important; gap: 8px !important; }
    .cards-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
    .stats-card { grid-template-columns: 1fr 1fr !important; }
    .card { padding: 14px !important; min-height: auto !important; height: auto !important; margin-bottom: 12px !important; border-width: 2px !important; border-radius: 12px !important; }
    .card-title { font-size: 16px !important; margin-bottom: 12px !important; padding-left: 12px !important; border-left-width: 4px !important; }
    .chart { min-height: 200px !important; width: 100% !important; }
    .container { padding: 12px !important; gap: 16px !important; height: auto !important; overflow: visible !important; }
    .realtime-clock { min-width: auto !important; padding: 6px 10px !important; font-size: 12px !important; }
    .clock-time { font-size: 14px !important; }
    .stat-value { font-size: 24px !important; }
    .stat-label { font-size: 13px !important; }
    .stat-sublabel { font-size: 10px !important; }
    [style*=\"overflow: hidden\"] { overflow-y: auto !important; }
    /* 板块分隔增强 */
    .card + .card { margin-top: 4px !important; }
    section, .section-block, .module-block { margin-bottom: 20px !important; padding-bottom: 10px !important; border-bottom: 2px solid rgba(0,255,255,0.15) !important; }
    hr { border-color: rgba(0,255,255,0.2) !important; margin: 16px 0 !important; }
}

/* ---- 手机小屏 ---- */
@media (max-width: 480px) {
    .stats-card { grid-template-columns: 1fr !important; }
    .landuse-legend { grid-template-columns: repeat(2, 1fr) !important; max-height: 180px !important; }
    .header h1 { font-size: 14px !important; letter-spacing: 0 !important; }
}

/* ---- 欢迎页 ---- */
@media (max-width: 768px) {
    .content-wrapper { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .ppt-cover { min-height: auto !important; padding: 2rem 1rem !important; }
    .hero { flex-direction: column !important; text-align: center !important; padding: 2rem 1rem !important; }
    .hero-content { max-width: 100% !important; }
    .hero h1 { font-size: 2rem !important; letter-spacing: -1px !important; white-space: normal !important; }
    .hero p { font-size: 0.95rem !important; max-width: 100% !important; }
    .hero-stats { flex-direction: row !important; justify-content: space-around !important; gap: 0.5rem !important; flex-wrap: wrap !important; }
    .hero-stats .stat-item { padding: 0.8rem 0.5rem !important; }
    .hero-stats .stat-number { font-size: 1.8rem !important; }
    .hero-right-carousel { width: 100% !important; margin-right: 0 !important; margin-top: 1.5rem !important; }
    .ppt-cover-platform-label { font-size: clamp(1.2rem, 5vw, 1.8rem) !important; }
    .ppt-cover-main-title { white-space: normal !important; flex-wrap: wrap !important; }
    .ppt-cover-info-row { flex-direction: column !important; gap: 0.8rem !important; min-width: auto !important; padding: 1rem !important; }
    .ppt-cover-info-card { padding: 0 1rem !important; }
    .bg-section { min-height: auto !important; padding: 2rem 1rem !important; }
    .bg-section-inner { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    .bg-title { font-size: 1.5rem !important; padding-left: 0 !important; }
    .bg-challenge-tags { flex-wrap: wrap !important; gap: 6px !important; }
    .bg-tag { font-size: 0.68rem !important; padding: 5px 10px !important; }
    .bg-img-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
    .features-section { padding: 2rem 1rem !important; }
    .features-title { font-size: 1.6rem !important; }
    .features-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
    .features-description { font-size: 0.85rem !important; }
    .gallery-section { padding: 1.5rem 0.5rem !important; }
    .gallery-carousel { padding: 0.5rem 0 !important; }
    .gallery-title { font-size: 1.5rem !important; }
    .achievements-section { padding: 2rem 0.8rem !important; }
    .achievements-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
    .achievements-title { font-size: 1.4rem !important; }
    .timeline-title { font-size: 1.5rem !important; }
    .footer-team-name { font-size: 1.1rem !important; }
    .cta-corner-btn { top: 10px !important; right: 10px !important; padding: 8px 14px !important; font-size: 12px !important; letter-spacing: 1px !important; }
    .scroll-indicator { bottom: 20px !important; }
    .bg-solution-desc { font-size: 0.85rem !important; }
    #heroCarousel, .hero-right-carousel { display: block !important; width: 100% !important; }
}

/* ---- 登录页 ---- */
@media (max-width: 768px) {
    .login-container { width: 95% !important; max-width: 100% !important; }
    .login-card { padding: 30px 20px !important; border-radius: 16px !important; }
    .login-logo { width: 100px !important; }
    .form-group { margin-bottom: 14px !important; }
    .form-group label { font-size: 13px !important; }
    .submit-btn { width: 100% !important; height: 48px !important; font-size: 16px !important; }
    .tab-btn { font-size: 13px !important; padding: 8px 14px !important; }
    .captcha-box { width: 100px !important; height: 36px !important; }
    .captcha-text { font-size: 18px !important; }
}

/* ---- 仪表盘 ---- */
@media (max-width: 768px) {
    html, body { overflow: auto !important; height: auto !important; }
    .container { height: auto !important; overflow: visible !important; max-height: none !important; }
    .main-wrapper { flex: auto !important; overflow: visible !important; position: static !important; }
    .slider-container { position: static !important; display: block !important; transform: none !important; overflow: visible !important; }
    .slider-page { min-width: 100% !important; height: auto !important; overflow: visible !important; padding: 0 !important; position: static !important; margin-bottom: 12px !important; }
    .cards-grid { grid-template-columns: 1fr !important; gap: 16px !important; grid-auto-rows: auto !important; }
    .card { min-height: auto !important; height: auto !important; padding: 14px !important; overflow: visible !important; margin-bottom: 16px !important; border: 2px solid rgba(0,255,255,0.25) !important; border-radius: 14px !important; }
    .stats-card { grid-template-columns: 1fr 1fr !important; grid-gap: 8px !important; }
    .stat-item { padding: 10px !important; }
    .stat-value { font-size: 22px !important; }
    .header { flex-shrink: 0 !important; }
    .nav-arrow { display: none !important; }
    .navigation-dots { display: none !important; }
    .landuse-image-wrapper { min-height: 150px !important; }
    .landuse-legend { grid-template-columns: repeat(2, 1fr) !important; max-height: none !important; overflow: visible !important; }
    .disaster-list { max-height: 400px !important; }
    .disaster-header { flex-direction: column !important; }
    .disaster-category-filter { flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    .disaster-search-box { width: 100% !important; }
    .disaster-search-input { flex: 1 !important; }
    .disaster-stats-bar { flex-wrap: wrap !important; }
    .disaster-controls { flex-wrap: wrap !important; }
    .category-btn { font-size: 12px !important; padding: 4px 8px !important; white-space: nowrap !important; flex-shrink: 0; }
    .disaster-item { padding: 8px 10px !important; }
    .disaster-title { font-size: 13px !important; }
    .disaster-meta { font-size: 11px !important; }
    .login-logo { height: auto !important; }
    .chart { width: 100% !important; max-width: 100% !important; min-height: 200px !important; }
    .chart canvas, .chart svg, .chart img { max-width: 100% !important; height: auto !important; }
}

/* ---- 火点监测/病虫害分布地图 ---- */
@media (max-width: 768px) {
    .mapboxgl-map { height: 50vh !important; min-height: 300px !important; }
    .ds-panel, .ai-panel { width: 100% !important; right: 0 !important; bottom: 0 !important; max-height: 50vh !important; }
    .ds-panel-body, .ai-messages-area { max-height: 30vh !important; }
    .btn-deepseek-header, #aiChatTrigger { width: 44px !important; height: 44px !important; font-size: 20px !important; }
}

/* ---- 病虫害诊断 ---- */
@media (max-width: 768px) {
    .upload-section { padding: 16px !important; margin-bottom: 16px !important; border-radius: 12px !important; }
    .image-display-container { width: 100% !important; height: auto !important; margin-bottom: 12px !important; }
    .result-section { margin-top: 16px !important; padding: 14px !important; }
    .records-panel { margin-top: 20px !important; padding-top: 16px !important; border-top: 3px solid rgba(0,255,255,0.3) !important; }
    .record-card { display: flex !important; flex-direction: column !important; gap: 8px !important; padding: 14px !important; margin-bottom: 10px !important; border-radius: 10px !important; border-left: 4px solid #00ffff !important; }
    .rc-left { display: flex; flex-direction: row; gap: 10px; align-items: center; }
    .rc-id { font-size: 15px !important; }
    .rc-title { font-size: 14px !important; white-space: normal !important; }
    .rc-actions { flex-direction: row !important; gap: 6px !important; flex-wrap: wrap !important; }
    .rc-actions button { font-size: 12px !important; padding: 6px 10px !important; }
    .modal-content { width: 95% !important; max-height: 85vh !important; border-radius: 14px !important; }
    .info-fields-grid { grid-template-columns: 1fr !important; }
    .pagination { gap: 4px !important; flex-wrap: wrap !important; }
    .page-btn { padding: 6px 10px !important; font-size: 12px !important; }
    .record-card .rc-preview { display: none !important; }
}

/* ---- 知识平台 ---- */
@media (max-width: 768px) {
    .qa-panel { width: 100% !important; }
    .qa-messages { max-height: 40vh !important; }
    .qa-bubble { max-width: 90% !important; font-size: 13px !important; }
}

/* ---- 个人中心 ---- */
@media (max-width: 768px) {
    .user-profile-container { padding: 15px !important; }
    .profile-info-grid { grid-template-columns: 1fr !important; }
    .activity-item { padding: 8px 10px !important; }
}

/* ---- 安全面板 ---- */
@media (max-width: 768px) {
    .log-table { font-size: 11px !important; }
    .log-table th, .log-table td { padding: 6px 4px !important; }
    .path-cell { max-width: 120px !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
