/* ==================== 全局重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; font-size: 14px; color: #333; background: #f0f2f5; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }

/* ==================== 主题色 ==================== */
:root {
  --primary: #1677ff;
  --primary-light: #e6f0ff;
  --success: #52c41a;
  --success-light: #f0fbe8;
  --warning: #faad14;
  --warning-light: #fff7e6;
  --danger: #ff4d4f;
  --danger-light: #fff1f0;
  --purple: #722ed1;
  --purple-light: #f9f0ff;
  --teal: #13c2c2;
  --teal-light: #e6fffb;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --border: #e8e8e8;
  --bg: #f0f2f5;
  --card: #fff;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ==================== 登录界面 ==================== */
.login-screen { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #1677ff, #0958d9); }
.login-card { background: #fff; border-radius: 16px; padding: 32px 24px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.login-card h2 { text-align: center; font-size: 22px; margin-bottom: 8px; color: #1a1a1a; }
.login-card p { text-align: center; font-size: 13px; color: #999; margin-bottom: 24px; }

/* ==================== APP布局 ==================== */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; padding-bottom: 64px; }

.app-header { background: linear-gradient(135deg, #1677ff, #0958d9); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 8px rgba(22,119,255,0.3); }
.header-title { font-size: 17px; font-weight: 600; }
.header-user { font-size: 12px; opacity: 0.85; }
.header-right { display: flex; align-items: center; gap: 8px; }

/* ==================== 刷新按钮 ==================== */
.btn-refresh { background: rgba(255,255,255,0.2); border-radius: 6px; padding: 4px 10px; font-size: 16px; color: #fff; transition: background 0.2s; }
.btn-refresh:active { background: rgba(255,255,255,0.35); }

.app-main { padding-bottom: 10px; }

/* ==================== 底部导航 ==================== */
.tab-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: #fff; display: flex; border-top: 1px solid var(--border); z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0; color: var(--text-light); font-size: 11px; gap: 2px; transition: color 0.2s; }
.tab-item.active { color: var(--primary); }
.tab-icon { font-size: 20px; line-height: 1; }
.tab-label { font-size: 10px; }

/* ==================== 统计卡片 ==================== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; }
.stat-card { background: var(--card); border-radius: 10px; padding: 12px 8px; box-shadow: var(--shadow); text-align: center; transition: transform 0.15s, box-shadow 0.15s; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:active { transform: scale(0.95); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.stat-card .stat-num { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.stat-card.green .stat-num { color: var(--success); }
.stat-card.blue .stat-num { color: var(--primary); }
.stat-card.orange .stat-num { color: var(--warning); }
.stat-card.red .stat-num { color: var(--danger); }
.stat-card.suspended { background: #fff3e0; }
.stat-card.suspended .stat-num { color: #e65100; }
.stat-card.suspended .stat-label { color: #e65100; }

/* ==================== 卡片 ==================== */
.card { background: var(--card); border-radius: var(--radius); margin: 8px 12px; padding: 14px; box-shadow: var(--shadow); }
.card-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-info { display: flex; gap: 12px; font-size: 13px; color: var(--text-secondary); margin-top: 4px; flex-wrap: wrap; }
.card-info span { white-space: nowrap; }
.card-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ==================== Section Header ==================== */
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 8px; }
.section-header h2 { font-size: 16px; font-weight: 600; }

/* ==================== 筛选栏 ==================== */
.filter-bar { display: flex; gap: 8px; padding: 0 12px 8px; align-items: center; flex-wrap: wrap; }
.search-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; min-width: 120px; }
.filter-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; }
.date-input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }

/* ==================== 标签 ==================== */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-orange { background: var(--warning-light); color: var(--warning); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-purple { background: var(--purple-light); color: var(--purple); }
.tag-teal { background: var(--teal-light); color: var(--teal); }
.tag-gray { background: #f0f0f0; color: #888; }

/* ==================== 徽章 ==================== */
.badge-mine { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 600; background: var(--success-light); color: var(--success); }

/* ==================== 派车进度 ==================== */
.plan-progress { font-size: 12px; color: var(--primary); margin-top: 2px; padding: 3px 8px; background: var(--primary-light); border-radius: 6px; display: inline-block; }

/* ==================== 按钮 ==================== */
.btn { padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: all 0.15s; background: #f0f0f0; color: #333; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: #0958d9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:active { background: #d9363e; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: 0.5; }

/* ==================== 表单 ==================== */
.form-group { margin-bottom: 12px; }
.form-group label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; display: block; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; transition: border 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 60px; }
.form-group input:disabled { background: #f5f5f5; color: #999; }
.form-group input[type="datetime-local"] { font-size: 13px; }

/* ==================== 弹窗 ==================== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 20px 16px 24px; max-height: 85vh; overflow-y: auto; animation: slideUp 0.25s ease; }
.modal h3 { font-size: 17px; margin-bottom: 16px; font-weight: 600; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ==================== 空状态 ==================== */
.empty { text-align: center; padding: 40px 20px; color: var(--text-light); font-size: 14px; }

/* ==================== 位置提醒 ==================== */
.location-alert { background: linear-gradient(135deg, #fff7e6, #fffbe6); border: 1px solid #ffe58f; border-radius: var(--radius); margin: 8px 12px; padding: 12px 14px; font-size: 13px; color: #874d00; }

/* ==================== Toast ==================== */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.75); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 300; max-width: 280px; text-align: center; }

/* ==================== 车辆状态卡片 ==================== */
.vehicle-status-card { color: #fff; }
.status-bg-green { background: linear-gradient(135deg, #52c41a, #389e0d); }
.status-bg-blue { background: linear-gradient(135deg, #1677ff, #0958d9); }
.status-bg-orange { background: linear-gradient(135deg, #faad14, #d48806); }
.status-bg-red { background: linear-gradient(135deg, #ff4d4f, #cf1322); }
.status-bg-purple { background: linear-gradient(135deg, #722ed1, #531dab); }
.status-bg-gray { background: linear-gradient(135deg, #8c8c8c, #595959); }

/* ==================== 菜单列表 ==================== */
.menu-list { padding: 0 12px; }
.menu-item { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 8px; box-shadow: var(--shadow); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.menu-item:active { background: #fafafa; }

/* ==================== 车辆卡片可点击 ==================== */
.vehicle-card { cursor: pointer; }
.vehicle-card:active { background: #fafafa; }

/* ==================== Section ==================== */
.section { padding: 0; }

/* ==================== V3 新增样式 ==================== */

/* 排队号大字显示 */
.queue-number-large { font-size: 48px; font-weight: 700; color: var(--primary); text-align: center; line-height: 1.2; }
.queue-number-medium { font-size: 36px; font-weight: 700; color: var(--primary); text-align: center; line-height: 1.2; }

/* 派车时间提示 */
.dispatch-after-info { font-size: 12px; color: var(--warning); margin-top: 2px; }

/* 车辆ID小字 */
.vehicle-id-tag { font-size: 12px; color: var(--text-light); }

/* 暂停排队标记 */
.suspend-notice { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* 请假到期警告 */
.leave-expired { color: var(--danger); font-size: 12px; font-weight: 700; margin-top: 4px; }

/* 请假审批卡片 */
.leave-approval-card { border-left: 3px solid var(--warning); }

/* 多客户/多计划列表项 */
.plan-item, .customer-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; border-bottom: 1px solid #f5f5f5; }
.plan-item:last-child, .customer-item:last-child { border-bottom: none; }

/* 手动派车弹窗选项 */
.manual-dispatch-option { padding: 8px 12px; }

/* 车辆明细弹窗 */
.vehicle-detail-summary { display: flex; justify-content: space-around; text-align: center; }
.vehicle-detail-summary .summary-num { font-size: 18px; font-weight: 700; }
.vehicle-detail-summary .summary-label { font-size: 11px; color: var(--text-light); }

/* 运费汇总 */
.freight-summary { display: flex; justify-content: space-around; text-align: center; }
.freight-summary .summary-num { font-size: 24px; font-weight: 700; }
.freight-summary .summary-label { font-size: 12px; color: var(--text-light); }

/* 报表汇总卡片 */
.report-summary-card { background: var(--primary); color: #fff; text-align: center; }
.report-summary-card .summary-num { font-size: 20px; font-weight: 700; }
.report-summary-card .summary-label { font-size: 11px; opacity: 0.9; }

/* 司机任务卡片操作 */
.task-action-btn { width: 100%; padding: 10px; font-size: 14px; }

/* 禁用状态按钮 */
.btn-waiting { opacity: 0.5; cursor: not-allowed; }

/* 统计卡片可点击 */
.stat-card[onclick], .stat-card[@click] { cursor: pointer; }

/* 请假待审批提醒卡片 */
.leave-alert-card { margin-top: 8px; background: #fff3e0; border: 1px solid #ff9800; border-radius: var(--radius); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; cursor: pointer; }
.leave-alert-card:active { background: #ffe0b2; }

/* 行内flex工具类 */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-around { display: flex; justify-content: space-around; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.text-center { text-align: center; }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.font-bold { font-weight: 700; }
.font-sm { font-size: 12px; }
.font-xs { font-size: 11px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
