/* ========================================
   骑士保服务履约舱 — SaaS Pro Design
   Brand: Orange #FF6B35
   ======================================== */

:root {
  /* Brand */
  --brand: #FF6B35;
  --brand-hover: #E85A28;
  --brand-light: #FFF0EA;
  --brand-lighter: #FFF8F5;
  --brand-soft: #FFB499;
  --prog-pending: #2563EB; /* 服务进度-待发货（蓝，避免灰色不搭） */

  /* Neutral */
  --bg-base: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-hover: #F3F4F6;
  --bg-input: #F9FAFB;
  --text-1: #111827;
  --text-2: #4B5563;
  --text-3: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F0F1F3;

  /* Status */
  --green: #16A34A;
  --green-bg: #DCFCE7;
  --amber: #D97706;
  --amber-bg: #FEF3C7;
  --red: #DC2626;
  --red-bg: #FEE2E2;
  --blue: #2563EB;
  --blue-bg: #DBEAFE;
  --purple: #7C3AED;
  --purple-bg: #EDE9FE;

  /* Layout */
  --sidebar-w: 224px;
  --header-h: 56px;

  /* Radius — 3级统一体系 */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

  /* Font */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;

  --transition: 0.15s ease;
}

[data-theme="dark"] {
  --bg-base: #0F1115;
  --bg-surface: #1A1D23;
  --bg-hover: #22262E;
  --bg-input: #22262E;
  --text-1: #F3F4F6;
  --text-2: #9CA3AF;
  --text-3: #6B7280;
  --border: #2D3139;
  --border-light: #232730;
  --brand-light: rgba(255,107,53,0.12);
  --brand-lighter: rgba(255,107,53,0.06);
  --brand-soft: #FF9E7A;
  --prog-pending: #60A5FA; /* 服务进度-待发货（暗色下用更亮蓝） */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  zoom: 1.1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-1);
  line-height: 1.55;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* ===== Login ===== */
.login-container {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 12% 8%, rgba(255,107,53,0.07), transparent 60%),
    radial-gradient(1000px 520px at 88% 92%, rgba(37,99,235,0.06), transparent 55%),
    var(--bg-base);
  position: relative;
  overflow: hidden;
}

/* 登录页装饰背景 */
.login-container::before {
  content: '';
  position: absolute;
  top: -25%;
  right: -12%;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(255,107,53,0.13) 0%, transparent 68%);
  border-radius: 50%;
  filter: blur(12px);
  pointer-events: none;
  animation: floatBlob1 15s ease-in-out infinite;
}
.login-container::after {
  content: '';
  position: absolute;
  bottom: -22%;
  left: -12%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(37,99,235,0.11) 0%, transparent 68%);
  border-radius: 50%;
  filter: blur(12px);
  pointer-events: none;
  animation: floatBlob2 19s ease-in-out infinite;
}
@keyframes floatBlob1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-26px, 30px); }
}
@keyframes floatBlob2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(28px, -26px); }
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 34px 24px;
  width: 380px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-hover));
}

.login-card .login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 11px;
  margin-bottom: 22px;
}

.login-card .login-brand .brand-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: 0 8px 20px -4px rgba(255,107,53,0.45);
}

.login-card h1 {
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-3);
  font-size: 0.82rem;
  margin-bottom: 25px;
}

.login-card .brand-tag {
  font-size: 0.76rem;
  color: var(--brand);
  background: var(--brand-light);
  padding: 3px 13px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.login-card .input-with-icon {
  position: relative;
}
.login-card .input-with-icon .input-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-3);
  pointer-events: none;
  transition: color var(--transition);
}
.login-card .input-with-icon .form-input {
  padding-left: 40px;
}
.login-card .input-with-icon .form-input:focus ~ .input-ico {
  color: var(--brand);
}

.login-card .login-submit {
  margin-top: 6px;
  letter-spacing: 4px;
}

.login-card .login-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-3);
}
.login-card .login-footer .logo-sub {
  color: var(--text-2);
  font-weight: 600;
}

/* ===== App Layout ===== */
.app-container {
  display: none;
  min-height: 100vh;
}
.app-container.active {
  display: flex;
}

/* ===== Sidebar (Fixed-width reference design) ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-logo .logo-mark {
  width: 26px;
  height: 26px;
  background: var(--brand);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.01em;
}

.sidebar-logo .logo-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: 6px;
}

.nav-section-title {
  font-size: 0.72rem;
  color: var(--text-3);
  padding: 14px 20px 6px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* 导航项 — 参考图风格：固定宽，左侧 3px 橙色高亮条，胶囊形 hover */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 40px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.18s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  position: relative;
  font-family: inherit;
  letter-spacing: 0.01em;
}

/* 左侧高亮条容器 */
.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transform: scaleY(0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.nav-item:hover::before {
  opacity: 0.35;
  transform: scaleY(0.7);
}

.nav-item.active {
  color: var(--brand);
  background: var(--brand-light);
  font-weight: 600;
}

.nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

/* 导航图标 — Lucide SVG 风格 */
.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
  stroke-width: 1.8;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.2s ease;
}

.nav-item:hover .nav-icon svg {
  transform: scale(1.08);
}

.nav-item.active .nav-icon svg {
  stroke-width: 2.2;
}

/* 侧栏底部 */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 0 12px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 44px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease;
  border-radius: var(--r-md);
}

.user-info:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px -1px rgba(255, 107, 53, 0.35);
}

.user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* 侧栏底部按钮 — 与 nav-item 同风格 */
.sidebar-footer .btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 36px;
  width: 100%;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  white-space: nowrap;
  border-radius: var(--r-md);     /* 统一圆角，不再强制 0 */
  justify-content: flex-start;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.sidebar-footer .btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.sidebar-footer .btn .btn-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.sidebar-footer .btn:hover .btn-icon { transform: none; }

/* ===== Sidebar overlay (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-md);
  background: var(--bg-base);
  transition: background var(--transition);
}

.header-user:hover {
  background: var(--bg-hover);
}

.header-user .header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.header-user .header-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  color: var(--text-2);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--brand);
  color: var(--brand);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-1);
  padding: 4px;
}

/* Page Content */
.page-content {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
}

.page-section {
  display: none;
}
.page-section.active {
  display: block;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-title > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-sub {
  font-size: 0.74rem;
  color: var(--text-2);
  font-weight: 500;
  background: var(--bg-input);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.card-title svg {
  color: var(--brand);
  flex-shrink: 0;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}

.form-label .required {
  color: var(--red);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  color: var(--text-1);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  transition: all var(--transition);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-3);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}

.form-input.error,
.form-select.error {
  border-color: var(--red);
}

.form-error {
  font-size: 0.72rem;
  color: var(--red);
  margin-top: 4px;
}

.form-textarea {
  min-height: 72px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--r-md);    /* 统一 8px 圆角 */
  border: 1px solid transparent;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  font-family: var(--font-sans);
  white-space: nowrap;
  line-height: 1.2;
  letter-spacing: 0.01em;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn .btn-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
  flex-shrink: 0;
  transition: transform .2s ease;
}

.btn:hover .btn-icon { transform: translateX(1px); }

/* 主操作按钮 — 品牌橙实心 (参考图「添加客户」) */
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(255, 107, 53, 0.25),
              0 2px 8px -2px rgba(255, 107, 53, 0.35);
}
.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3),
              0 6px 16px -4px rgba(255, 107, 53, 0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.97); }

/* 成功按钮 — 绿色实心 */
.btn-success {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.2);
}
.btn-success:hover {
  background: #15803D;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(22, 163, 74, 0.4);
}

/* 警告按钮 — 琥珀色 */
.btn-warning {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 1px 2px rgba(217, 119, 6, 0.2);
}
.btn-warning:hover {
  background: #B45309;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(217, 119, 6, 0.4);
}

/* 危险按钮 — 红色 */
.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
  background: #B91C1C;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(220, 38, 38, 0.4);
}

/* 次要按钮 — 白底描边 (参考图「导出」) */
.btn-outline {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-1);
}
.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--text-3);
  transform: translateY(-1px);
}

/* 幽灵按钮 — 无边框透明 */
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.btn-sm {
  padding: 6px 13px;
  font-size: 0.76rem;
  border-radius: var(--r-md);    /* 统一 8px 圆角 */
}
.btn-sm .btn-icon { width: 13px; height: 13px; }

/* 物流单号后的「查」按钮：品牌色胶囊，与界面统一语言 */
.track-query-btn {
  margin-left: 8px;
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
  border-radius: 999px;                 /* 胶囊圆角，比 8px 更精致 */
  color: var(--brand);
  border: 1px solid rgba(255, 107, 53, 0.4);
  background: rgba(255, 107, 53, 0.08);
  box-shadow: none;
}
.track-query-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px -2px rgba(255, 107, 53, 0.45);
}
.track-query-btn:active { transform: scale(0.96); }

/* 修改物流单号按钮（中性灰胶囊，与"查"呼应但区分） */
.edit-ship-btn {
  margin-left: 8px;
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
  border-radius: 999px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: transparent;
  box-shadow: none;
}
.edit-ship-btn:hover {
  background: var(--bg-base);
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}
.edit-ship-btn:active { transform: scale(0.96); }

/* 订单号可点击：有发货记录时点击直接修改已发货单号 */
.order-no-edit {
  position: relative;
  transition: color .15s ease;
}
.order-no-edit:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  filter: brightness(1.1);
}
.order-no-edit::after {
  content: "✎";
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0;
  color: var(--brand);
  transition: opacity .15s ease;
}
.order-no-edit:hover::after { opacity: 1; }

.btn-lg {
  padding: 12px 26px;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 图标-only 圆形按钮 */
.btn-icon-only {
  padding: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

thead {
  background: var(--bg-base);
}

th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 0.74rem;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-1);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--bg-hover);
}

/* ===== Badges / Status Tags ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.6;
}

.badge-pending {
  background: var(--amber-bg);
  color: var(--amber);
}
.badge-shipped {
  background: var(--green-bg);
  color: var(--green);
}
.badge-cancelled {
  background: var(--red-bg);
  color: var(--red);
}
.badge-group-a {
  background: var(--purple-bg);
  color: var(--purple);
}
.badge-group-b {
  background: var(--blue-bg);
  color: var(--blue);
}
.badge-group-c {
  background: var(--brand-light);
  color: var(--brand);
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 130px;
}

/* Status filter chips */
.status-filter-btn {
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-filter-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 6px -1px rgba(255, 107, 53, 0.35);
}

.status-filter-btn:hover:not(.active) {
  border-color: var(--brand);
  color: var(--brand);
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17,24,39,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.modal-title svg {
  color: var(--brand);
  flex-shrink: 0;
}
h3[data-icon] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
h3[data-icon] svg {
  color: var(--brand);
  flex-shrink: 0;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  border: none;
  background: var(--bg-hover);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-2);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--red-bg);
  color: var(--red);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== 物流轨迹时间线 ===== */
.tracking-timeline {
  position: relative;
  max-height: 360px;
  overflow-y: auto;
  padding-left: 6px;
}
.tracking-item {
  position: relative;
  padding: 0 0 18px 22px;
  border-left: 2px solid var(--border);
}
.tracking-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.tracking-dot {
  position: absolute;
  left: -7px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--text-3);
  transition: all .2s ease;
}
.tracking-item.is-latest .tracking-dot {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
}
.tracking-content { line-height: 1.5; }
.tracking-desc {
  font-size: 0.88rem;
  color: var(--text-1);
}
.tracking-item.is-latest .tracking-desc {
  font-weight: 600;
  color: var(--brand);
}
.tracking-meta {
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--text-3);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tracking-time { font-family: monospace; }

/* ===== Toast ===== */
#toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: none;
  align-items: center;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  min-width: 280px;
  max-width: 420px;
  animation: toastIn 0.3s ease-out;
}

#toast.show {
  display: flex;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
.toast-warning { background: var(--amber); color: #fff; }
.toast-info { background: var(--bg-surface); color: var(--text-1); border: 1px solid var(--border); }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  color: var(--text-2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 34px;
  text-align: center;
}

.pagination button:hover:not(:disabled) {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 600;
}

.pagination .page-info {
  margin: 0 8px;
  font-size: 0.8rem;
  color: var(--text-3);
  white-space: nowrap;
}

.pagination .page-ellipsis {
  color: var(--text-3);
  padding: 0 4px;
  user-select: none;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
}
.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.4;
}
.empty-state .empty-icon svg {
  color: var(--text-3);
  opacity: 0.5;
}
.empty-state p {
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.empty-state .empty-hint {
  font-size: 0.78rem;
  color: var(--text-3);
  opacity: 0.7;
}

/* ===== Loading ===== */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-light) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-table {
  padding: 0;
}
.skeleton-table .sk-row {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}
.skeleton-table .sk-row:last-child { border-bottom: none; }
.skeleton-table .sk-cell {
  height: 16px;
  border-radius: var(--r-sm);
  flex: 1;
}
.skeleton-table .sk-cell.short { flex: 0.5; }
.skeleton-table .sk-cell.tiny { flex: 0.3; }
.skeleton-table .sk-header {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
}
.skeleton-table .sk-header .sk-cell {
  height: 14px;
}

/* ===== Duplicate Groups ===== */
.duplicate-group {
  border: 1px solid var(--amber);
  border-radius: var(--r-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.duplicate-group-header {
  background: var(--amber-bg);
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== Stats Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  font-family: var(--font-mono);
}

/* 统计卡片颜色区分 */
.stat-card.stat-pending .stat-value { color: var(--amber); }
.stat-card.stat-shipped .stat-value { color: var(--green); }
.stat-card.stat-users .stat-value { color: var(--blue); }

/* 统计卡片左侧色条 */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  opacity: 0.8;
}
.stat-card.stat-pending::before { background: var(--amber); }
.stat-card.stat-shipped::before { background: var(--green); }
.stat-card.stat-users::before { background: var(--blue); }

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 6px;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text-1);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ===== Upload Area ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-base);
}

.upload-area:hover {
  border-color: var(--brand);
  background: var(--brand-lighter);
}

.upload-area .upload-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
  opacity: 0.5;
  color: var(--brand);
}
.upload-area .upload-icon svg {
  color: var(--brand);
  display: inline-block;
}

.upload-area p {
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ===== Misc ===== */
.link-like {
  color: var(--brand);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-like:hover {
  text-decoration: underline;
}
.link-like .toggle-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--brand);
  transition: transform 0.2s ease;
  margin-left: 2px;
}
.link-like.expanded .toggle-arrow {
  transform: rotate(180deg);
}

.shipments-row .shipments-cell {
  background: var(--bg-base);
  padding: 10px 16px;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* 移动端取消 zoom，避免 100vh 溢出产生空白 */
  html {
    zoom: 1 !important;
    font-size: 15px;
  }
  .login-container {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
    transition: transform 0.25s ease;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.15);
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: block !important;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 16px;
  }
  .page-content {
    padding: 16px;
  }
  .app-header {
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .sidebar-overlay.active {
    display: block;
  }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 0.72rem; }
.text-sm { font-size: 0.78rem; }
.text-muted { color: var(--text-3); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-warning { color: var(--amber); }
.w-full { width: 100%; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-row-gap-sm { display: flex; align-items: center; gap: 6px; }
.flex-wrap { flex-wrap: wrap; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 480px; }
.modal-lg { max-width: 560px; }
.modal-xl { max-width: 900px; width: 95vw; }
.p-6 { padding: 24px; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.whitespace-nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.opacity-60 { opacity: 0.6; }

/* ===== Action Bar ===== */
.action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 4px;
}
.action-bar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.action-bar-group + .action-bar-group {
  margin-left: auto;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  position: relative;
}
@media (max-width: 720px) {
  .action-bar-group + .action-bar-group {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    width: 100%;
  }
}
.gap-2 { gap: 12px; }
.highlight { background: var(--amber-bg); padding: 1px 4px; border-radius: 3px; }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-warning { color: var(--amber); }
.text-muted { color: var(--text-3); }

/* ===== Dashboard (数据大盘) ===== */
/* ========== 数据大盘（紧凑业务风） ========== */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.dash-h-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
}
.dash-h-meta {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 0.8rem;
}

/* ===== 核心指标 4 卡 ===== */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.dash-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dash-kpi-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 10px;
}
.dash-kpi-num {
  font-size: 2.9rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-1);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.dash-kpi-num.accent { color: var(--brand); }
.dash-kpi-sub { margin-top: 9px; font-size: 0.82rem; color: var(--text-3); }
.dash-kpi-rate {
  margin-top: 12px;
  height: 6px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
}
.dash-kpi-rate span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== 通用网格 ===== */
.dash-grid { display: grid; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.dash-grid-main { grid-template-columns: 380px 1fr; }
.dash-grid-3 { grid-template-columns: repeat(3, 1fr); }
.dash-grid-2 { grid-template-columns: repeat(2, 1fr); }
.dash-card { padding: 18px 20px; }

/* ===== Donut ===== */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-wrap-lg { gap: 26px; }
.donut-box { flex-shrink: 0; }
.donut { width: 150px; height: 150px; display: block; }
.donut-lg { width: 172px; height: 172px; }
.dn-num { font-size: 26px; font-weight: 800; fill: var(--text-1); font-variant-numeric: tabular-nums; }
.dn-sub { font-size: 11px; fill: var(--text-3); letter-spacing: 0.3px; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.donut-legend li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; }
.donut-legend i { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.donut-legend span { color: var(--text-2); flex: 1; }
.donut-legend b { color: var(--text-1); font-weight: 700; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.donut-legend.lg-rich li { flex-wrap: wrap; }
.donut-legend.lg-rich em { font-style: normal; font-size: 0.78rem; color: var(--text-3); width: 100%; margin-left: 22px; margin-top: -6px; }

/* ===== 服务进度块 + 今日动态 ===== */
.prog-block { display: flex; flex-direction: column; gap: 18px; }
.dash-today {
  display: flex;
  align-items: stretch;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}
.today-block { flex: 1; text-align: center; }
.today-divider { width: 1px; background: var(--border-light); }
.today-num { font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--text-1); font-variant-numeric: tabular-nums; }
.today-num.accent { color: var(--brand); }
.today-lbl { margin-top: 8px; font-size: 0.86rem; color: var(--text-2); }

/* ===== 趋势图 ===== */
.dash-legend { display: flex; gap: 18px; font-size: 0.84rem; color: var(--text-2); font-weight: 500; }
.dash-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lg-in { background: var(--blue); }
.lg-out { background: var(--brand); }
.chart { display: flex; align-items: flex-end; gap: 12px; height: 240px; padding: 10px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.bar { width: 42%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.5s ease; }
.bar-in { background: var(--blue); }
.bar-out { background: var(--brand); }
.chart-x { margin-top: 8px; font-size: 0.8rem; color: var(--text-3); }

/* ===== 横向条形列表（批次 / 快递公司） ===== */
.barlist { display: flex; flex-direction: column; gap: 16px; }
.bar-row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bar-name { font-size: 0.9rem; color: var(--text-1); font-weight: 500; }
.bar-val { font-size: 0.9rem; color: var(--text-1); font-weight: 700; }
.bar-track { height: 9px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar-sub { display: block; margin-top: 5px; font-size: 0.78rem; color: var(--text-3); }

.dash-empty { padding: 26px 10px; text-align: center; color: var(--text-3); font-size: 0.88rem; }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-main { grid-template-columns: 1fr; }
  .dash-grid-3 { grid-template-columns: 1fr; }
  .dash-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .donut-wrap { flex-direction: column; }
  .donut { width: 140px; height: 140px; }
  .dash-kpi-num { font-size: 2.4rem; }
}

/* ===== 最近录入（单行紧凑布局） ===== */
.entry-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.entry-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px 13px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  font-size: 1rem;
}
.entry-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.entry-item.is-imp::before { background: linear-gradient(180deg, var(--brand), #ff9a6b); }
.entry-item.is-sng::before { background: linear-gradient(180deg, #2563eb, #60a5fa); }
.entry-item:hover {
  border-color: var(--brand-soft, var(--brand));
  box-shadow: 0 4px 16px rgba(255,107,53,.08);
  transform: translateY(-1px);
}
.entry-ico {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
}
.entry-ico.imp { background: rgba(255,107,53,.14); color: var(--brand); }
.entry-ico.sng { background: rgba(37,99,235,.14); color: #2563eb; }
.entry-tag {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .85rem; line-height: 1; font-weight: 700;
  padding: 6px 11px; border-radius: 6px;
  letter-spacing: .3px; white-space: nowrap; box-sizing: border-box;
}
.entry-tag.t-imp { background: rgba(255,107,53,.14); color: var(--brand); }
.entry-tag.t-sng { background: rgba(37,99,235,.14); color: #2563eb; }
.entry-time {
  flex: 0 0 auto;
  font-size: .92rem; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 5px; font-weight: 600;
  white-space: nowrap;
}
.entry-time svg { opacity: .55; }
.entry-batch {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .85rem; line-height: 1; font-weight: 700;
  padding: 6px 11px; border-radius: 6px;
  color: #1d4ed8;
  background: rgba(59,130,246,.1);
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.2);
  white-space: nowrap; box-sizing: border-box;
  min-width: 0;
}
.entry-batch svg { opacity: .7; }
.entry-gifts {
  flex: 1 1 auto;
  min-width: 0;
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.gift-chip {
  flex: 0 0 auto;
  font-size: .9rem; padding: 4px 11px; border-radius: 999px;
  background: var(--bg-input); color: var(--text-2); border: 1px solid var(--border);
  font-weight: 500;
}
.gift-chip b { color: var(--text-1); font-weight: 800; margin-left: 2px; }
.entry-meta {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 16px;
  margin-left: auto;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}
.entry-stat {
  display: inline-flex; align-items: baseline; gap: 4px;
  white-space: nowrap;
}
.entry-stat-label { font-size: .82rem; color: var(--text-3); font-weight: 600; }
.entry-stat-value { font-size: 1.35rem; font-weight: 800; color: var(--text-1); font-variant-numeric: tabular-nums; line-height: 1; }
.entry-stat-value.qty { color: #3b82f6; }

/* 子区块：批量导入下的“最近录入” */
.entry-log-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.entry-log-block > .card-header {
  padding: 0; margin: 0 0 14px 0;
}

@media (max-width: 640px) {
  .entry-item { flex-wrap: wrap; gap: 8px 10px; }
  .entry-gifts { flex-basis: 100%; order: 5; overflow: visible; white-space: normal; }
  .entry-meta { margin-left: 0; padding-left: 0; border-left: none; width: 100%; justify-content: flex-start; }
}
