/* ============ 基础重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-bg: #eff6ff;
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --orange: #ea580c;
  --orange-bg: #fff7ed;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
  /* 2026-09-11 新增：字号 token（替换散落的硬编码 13/14/15/16/18/20/23） */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  --text-4xl: 28px;
  /* 财务数字等宽（用于报价、收款、提成表，避免数字左右抖动） */
  --num-feature: "tnum" 1;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
a { text-decoration: none; color: inherit; }

/* 2026-09-11 新增：财务数字等宽（所有金额、统计数字避免左右抖动对齐） */
.stat-value, .pay-amount, .oc-amount, .ms-value, .num, table td.font-bold, .font-bold.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: var(--num-feature);
}

/* 2026-09-11 新增：全局键盘焦点环（a11y，符合 WCAG 2.4.7） */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; min-width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: margin-left .3s ease;
  z-index: 100;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; }
.logo-text strong { color: #fff; font-size: 15px; letter-spacing: .5px; }
.logo-text span { font-size: 11px; color: #64748b; letter-spacing: 1px; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 500; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 10px; }
.storage-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #64748b; }
.storage-status i { color: var(--success); }
.storage-status.sync-fail { color: #f87171; }
.storage-status.sync-fail i { color: #f87171; }
.storage-status.sync-ok { color: #94a3b8; }
.storage-status.sync-ok i { color: var(--success); }
.sidebar-footer .btn { color: #94a3b8; }
.sidebar-footer .btn:hover { color: #fff; background: rgba(255,255,255,.06); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 90;
}
.topbar-title { font-size: 18px; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.content { padding: 24px; flex: 1; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  font-size: 14px; font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-outline-primary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-bg); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg); }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.card-header h2 { font-size: 15.5px; font-weight: 600; }
.card-header h2 i { margin-right: 8px; color: var(--primary); }
.card-body { padding: 20px; }

/* ============ 统计卡片 ============ */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-info { min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-value { font-size: var(--text-3xl); font-weight: 700; line-height: 1.1; }
.stat-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; padding: 12px 14px;
  background: #f8fafc; color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

/* ============ 标签 ============ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-purple { background: var(--purple-bg); color: var(--purple); }
.tag-orange { background: var(--orange-bg); color: var(--orange); }
.tag-gray { background: #f1f5f9; color: var(--text-secondary); }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%; background: var(--card);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-light); }

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.5);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card); border-radius: 16px;
  width: 100%; max-width: 680px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============ 轻提示 ============ */
.toast-container {
  position: fixed; top: 80px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 10px;
  padding: 12px 18px; box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  animation: toastIn .25s ease;
  min-width: 240px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast i { font-size: 16px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============ 搜索/筛选栏 ============ */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: 13px;
}
.search-box input {
  padding: 8px 12px 8px 34px; border: 1px solid var(--border);
  border-radius: 8px; outline: none; width: 240px; background: var(--card);
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.filter-select {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 8px; outline: none; background: var(--card);
}

/* ============ 空状态 ============ */
.empty {
  text-align: center; padding: 50px 20px; color: var(--text-light);
}
.empty i { font-size: 46px; margin-bottom: 14px; opacity: .4; }
.empty p { font-size: 15px; margin-bottom: 6px; color: var(--text-secondary); }
.empty .empty-sub { font-size: 13px; }

/* ============ 头像 ============ */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.avatar-lg { width: 52px; height: 52px; font-size: 19px; }

/* ============ 详情页 ============ */
.detail-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.detail-info { flex: 1; min-width: 200px; }
.detail-info h1 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.detail-info .detail-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-secondary); font-size: 13px; }
.detail-info .detail-meta i { margin-right: 4px; }
.detail-section { margin-bottom: 20px; }

/* 两列布局 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* 信息列表 */
.info-list { display: flex; flex-direction: column; }
.info-item {
  display: flex; padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.info-item:last-child { border-bottom: none; }
.info-label { width: 100px; color: var(--text-secondary); font-size: 13px; flex-shrink: 0; }
.info-value { flex: 1; font-weight: 500; word-break: break-all; }

/* ============ 进度条 ============ */
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress {
  flex: 1; height: 6px; border-radius: 3px; background: var(--bg);
  overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 3px; background: var(--primary); transition: width .4s ease; }
.progress-bar.green { background: var(--success); }
.progress-bar.orange { background: var(--warning); }

/* ============ 文件上传 ============ */
.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 30px 20px; text-align: center; cursor: pointer;
  transition: all .2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-bg); }
.upload-zone i { font-size: 32px; color: var(--text-light); margin-bottom: 10px; }
.upload-zone p { color: var(--text-secondary); font-size: 13px; }
.upload-zone .upload-sub { color: var(--text-light); font-size: 12px; margin-top: 4px; }
.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 8px; padding: 10px 14px;
}
.file-item i { color: var(--primary); font-size: 18px; }
.file-item .file-name { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { font-size: 12px; color: var(--text-light); }

/* ============ 订单状态步骤条 ============ */
.order-steps { display: flex; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-light);
  white-space: nowrap;
}
.step .step-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.step.active .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.active { color: var(--primary); font-weight: 600; }
.step.done .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.step.done { color: var(--success); }
.step-line { width: 26px; height: 2px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.step-line.done { background: var(--success); }

/* ============ 订单明细行编辑 ============ */
.item-table { width: 100%; border-collapse: collapse; }
.item-table th {
  text-align: left; padding: 8px 8px; font-size: 12.5px;
  color: var(--text-secondary); background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.item-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.item-table input, .item-table select {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  width: 100%; outline: none; font-size: 13px;
}
.item-table input:focus { border-color: var(--primary); }

/* ============ 移动端适配 ============ */
@media (max-width: 900px) {
  .sidebar { margin-left: -240px; position: fixed; }
  .sidebar.open { margin-left: 0; box-shadow: var(--shadow-lg); }
  .content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .search-box input { width: 160px; }
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 16px; }
  .order-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .detail-meta { gap: 8px 14px; }
  .stat-value { font-size: var(--text-2xl); }
}
@media (min-width: 901px) { .mobile-toggle { display: none; } }

/* ============ 移动端增强（手机） ============ */
@media (max-width: 600px) {
  .topbar { height: 56px; padding: 0 12px; gap: 10px; }
  .topbar-title { font-size: 15px; }
  .content { padding: 12px; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }

  /* 统计卡 2 列紧凑布局 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 12px 14px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 16px; border-radius: 10px; }
  .stat-value { font-size: var(--text-xl); }
  .stat-label { font-size: 12px; }
  .stat-sub { font-size: 11px; }

  /* 表格更紧凑（仍可横向滑动） */
  table { font-size: 13px; }
  thead th, tbody td { padding: 9px 10px; }

  /* 弹窗近全屏，编辑体验更好 */
  .modal-overlay { padding: 0; }
  .modal { max-width: 100%; width: 100%; height: 100%; max-height: 100vh; border-radius: 0; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }

  /* 工具栏：搜索框拉满 */
  .toolbar { align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .toolbar-right { justify-content: flex-end; }

  /* 登录页 */
  .login-card { padding: 28px 22px 22px; }
  .login-logo { margin-bottom: 20px; }
  .login-logo h1 { font-size: 17px; }

  /* toast 通栏显示 */
  .toast-container { left: 12px; right: 12px; top: 68px; }
  .toast { min-width: 0; width: 100%; }

  /* 详情页 */
  .detail-header { gap: 12px; }
  .detail-info h1 { font-size: 18px; }
  .detail-info .detail-meta { gap: 6px 12px; font-size: 12px; }
  .info-label { width: 84px; }

  /* 订单卡片 */
  .order-cards { grid-template-columns: 1fr; gap: 12px; }
  .order-card { padding: 14px 16px; }
  .order-card .oc-amount { font-size: 18px; }
  .pay-block { padding: 12px; }
  .pay-block .pay-amount { font-size: 16px; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }

  /* 状态步骤条 */
  .step { font-size: 11.5px; }
  .step-line { width: 14px; }
  .step-dot { width: 22px; height: 22px; }

  /* 文件上传 */
  .file-item { flex-wrap: wrap; }
  .file-item .file-size { width: 100%; }

  /* 按钮微调 */
  .btn { padding: 7px 12px; font-size: 13px; }
  .btn-sm { padding: 4px 8px; font-size: 12px; }

  /* 空状态 */
  .empty { padding: 36px 16px; }
  .empty i { font-size: 38px; }
}

/* ============ 打印 ============ */
@media print {
  .sidebar, .topbar, .toolbar, .no-print { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ============ 工具类 ============ */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.font-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.gap-1 { gap: 8px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mini-stat { background: var(--bg); border-radius: 10px; padding: 14px 16px; }
.mini-stat .ms-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.mini-stat .ms-value { font-size: 19px; font-weight: 700; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* 收款区块 */
.pay-block { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.pay-block .pay-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pay-block .pay-name { font-weight: 600; font-size: 14px; }
.pay-block .pay-amount { font-size: 18px; font-weight: 700; }
.pay-block .pay-meta { font-size: 12.5px; color: var(--text-secondary); }
.pay-block.deposit { border-left: 4px solid var(--primary); }
.pay-block.mid { border-left: 4px solid var(--orange); }
.pay-block.final { border-left: 4px solid var(--success); }

/* 订单卡片 */
.order-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.order-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.order-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--primary-light); }
.order-card .oc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.order-card .oc-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card .oc-body { display: flex; justify-content: space-between; align-items: flex-end; }
.order-card .oc-amount { font-size: 20px; font-weight: 700; color: var(--primary); }
.order-card .oc-meta { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }
.order-card .oc-meta i { margin-right: 4px; }

/* 时间线 */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px 0; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--border);
}
.tl-item.done::before { background: var(--success); border-color: var(--success); }
.tl-item.active::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.2); }
.tl-item .tl-title { font-weight: 600; font-size: 13.5px; }
.tl-item .tl-date { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ============ 登录页 ============ */
.login-page {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  padding: 20px;
}
.login-page.hidden { display: none; }
.hidden { display: none !important; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--card);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 36px 34px 28px;
}
.login-card .btn:disabled { opacity: .55; cursor: not-allowed; }
.login-card .btn-primary:disabled { box-shadow: none; }
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo h1 { font-size: 19px; color: var(--text); }
.login-logo p { font-size: 12px; color: var(--text-light); letter-spacing: 1px; margin-top: 2px; }
.login-input {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0 14px; height: 44px; margin-top: 6px;
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
}
.login-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.login-input i { color: var(--text-light); font-size: 14px; }
.login-input input { flex: 1; border: none; outline: none; background: transparent; height: 100%; font-size: 14px; }
.login-error { min-height: 22px; color: var(--danger); font-size: 13px; margin: 8px 0 2px; }
.btn-block { width: 100%; height: 44px; font-size: 15px; border-radius: 10px; margin-top: 6px; }
.login-demo {
  margin-top: 22px; padding: 14px 16px;
  background: var(--primary-bg); border-radius: 10px;
  font-size: 12.5px; color: var(--text-secondary);
}
.login-demo .demo-title { font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.login-demo .demo-list { display: flex; flex-direction: column; gap: 5px; line-height: 1.6; }
.login-demo .demo-list b { color: var(--text); font-family: ui-monospace, Consolas, monospace; }
.login-demo .demo-tip { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(37,99,235,.2); color: var(--text-light); }

/* ============ 顶栏用户信息 ============ */
.user-box { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.user-box .user-meta { display: flex; flex-direction: column; line-height: 1.25; margin-right: 4px; }
.user-box .user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-box .user-role { font-size: 11px; color: var(--text-secondary); }
.user-box .avatar { width: 30px; height: 30px; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
