/* ============================================
   LALA 移动端完整适配 v2.0
   仅影响 ≤640px 屏幕，桌面端完全不受影响
   ============================================ */

/* 桌面端：底部导航默认隐藏 */
.bottom-nav-mobile { display: none; }

@media (max-width: 640px) {

/* ===== 全局重置 ===== */
* { box-sizing: border-box; }
html { font-size: 14px; }
body { 
  margin: 0; padding: 0; 
  background: #f5f7fb; 
  -webkit-text-size-adjust: 100%;
  padding-bottom: 70px; /* 给底部导航留空间 */
}

/* ===== Admin布局 - 移动端重构 ===== */
.admin-layout { display: block !important; min-height: 100vh; background: #f5f7fb; }
.admin-sidebar { display: none !important; } /* 隐藏侧边栏 */
.admin-main { 
  margin-left: 0 !important; 
  padding-top: 56px !important; /* 顶部导航高度 */
  padding-bottom: 80px;
}

/* ===== 顶部导航栏 - 移动端简化 ===== */
.top-nav {
  position: fixed !important; top: 0; left: 0; right: 0;
  height: 56px; z-index: 1000;
  display: flex !important; align-items: center; justify-content: space-between;
  padding: 0 12px !important;
  background: #fff; 
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.nav-logo { display: flex; align-items: center; gap: 6px; }
.nav-logo svg { width: 24px; height: 24px; }
.nav-logo span { font-size: 16px; font-weight: 700; }
.nav-links { display: none !important; } /* 隐藏桌面端导航链接 */
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-search { display: none !important; } /* 移动端隐藏搜索框 */
.nav-bell { position: relative; cursor: pointer; }
.nav-bell svg { width: 20px; height: 20px; color: #555; }
.nav-balance { 
  font-size: 13px; color: #667eea; font-weight: 600;
  background: rgba(102,126,234,0.08); padding: 4px 10px; border-radius: 16px;
}
.hamburger-btn { cursor: pointer; padding: 4px; }
.hamburger-btn svg { width: 22px; height: 22px; color: #555; }

/* ===== 底部导航栏 ===== */
.bottom-nav-mobile {
  display: flex !important;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px; z-index: 9999;
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  border-top: 1px solid #eee;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-mobile a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: #8b8fa3; font-size: 10px; gap: 2px;
  transition: color 0.2s;
}
.bottom-nav-mobile a.active { color: #667eea; }
.bottom-nav-mobile a .nav-icon { font-size: 20px; line-height: 1; }
.bottom-nav-mobile a .nav-label { font-weight: 500; }

/* ===== Dashboard 控制台 - 移动端重构 ===== */
.admin-page-header {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; border: none !important;
}
.admin-page-header h1 { font-size: 20px !important; color: #fff !important; margin: 0; }
.admin-page-header p { font-size: 13px !important; color: rgba(255,255,255,0.85) !important; margin: 4px 0 0; }
.admin-header-actions { display: flex; gap: 8px; }
.admin-header-actions .btn-primary {
  background: rgba(255,255,255,0.2) !important; border: 1px solid rgba(255,255,255,0.4);
  color: #fff !important; border-radius: 20px; padding: 8px 16px; font-size: 13px;
}
.admin-header-actions .btn-secondary {
  background: rgba(255,255,255,0.1) !important; border: 1px solid rgba(255,255,255,0.3);
  color: #fff !important; border-radius: 20px; padding: 8px 16px; font-size: 13px;
}

/* 统计卡片 - 2列网格 */
.admin-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
  padding: 12px !important;
}
.admin-stat-card {
  background: #fff; border-radius: 12px; padding: 14px;
  display: flex; align-items: center; gap: 10px;
  border-left: none !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.admin-stat-icon {
  width: 36px !important; height: 36px !important;
  border-radius: 10px !important; font-size: 16px !important;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-stat-content { flex: 1; min-width: 0; }
.admin-stat-value { font-size: 18px !important; font-weight: 700; color: #1a1d2e; }
.admin-stat-label { font-size: 11px !important; color: #8b8fa3; margin-top: 2px; }
.admin-stat-trend { font-size: 10px !important; margin-top: 2px; }

/* 图表区 - 移动端隐藏或简化 */
.admin-charts-row {
  display: flex; flex-direction: column; gap: 12px;
  padding: 0 12px;
}
.admin-chart-card {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 0;
}
.admin-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.admin-card-header h3 { font-size: 15px !important; font-weight: 600; margin: 0; }

/* 健康度网格 */
.health-grid {
  display: grid !important; grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px;
}
.health-item { text-align: center; }
.health-ring { width: 64px !important; height: 64px !important; margin: 0 auto; }
.health-ring-value { font-size: 12px !important; }
.health-label { font-size: 11px; color: #8b8fa3; margin-top: 4px; }

/* 柱状图 - 移动端简化 */
.admin-bar-chart { 
  display: flex; align-items: flex-end; gap: 4px; 
  height: 100px; padding: 0 4px;
  overflow: hidden;
}
.admin-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; }
.admin-bars { display: flex; gap: 2px; align-items: flex-end; height: 80px; }
.admin-bar { width: 8px !important; border-radius: 3px 3px 0 0; min-height: 2px; }
.admin-bar-label { font-size: 9px; color: #8b8fa3; margin-top: 4px; }
.chart-legend { font-size: 11px; color: #8b8fa3; margin-top: 8px; }

/* 待处理事项 */
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pending-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; background: #f9fafb; border-radius: 8px;
}
.pending-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pending-dot.error { background: #ef4444; }
.pending-dot.warning { background: #f59e0b; }
.pending-dot.info { background: #3b82f6; }
.pending-info { flex: 1; min-width: 0; }
.pending-title { font-size: 13px; color: #1a1d2e; line-height: 1.4; 
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-meta { font-size: 11px; color: #8b8fa3; margin-top: 2px; }
.pending-item .btn-sm { font-size: 11px; padding: 4px 8px; flex-shrink: 0; }

/* 最近任务 */
.admin-bottom-row {
  display: flex; flex-direction: column; gap: 12px;
  padding: 0 12px;
}
.dash-task-list { display: flex; flex-direction: column; gap: 0; }
.dash-task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.dash-task-item:last-child { border-bottom: none; }
.dash-task-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.dash-task-info { flex: 1; min-width: 0; }
.dash-task-name { font-size: 14px; font-weight: 500; color: #1a1d2e; }
.dash-task-meta { font-size: 11px; color: #8b8fa3; margin-top: 2px; display: flex; gap: 8px; }
.dash-task-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.status-running { background: #dbeafe; color: #2563eb; }
.status-completed { background: #d1fae5; color: #059669; }
.status-failed { background: #fee2e2; color: #dc2626; }
.dash-task-cost { font-size: 13px; font-weight: 600; color: #ef4444; flex-shrink: 0; }
.dash-card-link { font-size: 12px; color: #667eea; cursor: pointer; }

/* 系统通知 */
.dash-notice-list { display: flex; flex-direction: column; gap: 0; }
.dash-notice-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.dash-notice-item:last-child { border-bottom: none; }
.dash-notice-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.dash-notice-dot.success { background: #10b981; }
.dash-notice-dot.info { background: #3b82f6; }
.dash-notice-dot.warning { background: #f59e0b; }
.dash-notice-content { flex: 1; }
.dash-notice-title { font-size: 13px; color: #1a1d2e; line-height: 1.4; }
.dash-notice-time { font-size: 11px; color: #8b8fa3; margin-top: 2px; }

/* ===== 非Admin页面 - 移动端优化 ===== */

/* 任务广场 */
.cards-grid { 
  grid-template-columns: 1fr !important; 
  gap: 12px !important;
}
.task-card { margin-bottom: 0; }
.task-card-cover { height: 100px !important; }
.task-card-body { padding: 12px !important; }

/* 节点市场 */
.node-card { padding: 14px !important; }

/* 首页 Hero - 移动端简化 */
.hero {
  padding: 20px 16px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: auto !important;
  margin-top: 56px !important;
}
.hero::before, .hero::after { display: none !important; }
.hero-content { flex-direction: column; gap: 16px; }
.hero-text h1 { font-size: 22px !important; }
.hero-text p { font-size: 13px !important; }
.hero-visual { display: none; } /* 隐藏SVG动画 */
.hero-buttons { display: flex; gap: 8px; }
.btn-hero-primary, .btn-hero-secondary {
  padding: 10px 16px !important; font-size: 14px !important;
  border-radius: 20px !important;
}

/* 实时状态栏 */
.live-status-bar { padding: 12px 16px; overflow-x: auto; }
.live-status-inner { 
  display: flex; gap: 16px; min-width: max-content;
  padding: 0 4px;
}
.live-indicator { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.live-stat { display: flex; flex-direction: column; align-items: center; }
.live-stat-value { font-size: 16px; font-weight: 700; color: #667eea; }
.live-stat-label { font-size: 10px; color: #8b8fa3; }
.live-time { display: none; }

/* Feature bar */
.feature-bar { padding: 12px; }
.feature-bar-inner { 
  display: grid !important; grid-template-columns: repeat(2, 1fr) !important; 
  gap: 8px !important;
}
.feature-item { padding: 12px !important; }
.feature-item h4 { font-size: 13px !important; }
.feature-item p { font-size: 11px !important; }

/* 公告/快速入门/统计/价格/为什么选择LALA */
.home-announcements, .home-how-section, .home-stats-section,
.home-why-section, .home-timeline-section {
  padding: 16px !important;
}
.home-section-inner, .home-how-inner, .home-stats-inner,
.home-why-inner { padding: 0 !important; }
.section-title { font-size: 16px !important; }

.home-how-steps { 
  display: flex; flex-direction: column; gap: 12px;
}
.home-how-step { 
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: #fff; border-radius: 12px;
}
.home-how-step-num { 
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.home-how-step-icon { font-size: 24px; flex-shrink: 0; }
.home-how-step-title { font-size: 14px; font-weight: 600; }
.home-how-step-desc { font-size: 12px; color: #8b8fa3; }
.home-how-arrow { display: none; }

.home-stats-inner {
  display: grid !important; grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
}
.home-stat-item { text-align: center; padding: 8px; }
.home-stat-number { font-size: 18px !important; }
.home-stat-label { font-size: 10px !important; }

.home-why-grid { grid-template-columns: 1fr !important; }
.home-why-card { 
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: #fff; border-radius: 12px;
}

/* 活动Timeline */
.activity-timeline { padding-left: 16px; }
.timeline-item { display: flex; gap: 10px; padding: 8px 0; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.timeline-content { flex: 1; }
.timeline-title { font-size: 13px; font-weight: 500; }
.timeline-desc { font-size: 12px; color: #8b8fa3; margin-top: 2px; }
.timeline-time { font-size: 11px; color: #b0b4c4; margin-top: 2px; }

/* ===== 任务详情页 - 图片预览 ===== */
.image-grid { 
  display: grid !important; grid-template-columns: repeat(2, 1fr) !important; 
  gap: 8px !important; 
}
.image-card { border-radius: 10px; overflow: hidden; }
.image-card img { width: 100%; height: auto; display: block; }
.node-name-tag { font-size: 11px; padding: 4px 8px; }

/* 文件列表 */
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item { 
  display: flex; align-items: center; gap: 8px;
  padding: 10px; background: #f9fafb; border-radius: 8px;
}
.file-icon { font-size: 20px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; 
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 11px; color: #8b8fa3; }
.file-download { 
  padding: 6px 12px; background: #667eea; color: #fff;
  border-radius: 16px; font-size: 12px; text-decoration: none;
}

/* ===== 提交任务页 ===== */
.submit-form { padding: 16px !important; }
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #e0e3eb;
  border-radius: 10px; font-size: 14px; background: #fff;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #667eea; outline: none;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.task-type-grid {
  display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important;
}
.task-type-card { 
  padding: 14px 10px; text-align: center;
  border: 2px solid #e8ecf1; border-radius: 12px;
  cursor: pointer; transition: all 0.2s;
}
.task-type-card.active { border-color: #667eea; background: rgba(102,126,234,0.05); }
.task-type-icon { font-size: 24px; margin-bottom: 4px; }
.task-type-name { font-size: 13px; font-weight: 600; }
.btn-submit {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer;
}

/* ===== 登录/注册页 ===== */
.auth-page { padding: 20px 16px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.auth-card { background: #fff; border-radius: 16px; padding: 24px 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.auth-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 20px; }
.auth-card .form-input { padding: 12px 14px; font-size: 15px; }
.auth-card .btn-primary { width: 100%; padding: 14px; font-size: 16px; border-radius: 12px; }

/* ===== 个人中心 ===== */
.profile-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}
.profile-avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.2); 
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.profile-name { font-size: 16px; font-weight: 600; }
.profile-phone { font-size: 13px; opacity: 0.85; }
.profile-menu { display: flex; flex-direction: column; padding: 12px; gap: 2px; }
.profile-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: #fff; border-radius: 10px;
  font-size: 14px; color: #1a1d2e; cursor: pointer;
}
.profile-menu-item + .profile-menu-item { margin-top: 2px; }
.profile-menu-icon { font-size: 18px; width: 24px; text-align: center; }
.profile-menu-arrow { margin-left: auto; color: #ccc; font-size: 12px; }

/* ===== 我的任务页 ===== */
.my-task-filters {
  display: flex; gap: 8px; padding: 12px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.filter-chip {
  padding: 6px 14px; background: #fff; border: 1px solid #e0e3eb;
  border-radius: 20px; font-size: 13px; white-space: nowrap;
  cursor: pointer; transition: all 0.2s;
}
.filter-chip.active { background: #667eea; color: #fff; border-color: #667eea; }
.task-list-mobile { padding: 0 12px; display: flex; flex-direction: column; gap: 10px; }
.task-list-card {
  background: #fff; border-radius: 12px; padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.task-list-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.task-list-card-title { font-size: 14px; font-weight: 600; }
.task-list-card-time { font-size: 11px; color: #8b8fa3; }
.task-list-card-progress { height: 4px; background: #f0f0f0; border-radius: 2px; margin: 8px 0; }
.task-list-card-progress-bar { 
  height: 100%; background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px; transition: width 0.3s;
}

/* ===== 图片预览弹窗 ===== */
.image-preview-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.image-preview-overlay img {
  max-width: 100%; max-height: 90vh; border-radius: 8px;
  object-fit: contain;
}
.preview-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer;
}

/* ===== 推荐页 ===== */
.recommend-hero { padding: 20px 16px; text-align: center; }
.recommend-code {
  display: inline-block; padding: 8px 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; border-radius: 20px; font-size: 18px; font-weight: 700;
  letter-spacing: 2px;
}

/* ===== 动画优化 - 移动端减少动画 ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== 安全区适配 ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav-mobile { padding-bottom: env(safe-area-inset-bottom); }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

} /* end @media 640px */

/* ===== 基础布局类 (全尺寸) ===== */
.page { min-height: 100vh; padding-bottom: 20px; background: #f5f7fb; }
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.card { 
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
