/* 业务看板 · 视觉语言：纯白底 / 极淡细线 / 薄荷绿只做强调 / 数据区必有网格线 */
:root {
  --ink: #14161a;
  --text: #2b3038;
  --muted: #8a9099;
  --line: #f0f1f2;
  --line-2: #e6e8ea;
  --mint: #12c3a0;
  --mint-weak: #e8faf5;
  --danger: #e34d59;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px rgba(20, 22, 26, .04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

[v-cloak] { display: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 420px at 50% -10%, #f4fbf9 0%, #fff 62%),
    #fff;
  padding: 24px;
}

.login-card {
  width: 396px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 32px 32px 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--ink);
  position: relative;
  flex: 0 0 auto;
}
.brand-mark::after {
  content: "";
  position: absolute; left: 9px; top: 9px;
  width: 16px; height: 16px; border-radius: 5px;
  background: var(--mint);
}
.brand-title { font-size: 17px; font-weight: 650; letter-spacing: .2px; color: var(--ink); }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.brand.small { gap: 10px; }
.brand.small .brand-mark { width: 26px; height: 26px; border-radius: 8px; }
.brand.small .brand-mark::after { left: 7px; top: 7px; width: 12px; height: 12px; border-radius: 4px; }
.brand.small .brand-title { font-size: 15px; }

.login-form { margin-top: 26px; }
.field-label {
  display: block; font-size: 12px; color: var(--muted);
  margin: 14px 0 6px;
}
.login-form .t-button { margin-top: 20px; }
.login-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); text-align: center;
}
.login-err { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* ---------- 框架 ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 20;
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.scope-tag {
  margin-left: 4px; font-size: 11px; color: var(--mint);
  background: var(--mint-weak); border-radius: 999px; padding: 3px 9px;
}
.date-box { display: flex; align-items: center; gap: 8px; }
.date-label { font-size: 12px; color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.user-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }

.main { flex: 1; padding: 22px 24px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }

.section-head { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 14px; }
.section-head.sub { margin-top: 30px; }
.section-head h2 { font-size: 16px; font-weight: 650; color: var(--ink); margin: 0; }
.section-sub { font-size: 12px; color: var(--muted); }

.loading-bar {
  position: fixed; left: 0; top: 60px; height: 2px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: slide 1s infinite linear;
}
@keyframes slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.alert {
  border: 1px solid #f6d9db; background: #fff7f7; color: #a8323b;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px;
}

/* ---------- KPI（gap:1px 拼线） ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
}
.kpi-card { background: #fff; padding: 18px 20px 16px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-title { font-size: 13px; color: var(--muted); }
.kpi-unit { font-size: 11px; color: #b6bcc4; }
.kpi-main { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 8px; }
.kpi-num {
  font-size: 32px; font-weight: 680; color: var(--ink);
  letter-spacing: -.6px; font-variant-numeric: tabular-nums;
}
.kpi-cap { font-size: 12px; color: var(--muted); }
.kpi-foot {
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 10px;
}
.kpi-foot b { color: var(--text); font-weight: 600; }
.kpi-foot .dim, .dim { color: var(--muted); }
.kpi-foot .src { display: block; margin-top: 4px; color: #b6bcc4; font-size: 11px; }

/* ---------- 表格（横竖线） ---------- */
.table-card {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  max-height: 560px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.table-card::-webkit-scrollbar { width: 5px; }
.table-card::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.table-card .grid-table thead th { position: sticky; top: 0; z-index: 2; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table thead th {
  background: #fbfbfc;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.grid-table thead th:last-child { border-right: none; }
.grid-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: middle;
}
.grid-table tbody td:last-child { border-right: none; }
.grid-table tbody tr:last-child td { border-bottom: none; }
.grid-table tbody tr:hover td { background: #fcfdfd; }
.grid-table.compact tbody td { padding: 9px 12px; }
.c-rank { width: 52px; }
.c-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-check { width: 40px; text-align: center; }
.c-shop { font-weight: 520; color: var(--ink); }
.strong { font-weight: 620; color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 26px 0 !important; }

.rank-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 7px;
  background: #f6f7f8; color: var(--muted); font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.rank-dot.hot { background: var(--mint-weak); color: #0a9d80; font-weight: 600; }

/* ---------- 选项卡 ---------- */
.tabs { display: flex; gap: 6px; margin: 2px 0 20px; border-bottom: 1px solid var(--line); }
.tab {
  appearance: none; background: none; border: none; cursor: pointer;
  padding: 9px 14px 12px; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--mint); }

/* ---------- 面板 ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: #fff;
}
.panel.wide { margin-top: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 640; color: var(--ink); }
.panel-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span2 { grid-column: span 2; }
.bind-row { display: flex; align-items: center; gap: 10px; margin: 12px 0 14px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--mint); }
.dim { font-size: 12px; }

.state-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; }
.state-dot.on { background: var(--mint); }
.state-dot.off { background: #c9ced6; }

.foot {
  margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 11px; color: #b6bcc4; flex-wrap: wrap;
}

/* ---------- 改密弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(20, 22, 26, .32);
  display: flex; align-items: center; justify-content: center; z-index: 60;
}
.dialog {
  width: 380px; background: #fff; border-radius: 16px; padding: 26px 26px 22px;
  box-shadow: 0 24px 60px rgba(20, 22, 26, .18);
}
.dialog h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: 10px; z-index: 80;
  box-shadow: 0 10px 30px rgba(20, 22, 26, .2);
}
.toast.error { background: var(--danger); }

/* ---------- TDesign 覆写：墨黑主按钮 / 薄荷焦点 / 圆角 ---------- */
.t-button { border-radius: 10px; font-family: inherit; }
.t-button--theme-primary,
.t-button--variant-base.t-button--theme-primary {
  background-color: var(--ink);
  border-color: var(--ink);
}
.t-button--theme-primary:hover,
.t-button--variant-base.t-button--theme-primary:hover {
  background-color: #2a2f37;
  border-color: #2a2f37;
}
.t-button--variant-outline { border-color: var(--line-2); color: var(--text); }
.t-button--variant-outline:hover { border-color: var(--mint); color: #0a9d80; }
.t-button--variant-text { color: var(--muted); }
.t-button--variant-text:hover { color: var(--ink); background: #f7f8f9; }
.t-input__wrap, .t-input { border-radius: 10px; }
.t-input:focus, .t-input--focused, .t-input__wrap--focused { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(18, 195, 160, .12); }
.t-select .t-input { border-radius: 10px; }
.t-tag { border-radius: 999px; }
.t-date-picker .t-input { border-radius: 10px; }
.t-is-checked, .t-select-option.t-is-selected { color: #0a9d80; }
.t-checkbox__input.t-is-checked, .t-radio__input.t-is-checked { border-color: var(--mint); background-color: var(--mint); }

@media (max-width: 1020px) {
  .two-col { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .main { padding: 16px; }
}
