/* ============================================
   生产管理系统 - 移动端样式 v2.0
   现代化UI + 流畅交互
   ============================================ */

:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-bg: #e6f4ff;
  --success: #52c41a;
  --success-bg: #f6ffed;
  --warning: #faad14;
  --warning-bg: #fffbe6;
  --danger: #ff4d4f;
  --danger-bg: #fff2f0;
  --info: #13c2c2;
  --purple: #722ed1;
  --purple-bg: #f9f0ff;
  --body-bg: #f5f7fa;
  --card-bg: #fff;
  --card-shadow: 0 2px 8px rgba(0,0,0,.04);
  --card-radius: 12px;
  --border-color: #f0f0f0;
  --text-primary: #1f1f1f;
  --text-secondary: #666;
  --text-muted: #999;
  --font-stack: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --transition: all .25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-stack);
  background: var(--body-bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }

/* ---- 登录页 ---- */
.login-page {
  display: none;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f3460 0%, #1677ff 50%, #36cfc9 100%);
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  top: -150px; right: -100px;
  border-radius: 50%;
}
.login-page.active { display: flex; align-items: center; justify-content: center; }
.login-card {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 40px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.15);
  position: relative;
  z-index: 1;
  animation: loginSlideUp .5s cubic-bezier(.4,0,.2,1);
}
@keyframes loginSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.login-icon { font-size: 52px; text-align: center; margin-bottom: 10px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.1)); }
.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 4px; font-weight: 700; letter-spacing: 1px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.login-tip { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 18px; }
.login-announcement {
  background: var(--warning-bg); color: #d48806; padding: 10px 14px; border-radius: 10px;
  font-size: 12px; line-height: 1.6; margin-bottom: 14px; text-align: left;
  border-left: 3px solid #d48806;
}

/* ---- 表单 ---- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; color: var(--text-secondary); font-size: 13px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px;
  font-size: 14px; outline: none; transition: var(--transition); background: #fafbfc;
  -webkit-appearance: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,119,255,.1);
  background: #fff;
}

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border: 1px solid #d9d9d9; border-radius: 10px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); background: #fff; color: var(--text-primary);
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(22,119,255,.25); }
.btn-primary:active { background: #0958d9; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); box-shadow: 0 2px 8px rgba(82,196,26,.2); }
.btn-success:active { background: #389e0d; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: 0 2px 8px rgba(255,77,79,.2); }
.btn-danger:active { background: #cf1322; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; border-radius: 10px; }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ---- 主布局 ---- */
.main-app { display: flex; flex-direction: column; min-height: 100vh; background: var(--body-bg); }
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff; padding: 0 16px; height: 50px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(22,119,255,.2);
}
.top-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.top-name { font-size: 13px; opacity: .9; }
.unread-dot {
  width: 10px; height: 10px; background: #fff; border-radius: 50%;
  display: inline-block; position: relative; cursor: pointer;
  box-shadow: 0 0 0 2px var(--danger);
  background: var(--danger);
}

.content-wrap { flex: 1; padding-bottom: 60px; overflow-y: auto; }
.page { display: none; }
.page.active { display: block; animation: pageIn .25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---- 底部导航 ---- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 58px;
  background: #fff; border-top: 1px solid #eee;
  display: flex; z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.04);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: 10px; gap: 2px;
  cursor: pointer; transition: var(--transition);
  position: relative;
}
.tabbar-item .tb-icon { font-size: 24px; transition: var(--transition); }
.tabbar-item.active { color: var(--primary); }
.tabbar-item.active .tb-icon { transform: scale(1.1); }

/* ---- 首页问候 ---- */
.greeting {
  background: linear-gradient(135deg, var(--primary), #36cfc9);
  color: #fff; padding: 24px 18px 20px; margin: 0;
  position: relative; overflow: hidden;
}
.greeting::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
  top: -80px; right: -40px;
  border-radius: 50%;
}
.greeting-text { position: relative; z-index: 1; }
.greeting-text h2 { font-size: 22px; margin-bottom: 4px; font-weight: 700; }
.greeting-text p { font-size: 13px; opacity: .85; }
.greeting-stats {
  display: flex; gap: 12px; margin-top: 18px;
  background: rgba(255,255,255,.15); border-radius: 12px; padding: 14px;
  backdrop-filter: blur(8px);
}
.gs-item { flex: 1; text-align: center; }
.gs-num { display: block; font-size: 24px; font-weight: 700; }
.gs-label { font-size: 11px; opacity: .85; }

/* ---- 公司头部 ---- */
.company-header {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--primary-bg), #f0f5ff);
  padding: 14px 18px;
  border-bottom: 1px solid #d6e4ff;
}
.company-logo {
  width: 40px; height: 40px; border-radius: 10px;
  object-fit: contain; flex-shrink: 0;
  background: #fff; padding: 4px; box-shadow: 0 2px 8px rgba(22,119,255,.1);
}
.company-info { flex: 1; }
.company-name {
  font-size: 18px; font-weight: 700; color: var(--primary); margin: 0;
  line-height: 1.3; letter-spacing: .5px;
}

/* ---- 提醒条 ---- */
.notice-bar {
  background: var(--warning-bg); color: #d48806; padding: 10px 18px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; cursor: pointer;
  border-left: 3px solid #d48806;
}

/* ---- 通告栏 ---- */
.announcement-bar {
  background: linear-gradient(90deg, var(--primary-bg), #bae7ff);
  color: var(--primary); padding: 10px 18px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.announcement-icon { flex-shrink: 0; font-size: 16px; }
.announcement-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement-close { flex-shrink: 0; cursor: pointer; font-size: 18px; color: var(--primary); padding: 0 4px; }

/* ---- 操作按钮 ---- */
.action-grid {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  padding: 18px;
}
.action-card {
  background: #fff; border-radius: 14px; padding: 22px 18px;
  text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.05);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 18px;
  border: 1px solid var(--border-color);
}
.action-card:active { transform: scale(.97); box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.action-icon { font-size: 38px; margin-bottom: 0; }
.action-text { font-size: 16px; font-weight: 600; }
.action-card.scan { border-left: 4px solid var(--primary); background: linear-gradient(135deg, var(--primary-bg) 0%, #fff 100%); }
.action-card.manual { border-left: 4px solid var(--success); background: linear-gradient(135deg, var(--success-bg) 0%, #fff 100%); }

/* ---- 区块 ---- */
.section { padding: 0 18px; margin-bottom: 18px; }
.section-title { font-size: 16px; font-weight: 600; padding: 14px 0 10px; color: var(--text-primary); }

/* ---- 工序标签 ---- */
.process-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.process-chip {
  background: var(--primary-bg); color: var(--primary); padding: 7px 16px;
  border-radius: 20px; font-size: 13px; font-weight: 500;
}
.process-chips-filter .process-chip {
  cursor: pointer; transition: var(--transition);
}
.process-chips-filter .process-chip.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 6px rgba(22,119,255,.25);
}
.process-chips-filter .process-chip:active { transform: scale(.95); }

/* ---- 卡片列表 ---- */
.card-list { padding: 0 18px; }
.record-card {
  background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.record-card:active { transform: scale(.99); }
.record-card .rc-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.record-card .rc-product { font-weight: 600; font-size: 14px; }
.record-card .rc-status {
  font-size: 11px; padding: 2px 10px; border-radius: 12px;
  font-weight: 500;
}
.status-pending { background: var(--warning-bg); color: #d48806; }
.status-passed { background: var(--success-bg); color: var(--success); }
.status-rejected { background: var(--danger-bg); color: var(--danger); }
.status-progress { background: var(--primary-bg); color: var(--primary); }
.record-card .rc-body { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.record-card .rc-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-color);
}
.record-card .rc-amount { font-weight: 700; color: var(--primary); font-size: 15px; }
.record-card .rc-date { font-size: 12px; color: var(--text-muted); }
.record-card .rc-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---- Tab栏 ---- */
.tab-bar {
  display: flex; padding: 8px 18px; gap: 0; background: #fff;
  border-bottom: 1px solid var(--border-color);
}
.tab-bar .tab {
  flex: 1; text-align: center; padding: 10px 0; font-size: 14px;
  color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent;
  transition: var(--transition); font-weight: 500;
}
.tab-bar .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---- 搜索栏 ---- */
.search-bar {
  display: flex; gap: 8px; padding: 14px 18px; background: #fff;
  border-bottom: 1px solid var(--border-color);
}
.search-input {
  flex: 1; padding: 9px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px;
  font-size: 14px; outline: none; transition: var(--transition);
  background: #fafbfc;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,119,255,.08); background: #fff; }

/* ---- 统计概览 ---- */
.stat-summary {
  display: flex; background: #fff; padding: 18px; margin: 14px 18px;
  border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.04);
  border: 1px solid var(--border-color);
}
.ss-item { flex: 1; text-align: center; }
.ss-num { display: block; font-size: 24px; font-weight: 700; color: var(--primary); }
.ss-label { font-size: 11px; color: var(--text-muted); }

/* ---- 统计条 ---- */
.stats-bars { }
.stat-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border-color); font-size: 13px;
}
.stat-row:last-child { border: none; }
.stat-row .sr-name { width: 60px; text-align: right; color: var(--text-secondary); }
.stat-row .sr-bar { flex: 1; height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.stat-row .sr-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--primary-hover)); transition: width .4s; }
.stat-row .sr-val { width: 60px; text-align: right; color: var(--text-muted); font-size: 12px; }

/* ---- 日期选择 ---- */
.date-picker {
  display: flex; align-items: center; gap: 8px; padding: 14px 18px;
  background: #fff; font-size: 13px;
}
.date-picker input {
  padding: 7px 10px; border: 1.5px solid #e0e0e0; border-radius: 8px;
  font-size: 13px; outline: none; transition: var(--transition);
  background: #fafbfc;
}
.date-picker input:focus { border-color: var(--primary); }

/* ---- 通知 ---- */
.notify-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
}
.notify-card {
  background: #fff; border-radius: 12px; padding: 16px; margin: 0 18px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); position: relative;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.notify-card:active { transform: scale(.99); }
.notify-card.unread::before {
  content: ''; position: absolute; top: 16px; left: 8px;
  width: 7px; height: 7px; background: var(--danger); border-radius: 50%;
}
.notify-card .nc-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.notify-card .nc-content { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.notify-card .nc-time { font-size: 12px; color: var(--text-muted); }

/* ---- 我的页 ---- */
.mine-header {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--primary), #36cfc9);
  color: #fff; padding: 28px 18px;
  position: relative; overflow: hidden;
}
.mine-header::after {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
  top: -60px; right: -30px;
  border-radius: 50%;
}
.mine-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,.3);
}
.mine-info { flex: 1; position: relative; z-index: 1; }
.mine-info h3 { font-size: 18px; font-weight: 700; }
.mine-info p { font-size: 13px; opacity: .85; }
.mine-header .btn { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(8px); }
.mine-stats {
  display: flex; background: #fff; padding: 18px; margin: -16px 18px 0;
  border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.06); position: relative;
  z-index: 2; border: 1px solid var(--border-color);
}
.ms-item { flex: 1; text-align: center; }
.ms-num { display: block; font-size: 22px; font-weight: 700; color: var(--primary); }
.ms-label { font-size: 11px; color: var(--text-muted); }

/* ---- 菜单 ---- */
.menu-list { background: #fff; margin: 14px 18px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); }
.menu-item {
  display: flex; align-items: center; padding: 15px 18px;
  border-bottom: 1px solid var(--border-color); cursor: pointer;
  transition: var(--transition);
}
.menu-item:active { background: #f5f7fa; }
.menu-item:last-child { border: none; }
.menu-icon { font-size: 22px; margin-right: 14px; width: 24px; text-align: center; }
.menu-text { flex: 1; font-size: 14px; }
.menu-badge {
  background: var(--danger); color: #fff; font-size: 11px; padding: 2px 8px;
  border-radius: 10px; min-width: 18px; text-align: center; font-weight: 500;
}
.arrow { color: #d0d0d0; font-size: 18px; }

/* ---- 管理端 ---- */
.admin-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding: 18px;
}
.admin-card {
  background: #fff; border-radius: 14px; padding: 18px 10px;
  text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.05);
  cursor: pointer; transition: var(--transition); position: relative;
  overflow: hidden; border: 1px solid var(--border-color);
}
.admin-card:active { transform: scale(.95); background: #f5f7fa; }
.admin-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), #36cfc9);
  border-radius: 14px 14px 0 0;
}
.ac-icon { font-size: 30px; margin-bottom: 8px; }
.ac-text { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ---- 工单卡片 ---- */
.order-card {
  background: #fff; border-radius: 12px; padding: 16px; margin: 0 18px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.order-card:active { transform: scale(.99); }
.order-card .oc-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.order-card .oc-no { font-weight: 600; font-size: 14px; }
.order-card .oc-contract { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.order-card .oc-task { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.order-card .oc-product { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.order-card .oc-qty { font-size: 13px; color: var(--text-secondary); }
.order-card .oc-routes {
  display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; align-items: center;
}
.oc-route {
  padding: 3px 10px; border-radius: 4px; font-size: 11px;
  font-weight: 500;
}
.oc-route.done { background: var(--success-bg); color: var(--success); }
.oc-route.current { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.oc-route.pending { background: #f5f5f5; color: var(--text-muted); }
.oc-route.rejected { background: var(--danger-bg); color: var(--danger); }
.oc-route.inspecting { background: var(--warning-bg); color: #d48806; }
.oc-arrow { color: #d0d0d0; font-size: 11px; }
.order-card .oc-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---- 扫码结果卡片 ---- */
.scan-result-card {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.scan-result-card:active { background: #f9fafb; }
.scan-result-card .src-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.scan-fuzzy-tip {
  font-size: 13px; color: var(--primary); background: var(--primary-bg);
  padding: 8px 14px; border-radius: 8px; margin-bottom: 12px;
  font-weight: 500;
}
.scan-route-summary {
  font-size: 12px; color: var(--text-muted); background: #f5f5f5;
  padding: 2px 8px; border-radius: 4px; margin-top: 4px; display: inline-block;
}

/* ---- 工单详情 ---- */
.back-bar {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: #fff; border-bottom: 1px solid var(--border-color);
}
.back-bar .btn { background: none; border: none; font-size: 18px; color: var(--primary); padding: 0; }
.detail-card {
  background: #fff; margin: 14px 18px; border-radius: 12px; padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  border: 1px solid var(--border-color);
}
.detail-card .dc-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  font-size: 13px; border-bottom: 1px solid var(--border-color);
}
.detail-card .dc-row:last-child { border: none; }
.detail-card .dc-label { color: var(--text-muted); }
.detail-card .dc-value { color: var(--text-primary); font-weight: 500; }

/* ---- 时间线 ---- */
.timeline { padding: 0 18px; }
.timeline-item {
  display: flex; gap: 12px; padding-bottom: 18px; position: relative;
}
.timeline-item::before {
  content: ''; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 2px; background: #e8e8e8;
}
.timeline-item:last-child::before { display: none; }
.tl-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  z-index: 1;
}
.tl-dot.done { background: var(--success-bg); color: var(--success); }
.tl-dot.current { background: var(--primary-bg); color: var(--primary); }
.tl-dot.pending { background: #f5f5f5; color: var(--text-muted); }
.tl-dot.rejected { background: var(--danger-bg); color: var(--danger); }
.tl-dot.inspecting { background: var(--warning-bg); color: #d48806; }
.tl-content { flex: 1; }
.tl-title { font-size: 14px; font-weight: 500; }
.tl-info { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- 弹窗 ---- */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45); z-index: 200; display: flex;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-sheet {
  background: #fff; border-radius: 18px 18px 0 0; width: 100%; max-height: 90vh;
  overflow-y: auto; animation: slideUp .3s cubic-bezier(.4,0,.2,1);
}
.modal-handle {
  width: 40px; height: 4px; background: #ddd; border-radius: 2px;
  margin: 10px auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition); }
.modal-close:hover { background: #f0f0f0; }
.modal-body { padding: 18px 22px 28px; }

/* 摄像头扫码区域 */
#scanCameraReader video,
#rptCameraReader video {
  border-radius: 10px;
}
#scanCameraReader,
#rptCameraReader {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---- Toast ---- */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  padding: 10px 28px; border-radius: 10px; color: #fff; font-size: 14px;
  z-index: 999; animation: fadeIn .3s;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  font-weight: 500; backdrop-filter: blur(8px);
}
.toast.success { background: rgba(82,196,26,.92); }
.toast.error { background: rgba(255,77,79,.92); }
.toast.info { background: rgba(22,119,255,.92); }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%); } }

/* ---- 空状态 ---- */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 14px; }
.empty-state .empty-text { font-size: 14px; }

/* ---- 标签 ---- */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 11px;
  font-weight: 500;
}
.tag-blue { background: var(--primary-bg); color: var(--primary); }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-orange { background: var(--warning-bg); color: #d48806; }
.tag-red { background: var(--danger-bg); color: var(--danger); }
.tag-gray { background: #f5f5f5; color: var(--text-muted); }
.tag-purple { background: var(--purple-bg); color: var(--purple); }

/* ---- 分页 ---- */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 18px;
}
.pager button {
  padding: 6px 14px; border: 1px solid #d9d9d9; border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 13px;
  transition: var(--transition);
}
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 6px rgba(22,119,255,.2); }
.pager button:disabled { opacity: .35; }
.pager-info { font-size: 13px; color: var(--text-muted); }

/* ---- 管理端子页面表格 ---- */
.m-table {
  width: 100%; font-size: 12px; border-collapse: collapse;
}
.m-table th {
  background: #fafbfc; padding: 10px; text-align: left; font-weight: 600;
  border-bottom: 2px solid var(--border-color); white-space: nowrap;
  color: var(--text-secondary);
}
.m-table td { padding: 10px; border-bottom: 1px solid var(--border-color); }
.m-table-wrap { overflow-x: auto; }

/* ---- 平板/PC端适配 ---- */
@media (min-width: 768px) {
  body { background: #eef1f5; font-size: 15px; }
  .login-page {
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-app {
    max-width: 820px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,.06);
    min-height: 100vh;
    position: relative;
    background: #fff;
    border-radius: 0;
  }

  .content-wrap { padding-bottom: 60px; overflow-y: auto; }
  .tabbar {
    max-width: 820px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,.04);
  }
  .topbar { border-radius: 0; }

  .greeting { border-radius: 0; padding: 32px 28px 24px; }
  .greeting-text h2 { font-size: 26px; }
  .greeting-stats { gap: 18px; padding: 16px 20px; }
  .gs-num { font-size: 28px; }

  .action-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 22px 28px;
  }
  .action-card { padding: 30px 22px; }
  .action-icon { font-size: 44px; }
  .action-text { font-size: 16px; }

  .section { padding: 0 28px; margin-bottom: 20px; }
  .section-title { font-size: 17px; padding: 16px 0 12px; }

  .admin-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 22px 28px;
    max-width: none;
  }
  .admin-card { padding: 22px 14px; border-radius: 14px; }
  .ac-icon { font-size: 34px; }
  .ac-text { font-size: 13px; }

  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 15px; padding: 12px 16px; }

  .card-list { padding: 0 28px; }
  .record-card { padding: 18px 20px; border-radius: 14px; }

  .stat-summary { max-width: none; margin: 16px 28px; padding: 22px; border-radius: 14px; }
  .ss-num { font-size: 28px; }

  .menu-list { margin: 16px 28px; border-radius: 14px; }
  .menu-item { padding: 18px 22px; }
  .menu-text { font-size: 15px; }

  .modal-sheet { border-radius: 18px; max-width: 540px; align-items: flex-end; margin: 0 auto; }
  .modal-body { padding: 22px 30px 32px; }

  .tabbar-item .tb-icon { font-size: 28px; }
  .tabbar-item { font-size: 12px; }

  .process-chips { gap: 10px; }
  .process-chip { font-size: 14px; padding: 9px 20px; }

  .mine-header { padding: 32px 28px; }
  .mine-avatar { width: 64px; height: 64px; font-size: 34px; }
  .mine-info h3 { font-size: 20px; }
  .ms-num { font-size: 24px; }

  .tab-bar .tab { font-size: 15px; padding: 12px 0; }

  .empty-state { padding: 56px 24px; }
}

@media (min-width: 1024px) {
  body { font-size: 15px; }
  .main-app { max-width: 920px; }
  .tabbar { max-width: 920px; }
  .admin-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- 岗位分组 ---- */
.position-group {
  background: #fff;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.pg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border-color);
}
.pg-name { font-weight: 600; font-size: 15px; flex: 1; }
.pg-code { font-size: 11px; color: var(--text-muted); background: #f0f0f0; padding: 2px 10px; border-radius: 4px; }
.pg-actions { display: flex; gap: 6px; }
.pg-processes { padding: 10px 16px; }
.pg-proc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
.pg-proc-item:last-child { border: none; }
.pg-proc-item span:first-child { flex: 1; }

/* ---- 工序宫格选择 ---- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px 0;
}
.process-grid-item {
  background: #fafbfc;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.process-grid-item:active { transform: scale(0.95); }
.process-grid-item.checked {
  background: var(--primary-bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,119,255,.1);
}
.process-grid-item .pgi-icon {
  font-size: 24px;
  margin-bottom: 4px;
}
.process-grid-item .pgi-name {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
  word-break: break-all;
}
.process-grid-item.checked .pgi-name {
  color: var(--primary);
}

/* ---- 增强UI识别度 ---- */
/* 卡片点击反馈 */
.card-list-item:active, .record-card:active, .action-card:active {
  transform: scale(.98);
  transition: transform .1s;
}

/* 表单输入增强 */
.form-group input:not(:focus):not(:placeholder-shown) {
  border-color: #d9d9d9;
}
.form-group input:focus, .form-group select:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(22,119,255,.1), 0 2px 6px rgba(22,119,255,.06);
}

/* 按钮点击缩放 */
.btn:active { transform: scale(.96); }

/* 标签增强 - 带小圆点 */
.tag { position: relative; padding-left: 16px; }
.tag::before {
  content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
}
.tag-blue::before { background: var(--primary); }
.tag-green::before { background: var(--success); }
.tag-orange::before { background: #d48806; }
.tag-red::before { background: var(--danger); }
.tag-gray::before { background: var(--text-muted); }
.tag-purple::before { background: var(--purple); }

/* 通知/消息红点 */
.badge-dot {
  position: absolute; top: -4px; right: -4px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid #fff;
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0b0b0; }

/* 加载中骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ====== 报工弹窗多工序行样式 ====== */
.modal-sheet-large { max-height: 88vh; }
.modal-scroll-body { max-height: calc(88vh - 120px); overflow-y: auto; padding-bottom: 8px; }

.process-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin: 12px 0 10px; padding: 8px 0;
  border-top: 1.5px dashed #d9d9d9;
}
.section-title-text { font-size: 15px; font-weight: 600; color: #1890ff; }
.section-hint-text { font-size: 12px; color: #999; }

.process-row {
  background: #fafbfc; border: 1px solid #e8e8e8; border-radius: 10px;
  margin-bottom: 10px; overflow: hidden;
}
.process-row-header {
  display: flex; justify-content: space-between; align-items: center;
  background: #f0f5ff; padding: 6px 12px;
}
.row-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; background: #1890ff; color: #fff;
  border-radius: 50%; font-size: 12px; font-weight: 700;
}
.row-del {
  cursor: pointer; color: #ff4d4f; font-size: 16px; padding: 2px 6px; line-height: 1;
}
.row-del.hidden { visibility: hidden; pointer-events: none; }
.row-del:active { opacity: 0.6; }
.process-row-body { padding: 10px 12px; }
.form-group-sm { margin-bottom: 8px; }
.form-group-sm:last-child { margin-bottom: 0; }
.form-group-sm select,
.form-group-sm input {
  height: 38px; font-size: 14px; border-radius: 8px; padding: 0 10px;
}

.btn-add-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 40px; border: 2px dashed #b7eb8f; border-radius: 10px;
  background: #f6ffed; color: #52c41a; font-size: 14px; font-weight: 500;
  margin: 4px 0 14px; cursor: pointer; transition: all .15s;
}
.btn-add-row:active { background: #d9f7be; transform: scale(.98); }

/* ====== "添加工序"按钮（区别于"添加产品"） ====== */
.btn-add-process {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 40px; border: 2px dashed #b7b1eb; border-radius: 10px;
  background: #f6f0ff; color: #722ed1; font-size: 14px; font-weight: 500;
  margin: 4px 0 14px; cursor: pointer; transition: all .15s;
}
.btn-add-process:active { background: #efdbff; transform: scale(.98); }

/* ====== 工序分组 ====== */
.process-group {
  background: #fafbfc; border: 1.5px solid #d9d9d9; border-radius: 12px;
  margin-bottom: 12px; padding: 12px;
}
.pg-group-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}
.pg-num {
  font-size: 14px; font-weight: 700; color: #722ed1;
}
.pg-del {
  cursor: pointer; color: #ff4d4f; font-size: 13px; padding: 2px 6px;
}
.pg-del.hidden { visibility: hidden; pointer-events: none; }
.pg-del:active { opacity: 0.6; }

/* 工序分组内的添加产品按钮 */
.btn-add-product-in-group {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; height: 34px; border: 1.5px dashed #b7eb8f; border-radius: 8px;
  background: #f6ffed; color: #52c41a; font-size: 13px; font-weight: 500;
  margin: 4px 0 0; cursor: pointer; transition: all .15s;
}
.btn-add-product-in-group:active { background: #d9f7be; transform: scale(.98); }

/* ====== 手动录入模式：产品表格网格布局 ====== */
.product-grid-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
}
.product-grid-body .pg-cell {
  display: flex;
  align-items: center;
}
.product-grid-body .pg-cell input,
.product-grid-body .pg-cell select {
  width: 100%;
  height: 42px;
  font-size: 15px;
  border-radius: 8px;
  padding: 0 10px;
  border: 1.5px solid #e0e0e0;
  background: #fafbfc;
  outline: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  -webkit-appearance: none;
}
.product-grid-body .pg-cell input:focus,
.product-grid-body .pg-cell select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,119,255,.1);
  background: #fff;
}
/* 产品名称占满第一行并放大 */
.product-grid-body .pg-cell-full {
  grid-column: 1 / -1;
  display: flex; align-items: center;
}
.product-grid-body .pg-cell-full input,
.product-grid-body .pg-cell-full select {
  width: 100%;
  height: 44px; font-size: 16px;
  border-radius: 8px; padding: 0 12px;
  border: 1.5px solid #e0e0e0;
  background: #fafbfc;
  outline: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  -webkit-appearance: none;
}
.product-grid-body .pg-cell-full input:focus,
.product-grid-body .pg-cell-full select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,119,255,.1);
  background: #fff;
}

/* 图片上传预览区 */
.image-preview-area {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px;
}
.image-preview-item {
  position: relative; width: 72px; height: 72px; border-radius: 8px;
  overflow: hidden; border: 1px solid #e8e8e8;
}
.image-preview-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.image-preview-del {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; background: rgba(255,59,48,.85);
  color: #fff; border-radius: 50%;
  font-size: 11px; text-align: center; line-height: 18px;
  cursor: pointer;
}

/* 记录卡片中的图片展示 */
.rc-images {
  display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap;
}
.rc-img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 6px;
  border: 1px solid #e8e8e8; cursor: pointer;
}

/* ====== 老年模式 ====== */
body.elderly-mode {
  font-size: 20px !important;
  line-height: 1.7 !important;
}
body.elderly-mode .topbar {
  height: 60px; padding: 0 20px;
}
body.elderly-mode .top-title { font-size: 22px; }
body.elderly-mode .top-name { font-size: 16px; }
body.elderly-mode .greeting { padding: 32px 22px 26px; }
body.elderly-mode .greeting-text h2 { font-size: 28px; }
body.elderly-mode .greeting-text p { font-size: 16px; }
body.elderly-mode .gs-num { font-size: 30px; }
body.elderly-mode .gs-label { font-size: 14px; }
body.elderly-mode .section-title { font-size: 20px; padding: 18px 0 14px; }
body.elderly-mode .action-card { padding: 28px 22px; border-radius: 16px; }
body.elderly-mode .action-icon { font-size: 44px; }
body.elderly-mode .action-text { font-size: 20px; }
body.elderly-mode .record-card { padding: 20px; border-radius: 14px; font-size: 16px; }
body.elderly-mode .record-card .rc-product { font-size: 18px; }
body.elderly-mode .record-card .rc-body { font-size: 16px; }
body.elderly-mode .record-card .rc-amount { font-size: 20px; }
body.elderly-mode .btn {
  padding: 14px 28px; font-size: 18px; border-radius: 12px;
}
body.elderly-mode .btn-sm { padding: 10px 20px; font-size: 16px; border-radius: 10px; }
body.elderly-mode .btn-block { padding: 16px; font-size: 20px; border-radius: 14px; }
body.elderly-mode .form-group label { font-size: 17px; margin-bottom: 8px; }
body.elderly-mode .form-group input,
body.elderly-mode .form-group select,
body.elderly-mode .form-group textarea {
  padding: 14px 16px; font-size: 18px; border-radius: 12px; height: auto;
}
body.elderly-mode .form-group-sm select,
body.elderly-mode .form-group-sm input { height: 48px; font-size: 18px; }
body.elderly-mode .tab-bar .tab { font-size: 18px; padding: 14px 0; }
body.elderly-mode .tabbar { height: 68px; }
body.elderly-mode .tabbar-item { font-size: 14px; }
body.elderly-mode .tabbar-item .tb-icon { font-size: 30px; }
body.elderly-mode .process-chip { font-size: 16px; padding: 10px 22px; border-radius: 24px; }
body.elderly-mode .process-group { padding: 16px; border-radius: 14px; }
body.elderly-mode .pg-num { font-size: 18px; }
body.elderly-mode .product-grid-body { gap: 12px; padding: 14px 16px; }
body.elderly-mode .product-grid-body .pg-cell input,
body.elderly-mode .product-grid-body .pg-cell select { height: 52px; font-size: 18px; border-radius: 10px; }
body.elderly-mode .product-grid-body .pg-cell-full input,
body.elderly-mode .product-grid-body .pg-cell-full select { height: 54px; font-size: 20px; border-radius: 10px; }
body.elderly-mode .modal-header h3 { font-size: 22px; }
body.elderly-mode .modal-close { font-size: 32px; width: 40px; height: 40px; }
body.elderly-mode .menu-item { padding: 20px 22px; }
body.elderly-mode .menu-icon { font-size: 28px; }
body.elderly-mode .menu-text { font-size: 18px; }
body.elderly-mode .mine-info h3 { font-size: 24px; }
body.elderly-mode .mine-info p { font-size: 16px; }
body.elderly-mode .mine-avatar { width: 68px; height: 68px; font-size: 36px; }
body.elderly-mode .ms-num { font-size: 28px; }
body.elderly-mode .ms-label { font-size: 14px; }
body.elderly-mode .empty-state .empty-icon { font-size: 68px; }
body.elderly-mode .empty-state .empty-text { font-size: 18px; }
body.elderly-mode .toast { font-size: 18px; padding: 14px 36px; }
body.elderly-mode .btn-add-row,
body.elderly-mode .btn-add-process { height: 50px; font-size: 18px; }
body.elderly-mode .btn-add-product-in-group { height: 40px; font-size: 16px; }
body.elderly-mode .company-name { font-size: 22px; }
body.elderly-mode .company-logo { width: 50px; height: 50px; }
/* 老年模式高对比度 */
body.elderly-mode .process-row { border-width: 2px; }
body.elderly-mode .record-card { border-width: 2px; }
body.elderly-mode .order-card { border-width: 2px; }
body.elderly-mode .text-secondary { color: #333; }
body.elderly-mode .text-muted { color: #555; }

/* ====== 分页 ====== */
.pagination-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 14px 16px 20px;
}
.page-info {
  font-size: 13px; color: var(--text-secondary); white-space: nowrap;
}
.pagination-bar button:disabled {
  opacity: .4; pointer-events: none;
}
