/* ============ 校园卡办理进度管理系统 ============ */
:root {
  --bg: #F6F7FB;
  --card: #FFFFFF;
  --border: #E8EAF2;
  --border-light: #EEF0F6;
  --primary: #2F5FE8;
  --primary-weak: #EAF0FE;
  --text-1: #1A2233;
  --text-2: #5A6478;
  --text-3: #98A2B3;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 12px rgba(16,24,40,.06);
  --sidebar-w: 232px;
  --topbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text-1); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; outline: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8DCE7; border-radius: 4px; }

.app { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px; gap: 4px; z-index: 50;
}
.logo-row { display: flex; align-items: center; gap: 10px; padding: 8px; height: 48px; }
.logo-text { font-size: 15px; font-weight: 600; color: var(--text-1); }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; height: 40px;
  border-radius: 12px; color: var(--text-2); font-size: 13px; transition: .15s;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: #F2F4FA; }
.nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 500; }
.sidebar-bottom { display: flex; flex-direction: column; gap: 10px; }
.agent-card {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  background: var(--bg); border-radius: 14px;
}
.agent-avatar {
  width: 36px; height: 36px; border-radius: 18px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.agent-info { min-width: 0; }
.agent-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.agent-code { font-size: 11px; color: var(--text-3); }
.upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: 12px; background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 500; transition: .15s;
}
.upload-btn:hover { background: #2750C6; }

/* ---------- 主区域 ---------- */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; background: var(--bg); z-index: 40;
}
.topbar-title h1 { font-size: 22px; font-weight: 600; line-height: 1.3; }
.topbar-title p { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 8px; width: 260px; height: 36px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 12px;
}
.search-box input { border: none; background: none; font-size: 12px; color: var(--text-1); width: 100%; }
.search-box input::placeholder { color: var(--text-3); }
.bell-btn {
  width: 36px; height: 36px; border-radius: 10px; background: var(--card);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--danger); position: relative;
}
.top-avatar {
  width: 36px; height: 36px; border-radius: 18px; color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2E5CE8, #6E8DF0);
}

/* ---------- 内容区 ---------- */
.content { flex: 1; padding: 24px; overflow-y: auto; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 16px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-3); margin-left: 8px; font-weight: 400; }
.card-link { font-size: 12px; color: var(--primary); font-weight: 500; cursor: pointer; }

/* 统计卡片 */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card { display: flex; flex-direction: column; gap: 10px; }
.stat-top { display: flex; align-items: center; gap: 10px; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 600; line-height: 1; display: flex; align-items: baseline; gap: 4px; }
.stat-value .unit { font-size: 13px; color: var(--text-3); font-weight: 400; }
.stat-delta { font-size: 11px; }

/* 中部双卡 */
.mid-row { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; margin-bottom: 16px; }
.status-row { display: flex; align-items: center; gap: 10px; height: 26px; margin-bottom: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; }
.status-name { width: 84px; font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.status-bar { flex: 1; height: 8px; border-radius: 4px; background: #EEF0F6; overflow: hidden; }
.status-bar i { display: block; height: 100%; border-radius: 4px; }
.status-count { width: 36px; font-size: 12px; font-weight: 500; text-align: right; color: var(--text-1); }

.follow-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-light); }
.follow-item:last-child { border-bottom: none; }
.follow-avatar { width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; flex-shrink: 0; }
.follow-info { flex: 1; min-width: 0; }
.follow-name { font-size: 13px; font-weight: 500; }
.follow-phone { font-size: 11px; color: var(--text-3); font-family: var(--mono); margin-top: 2px; }

/* 徽章 / 状态标签 */
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-new { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 11px; font-size: 11px; font-weight: 500; }

/* 上传记录表 */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 10px 12px; background: #F8F9FC; }
.table th:first-child { border-radius: 8px 0 0 8px; }
.table th:last-child { border-radius: 0 8px 8px 0; }
.table td { padding: 11px 12px; font-size: 13px; border-bottom: 1px solid var(--border-light); }
.table td.mono { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.table td.time { font-size: 12px; color: var(--text-3); }
.table tr:hover td { background: #FAFBFE; }

/* 筛选条 */
.filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.list-search-box { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; box-sizing: border-box; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.list-search-box input { border: none; background: none; outline: none; font-size: 12px; color: var(--text-1); width: 170px; }
.list-search-box input::placeholder { color: var(--text-3); }
.clear-search { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 0 2px 4px; }
.clear-search:hover { color: var(--text-1); }
.filter-chip {
  height: 32px; padding: 0 14px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--border); font-size: 12px; color: var(--text-2); transition: .15s;
}
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.filter-spacer { flex: 1; }
.filter-btn { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.page-info { font-size: 12px; color: var(--text-3); }
.page-btns { display: flex; gap: 6px; align-items: center; }
.page-btn { min-width: 28px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.page-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 状态更新按钮 */
.btn-update { height: 28px; padding: 0 12px; border-radius: 8px; background: var(--primary-weak); color: var(--primary); font-size: 12px; font-weight: 500; }

/* ---------- 上传页 ---------- */
/* 手机号链接 + 操作菜单 */
.phone-link { color: var(--primary); text-decoration: none; border-bottom: 1px dashed rgba(47,95,232,.35); cursor: pointer; }
.phone-link:hover { color: #1a3fc0; }
.m-phone { font-weight: 600; }
.phone-menu { position: fixed; z-index: 200; min-width: 150px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgba(16,24,40,.16); padding: 6px; animation: pm-in .12s ease; }
@keyframes pm-in { from { opacity: 0; transform: translateY(-4px); } }
.phone-menu-title { font-size: 12px; font-weight: 600; color: var(--text-1); padding: 6px 10px 8px; border-bottom: 1px solid var(--border-light); margin-bottom: 4px; }
.pm-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; background: none; font-size: 13px; color: var(--text-2); border-radius: 8px; cursor: pointer; text-align: left; }
.pm-item:hover { background: #F4F6FB; color: var(--text-1); }

.upload-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 16px; margin-bottom: 16px; }
.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  height: 160px; border: 1.5px dashed var(--primary); border-radius: 12px; background: #F6F8FE; cursor: pointer;
  transition: .15s; text-align: center; padding: 20px;
}
.drop-zone.dragover { background: var(--primary-weak); }
.drop-zone .dz-icon { width: 40px; height: 40px; border-radius: 20px; background: var(--primary-weak); display: flex; align-items: center; justify-content: center; }
.drop-zone .dz-title { font-size: 14px; font-weight: 500; }
.drop-zone .dz-sub { font-size: 12px; color: var(--text-3); }
.rule-box { display: flex; align-items: center; gap: 10px; padding: 12px; background: #F6F8FE; border-radius: 10px; margin-top: 14px; }
.rule-box .rule-icon { width: 24px; height: 24px; border-radius: 12px; background: var(--primary-weak); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rule-box .rule-title { font-size: 12px; font-weight: 500; }
.rule-box .rule-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.btn-file { width: 100%; height: 40px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-size: 13px; font-weight: 500; margin-top: 14px; }

.step-card { border-radius: 12px; padding: 18px; background: #F6F8FE; flex: 1; }
.step-card.done { background: #E6F6EC; }
.step-num { width: 28px; height: 28px; border-radius: 14px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.step-card.done .step-num { background: var(--success); }
.step-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.step-desc { font-size: 11px; color: var(--text-2); line-height: 1.6; }
.steps-row { display: flex; gap: 12px; }

/* 预览 */
.preview-status-new { color: var(--success); }
.preview-status-dup { color: var(--text-3); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(26, 34, 51, .45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal { width: 620px; max-width: 100%; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.08); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--border-light); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; border-radius: 16px; background: #F0F2F6; display: flex; align-items: center; justify-content: center; }
.modal-customer { display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: #F6F8FE; }
.modal-customer .m-avatar { width: 48px; height: 48px; border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; flex-shrink: 0; }
.modal-customer .m-name { font-size: 15px; font-weight: 600; }
.modal-customer .m-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.modal-customer .m-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.modal-current { display: flex; align-items: center; gap: 8px; padding: 14px 24px; }
.modal-current .current-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.modal-current .current-time { margin-left: auto; font-size: 11px; color: var(--text-3); }
.modal-section-title { display: flex; align-items: center; justify-content: space-between; padding: 8px 24px 0; }
.modal-section-title span { font-size: 13px; font-weight: 500; }
.modal-section-title .modal-tip { font-size: 11px; color: var(--text-3); font-weight: 400; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 24px 4px; }
.status-option {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); cursor: pointer; transition: .15s;
}
.status-option:hover { border-color: #C9D4F6; }
.status-option.selected { border: 1.5px solid var(--primary); background: var(--primary-weak); }
.status-option .so-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.status-option .so-icon i { width: 10px; height: 10px; border-radius: 5px; }
.status-option .so-name { flex: 1; font-size: 13px; font-weight: 500; }
.radio { width: 18px; height: 18px; border-radius: 9px; border: 1.5px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.status-option.selected .radio { border-color: var(--primary); background: var(--primary); }
.status-option.selected .radio::after { content: ""; width: 6px; height: 6px; border-radius: 3px; background: #fff; }
.modal-note { padding: 12px 24px 8px; }
.modal-note label { font-size: 12px; color: var(--text-2); font-weight: 500; display: block; margin-bottom: 8px; }
.modal-note textarea { width: 100%; height: 72px; border: none; background: #F8F9FC; border-radius: 8px; padding: 12px; font-size: 12px; color: var(--text-1); resize: vertical; }
.modal-note textarea::placeholder { color: var(--text-3); }
.modal-timeline { padding: 8px 24px; }
.timeline-title { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 8px; }
.timeline-item { display: flex; align-items: center; gap: 12px; padding: 5px 0; font-size: 12px; }
.timeline-item .tl-time { width: 100px; color: var(--text-3); font-family: var(--mono); font-size: 12px; flex-shrink: 0; }
.timeline-item .tl-note { color: var(--text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-top: 1px solid var(--border-light); }
.btn-cancel { height: 36px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.btn-primary { height: 36px; padding: 0 18px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }

/* toast */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: #1A2233; color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 空状态 */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty .empty-icon { font-size: 36px; margin-bottom: 8px; }
.empty p { font-size: 13px; }

/* 加载骨架 */
.skeleton { background: linear-gradient(90deg, #EEF0F6 25%, #F6F8FC 50%, #EEF0F6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 移动端 ---------- */
.mobile-tabbar { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .mid-row { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .search-box { display: none; }
  .content { padding: 16px; padding-bottom: 88px; }
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 64px;
    background: var(--card); border-top: 1px solid var(--border-light); z-index: 60;
  }
  .tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; color: var(--text-3); }
  .tab-item.active { color: var(--primary); font-weight: 500; }
  .tab-icon { width: 18px; height: 18px; border-radius: 4px; }
  /* 移动端表格 → 卡片 */
  .table-wrap { overflow-x: auto; }
  table.table th, table.table td { white-space: nowrap; }
  /* 移动端搜索框全宽 */
  .filter-actions { width: 100%; margin-left: 0; }
  .list-search-box { flex: 1; }
  .list-search-box input { width: 100%; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 14px; }
  .status-grid { grid-template-columns: 1fr; }
  .steps-row { flex-direction: column; }
}
