* { box-sizing: border-box; }

:root {
  --accent: #2f6feb;
  --accent-dark: #2559c4;
  --accent-light: #eaf1ff;
  --orange: #ff7a1a;
  --orange-dark: #e6690a;
  --orange-light: #fff1e6;
  --text-primary: #1a1f2b;
  --text-secondary: #6b7280;
  --text-tertiary: #9aa2b1;
  --border: #e5e8ee;
  --bg: #f6f7f9;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
}

/* 统一全站字体：中英文数字都用同一套无衬线字体，不再混用等宽字体，
   避免同一行里数字和文字看起来像两种风格 */
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", -apple-system, sans-serif;
  background: var(--bg);
  margin: 0;
  font-size: 13.5px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1; /* 数字等宽对齐，不用等宽字体也能让表格数字整齐 */
}
.muted { color: var(--text-tertiary); font-size: 12px; }

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

/* ============ 左侧供应商栏（白底） ============ */
.sidebar {
  width: 224px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  color: var(--text-primary);
  flex-shrink: 0;
  padding: 22px 0;
  display: flex;
  flex-direction: column;
}
.sidebar-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px;
  padding: 0 20px 18px 20px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.vendor-nav { display: flex; flex-direction: column; }
.vendor-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 20px; text-decoration: none; color: var(--text-secondary); font-size: 13.5px;
  border-left: 3px solid transparent; transition: background .12s;
}
.vendor-item:hover { background: #f5f8ff; color: var(--text-primary); }
.vendor-item.active { background: var(--accent-light); color: var(--accent-dark); border-left: 3px solid var(--accent); font-weight: 700; }
.vendor-item.disabled { color: var(--text-tertiary); cursor: not-allowed; }
.vendor-divider { height: 1px; background: var(--border); margin: 8px 20px; }
.aggregate-item { font-weight: 700; }
.aggregate-item .vendor-name::before { content: "☰ "; }
.vendor-count {
  background: #eef0f4; color: var(--text-secondary); font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; min-width: 20px; text-align: center;
}
.vendor-item.active .vendor-count { background: var(--accent); color: #fff; }
.vendor-badge { font-size: 10.5px; color: var(--text-tertiary); background: #f2f3f5; padding: 2px 8px; border-radius: 20px; }

.sidebar-actions { margin: 18px 16px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.side-btn {
  display: block; width: 100%; padding: 9px 12px; text-decoration: none; text-align: center;
  font-size: 12.5px; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--accent); transition: all .12s;
}
.side-btn-primary { background: var(--orange); color: #fff; border-color: var(--orange); }
.side-btn-primary:hover { background: var(--orange-dark); }
.side-btn-outline { background: #fff; color: var(--accent); }
.side-btn-outline:hover { background: var(--accent-light); }
.side-btn-count { opacity: .85; }
.side-hint { font-size: 10.5px; color: var(--text-tertiary); text-align: center; }
.sidebar-spacer { flex: 1; }
.logout-link {
  display: block; margin: 0 16px 4px 16px; padding: 9px 12px; text-align: center;
  font-size: 12.5px; color: var(--text-tertiary); text-decoration: none; border-radius: var(--radius-sm);
  transition: all .12s;
}
.logout-link:hover { background: #fdeceb; color: #d94141; }

/* ============ 主内容 ============ */
.main { flex: 1; padding: 24px 28px; max-width: 1600px; }
.empty-vendor { text-align: center; margin-top: 100px; color: var(--text-secondary); }
.empty-vendor h2 { color: var(--text-primary); font-size: 17px; }

.flash-msg { padding: 10px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.flash-ok { background: #e5f6ec; color: #1a6b3f; }
.flash-fail { background: #fde8e8; color: #c92a2a; }

.filters {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin: 0 0 18px 0; box-shadow: var(--shadow);
}
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.filters select, .filters input[type="text"] {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-primary); background: #fff; height: 34px;
  font-family: inherit;
}
.filters select:focus, .filters input:focus { outline: none; border-color: var(--accent); }
.filters .ym-select { min-width: 130px; }
.filters input[type="text"] { width: 190px; }
.filters .cat-select { min-width: 130px; }
.filter-submit {
  padding: 8px 18px; background: var(--orange); color: #fff; border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 600; height: 34px;
}
.filter-submit:hover { background: var(--orange-dark); }
.filter-export {
  padding: 8px 18px; background: #fff; color: var(--accent); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600; height: 34px;
}
.filter-export:hover { background: var(--accent-light); }

.table-scroll {
  overflow-x: auto; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; min-width: 1080px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
th {
  background: #fafbfc; color: var(--text-tertiary); font-weight: 600; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.col-salesman { width: 8%; }
.col-owner { width: 8%; }
.col-supplier { width: 7%; }
.col-lws { width: 11%; }
.col-vendor { width: 12%; }
.col-addr { width: 10%; }
.col-track { width: 17%; }
.col-tag { width: 13%; }
.col-sync { width: 10%; }
.col-op { width: 90px; }

.track-cell { line-height: 1.5; }
.track-cell.track-latest { font-weight: 700; color: var(--text-primary); }
.track-date { display: block; font-size: 11px; color: var(--text-tertiary); }
.track-name { display: block; font-size: 13px; margin-top: 1px; }

.mismatch-hint { font-size: 10.5px; color: #d94141; margin-top: 3px; }

.supplier-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600;
  background: #eef0f4; color: var(--text-secondary);
}

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  background: #eef0f4; color: var(--text-secondary); margin: 0 4px 4px 0;
}
.tag-done { background: #e5f6ec; color: #1a9c5c; }
.tag-warn { background: #fef3e2; color: #d97c1f; }
.tag-delay { background: #fde8e8; color: #d94141; }
.tag-mismatch { background: #ffe3e3; color: #c92a2a; }
.tag-empty { background: #f2f3f5; color: var(--text-tertiary); }
.row-inspecting { background: #fffdf8; }
.row-delayed { background: #fffafa; }
.row-completed { color: var(--text-tertiary); }
.row-completed .track-cell.track-latest { color: var(--text-secondary); }
.empty { text-align: center; color: var(--text-tertiary); padding: 40px; font-size: 13px; }

.btn-detail {
  display: inline-block; padding: 6px 14px; font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--accent); color: var(--accent); border-radius: var(--radius-sm); text-decoration: none;
  transition: all .12s;
}
.btn-detail:hover { background: var(--accent); color: #fff; }

/* ============ 轨迹详情页 ============ */
.detail-page { max-width: 1400px; margin: 0 auto; padding: 28px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px;
  color: #fff; text-decoration: none; font-size: 13px; font-weight: 700;
  background: var(--accent); padding: 9px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow); transition: background .12s;
}
.back-link:hover { background: var(--accent-dark); }

.detail-header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--card-bg); border: 1px solid var(--border); padding: 16px 20px; border-radius: var(--radius);
  margin-bottom: 18px; box-shadow: var(--shadow);
}
.detail-vendor {
  font-weight: 700; color: var(--accent); font-size: 13px; text-transform: uppercase;
  background: var(--accent-light); padding: 4px 10px; border-radius: 20px;
}
.detail-lws, .detail-vendorno { color: var(--text-secondary); font-size: 13px; }

/* 大阶段进度条（纽酷专用，参考纽酷网页顶部的7段进度条） */
.stagebar-block {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px 16px 24px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.stagebar-title, .timeline-title {
  font-size: 12px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 14px;
}
.stagebar { display: flex; align-items: flex-start; position: relative; width: 100%; }
.stagebar::before {
  content: ""; position: absolute; top: 13px; left: 0; right: 0; height: 3px; background: var(--border); z-index: 0;
}
.stagebar-progress {
  position: absolute; top: 13px; left: 0; height: 3px; background: #1a9c5c; z-index: 0; transition: width .2s;
}
.stage-node { display: flex; flex-direction: column; align-items: center; flex: 1 1 0; min-width: 0; position: relative; }
.stage-dot {
  width: 14px; height: 14px; border-radius: 50%; background: #d9dce3; z-index: 1;
  margin-bottom: 8px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border);
}
.stage-done .stage-dot { background: #1a9c5c; box-shadow: 0 0 0 1px #1a9c5c; }
.stage-label { font-size: 12.5px; color: var(--text-tertiary); font-weight: 500; text-align: center; }
.stage-done .stage-label { color: #1a9c5c; font-weight: 700; }

/* 时间轴：所有节点用flex等分铺满整行宽度，不需要横向拖拽查看 */
.timeline-scroll {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 24px 18px 24px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.timeline { display: flex; align-items: flex-start; position: relative; width: 100%; }
.timeline::before {
  content: ""; position: absolute; top: 15px; left: 0; right: 0; height: 2px; background: var(--border); z-index: 0;
}
.timeline-progress {
  position: absolute; top: 15px; left: 0; height: 2px; background: var(--accent); z-index: 0; transition: width .2s;
}
.tl-node {
  display: flex; flex-direction: column; align-items: center;
  flex: 1 1 0; min-width: 0; position: relative; padding-top: 10px;
}
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%; background: #d9dce3; z-index: 1;
  margin-bottom: 9px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border);
}
.tl-done .tl-dot { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tl-label { font-size: 12px; color: var(--text-tertiary); text-align: center; margin-bottom: 3px; font-weight: 500; padding: 0 2px; }
.tl-done .tl-label { color: var(--text-primary); font-weight: 700; }
.tl-date { font-size: 10.5px; color: var(--text-tertiary); text-align: center; }
.tl-done .tl-date { color: var(--accent); }

.remarks-block { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.remarks-title { font-weight: 700; margin-bottom: 10px; font-size: 13px; color: var(--text-primary); }
.remark-item { display: flex; gap: 12px; padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed var(--border); }
.remark-item:last-child { border-bottom: none; }
.remark-time { color: var(--text-tertiary); flex-shrink: 0; width: 130px; }
.remark-content { color: var(--text-secondary); }

/* ============ 上传页面 ============ */
.upload-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.upload-card h2 { margin-top: 0; font-size: 17px; }
.upload-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
.template-link {
  display: inline-block; margin-bottom: 18px; padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-sm); text-decoration: none;
}
.template-link:hover { background: var(--accent-light); }
.upload-form { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.upload-form select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; height: 34px;
  font-family: inherit;
}
.upload-form input[type="file"] { font-size: 12.5px; }
.upload-form button {
  padding: 8px 18px; background: var(--orange); color: #fff; border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 600; font-size: 13px; height: 34px;
}
.upload-form button:hover { background: var(--orange-dark); }

.result-box { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.7; }
.result-ok { background: #e5f6ec; color: #1a6b3f; }
.result-fail { background: #fde8e8; color: #c92a2a; }
.warn-line { margin-top: 10px; font-weight: 700; }
.result-box ul { margin: 4px 0 0 0; padding-left: 20px; }

/* ============ 登录页面：深色科技风，蓝橙光晕 ============ */
.login-body {
  margin: 0; min-height: 100vh; background: #0a0e1a; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", -apple-system, sans-serif;
}
.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.login-glow {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35;
}
.login-glow-blue { width: 520px; height: 520px; background: #2f6feb; top: -120px; left: -100px; }
.login-glow-orange { width: 420px; height: 420px; background: #ff7a1a; bottom: -100px; right: -80px; opacity: .25; }
.login-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
}

.login-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.login-card {
  width: 380px; background: rgba(20, 26, 46, .72); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 40px 36px 34px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.02);
  text-align: center;
}
.login-logo { display: flex; justify-content: center; margin-bottom: 18px; filter: drop-shadow(0 4px 16px rgba(47,111,235,.5)); }
.login-title { color: #fff; font-size: 19px; font-weight: 700; margin: 0 0 6px 0; letter-spacing: .01em; }
.login-subtitle { color: rgba(255,255,255,.45); font-size: 12.5px; margin: 0 0 28px 0; }

.login-error {
  background: rgba(217,65,65,.15); border: 1px solid rgba(217,65,65,.35); color: #ff8a8a;
  font-size: 12.5px; padding: 9px 12px; border-radius: 8px; margin-bottom: 18px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.login-field label {
  display: block; font-size: 11px; color: rgba(255,255,255,.5); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 7px;
}
.login-field input {
  width: 100%; padding: 11px 13px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px; color: #fff; font-size: 14px; font-family: inherit; transition: all .15s;
}
.login-field input::placeholder { color: rgba(255,255,255,.28); }
.login-field input:focus {
  outline: none; border-color: #2f6feb; background: rgba(47,111,235,.08);
  box-shadow: 0 0 0 3px rgba(47,111,235,.15);
}

.login-btn {
  margin-top: 6px; padding: 12px; border: none; border-radius: 9px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, #2f6feb 0%, #1a4fc4 55%, #ff7a1a 150%);
  box-shadow: 0 8px 24px rgba(47,111,235,.35); transition: transform .15s, box-shadow .15s;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(47,111,235,.45); }
.login-btn:active { transform: translateY(0); }

.login-footer { color: rgba(255,255,255,.25); font-size: 11px; letter-spacing: .03em; }
