:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --line: #e8ebf0;
  --text: #1c2330;
  --muted: #87909e;
  --brand: #3b6ef0;
  --brand-deep: #2a56d6;
  --brand-soft: #edf2fe;
  --side: #131c2e;
  --side-2: #1b2740;
  --up: #d93026;      /* 涨=红（国内习惯） */
  --down: #12a150;
  --warn: #b26a00;
  --warn-soft: #fff7e6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-lift: 0 4px 10px rgba(16, 24, 40, .08), 0 12px 28px rgba(16, 24, 40, .10);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 85% -80px, rgba(59, 110, 240, .07), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.2px; }

/* ---------------------------------------------------------------- 布局 */
.layout { display: flex; min-height: 100vh; }

.side {
  width: 216px;
  flex: 0 0 216px;
  background: linear-gradient(180deg, var(--side), var(--side-2));
  color: #c6cede;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 10px 22px;
}
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  flex: 0 0 34px;
}
.brand-txt {
  font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .5px;
  line-height: 1.3;
}
.brand-txt span {
  color: #7fa2ff; margin-left: 4px; font-weight: 600; font-size: 13px;
}

.side nav { display: flex; flex-direction: column; gap: 3px; }
.side nav a {
  padding: 10px 13px;
  border-radius: 9px;
  color: #aeb6c6;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav a.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 110, 240, .35);
}

.side-foot {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .09);
  display: flex; flex-direction: column; gap: 8px;
  font-size: 13px; color: #8b93a5;
}
.side-foot a { color: #aeb6c6; }
.side-foot a:hover { color: #fff; }

.main { flex: 1; min-width: 0; padding: 26px 30px 64px; }

/* ---------------------------------------------------------------- 通用 */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 5px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 14px; }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 .kpi .value { font-size: 28px; }
.grid.cols-3 .kpi { padding: 18px 20px 16px; }
@media (max-width: 1180px) {
  .grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .side { width: auto; flex: none; height: auto; position: static; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 16px; }
  .grid.cols-6, .grid.cols-3 { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- 指标卡 */
.kpi {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #7fa2ff, var(--brand));
}
.kpi:nth-child(2)::before { background: linear-gradient(180deg, #6fd6a8, #12a150); }
.kpi:nth-child(3)::before { background: linear-gradient(180deg, #ffc46f, #f59e0b); }
.kpi:nth-child(4)::before { background: linear-gradient(180deg, #b39dff, #7c5cf0); }
.kpi:nth-child(5)::before { background: linear-gradient(180deg, #ff9d9d, #ef5350); }
.kpi:nth-child(6)::before { background: linear-gradient(180deg, #7fd8ff, #2b9fe0); }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value {
  font-size: 25px; font-weight: 700; letter-spacing: -.4px; margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi .value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.kpi .foot { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.delta { font-weight: 600; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }

/* ---------------------------------------------------------------- 图表 */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 172px; padding-top: 8px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart .bar {
  background: linear-gradient(180deg, #7fa2ff, var(--brand));
  border-radius: 6px 6px 2px 2px;
  min-height: 2px;
  transition: opacity .15s;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.chart .bar:hover { opacity: .8; }
.chart .x { text-align: center; font-size: 11px; color: var(--muted); margin-top: 8px; }
.chart .amt { text-align: center; font-size: 11px; color: #6b7280; margin-bottom: 4px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-weight: 550; color: var(--muted);
  padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: #fafbfd;
}
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 11px 10px; border-bottom: 1px solid #f1f3f6; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f7f9fc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.tag {
  display: inline-block; padding: 1.5px 8px; border-radius: 999px;
  font-size: 12px; line-height: 18px; background: #f1f3f6; color: #5b6068;
  white-space: nowrap;
}
.tag.ok { background: #e7f8ee; color: #0e8a48; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: #fdeeee; color: var(--up); }
.tag.info { background: var(--brand-soft); color: var(--brand); }

.bar-mini { height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar-mini i { display: block; height: 100%; background: linear-gradient(90deg, #7fa2ff, var(--brand)); }

/* ---------------------------------------------------------------- 表单 */
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
label.f.grow { flex: 1; min-width: 220px; }
input[type=text], input[type=password], input[type=date], select, textarea {
  padding: 8px 11px; border: 1px solid #d9dde3; border-radius: 8px;
  font-size: 13px; color: var(--text); background: #fff; min-width: 150px;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea { width: 100%; resize: vertical; line-height: 1.7; min-width: 0; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
label.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); }
label.chk input { width: 15px; height: 15px; accent-color: var(--brand); min-width: 0; }

.btn {
  height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid #d9dde3;
  background: #fff; color: var(--text); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s; font-family: inherit;
}
.btn:hover { border-color: #c3c9d2; background: #f8fafc; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(59, 110, 240, .3);
}
.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--brand), var(--brand-deep)); }
.btn.danger { color: var(--up); }
.btn.danger:hover { background: #fdeeee; border-color: #f2c8c8; }

/* ---------------------------------------------------------------- 提示 */
.flash-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  padding: 11px 15px; border-radius: 10px; font-size: 13px;
  border: 1px solid transparent; box-shadow: var(--shadow);
}
.flash.ok { background: #eefaf3; border-color: #cdebd9; color: #14724a; }
.flash.error { background: #fdf1f1; border-color: #f6d5d5; color: #b02a25; }
.flash.warn { background: var(--warn-soft); border-color: #f3e1bd; color: #8a5a00; }

.hint { color: var(--muted); font-size: 12px; line-height: 1.7; }
.hint code { background: #f1f3f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

details.note { background: #fbfcfe; border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; }
details.note summary { cursor: pointer; font-size: 13px; color: #4a5058; font-weight: 550; }
details.note ul { margin: 10px 0 0; padding-left: 20px; }
details.note li { font-size: 12.5px; color: #5b6068; line-height: 1.9; }

.empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty .btn { margin-top: 14px; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13px; }
.pager a, .pager span.cur {
  padding: 5px 11px; border-radius: 7px; border: 1px solid var(--line); background: #fff;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager span.cur { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand); font-weight: 600; }

dl.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

pre.raw {
  background: #101828; color: #d6e2ff; padding: 16px; border-radius: 10px;
  overflow: auto; font-size: 12px; line-height: 1.6; max-height: 480px;
}

/* ---------------------------------------------------------------- 登录 */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(900px 480px at 20% 0%, rgba(59, 110, 240, .18), transparent 55%),
    radial-gradient(700px 420px at 90% 100%, rgba(124, 92, 240, .14), transparent 55%),
    linear-gradient(160deg, #16203a, #101828);
}
.login-card {
  width: 350px; background: rgba(255, 255, 255, .98);
  border-radius: 18px; padding: 32px 30px;
  box-shadow: 0 20px 50px rgba(8, 14, 30, .45);
  text-align: center;
}
.login-logo {
  width: 58px; height: 58px; border-radius: 14px;
  box-shadow: 0 6px 18px rgba(20, 32, 60, .25);
  margin-bottom: 12px;
}
.login-card h1 { font-size: 20px; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin: 6px 0 22px; }
.login-card .f { margin-bottom: 14px; text-align: left; }
.login-card input { width: 100%; }
.login-card .btn { width: 100%; justify-content: center; height: 38px; }

.section-title { font-size: 14px; font-weight: 650; margin-bottom: 12px; }
.mb { margin-bottom: 14px; }
.mt { margin-top: 14px; }

/* ---------------------------------------------------------------- 客户案例 */
.case-list { display: flex; flex-direction: column; gap: 14px; }
.case-card { transition: transform .15s, box-shadow .15s; }
.case-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.case-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.case-title { font-size: 16px; font-weight: 650; }
.case-meta { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.case-metric {
  font-size: 13px; font-weight: 650; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 4px 13px;
  white-space: nowrap;
}
.case-body { margin-top: 10px; }
.case-body p { margin: 0 0 6px; color: #454e5e; font-size: 13.5px; line-height: 1.85; }
.case-ops { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.case-ops .btn { height: 30px; padding: 0 13px; font-size: 12.5px; }
.case-ops-hide { border: none; padding-top: 0; }

.case-detail p { margin: 0 0 10px; font-size: 14.5px; line-height: 2; color: #333c4c; }
.case-title a { color: var(--text); }
.case-title a:hover { color: var(--brand); }

/* ---------------------------------------------------------------- 官网式总览 */
.hero {
  border-radius: 16px;
  background:
    radial-gradient(700px 300px at 88% 10%, rgba(124, 92, 240, .28), transparent 60%),
    radial-gradient(500px 260px at 8% 90%, rgba(59, 110, 240, .30), transparent 60%),
    linear-gradient(135deg, #16203a 0%, #1d2b52 55%, #23408f 100%);
  color: #fff; padding: 40px 38px 36px; margin-bottom: 26px;
  box-shadow: 0 14px 34px rgba(20, 32, 60, .28);
}
.hero h1 { font-size: 27px; letter-spacing: 1px; }
.hero p { margin: 8px 0 0; color: #b9c6e2; font-size: 14px; letter-spacing: 2px; }
.hero-stats { display: flex; gap: 46px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats b {
  display: block; font-size: 26px; font-weight: 700; letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
.hero-stats span { font-size: 12.5px; color: #9fb0d4; }

/* 紧凑版横幅（总览页）：一行放下标题 + 三个汇总数 */
.hero.slim { padding: 24px 30px; margin-bottom: 20px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-id { display: flex; align-items: center; gap: 16px; }
.hero-logo {
  width: 52px; height: 52px; border-radius: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); flex: 0 0 52px;
}
.hero-id h1 { font-size: 21px; letter-spacing: .5px; }
.hero-id p { margin: 3px 0 0; color: #9fb0d4; font-size: 12.5px; letter-spacing: 1px; }
.hero.slim .hero-stats { margin-top: 0; gap: 36px; }
.hero.slim .hero-stats b { font-size: 22px; }
@media (max-width: 900px) {
  .hero-top { flex-direction: column; align-items: flex-start; }
}

.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 26px 0 12px; gap: 12px; flex-wrap: wrap;
}
.section-head.tight { margin: 18px 0 12px; }
.section-head h2 { font-size: 17px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.shop-card {
  display: block; color: var(--text); position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.shop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #c9d6f7; }
.shop-card.shop-empty { opacity: .75; }
.shop-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.shop-name { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 4px 8px; border-radius: 6px;
  background: #f1f3f6; color: #87909e; letter-spacing: .3px;
}
.rank.r1 { background: linear-gradient(135deg, #ffd76f, #f0a819); color: #5c3d00; }
.rank.r2 { background: linear-gradient(135deg, #e8edf4, #c3ccd9); color: #4a5568; }
.rank.r3 { background: linear-gradient(135deg, #f0c3a0, #d98d55); color: #5c3200; }
.shop-amount { font-size: 24px; font-weight: 700; margin-top: 8px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.shop-amount.muted { color: var(--muted); font-weight: 600; }
.shop-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.shop-date { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.shop-bar { height: 5px; background: #eef0f4; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.shop-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7fa2ff, var(--brand)); border-radius: 3px; transition: width .4s; }

/* ---------------------------------------------------------------- 案例轮播 */
.carousel { position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.car-track { display: flex; transition: transform .5s ease; }
.car-slide {
  flex: 0 0 100%; display: block; color: #fff; min-height: 220px;
  padding: 34px 40px; position: relative;
}
.car-badge {
  display: inline-block; font-size: 12px; letter-spacing: 3px; color: #9db8f5;
  border: 1px solid rgba(157, 184, 245, .45); border-radius: 999px;
  padding: 3px 14px; margin-bottom: 18px;
}
.car-title { font-size: 21px; font-weight: 700; line-height: 1.55; max-width: 72%; }
.car-metric {
  display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 650;
  color: #ffd88a; background: rgba(255, 216, 138, .12);
  border: 1px solid rgba(255, 216, 138, .35); border-radius: 999px; padding: 5px 16px;
}
.car-meta {
  position: absolute; left: 40px; right: 40px; bottom: 24px;
  display: flex; gap: 14px; align-items: center;
  color: #9fb0d4; font-size: 13px;
}
.car-more { margin-left: auto; color: #cdd9f2; }
.car-slide:hover .car-more { color: #fff; }

.car-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px; line-height: 1;
  transition: background .15s; backdrop-filter: blur(4px);
}
.car-btn:hover { background: rgba(255, 255, 255, .30); }
.car-btn.prev { left: 14px; }
.car-btn.next { right: 14px; }

.car-dots { position: absolute; bottom: 14px; right: 40px; display: flex; gap: 7px; }
.car-dots i {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .35);
  cursor: pointer; transition: background .15s, transform .15s;
}
.car-dots i.on { background: #fff; transform: scale(1.2); }

/* ---------------------------------------------------------------- 凭据卡片 */
.cred-card {
  background: linear-gradient(135deg, #eef4ff, #f5f0ff);
  border: 1px solid #c9d6f7; border-radius: 12px;
  padding: 16px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.cred-title { font-weight: 650; font-size: 13.5px; color: #2a56d6; }
.cred-line {
  display: flex; gap: 10px 26px; align-items: center; flex-wrap: wrap; margin-top: 10px;
  font-size: 13px; color: #4a5068;
}
.cred-line b {
  font-size: 15px; color: #16203a; background: #fff;
  border: 1px dashed #b8c6ea; border-radius: 6px; padding: 3px 10px;
}
.cred-ops { display: flex; gap: 8px; margin-top: 12px; }
