/* =========================================================
   TK 利润工具 v2 —— 现代 SaaS 设计系统
   ========================================================= */
:root {
  --primary: #157a4a;
  --primary-600: #157a4a;
  --primary-500: #1a8f57;
  --primary-400: #22a06b;
  --primary-soft: #e8f5ee;
  --primary-ring: rgba(21, 122, 74, .16);

  --ink: #0f172a;
  --ink-2: #1e293b;
  --text: #334155;
  --text-2: #475569;
  --muted: #8a97a8;
  --line: #e8edf3;
  --line-2: #f1f5f9;

  --bg: #f4f7fa;
  --surface: #ffffff;

  --sidebar-w: 244px;
  --topbar-h: 66px;
  --radius: 16px;
  --radius-sm: 10px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 20px -14px rgba(16, 24, 40, .10);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .04), 0 18px 36px -20px rgba(16, 24, 40, .18);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, .28);

  --ease: cubic-bezier(.22, .61, .36, 1);

  --success: #0f9d6e;
  --danger: #e5484d;
  --warning: #d97706;
  --blue: #2563eb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1000px 520px at 8% -10%, rgba(26, 143, 87, .07), transparent 62%),
    radial-gradient(900px 480px at 100% 0%, rgba(37, 99, 235, .06), transparent 60%);
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
::selection { background: var(--primary-soft); color: var(--primary); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd6e1; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bfcd; background-clip: content-box; }

/* ---------------- 布局骨架 ---------------- */
.layout { display: flex; min-height: 100vh; }
.layout-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.layout-content { padding: 22px 26px 40px; flex: 1; max-width: 1680px; width: 100%; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
  display: flex; flex-direction: column;
  background: #ffffff;
  border-right: 1px solid var(--line);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px; position: relative; z-index: 1;
}
.logo-img {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  object-fit: cover; background: #fff;
  box-shadow: 0 4px 12px -6px rgba(21, 122, 74, .45), inset 0 0 0 1px rgba(15, 23, 42, .06);
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #22a06b, #157a4a);
  box-shadow: 0 6px 16px -6px rgba(34, 160, 107, .75), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.logo-text b { font-size: 14.5px; color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
.logo-text span { font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; position: relative; z-index: 1; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #dbe3ec; background-clip: content-box; }
.nav-group { margin-bottom: 4px; }
.nav-group-label {
  padding: 12px 10px 6px; font-size: 10px; font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase; color: #a3afbf;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 2px; border-radius: 10px;
  color: #5b6b7f; font-size: 13.5px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-item:hover { background: #f4f7fa; color: var(--ink-2); }
.nav-item.active {
  color: var(--primary); font-weight: 650;
  background: linear-gradient(90deg, #e9f6ef, #f5fbf8);
  box-shadow: inset 0 0 0 1px rgba(21, 122, 74, .14);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--primary-400), var(--primary));
}
.nav-icon { display: inline-flex; width: 18px; height: 18px; opacity: .75; flex-shrink: 0; }
.nav-item:hover .nav-icon { opacity: .95; }
.nav-item.active .nav-icon { opacity: 1; color: var(--primary); }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-arrow { margin-left: auto; opacity: .38; transition: transform .2s var(--ease); }
.nav-arrow.rot { transform: rotate(90deg); }
.nav-sub { padding-left: 12px; margin: 2px 0 4px; border-left: 1px solid var(--line); margin-left: 20px; }
.nav-item.sub { font-size: 13px; padding: 8px 10px; }
.nav-item.sub.active::before { display: none; }

.sidebar-footer {
  display: flex; align-items: center; gap: 7px;
  padding: 14px 20px 18px; font-size: 11.5px; color: var(--muted);
  border-top: 1px solid var(--line); position: relative; z-index: 1;
}
.ver-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.sidebar-mask { display: none; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-heading { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.topbar-heading .crumb { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.topbar-heading h1 { font-size: 17px; font-weight: 650; }
.topbar-spacer { flex: 1; }
.topbar-tz {
  height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  min-width: 142px; cursor: pointer;
}
.topbar-tz:hover { border-color: #d3dce7; color: var(--ink); }
.topbar-user { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border-radius: 999px; transition: background .18s var(--ease); }
.topbar-user:hover { background: var(--line-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 650;
  background: linear-gradient(135deg, #22a06b, #15704a);
  box-shadow: 0 4px 10px -4px rgba(21, 122, 74, .6);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; color: var(--ink-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10.5px; color: var(--muted); }
.menu-btn { display: none; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.icon-btn:hover { background: var(--line-2); color: var(--ink-2); border-color: var(--line); }
.logout-btn:hover { color: var(--danger); background: #fef2f2; border-color: #fee2e2; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 18px;
  transition: box-shadow .22s var(--ease), transform .22s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 15px; font-weight: 650; color: var(--ink);
  margin-bottom: 16px; min-height: 30px;
}
.card-title::before {
  content: ""; width: 3px; height: 15px; border-radius: 3px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--primary-400), var(--primary));
}
.card-extra { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Hero 区（页面头部说明 + 快捷操作） */
.page-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 20px 22px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, #ffffff 0%, #f6fbf8 60%, #eef7f2 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.page-hero-text h2 { font-size: 18px; margin-bottom: 4px; }
.page-hero-text p { font-size: 12.5px; color: var(--muted); max-width: 560px; }
.hero-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-actions .form-input { width: 230px; }

/* ---------------- 表单控件 ---------------- */
.form-input, .form-select, textarea.form-input {
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-2); font-size: 13px;
  outline: none; transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
  min-width: 0;
}
.form-input::placeholder { color: #a9b4c2; }
.form-input:hover, .form-select:hover { border-color: #d7dfe9; }
.form-input:focus, .form-select:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-ring);
  background: #fff;
}
.form-select {
  padding-right: 30px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a97a8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.form-input.mini { height: 30px; padding: 0 8px; font-size: 12.5px; width: 100%; }
label.field { display: flex; flex-direction: column; gap: 5px; }
label.field > span { font-size: 11.5px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }

/* ---------------- 日期选择器 ---------------- */
.tk-date { position: relative; display: inline-block; width: 150px; }
.tk-date-trigger {
  display: flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink-2); font-size: 13px; cursor: pointer; user-select: none;
  box-shadow: var(--shadow-xs);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
.tk-date-trigger:hover { border-color: #cfd9e4; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tk-date.open .tk-date-trigger {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-ring), var(--shadow-xs);
  transform: none;
}
.tk-date-trigger.empty { color: #a9b4c2; }
.tk-date-trigger svg { color: var(--muted); flex-shrink: 0; }
.tk-date.open .tk-date-trigger svg { color: var(--primary); }
.tk-date-text {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.tk-date-clear {
  width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: 9px; color: var(--muted); background: #eef2f7; flex-shrink: 0;
}
.tk-date-clear:hover { background: #fee2e2; color: var(--danger); }
.tk-date-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 130; width: 268px;
  padding: 14px 12px 12px; background: rgba(255, 255, 255, .98);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); animation: popIn .18s var(--ease);
}
.tk-date-pop.right { left: auto; right: 0; }
.tk-date-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.tk-date-title { font-size: 13.5px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tk-date-nav {
  width: 28px; height: 28px; border: none; border-radius: 50%; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.tk-date-nav:hover { background: var(--primary-soft); color: var(--primary); }
.tk-date-nav:active { transform: scale(.92); }
.tk-date-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding-bottom: 6px; }
.tk-date-week span {
  text-align: center; font-size: 10px; font-weight: 650; color: #a3afbf;
  letter-spacing: .06em; text-transform: uppercase;
}
.tk-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.tk-date-cell {
  height: 32px; border: none; border-radius: 50%; background: transparent; cursor: pointer;
  font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums;
  transition: background .14s var(--ease), color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease);
}
.tk-date-cell:hover { background: var(--primary-soft); color: var(--primary); }
.tk-date-cell:active { transform: scale(.92); }
.tk-date-cell.mute { color: #ccd4df; }
.tk-date-cell.today {
  background: var(--primary-soft); color: var(--primary); font-weight: 650;
}
.tk-date-cell.sel {
  background: linear-gradient(135deg, var(--primary-400), var(--primary));
  color: #fff; font-weight: 650;
  box-shadow: 0 6px 14px -6px rgba(21, 122, 74, .85), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.tk-date-cell.sel:hover { color: #fff; }
.tk-date-foot { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.tk-date-btn {
  flex: 1; height: 30px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--text-2); font-size: 12px; font-weight: 550; cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.tk-date-btn:hover {
  border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--primary-500), var(--primary));
  box-shadow: 0 6px 14px -8px rgba(21, 122, 74, .9);
}
.filter-bar .tk-date { width: 148px; }
.filter-bar .tk-date-trigger { height: 34px; }

/* ---------------- 按钮 ---------------- */
.btn {
  height: 36px; padding: 0 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .18s var(--ease);
  box-shadow: var(--shadow-xs);
}
.btn:hover { border-color: #d3dce7; background: #fbfcfe; color: var(--ink-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--primary-500), var(--primary));
  box-shadow: 0 6px 16px -8px rgba(21, 122, 74, .75), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
  box-shadow: 0 10px 22px -10px rgba(21, 122, 74, .8);
}
.btn-danger { color: var(--danger); border-color: #fbd5d5; background: #fff; }
.btn-danger:hover { background: #fef2f2; border-color: #f7c3c3; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.link-btn {
  border: none; background: none; padding: 0; margin-top: 3px; cursor: pointer;
  font-size: 11.5px; color: var(--primary); font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--muted); cursor: wait; text-decoration: none; }

/* ---------------- 指标卡 ---------------- */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 18px 15px; box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary-400), rgba(34, 160, 107, .15));
  opacity: 0; transition: opacity .22s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #dde5ee; }
.stat-card:hover::before { opacity: 1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 550; letter-spacing: .01em; margin-bottom: 7px; }
.stat-value {
  font-size: 25px; font-weight: 700; color: var(--ink); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-value.money-usd { color: var(--primary); }
.stat-sub { margin-top: 8px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat-sub .up { color: var(--success); font-weight: 650; }
.stat-sub .down { color: var(--danger); font-weight: 650; }

/* ---------------- SLA 监测卡片 ---------------- */
.sla-card {
  position: relative; padding: 18px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  text-align: center; overflow: hidden; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.sla-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sla-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--primary); opacity: .85;
}
.sla-card.sla-danger::before { background: linear-gradient(90deg, #dc2626, #f97316); }
.sla-card.sla-danger { border-color: rgba(220, 38, 38, .25); background: linear-gradient(135deg, #fff5f5 0%, #fff 100%); }
.sla-card.sla-warning::before { background: linear-gradient(90deg, #f59e0b, #eab308); }
.sla-card.sla-warning { border-color: rgba(245, 158, 11, .28); background: linear-gradient(135deg, #fffbeb 0%, #fff 100%); }
.sla-card.sla-stuck::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.sla-card.sla-stuck { border-color: rgba(124, 58, 237, .25); background: linear-gradient(135deg, #faf5ff 0%, #fff 100%); position: relative; }
.sla-stuck .sla-num { color: #7c3aed; }
.sla-stuck-ctrl {
  margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; color: #7c3aed;
}
.sla-stuck-input {
  width: 46px; height: 24px; padding: 0 4px; font-size: 11.5px; text-align: center;
  border: 1px solid rgba(124, 58, 237, .3); border-radius: 6px;
  background: #fff; color: #7c3aed; outline: none;
}
.sla-stuck-input:focus { border-color: #7c3aed; }
/* 隐藏 number 输入的上下箭头 */
.sla-stuck-input::-webkit-outer-spin-button,
.sla-stuck-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sla-stuck-input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---------------- 大图查看 Lightbox ---------------- */
.ui-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10, 14, 20, .88);
  display: flex; align-items: center; justify-content: center;
  animation: uiLbIn .18s ease;
}
@keyframes uiLbIn { from { opacity: 0; } to { opacity: 1; } }
.ui-lb-img {
  max-width: 88vw; max-height: 86vh; border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
  object-fit: contain; background: #fff;
}
.ui-lb-close {
  position: absolute; top: 18px; right: 22px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; line-height: 1;
}
.ui-lb-close:hover { background: rgba(255, 255, 255, .28); }
.ui-lb-prev, .ui-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 30px; line-height: 1;
  display: grid; place-items: center;
}
.ui-lb-prev { left: 20px; }
.ui-lb-next { right: 20px; }
.ui-lb-prev:hover, .ui-lb-next:hover { background: rgba(255, 255, 255, .3); }
.ui-lb-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .85); font-size: 13px; letter-spacing: .08em;
  background: rgba(0, 0, 0, .4); padding: 4px 14px; border-radius: 999px;
}
/* 可点击的小图 */
.img-zoomable { cursor: zoom-in; transition: transform .15s ease, box-shadow .15s ease; }
.img-zoomable:hover { transform: scale(1.06); box-shadow: 0 4px 14px -4px rgba(16, 24, 40, .35); }

/* 订单商品规格行 */
.oi-spec {
  font-size: 12px; color: var(--primary); font-weight: 600;
  margin-top: 1px; line-height: 1.3;
}

/* ---------------- 自定义下拉 tk-select ---------------- */
.tk-select { position: relative; display: inline-block; min-width: 120px; }
.tk-select-trigger {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff;
  cursor: pointer; user-select: none;
  font-size: 13px; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.tk-select-trigger:hover { border-color: #cbd5e1; }
.tk-select.open .tk-select-trigger {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.tk-select-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-select-label.placeholder { color: #94a3b8; }
.tk-select-arrow { color: #94a3b8; flex-shrink: 0; transition: transform .18s; }
.tk-select.open .tk-select-arrow { transform: rotate(180deg); color: var(--primary); }
.tk-select-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 500;
  min-width: 100%; max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .06);
  padding: 4px;
}
.tk-select-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--text); white-space: nowrap;
}
.tk-select-item:hover { background: var(--line-2); }
.tk-select-item.active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.tk-select-item.active svg { color: var(--primary); }
.tk-select-empty { padding: 14px; text-align: center; color: #94a3b8; font-size: 12.5px; }
.tk-select-pop-enter-active, .tk-select-pop-leave-active { transition: opacity .14s ease, transform .14s ease; }
.tk-select-pop-enter-from, .tk-select-pop-leave-to { opacity: 0; transform: translateY(-4px); }
.sla-icon { font-size: 22px; margin-bottom: 6px; }
.sla-num {
  font-size: 32px; font-weight: 750; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 6px;
  color: var(--ink);
}
.sla-danger .sla-num { color: #dc2626; }
.sla-warning .sla-num { color: #d97706; }
.sla-label { font-size: 12px; color: var(--muted); font-weight: 550; letter-spacing: .01em; }

/* SLA 倒计时标签（订单表内） */
.sla-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap; line-height: 1.5; border: 1px solid transparent;
}
.sla-tag.sla-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.sla-tag.sla-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.sla-tag.sla-normal { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.sla-tag.sla-ship.sla-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.sla-tag.sla-ship.sla-warning { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.sla-tag.sla-deliver.sla-danger { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.sla-tag.sla-deliver.sla-warning { background: #fefce8; color: #a16207; border-color: #fde68a; }
.sla-tag + .sla-tag { margin-left: 4px; }

/* ---------------- 分段选择器（时间范围切换） ----------------
 * 修 2026-10-22：原 btn-primary 选中态白字+透明背景导致看不见。专用 seg 组件。 */
.seg {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--line-2); border-radius: 8px;
}
.seg-btn {
  height: 28px; padding: 0 12px; border: none; background: transparent;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; border-radius: 6px;
  font-weight: 500; transition: all .15s var(--ease); white-space: nowrap;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active {
  background: #fff; color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .1), 0 0 0 1px rgba(15, 23, 42, .04);
}
.seg-btn:active { transform: scale(.97); }

/* ---------------- 订单表格（密度更高、字体更大） ---------------- */
.orders-table-card table { font-size: 13.5px; }
.orders-table-card th { font-size: 12px; padding: 10px 12px; }
.orders-table-card td { padding: 12px; }
.orders-table-card .oi-name { font-size: 13px; line-height: 1.4; }
.orders-table-card .oi-meta { font-size: 11.5px; }

/* ---------------- 状态统计条 ---------------- */
.status-bar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: stretch;
  padding: 6px; margin-bottom: 14px; border-radius: 12px;
  background: #f7f9fc; border: 1px solid var(--line);
}
.status-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 16px 7px; border-radius: 9px; cursor: pointer; min-width: 86px;
  color: var(--text-2); font-weight: 550;
  transition: all .16s var(--ease); user-select: none;
}
.status-count { font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.25; }
.status-label { font-size: 11.5px; color: var(--muted); letter-spacing: .01em; white-space: nowrap; }
.status-item:hover { background: #fff; box-shadow: var(--shadow-xs); }
.status-item.active {
  background: #fff; box-shadow: var(--shadow-xs), inset 0 0 0 1px rgba(21, 122, 74, .18);
}
.status-item.active .status-label { color: var(--primary); }
.status-item.active .status-count { color: var(--primary); }
.status-item em {
  font-style: normal; font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 999px;
  background: #eef2f7; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.status-item.active em { background: var(--primary-soft); color: var(--primary); }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 14px 16px; margin-bottom: 14px;
  background: #fafcfe; border: 1px solid var(--line); border-radius: 12px;
}
.filter-bar .form-input, .filter-bar .form-select { height: 34px; }
.filter-bar .form-input { width: 180px; }
.filter-bar .form-select { min-width: 130px; }

/* ---------------- 表格 ---------------- */
.table-wrap {
  overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  max-height: calc(100vh - 360px);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; padding: 11px 14px; white-space: nowrap;
  font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--text); }
tbody tr { transition: background .14s var(--ease); }
tbody tr:hover td { background: #f8fbff; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary-400); }

.cell-product { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.cell-product img, .cell-product .thumb {
  width: 44px; height: 44px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
  background: #f1f5f9; border: 1px solid var(--line);
}
.cell-product .pname {
  font-size: 13px; color: var(--ink-2); font-weight: 550; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cell-product .pspec { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* 同订单多件：商品明细堆叠在同一行内 */
.order-items { display: flex; flex-direction: column; gap: 8px; min-width: 170px; max-width: 280px; }
.order-item { display: flex; gap: 9px; align-items: center; }
.order-item + .order-item { padding-top: 8px; border-top: 1px dashed var(--line-2); }
.oi-thumb {
  width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: #f1f5f9; border: 1px solid var(--line);
}
.oi-info { min-width: 0; max-width: 190px; }
.oi-name {
  font-size: 12.5px; color: var(--ink-2); font-weight: 550; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.oi-meta { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oi-pid { font-size: 11px; color: var(--primary); margin-top: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oi-pid:hover { text-decoration: underline; }
.oi-total { font-size: 11px; color: var(--muted); padding-top: 6px; border-top: 1px dashed var(--line-2); }

/* 多商品订单：按 SKU 修改成本弹窗 */
.cost-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.cost-row-info { flex: 1; min-width: 0; }
.cost-row-name { font-size: 12.5px; color: var(--ink-2); font-weight: 550; line-height: 1.4; }
.cost-row-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.7;
  background: #f1f5f9; color: var(--text-2); white-space: nowrap;
}
.tag-green { background: #e9f8f0; color: #0b7a51; }
.tag-orange { background: #fff4e6; color: #b45309; }
.tag-red { background: #feecec; color: #c53030; }
.tag-blue { background: #eaf1ff; color: #1d4ed8; }
.tag-gray { background: #f1f5f9; color: #64748b; }
.tag-purple { background: #f3ecff; color: #6d28d9; }

/* ---------------- 金额 ---------------- */
.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.money-usd { color: var(--primary); }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--muted); }
.text-secondary { color: var(--text-2); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------------- 分页 ---------------- */
.pagination {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 4px 2px; font-size: 12.5px; color: var(--muted);
}
.pagination-pages { display: flex; gap: 5px; margin-left: auto; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 12.5px; font-weight: 550; cursor: pointer;
  transition: all .16s var(--ease);
}
.page-btn:hover:not(:disabled) { border-color: var(--primary-400); color: var(--primary); }
.page-btn.active {
  background: linear-gradient(135deg, var(--primary-500), var(--primary));
  border-color: transparent; color: #fff; box-shadow: 0 6px 14px -8px rgba(21, 122, 74, .8);
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .42);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  animation: fadeIn .18s var(--ease);
}
.modal {
  width: 480px; max-width: calc(100vw - 32px); max-height: 84vh; overflow: auto;
  background: #fff; border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: popIn .22s var(--ease);
}
.modal-title { font-size: 16px; font-weight: 650; margin-bottom: 16px; color: var(--ink); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------------- 确认 / 提示弹窗 ---------------- */
.ui-mask {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, .44);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn .18s var(--ease);
}
.ui-mask.closing { animation: fadeOut .14s var(--ease) forwards; }
.ui-modal {
  width: 420px; max-width: 100%;
  background: #fff; border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: popIn .22s var(--ease);
}
.ui-modal-body { display: flex; gap: 14px; align-items: flex-start; }
.ui-modal-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
}
.ui-icon-danger { color: var(--danger); background: #fef2f2; box-shadow: inset 0 0 0 1px #fee2e2; }
.ui-icon-info { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(21, 122, 74, .14); }
.ui-icon-success { color: var(--success); background: #ecfdf5; box-shadow: inset 0 0 0 1px #d1fae5; }
.ui-modal-text { min-width: 0; }
.ui-modal-title { font-size: 15.5px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.ui-modal-msg { font-size: 13px; color: var(--text-2); line-height: 1.65; word-break: break-word; }
.ui-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.btn-danger-solid {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #ef6a6e, var(--danger));
  box-shadow: 0 6px 16px -8px rgba(229, 72, 77, .8), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-danger-solid:hover {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #f27d80, var(--danger));
}

/* ---------------- 加载 / 空状态 ---------------- */
/* 遮罩静态不闪：backdrop 固定半透明 + 模糊，明确区分"加载中"与"已加载" */
.loading-mask { position: relative; pointer-events: none; }
.loading-mask::after {
  content: ""; position: absolute; inset: 0; z-index: 5;
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
/* 加载指示条：滑动的绿色光条，只动自身不影响遮罩 */
.loading-mask::before {
  content: ""; position: absolute; z-index: 6;
  left: 50%; top: 50%; width: 148px; height: 6px;
  margin: -3px 0 0 -74px; border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0%, var(--primary-400) 35%, var(--primary) 50%, var(--primary-400) 65%, transparent 100%),
    var(--line-2);
  background-size: 40% 100%, 100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .05);
  animation: slideBarTrack 1.15s var(--ease) infinite;
}
@keyframes slideBarTrack {
  0%   { background-position: -40% 0, 0 0; }
  100% { background-position: 140% 0, 0 0; }
}
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); font-size: 13px; }
.empty-icon { font-size: 30px; margin-bottom: 10px; opacity: .7; }
.chart-container { width: 100%; height: 340px; }

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 15% 0%, rgba(34, 160, 107, .20), transparent 62%),
    radial-gradient(760px 460px at 88% 100%, rgba(37, 99, 235, .14), transparent 60%),
    linear-gradient(160deg, #0d1726 0%, #122035 52%, #0b1421 100%);
}
.login-card {
  width: 416px; max-width: 100%; padding: 34px 34px 30px;
  background: rgba(255, 255, 255, .97); border-radius: 22px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .4) inset;
  animation: popIn .3s var(--ease);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .logo-icon, .login-brand .logo-img { width: 42px; height: 42px; border-radius: 12px; }
.login-brand b { display: block; font-size: 17px; color: var(--ink); font-weight: 700; }
.login-brand span { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.login-card h2 { font-size: 21px; margin-bottom: 5px; }
.login-card .sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field > span { font-size: 12px; }
.login-card .form-input { height: 42px; border-radius: 11px; font-size: 14px; }
.login-card .btn { width: 100%; height: 44px; border-radius: 11px; font-size: 14px; margin-top: 6px; }
.login-error {
  margin-top: 14px; padding: 9px 12px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fee2e2; color: #c53030; font-size: 12.5px;
}
.login-foot { margin-top: 18px; text-align: center; font-size: 11.5px; color: #9aa6b5; }
.login-back {
  position: fixed; top: 22px; left: 24px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: rgba(255, 255, 255, .72);
  transition: color .16s var(--ease);
}
.login-back:hover { color: #fff; }

/* ---------------- 物流商配置 ---------------- */
.carrier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.carrier-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  transition: box-shadow .22s var(--ease), transform .22s var(--ease), border-color .22s var(--ease);
}
.carrier-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #dfe7f0; }
.carrier-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.carrier-logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-size: 16px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 8px 18px -10px rgba(15, 23, 42, .5), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.carrier-meta { min-width: 0; flex: 1; }
.carrier-name { font-size: 14px; font-weight: 650; color: var(--ink); }
.carrier-code { font-size: 11px; color: var(--muted); }
.carrier-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.carrier-status i { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; }
.carrier-status.linked { color: var(--primary); }
.carrier-status.linked i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.carrier-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.carrier-shops { border-top: 1px dashed var(--line); padding-top: 10px; margin-bottom: 12px; }
.carrier-shops-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 12px; color: var(--text-2); font-weight: 550;
}
.shop-badge { padding: 1px 8px; border-radius: 999px; background: #eef2f7; color: var(--text-2); font-size: 11px; }
.chev { margin-left: auto; color: var(--muted); transition: transform .18s var(--ease); font-size: 12px; }
.chev.open { transform: rotate(180deg); }
.shop-pick { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; max-height: 130px; overflow: auto; }
.shop-opt { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.carrier-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.test-msg { font-size: 11.5px; }
.test-msg.ok { color: var(--success); }
.test-msg.err { color: var(--danger); }

/* ---------------- 运费模板 ---------------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.tpl-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fbfcfe; }
.tpl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tpl-name { font-weight: 600; border-color: transparent; background: transparent; padding-left: 4px; }
.tpl-name:hover { border-color: var(--line); background: #fff; }
.tier-table { width: 100%; font-size: 12px; }
.tier-table th { background: transparent; padding: 6px 6px; font-size: 10.5px; }
.tier-table td { padding: 4px 6px; }
.add-tier { margin-top: 8px; width: 100%; border-style: dashed; color: var(--muted); }
.add-tier:hover { color: var(--primary); border-color: var(--primary-400); }

/* 试算结果条 */
.trial-result {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 18px; margin-bottom: 18px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 13px; animation: popIn .22s var(--ease);
}
.trial-fee { font-size: 19px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ---------------- 轻提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 400;
  transform: translate(-50%, 18px); opacity: 0; pointer-events: none;
  padding: 11px 20px; border-radius: 12px; font-size: 13px; font-weight: 550;
  color: #fff; background: rgba(15, 23, 42, .92);
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: rgba(197, 48, 48, .95); }
.toast.success { background: rgba(11, 122, 81, .95); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .carrier-fields { grid-template-columns: 1fr; }
  .layout-content { padding: 18px 18px 36px; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .26s var(--ease); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-mask {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(15, 23, 42, .42);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  }
  .layout-main { margin-left: 0; }
  .menu-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border-radius: 10px; border: 1px solid var(--line); background: #fff;
    color: var(--text-2); cursor: pointer;
  }
  .topbar { padding: 0 16px; }
  .user-meta { display: none; }
}
@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
  .hero-actions { margin-left: 0; width: 100%; }
  .hero-actions .form-input { flex: 1; width: auto; }
  .filter-bar .form-input { width: 100%; }
  .table-wrap { max-height: none; }
}

/* 数据更新时间 + 内置更新按钮 */
.data-fresh {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: #94a3b8; white-space: nowrap;
}

/* 结算管理页页签 */
.tabs { display: flex; border-bottom: 1px solid #eef2f7; padding: 0 16px; }
.tab {
  padding: 12px 18px; font-size: 13.5px; font-weight: 550; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s; user-select: none;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; }

/* 结算-未结算商品单元格 */
.prod-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tk-select 搜索输入 */
.tk-select-search { padding: 6px 8px; border-bottom: 1px solid #eef2f7; position: sticky; top: 0; background: #fff; }
.tk-select-search-input {
  width: 100%; height: 28px; padding: 0 8px; box-sizing: border-box;
  border: 1px solid #e2e8f0; border-radius: 6px; font-size: 12.5px; outline: none;
}
.tk-select-search-input:focus { border-color: #3b82f6; }

/* 顶栏时区时钟 */
.tz-clock {
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums; margin-right: 10px;
}

/* 概览页趋势指标多选 chip */
.ov-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none;
  transition: all .15s var(--ease);
}
.ov-chip:hover { border-color: #cbd5e1; color: var(--ink); }
.ov-chip.active {
  background: var(--primary-soft); border-color: rgba(21, 122, 74, .3);
  color: var(--ink); font-weight: 600;
}
.ov-chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* 缓存数据提示弹窗（右下角，不阻断页面操作） */
.cache-tip {
  position: fixed; right: 22px; bottom: 22px; z-index: 1200;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: #111827; color: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .28);
  font-size: 12.5px;
}
.cache-tip-text { color: #e5e7eb; white-space: nowrap; }
.cache-tip-close {
  border: 0; background: transparent; color: #9ca3af;
  font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.cache-tip-close:hover { color: #fff; }

/* =========================================================
   公开首页（落地页）—— 无需登录可浏览
   ========================================================= */
.lp-page { min-height: 100vh; background: #fff; overflow-x: hidden; }
.lp-wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* 顶部导航 */
.lp-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 237, 243, .9);
}
.lp-nav-inner { height: 66px; display: flex; align-items: center; gap: 26px; }
.lp-brand { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.lp-brand .logo-img { width: 32px; height: 32px; border-radius: 9px; }
.lp-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.lp-brand-text b { font-size: 14.5px; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.lp-brand-text span { font-size: 9.5px; color: var(--muted); letter-spacing: .1em; }
.lp-nav-links { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.lp-nav-links a { font-size: 13.5px; color: var(--text-2); font-weight: 500; transition: color .16s var(--ease); }
.lp-nav-links a:hover { color: var(--primary); }
.lp-login-btn { height: 38px; padding: 0 18px; border-radius: 10px; flex-shrink: 0; }

/* Hero */
.lp-hero {
  position: relative; padding: 78px 0 76px;
  background:
    radial-gradient(920px 480px at 10% -6%, rgba(34, 160, 107, .13), transparent 62%),
    radial-gradient(820px 440px at 96% 4%, rgba(37, 99, 235, .08), transparent 60%),
    #fff;
}
.lp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr); gap: 52px; align-items: center; }
.lp-hero-copy, .lp-hero-visual, .lp-preview { min-width: 0; }
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(34, 160, 107, .09); border: 1px solid rgba(21, 122, 74, .16);
  font-size: 11.5px; font-weight: 650; color: #157a4a; letter-spacing: .03em;
}
.lp-dot { width: 6px; height: 6px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 3px rgba(34, 160, 107, .18); }
.lp-hero-copy h1 { margin-top: 18px; font-size: 44px; line-height: 1.22; letter-spacing: -.028em; color: #0b1a2b; }
.lp-hero-sub { margin-top: 18px; max-width: 548px; font-size: 15px; line-height: 1.85; color: var(--text-2); }
.lp-hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.lp-btn-lg { height: 46px; padding: 0 24px; border-radius: 12px; font-size: 14.5px; }
.lp-btn-ghost { background: #fff; }
.lp-note { display: flex; align-items: center; gap: 7px; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.lp-note svg { color: #15a06a; flex-shrink: 0; }
.lp-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.lp-hero-tags span {
  padding: 5px 11px; border-radius: 999px; background: #f5f8fb;
  border: 1px solid var(--line); font-size: 12px; color: var(--text-2);
}

/* Hero 右侧产品预览 */
.lp-hero-visual { position: relative; }
.lp-preview {
  position: relative; padding: 20px; border-radius: 20px; background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -38px rgba(15, 23, 42, .32), 0 0 0 1px rgba(255, 255, 255, .7) inset;
}
.lp-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--line-2);
}
.lp-preview-head b { display: block; font-size: 14px; color: var(--ink); }
.lp-preview-head span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.lp-preview-badge {
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #0f9d6e; background: #e8f8f0; border: 1px solid #d3f0e1;
  display: inline-block !important; margin-top: 0 !important;
}
.lp-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.lp-kpi { padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line-2); }
.lp-kpi span { display: block; margin-bottom: 4px; font-size: 10.5px; color: var(--muted); }
.lp-kpi b { display: block; font-size: 16.5px; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lp-kpi i { font-style: normal; font-size: 10.5px; font-weight: 600; }
.lp-kpi i.up { color: #0f9d6e; }
.lp-kpi i.down { color: #e5484d; }
.lp-chart { margin-top: 16px; padding: 14px; border-radius: 12px; background: linear-gradient(180deg, #fbfdff, #f6f9fc); border: 1px solid var(--line-2); }
.lp-chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.lp-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: #22a06b; margin-right: 5px; vertical-align: middle; }
.lp-bars { height: 108px; display: flex; align-items: flex-end; gap: 8px; }
.lp-bars span { flex: 1; border-radius: 5px 5px 3px 3px; background: linear-gradient(180deg, #3cbe85, #157a4a); opacity: .88; }
.lp-preview-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 11px; color: var(--muted); }

/* 通用区块 */
.lp-section { padding: 76px 0; scroll-margin-top: 84px; }
.lp-section-alt {
  background: linear-gradient(180deg, #f7fafc, #fbfdff);
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.lp-section-head { max-width: 620px; margin-bottom: 38px; }
.lp-section-head h2, .lp-about-copy h2, .lp-contact-copy h2 {
  margin-top: 14px; font-size: 30px; line-height: 1.35; letter-spacing: -.022em;
}
.lp-section-head p, .lp-about-copy p, .lp-contact-copy p {
  margin-top: 12px; font-size: 14px; line-height: 1.85; color: var(--text-2);
}

/* 功能卡片 */
.lp-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-feature {
  padding: 24px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.lp-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #dde5ee; }
.lp-feature-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 16px; color: #157a4a; background: var(--primary-soft);
}
.lp-feature h3 { margin-bottom: 8px; font-size: 15.5px; }
.lp-feature p { font-size: 13px; line-height: 1.78; color: var(--text-2); }
.lp-feature-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.lp-feature-tags span {
  padding: 3px 8px; border-radius: 6px; font-size: 11px;
  color: var(--text-2); background: #f5f8fb; border: 1px solid var(--line-2);
}

/* 使用流程 */
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-step {
  padding: 26px 24px; border-radius: 16px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-xs);
}
.lp-step-no { margin-bottom: 14px; font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: rgba(21, 122, 74, .2); }
.lp-step h3 { margin-bottom: 8px; font-size: 15.5px; }
.lp-step p { font-size: 13px; line-height: 1.78; color: var(--text-2); }

/* 关于我们 */
.lp-about-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 48px; align-items: start; }
.lp-about-copy p + p { margin-top: 12px; }
.lp-about-points { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.lp-about-point { display: flex; gap: 12px; }
.lp-about-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  flex-shrink: 0; color: #157a4a; background: #f2f8f5;
}
.lp-about-point b { display: block; margin-bottom: 3px; font-size: 13.5px; color: var(--ink); }
.lp-about-point span { font-size: 12.5px; line-height: 1.72; color: var(--text-2); }
.lp-company-card {
  padding: 26px; border-radius: 18px; background: linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.lp-company-card h3 { padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.lp-company-card dl { margin: 0; }
.lp-company-card dl > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed #eef2f6; }
.lp-company-card dl > div:last-child { border-bottom: 0; }
.lp-company-card dt { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lp-company-card dd { margin: 0; font-size: 12.5px; font-weight: 500; color: var(--ink-2); text-align: right; }
.lp-company-btn { width: 100%; height: 40px; margin-top: 18px; border-radius: 11px; }

/* 联系我们 */
.lp-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.lp-contact-card {
  display: flex; flex-direction: column; padding: 20px 24px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
}
.lp-contact-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line-2); }
.lp-contact-row:last-child { border-bottom: 0; }
.lp-contact-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  flex-shrink: 0; color: #157a4a; background: var(--primary-soft);
}
.lp-contact-row span { display: block; font-size: 11.5px; color: var(--muted); }
.lp-contact-row b { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 600; color: var(--ink); }

/* 页脚 */
.lp-footer { padding: 28px 0; background: #fff; border-top: 1px solid var(--line); }
.lp-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.lp-footer-brand { display: flex; align-items: center; gap: 10px; }
.lp-footer-brand .logo-img { width: 28px; height: 28px; border-radius: 8px; }
.lp-footer-brand div { display: flex; flex-direction: column; gap: 2px; }
.lp-footer-brand b { font-size: 12.5px; color: var(--ink); }
.lp-footer-brand span { font-size: 11.5px; color: var(--muted); }
.lp-footer-links { display: flex; align-items: center; gap: 20px; }
.lp-footer-links a { font-size: 12.5px; color: var(--text-2); }
.lp-footer-links a:hover { color: var(--primary); }

@media (max-width: 980px) {
  .lp-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .lp-hero-visual { max-width: 520px; }
  .lp-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-steps { grid-template-columns: minmax(0, 1fr); }
  .lp-about-grid, .lp-contact { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 640px) {
  .lp-nav-links { display: none; }
  .lp-nav-inner { height: 60px; }
  .lp-hero { padding: 46px 0 52px; }
  .lp-hero-copy h1 { font-size: 31px; }
  .lp-hero-sub { font-size: 14px; }
  .lp-hero-actions { flex-wrap: wrap; }
  .lp-section { padding: 52px 0; scroll-margin-top: 72px; }
  .lp-section-head h2, .lp-about-copy h2, .lp-contact-copy h2 { font-size: 23px; }
  .lp-feature-grid { grid-template-columns: minmax(0, 1fr); }
  .lp-kpi b { font-size: 14px; }
  .lp-footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .lp-company-card dl > div { flex-direction: column; gap: 3px; }
  .lp-company-card dd { text-align: left; }
}
