:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --border: #e5e7eb;
  --ok: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }

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

.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: #111827;
  color: #d1d5db;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 4px 8px 18px;
  letter-spacing: .5px;
}
.sidebar .brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
  margin-top: 2px;
  letter-spacing: 0;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 14.5px;
  margin-bottom: 3px;
}
.sidebar nav a:hover { background: #1f2937; color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar .sec-title {
  font-size: 11px;
  color: #6b7280;
  margin: 18px 12px 6px;
  letter-spacing: 1px;
}
.sidebar .foot {
  margin-top: 18px;
  padding: 12px;
  border-top: 1px solid #1f2937;
  font-size: 12px;
  color: #9ca3af;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 650; }
.topbar .who { font-size: 13px; color: var(--muted); }
.topbar .who b { color: var(--text); }

.content { padding: 22px; flex: 1; }
.content > .page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h2 { margin: 0; font-size: 20px; font-weight: 650; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 指标卡 ---------- */
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat.accent-blue .v { color: var(--primary); }
.stat.accent-green .v { color: var(--ok); }
.stat.accent-orange .v { color: var(--warn); }
.stat.accent-purple .v { color: #7c3aed; }

.chart { width: 100%; height: auto; display: block; }
.chart-sm { max-height: 220px; }
.empty { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn.danger:hover { background: #fef2f2; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=url],
input[type=email], input[type=datetime-local], input[type=color],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea { min-height: 110px; resize: vertical; }
input[type=color] { padding: 3px; height: 40px; }
input[type=file] {
  width: 100%;
  font-size: 13px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  background: #fafbfc;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: auto; }

/* ---------- 过滤条 ---------- */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filters .f { min-width: 130px; flex: 1 1 150px; }
.filters .f label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }

/* ---------- 列表（行卡片，天然响应式） ---------- */
.list-head, .row-item {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 96px 92px 96px 86px 168px;
  gap: 10px;
  align-items: center;
}
.list-head {
  padding: 0 14px 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.row-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}
.row-item:hover { border-color: #c7d2fe; }
.row-item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row-item .name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.row-item .ops { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.off { background: #f1f5f9; color: #64748b; }
.badge.warn { background: #fef3c7; color: #b45309; }
.badge.type-text { background: #e0e7ff; color: #4338ca; }
.badge.type-url { background: #dbeafe; color: #1d4ed8; }
.badge.type-file { background: #fce7f3; color: #be185d; }
.badge.type-rich { background: #dcfce7; color: #15803d; }
.badge.type-card { background: #fef3c7; color: #b45309; }
.badge.role-admin { background: #fee2e2; color: #b91c1c; }
.badge.role-editor { background: #dbeafe; color: #1d4ed8; }
.badge.role-viewer { background: #f1f5f9; color: #64748b; }

/* ---------- 提示 ---------- */
.flash { padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 14px; }
.flash.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.flash.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.pager a, .pager span {
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13.5px;
  color: var(--text);
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pager .info { border: none; background: none; color: var(--muted); }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 60%);
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.login-box h2 { margin: 0 0 4px; font-size: 21px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-box .tip {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
}

/* ---------- 访客落地页 ---------- */
.pub {
  min-height: 100vh;
  padding: 20px 14px 40px;
}
.pub-inner {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}
.pub-title {
  font-size: 21px; font-weight: 650; text-align: center; margin: 0 0 18px;
  color: var(--page-fg, #1f2937);
  text-shadow: var(--page-fg-shadow, none);
}
.pub-foot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  text-align: center;
  color: var(--page-fg-soft, var(--muted));
  font-size: 12px;
  line-height: 1.9;
}

/* 页面块（服务端渲染） */
.b-title { margin: 0 0 12px; font-weight: 650; line-height: 1.45; color: var(--page-fg, inherit); }
.b-text { line-height: 1.78; word-break: break-word; margin-bottom: 14px; color: var(--page-fg, #26303d); }
.b-text p { margin: 0 0 8px; }
.b-text ul, .b-text ol { padding-left: 22px; margin: 6px 0; }
.b-text a { text-decoration: underline; }
.b-imgs { display: grid; gap: 12px; margin-bottom: 14px; }
.b-fig { margin: 0; }
.b-fig img { width: 100%; border-radius: 12px; display: block; }

/* 图片宽度模式：左右留白 / 两端撑满 / 1/2 屏 / 自定义（逐图设置） */
.b-img-row { width: 100%; }
.b-img-row.imgw-inset { padding: 0 14px; }
.b-img-row.imgw-full { padding: 0; }
.b-img-row.imgw-half { width: 50%; margin: 0 auto; }
.b-img-row.imgw-custom { width: var(--imgw, 60%); margin: 0 auto; }
@media (max-width: 420px) {
  .b-img-row.imgw-half { width: 100%; }
}

/* 图片比例裁切 */
.b-fig.is-ratio { overflow: hidden; border-radius: 12px; background: #f1f4f8; }
.b-fig.is-ratio img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.b-fig.ratio-circle { border-radius: 50%; }
.b-fig.ratio-circle img { border-radius: 50%; }
.b-fig.ratio-1x1 { aspect-ratio: 1 / 1; }
.b-fig.ratio-3x4 { aspect-ratio: 3 / 4; }
.b-fig.ratio-4x3 { aspect-ratio: 4 / 3; }
.b-fig.ratio-9x16 { aspect-ratio: 9 / 16; }
.b-fig.ratio-16x9 { aspect-ratio: 16 / 9; }

/* 点击放大 */
.b-fig[data-zoom] { cursor: zoom-in; }
.b-fig img.is-zoom { cursor: zoom-in; }
.b-img-link { display: block; }
.b-img-link .b-fig[data-zoom] { cursor: pointer; }

/* 禁止保存（长按/右键屏蔽 + 关闭选择） */
.b-fig img.no-save {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* 图片查看器 */
.img-viewer {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(12, 16, 24, .94);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
  opacity: 0; transition: opacity .18s ease;
}
.img-viewer.on { opacity: 1; }
.img-viewer img {
  max-width: 100%; max-height: 100%;
  border-radius: 8px; object-fit: contain;
  transform: scale(.94); transition: transform .22s ease;
}
.img-viewer.on img { transform: scale(1); }
.b-cap { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; }
.b-desc { font-size: 14px; color: var(--page-fg-soft, #4b5563); margin-bottom: 10px; line-height: 1.7; }

/* 块级跳转链接：整块可点，块内自带的链接（图片/卡片/按钮）优先 */
.b-lk { position: relative; }
.b-lk-hit { position: absolute; inset: 0; z-index: 1; border-radius: 12px; }
.b-lk .b-img-link,
.b-lk .b-btn { position: relative; z-index: 2; }

/* 图文组：row = 图左文右卡片，grid = 图片宫格 */
.b-cards { display: grid; gap: 12px; margin-bottom: 14px; }
.b-card {
  position: relative; display: flex; gap: 12px;
  background: #fff; border-radius: 12px; padding: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.b-card-hit { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.b-card-img {
  flex: 0 0 var(--cd-imgw, 33%); width: var(--cd-imgw, 33%);
  aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #eef2f7;
}
.b-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b-card-ph { display: block; width: 100%; height: 100%; background: #e6ebf1; }
.b-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
/* 图文组标题/副标题/正文是富文本，清掉浏览器给 p / div 的默认段距 */
.b-card-title p, .b-card-sub p, .b-card-text p,
.b-card-title div, .b-card-sub div, .b-card-text div { margin: 0; }
.b-card-title, .b-card-sub, .b-card-text { overflow-wrap: break-word; }
.b-card-title { font-weight: 700; font-size: 15px; line-height: 1.35; color: #1f2937; }
.b-card-text {
  font-size: 12.5px; line-height: 1.55; color: #5b6573;
  margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere;
}
.b-card-foot {
  margin-top: auto; padding-top: 6px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
}
.b-card-price { font-weight: 700; font-size: 20px; color: var(--cd-accent, #b91c1c); line-height: 1.2; }
.b-card-price small { font-size: 12px; font-weight: 400; color: #5b6573; margin-left: 3px; }
.b-card-more { font-size: 12px; color: #5b6573; white-space: nowrap; margin-left: auto; }
.b-cards.is-grid { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; }
.b-cards.is-grid .b-card {
  flex-direction: column; gap: 0; padding: 0;
  background: transparent; box-shadow: none;
}
.b-cards.is-grid .b-card-img {
  flex: none; width: 100%; border-radius: 6px 6px 0 0;
}
.b-cards.is-grid .b-card-body {
  background: var(--cd-accent, #b91c1c); border-radius: 0 0 6px 6px;
  padding: 5px 4px; text-align: center;
}
.b-cards.is-grid .b-card-title { font-size: 13px; font-weight: 600; color: #fff; }
.b-cards.is-grid .b-card-text,
.b-cards.is-grid .b-card-foot { display: none; }

/* 副标题（蓝色小字）与正文强调 */
.b-card-sub { font-size: 13px; line-height: 1.5; color: #1a73e8; margin-top: 5px; white-space: pre-line; }
.cd-hl { font-style: normal; color: #e8560f; font-weight: 600; }

/* ---------- card2：欧洲精选（2 列白卡，方图在上，横向滑动） ---------- */
.b-cards.is-card2 {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.b-cards.is-card2::-webkit-scrollbar { height: 5px; }
.b-cards.is-card2::-webkit-scrollbar-thumb { background: #d3d9e2; border-radius: 3px; }
.b-cards.is-card2 .b-card {
  flex: 0 0 52%; flex-direction: column; gap: 0; padding: 0;
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .1); scroll-snap-align: start;
}
.b-cards.is-card2 .b-card-img { flex: none; width: 100%; aspect-ratio: 1 / 1; border-radius: 0; }
.b-cards.is-card2 .b-card-body { padding: 13px 13px 15px; }
.b-cards.is-card2 .b-card-title { font-size: 17px; font-weight: 700; color: #1a1a1a; }
.b-cards.is-card2 .b-card-sub { font-size: 13px; color: #1a73e8; margin-top: 6px; }
.b-cards.is-card2 .b-card-text {
  font-size: 13px; color: #333; line-height: 1.75; margin-top: 7px;
}
.b-cards.is-card2 .b-card-foot { display: none; }

/* ---------- banner：新疆小车团（通栏大图 + 一行底栏） ---------- */
.b-cards.is-banner { display: block; }
.b-cards.is-banner .b-card {
  display: flex; flex-direction: column; gap: 0; padding: 0;
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .1);
}
.b-cards.is-banner .b-card-img { flex: none; width: 100%; aspect-ratio: 1056 / 514; border-radius: 0; }
.b-cards.is-banner .b-card-body {
  display: flex; flex-direction: row; align-items: center; gap: 5px; padding: 10px 11px;
}
.b-cards.is-banner .b-card-title {
  flex: 0 0 auto; font-size: 14px; font-weight: 700; color: #1a1a1a;
}
.b-cards.is-banner .b-card-sub { display: none; }
.b-cards.is-banner .b-card-text {
  flex: 0 1 auto; margin: 0; font-size: 11.5px; color: #8a8f99;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-cards.is-banner .b-card-foot {
  margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 12px;
  flex: 0 0 auto;
}
.b-cards.is-banner .b-card-price { font-size: 17px; color: #e8560f; }
.b-cards.is-banner .b-card-price small { font-size: 12px; color: #e8560f; }
.b-cards.is-banner .b-card-more {
  margin: 0; padding: 4px 9px; border-radius: 6px;
  background: #eef4ff; color: #2b6cee; font-size: 12.5px; font-weight: 500;
}
.b-cards.is-banner .cd-arrow { display: none; }

/* ---------- overlay：日本心旅行（图上叠标题） ---------- */
.b-cards.is-overlay { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px; }
.b-cards.is-overlay .b-card {
  display: block; position: relative; padding: 0; gap: 0;
  background: transparent; box-shadow: none; border-radius: 8px; overflow: hidden;
}
.b-cards.is-overlay .b-card-img {
  position: relative; width: 100%; aspect-ratio: 520 / 354; border-radius: 8px;
}
.b-cards.is-overlay .b-card-img::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 58%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .62));
}
.b-cards.is-overlay .b-card-body {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 11px; z-index: 1;
}
.b-cards.is-overlay .b-card-title {
  font-size: 15px; font-weight: 700; color: #fff; line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.b-cards.is-overlay .b-card-sub,
.b-cards.is-overlay .b-card-text,
.b-cards.is-overlay .b-card-foot { display: none; }

/* ---------- strip：异国风情（横向滑动小卡 + 图下标题） ---------- */
.b-cards.is-strip {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.b-cards.is-strip::-webkit-scrollbar { height: 5px; }
.b-cards.is-strip::-webkit-scrollbar-thumb { background: #d3d9e2; border-radius: 3px; }
.b-cards.is-strip .b-card {
  flex: 0 0 27%; flex-direction: column; gap: 0; padding: 0;
  background: transparent; box-shadow: none; scroll-snap-align: start;
}
.b-cards.is-strip .b-card-img { flex: none; width: 100%; aspect-ratio: 298 / 188; border-radius: 6px; }
.b-cards.is-strip .b-card-body { padding: 7px 1px 0; }
.b-cards.is-strip .b-card-title {
  font-size: 13px; font-weight: 600; color: var(--page-fg, #1f2937);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-cards.is-strip .b-card-sub {
  margin-top: 2px; font-size: 11.5px; color: var(--page-fg-soft, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-cards.is-strip .b-card-text,
.b-cards.is-strip .b-card-foot { display: none; }

.b-files, .b-audio, .b-video { margin-bottom: 14px; }
.b-audio-item {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 9px;
  background: #fafbfc;
}
.b-audio-item b { display: block; font-size: 13.5px; margin-bottom: 6px; }
.b-audio-item audio { width: 100%; height: 34px; }
.b-video video { width: 100%; border-radius: 12px; background: #000; }
.b-fields { margin-bottom: 14px; }
.b-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.b-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  font-size: 15.5px;
  border: 0;
  cursor: pointer;
}
.b-btn:hover { background: var(--primary-dark); }
.b-btn.ghost { background: #fff; border: 1px solid var(--border); color: var(--primary) !important; }
.b-btn.ghost:hover { background: #f8fafc; }

.pub .pub-head { text-align: center; margin-bottom: 18px; }
.pub .pub-head h1 { font-size: 20px; margin: 0 0 4px; }
.pub .pub-head .sub { font-size: 13px; color: var(--muted); }
.pub-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.pub-card .body { font-size: 15.5px; white-space: pre-wrap; word-break: break-word; }
.pub .go {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  border-radius: 11px;
  font-weight: 600;
  font-size: 16px;
}
.pub .go:hover { background: var(--primary-dark); color: #fff; }
.pub .attach {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  margin-bottom: 9px;
  background: #fafbfc;
}
.pub .attach .meta { min-width: 0; }
.pub .attach .meta b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
.pub .foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.card-people { display: flex; gap: 16px; align-items: center; }
.card-people img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; }
.card-people .info { min-width: 0; }
.card-people .info h2 { margin: 0; font-size: 19px; }
.card-people .info p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.kv { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 74px; flex: 0 0 74px; color: var(--muted); font-size: 13.5px; }
.kv .v { flex: 1; min-width: 0; word-break: break-all; }

/* ---------- 错误页 ---------- */
.err-wrap { max-width: 460px; margin: 12vh auto; text-align: center; padding: 0 20px; }
.err-wrap .code { font-size: 64px; font-weight: 800; color: #cbd5e1; line-height: 1; }
.err-wrap p { color: var(--muted); }
.err-wrap .err-hint {
  font-size: 13px; line-height: 1.7; text-align: left;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin: 14px 0 18px;
}
.err-wrap .btn-row { margin-top: 4px; }

.table-simple { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-simple th, .table-simple td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
.table-simple th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.table-simple tr:last-child td { border-bottom: none; }

.qr-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: inline-block;
}
.qr-preview img { width: 190px; height: 190px; }

/* ---------- 响应式：平板 ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 响应式：移动端 ---------- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    padding: 12px 12px 8px;
    display: block;
  }
  .sidebar .brand { margin: 0 4px 10px; font-size: 16px; }
  .sidebar .brand small { display: none; }
  .sidebar .sec-title, .sidebar .foot { display: none; }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar nav a { margin: 0; white-space: nowrap; padding: 8px 12px; font-size: 14px; }
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 16px; }
  .content { padding: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }

  /* 列表行卡片化 */
  .list-head { display: none; }
  .row-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .row-item .ops { justify-content: flex-start; }
  .row-item .ops .btn { flex: 1; }
  .page-head { align-items: flex-start; }
  .filters .f { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  body { font-size: 14.5px; }
  .stat .v { font-size: 22px; }
  .content { padding: 12px; }
  .card { padding: 14px; }
  .pub { padding: 16px 12px 32px; }
}

/* ============================================================
   活码管理：文件夹目录 + 列表（对应草料式目录管理）
   ============================================================ */
.cf-app { display: flex; gap: 16px; align-items: flex-start; }

.cf-tree {
  width: 258px; flex: 0 0 258px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); position: sticky; top: 16px;
  max-height: calc(100vh - 100px); display: flex; flex-direction: column;
}
.cf-tree-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.cf-tree-top b { font-size: 15px; }
.cf-tree-body { padding: 6px 6px 12px; overflow-y: auto; }
.cf-tree-tip { font-size: 12px; color: var(--muted); padding: 10px 12px; line-height: 1.6; }

.cf-node {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border-radius: 8px; color: var(--text); font-size: 14px;
}
.cf-node:hover { background: #f3f6fb; color: var(--text); }
.cf-node.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.cf-node .cf-ico { color: #9aa6b8; font-size: 10px; width: 10px; flex: 0 0 10px; }
.cf-node .cf-node-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-node em {
  font-style: normal; font-size: 12px; color: var(--muted);
  background: #f1f5f9; border-radius: 10px; padding: 0 7px;
}
.cf-node.is-on em { background: #dbeafe; color: var(--primary); }
.cf-node-wrap { position: relative; }
.cf-node-wrap:hover .cf-menu-sm > summary { opacity: 1; }

.cf-menu { position: absolute; right: 4px; top: 3px; }
.cf-menu > summary {
  list-style: none; cursor: pointer; width: 26px; height: 26px; display: flex;
  align-items: center; justify-content: center; border-radius: 6px;
  color: var(--muted); opacity: 0; transition: opacity .12s, background .12s;
  font-size: 15px; line-height: 1;
}
.cf-menu > summary::-webkit-details-marker { display: none; }
.cf-menu > summary:hover { background: #e8eef8; color: var(--primary); }
.cf-menu[open] > summary { opacity: 1; background: #e8eef8; }
.cf-menu-new > summary { opacity: 1; border: 1px solid var(--border); }
.cf-ops .cf-menu { position: relative; right: auto; top: auto; }
.cf-ops .cf-menu > summary { opacity: 1; }
.cf-menu-box {
  position: absolute; right: 0; top: 30px; z-index: 30; width: 224px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .14); padding: 10px;
  display: grid; gap: 10px;
}
.cf-menu-box form { display: grid; gap: 5px; margin: 0; }
.cf-menu-box label { font-size: 12px; color: var(--muted); }
.cf-menu-box input, .cf-menu-box select { font-size: 13px; padding: 6px 8px; width: 100%; }
.cf-menu-box button { width: 100%; }

.cf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cf-bread { display: flex; align-items: center; gap: 8px; font-size: 15px; flex-wrap: wrap; }
.cf-crumb { font-weight: 600; }
.cf-count {
  font-size: 12px; color: var(--muted); background: #eef2f7;
  border-radius: 10px; padding: 2px 9px;
}
.cf-batch-link { font-size: 13px; margin-left: auto; }
.cf-subs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.cf-subs-t { color: var(--muted); }
.cf-sub {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 3px 10px; color: var(--text);
}
.cf-sub em { font-style: normal; color: var(--muted); font-size: 12px; }
.cf-sub:hover { border-color: var(--primary); color: var(--primary); }

.cf-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
}
.cf-toolbar select, .cf-toolbar input { font-size: 13px; padding: 6px 9px; height: 34px; }
.cf-toolbar input[type=search] { flex: 1 1 200px; min-width: 150px; }
.cf-toolbar select { flex: 0 0 auto; width: auto; }

.cf-bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 8px 12px; font-size: 13px;
}
.cf-bulkbar form { display: flex; gap: 8px; align-items: center; margin: 0; }
.cf-bulkbar select { font-size: 13px; padding: 5px 8px; width: auto; }
.cf-bulkbar[hidden] { display: none !important; }
.cf-bulkbar .cf-bulk-n { color: #1e40af; }
.cf-bulkbar .cf-bulk-n b { font-size: 14px; }
.cf-bulkbar .cf-bulk-a { font-size: 13px; }
.cf-bulkbar .cf-bulk-ops { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.cf-bulkbar .cf-bulk-ops .btn { background: #fff; }
.cf-modal-note { font-size: 12.5px; color: var(--muted); }

.cf-rows { display: flex; flex-direction: column; }
.cf-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px; border-bottom: 1px solid var(--border);
}
.cf-row:hover { background: #fafcff; }
.cf-row .sel { width: 15px; height: 15px; flex: 0 0 auto; }
.cf-thumb {
  flex: 0 0 auto; width: 46px; height: 46px; border: 1px solid var(--border);
  border-radius: 8px; padding: 3px; background: #fff;
}
.cf-thumb img { width: 100%; height: 100%; }
.cf-info { flex: 1; min-width: 0; }
.cf-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw;
}
.cf-name:hover { color: var(--primary); }
.cf-remark { font-size: 12px; color: var(--muted); }
.cf-stats {
  font-size: 12px; color: var(--muted); margin-top: 4px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.cf-stats b { color: var(--text); font-weight: 600; }
.cf-slug { font-family: ui-monospace, Menlo, Consolas, monospace; color: #9aa6b8; }
.cf-time { flex: 0 0 auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.cf-ops { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.cf-ops > a { font-size: 13px; color: var(--primary); padding: 4px 6px; border-radius: 6px; }
.cf-ops > a:hover { background: var(--primary-soft); }
.cf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .cf-app { flex-direction: column; }
  .cf-tree { width: 100%; flex: none; position: static; max-height: 320px; }
  .cf-name { max-width: none; }
}
@media (max-width: 720px) {
  .cf-row { flex-wrap: wrap; }
  .cf-time { width: 100%; }
  .cf-ops { width: 100%; justify-content: flex-start; }
}

/* ============================================================
   公开页：表格组件 / 文件组件（阅读入口 + 角标）
   ============================================================ */
.b-table-wrap { overflow-x: auto; margin: 4px 0 8px; }
.b-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.b-table th, .b-table td { padding: 9px 12px; text-align: left; vertical-align: top; }
.b-table.is-bordered th, .b-table.is-bordered td { border: 1px solid var(--border); }
.b-table thead th { background: #f2f6fb; font-weight: 600; }
.b-table tbody tr:nth-child(even) td { background: #fbfdff; }
/* 单元格富文本：清掉段落/列表默认外边距，避免行高被撑开 */
.b-table th > p, .b-table td > p { margin: 0; }
.b-table th > p + p, .b-table td > p + p { margin-top: 6px; }
.b-table th ul, .b-table td ul,
.b-table th ol, .b-table td ol { margin: 4px 0; padding-left: 20px; }
.b-table th a, .b-table td a { text-decoration: underline; }
.b-table th img, .b-table td img { max-width: 100%; height: auto; display: inline-block; border-radius: 6px; }
.b-table td:empty::after, .b-table th:empty::after { content: "\00a0"; }

.fe-icon {
  width: 40px; height: 40px; border-radius: 8px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .5px;
}
.fe-doc { background: #2b579a; }
.fe-pdf { background: #d33a2c; }
.fe-xls { background: #1e7145; }
.fe-ppt { background: #c43e1c; }
.fe-txt { background: #5a6b7b; }
.fe-zip { background: #8a6d3b; }
.fe-other { background: #7a8794; }

.file-card {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; background: #fff;
}
.file-card + .file-card { margin-top: 10px; }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-name {
  font-size: 14px; font-weight: 500; line-height: 1.45;
  overflow-wrap: anywhere; word-break: normal;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.file-size { font-size: 12px; color: var(--muted); }
.file-ops { display: flex; gap: 6px; flex: 0 0 auto; }

/* ============================================================
   活码目录：按参考图重做的宽松版（覆盖前面的紧凑样式）
   ============================================================ */
.cf-tree { width: 300px; flex: 0 0 300px; border-radius: 14px; }
.cf-tree-top { padding: 15px 16px; }
.cf-tree-top b { font-size: 16px; font-weight: 650; color: #1f2937; }
.cf-tree-tools { display: flex; align-items: center; gap: 2px; }
.cf-tree-icon {
  width: 30px; height: 30px; border: 0; background: none; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #64748b; cursor: pointer;
}
.cf-tree-icon:hover { background: #f1f5f9; color: var(--primary); }
.cf-tree-search { padding: 0 14px 10px; }
.cf-tree-search input { width: 100%; height: 34px; font-size: 13px; }
.cf-tree-body { padding: 4px 8px 12px; }
.cf-tree-tip { font-size: 12.5px; color: #94a3b8; padding: 12px 12px 4px; line-height: 1.7; }
.cf-tree-tip b { color: var(--primary); }

.cf-node { height: 38px; padding: 0 12px; gap: 8px; border-radius: 8px; font-size: 14.5px; color: #374151; }
.cf-node .cf-caret { width: 12px; flex: 0 0 12px; font-size: 10px; color: #9aa6b8; text-align: center; }
.cf-node .cf-folder { flex: 0 0 15px; color: #94a3b8; }
.cf-node.is-on .cf-folder { color: var(--primary); }
.cf-node.is-on { background: #eaf2ff; color: var(--primary); font-weight: 600; }
.cf-node .cf-node-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-node em {
  margin-left: auto; flex: 0 0 auto; font-style: normal; font-size: 12.5px;
  color: #94a3b8; background: none; padding: 0;
}
.cf-node.is-on em { color: var(--primary); }
.cf-node-root { font-weight: 600; }

.cf-menu { top: 6px; }
.cf-menu > summary {
  width: 28px; height: 28px; font-size: 16px; letter-spacing: 1px;
  border-radius: 7px; color: #94a3b8;
}
.cf-menu[open] > summary { background: #e8eef8; color: var(--primary); }
.cf-menu-list {
  position: absolute; right: 0; top: 32px; z-index: 40; min-width: 134px;
  background: #fff; border: 1px solid #e8edf5; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .16); padding: 6px;
}
.cf-menu-item {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 9px 10px; border-radius: 7px; font-size: 13.5px; color: #374151;
  cursor: pointer; white-space: nowrap;
}
.cf-menu-item:hover { background: #eff6ff; color: var(--primary); }
.cf-menu-item.danger { color: #dc2626; }
.cf-menu-item.danger:hover { background: #fef2f2; color: #dc2626; }

.cf-row { padding: 14px 8px; gap: 14px; }
.cf-thumb { width: 44px; height: 44px; }
.cf-time { color: #94a3b8; }

.cf-empty { display: flex; flex-direction: column; align-items: center; padding: 70px 20px 90px; color: #cbd5e1; }
.cf-empty-ico { color: #d7dee8; }
.cf-empty-t { font-size: 15px; color: #64748b; margin-top: 10px; }
.cf-empty-sub { font-size: 13px; color: #9aa6b8; margin-top: 4px; text-align: center; }
.cf-empty-actions { display: flex; gap: 10px; margin-top: 18px; }

.cf-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; }
.cf-modal[hidden] { display: none; }
.cf-modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); }
.cf-modal-box {
  position: relative; width: 424px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 14px; padding: 22px 22px 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.cf-modal-t { font-size: 16px; font-weight: 650; margin-bottom: 16px; color: #1f2937; }
.cf-modal-b { display: grid; gap: 10px; }
.cf-modal-b input, .cf-modal-b select { width: 100%; height: 40px; font-size: 14px; }
.cf-modal-b p { margin: 0; font-size: 13.5px; color: #6b7280; line-height: 1.65; }
.cf-modal-f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.cf-modal-f .btn { min-width: 78px; justify-content: center; }

@media (max-width: 1100px) {
  .cf-tree { width: 100%; flex: none; max-height: 360px; }
}

@media (hover: none) {
  .cf-menu > summary { opacity: 1; }
}



/* ============================================================
   页面背景：背景图 / 背景色 / 动效
   ============================================================ */
.pub { position: relative; }
.pub-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.pub-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-body { position: relative; z-index: 1; }

/* 图片底部渐变至透明 */
.pub-bg.is-fade {
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
}

/* 滤镜 */
/* 默认压一层浅色蒙层，保证深色正文在照片上仍可读；颜色滤镜会覆盖它 */
.pub-bg::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: .55; }
.pub-bg.f-blur img { filter: blur(6px); }
.pub-bg.f-color::after {
  content: ''; position: absolute; inset: 0;
  background: var(--tint, #000); opacity: .42;
}

/* 动效 */
.pub-bg.m-pan img { animation: bgPan var(--spd, 10s) ease-in-out infinite alternate; }
.pub-bg.m-zoom img { animation: bgZoom var(--spd, 10s) ease-in-out infinite alternate; }
.pub-bg.m-float img { animation: bgFloat var(--spd, 10s) ease-in-out infinite alternate; }
.pub-bg.p-once img { animation-iteration-count: 1; animation-fill-mode: both; }
@keyframes bgPan {
  from { transform: scale(1.16) translateX(-5%); }
  to { transform: scale(1.16) translateX(5%); }
}
@keyframes bgZoom {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}
@keyframes bgFloat {
  from { transform: scale(1.1) translateY(-2.5%); }
  to { transform: scale(1.1) translateY(2.5%); }
}
@media (prefers-reduced-motion: reduce) {
  .pub-bg img { animation: none !important; }
}

/* 手机上内容铺满：背景随内容宽度一起撑满，不再有卡片留白 */
@media (max-width: 480px) {
  .pub { padding: 0; }
  .pub-inner {
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    padding: 18px 16px 28px;
  }
}

/* ============================================================
   数据看板：筛选条 / 下拉层 / 指标卡 / 趋势图
   ============================================================ */
.db-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.db-head h2 { margin: 0; font-size: 20px; font-weight: 650; }
.db-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.db-head-r { font-size: 12.5px; color: var(--muted); background: #eef2f7; border-radius: 999px; padding: 4px 11px; }

.db-bar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 16px;
  /* 单独成层：让筛选弹层压在下方指标卡之上 */
  position: relative; z-index: 20;
}
.db-f { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.db-f > label { font-size: 12px; color: var(--muted); }
.db-f select { height: 36px; font-size: 13.5px; padding: 6px 10px; min-width: 168px; }
.db-f-code { min-width: 190px; }
.db-bar-r { margin-left: auto; display: flex; gap: 8px; }

/* 下拉按钮 + 浮层 */
.db-dd { position: relative; }
.db-dd-btn {
  height: 36px; min-width: 168px; max-width: 320px;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 11px; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px;
  cursor: pointer; font-family: inherit;
}
.db-dd-btn span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
}
.db-dd-btn i { font-style: normal; color: #94a3b8; font-size: 11px; flex: 0 0 auto; }
.db-dd-btn:hover { border-color: #cbd5e1; }
.db-dd-btn.is-open { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

.db-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 60;
  background: #fff; border: 1px solid #e8edf5; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16, 24, 40, .16); padding: 10px;
}
.db-pop[hidden] { display: none !important; }

/* 时间弹层 */
.db-pop-time { width: 320px; }
.db-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.db-pcol { display: flex; flex-direction: column; }
.db-p {
  display: block; padding: 7px 10px; border-radius: 7px;
  font-size: 13.5px; color: #374151;
}
.db-p:hover { background: #eff6ff; color: var(--primary); }
.db-p.is-on { background: #eaf2ff; color: var(--primary); font-weight: 600; }
.db-p-custom { color: var(--primary); }
.db-custom {
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.db-custom[hidden] { display: none !important; }
.db-custom input[type=date] {
  width: auto; flex: 1 1 118px; font-size: 13px; padding: 6px 8px; height: 34px;
}
.db-custom-sep { font-size: 12.5px; color: var(--muted); }
.db-custom-ops { display: flex; gap: 6px; width: 100%; justify-content: flex-end; }

/* 二维码树 */
.db-pop-code { width: 340px; padding: 0; overflow: hidden; }
.db-code-search { padding: 10px 10px 6px; }
.db-code-search input { height: 34px; font-size: 13px; }
.db-code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 12px 8px; font-size: 12.5px; color: var(--muted);
}
.db-code-head b { color: var(--primary); }
.db-code-tree {
  max-height: 320px; overflow-y: auto; padding: 0 6px 6px;
  border-top: 1px solid var(--border);
}
.db-code {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px;
  border-radius: 7px; font-size: 13.5px; color: #374151; cursor: pointer;
}
.db-code:hover { background: #f5f8ff; }
.db-code input { width: 14px; height: 14px; flex: 0 0 auto; }
.db-code-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-code em { font-style: normal; font-size: 11.5px; color: #94a3b8; }
.db-code-off { color: var(--warn) !important; }
.db-code-all { font-weight: 600; }
.db-code[hidden] { display: none !important; }
.db-code-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.db-grp[hidden] { display: none !important; }
.db-grp-t {
  display: flex; align-items: center; gap: 5px; width: 100%;
  border: 0; background: none; padding: 6px 8px; border-radius: 7px;
  font-size: 13.5px; color: #1f2937; font-weight: 600; cursor: pointer; text-align: left;
  font-family: inherit;
}
.db-grp-t:hover { background: #f5f8ff; }
.db-grp-t svg { color: #94a3b8; flex: 0 0 auto; }
.db-grp-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-caret { font-style: normal; font-size: 10px; color: #9aa6b8; width: 10px; flex: 0 0 10px; }
.db-grp-kids[hidden] { display: none !important; }
.db-code-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 8px 10px; border-top: 1px solid var(--border); background: #fafcff;
}

/* 指标卡 */
.db-kpis { margin-bottom: 16px; }
.db-kpis .stat { position: relative; }
.db-k-tag {
  font-size: 11px; color: var(--primary); background: var(--primary-soft);
  border-radius: 999px; padding: 1px 7px; margin-left: 4px;
}
.db-delta { font-size: 12px; margin-top: 6px; color: var(--muted); }
.db-delta em { font-style: normal; color: #94a3b8; }
.db-delta.up { color: #16a34a; }
.db-delta.down { color: #dc2626; }
.db-delta.flat { color: var(--muted); }

/* 趋势卡 */
.db-chart-card { padding-bottom: 10px; }
.db-chart-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.db-chart-head h3 { margin: 0; }
.db-series { display: flex; gap: 6px; }
.db-series button {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 13px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  font-family: inherit;
}
.db-series button.is-on {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-soft); font-weight: 600;
}
.db-h3-sub { font-size: 12px; color: var(--muted); font-weight: 400; }

@media (max-width: 720px) {
  .db-f, .db-f-code { min-width: 100%; }
  .db-dd, .db-dd-btn, .db-f select { width: 100%; max-width: none; }
  .db-pop-time, .db-pop-code { width: calc(100vw - 60px); }
  .db-bar-r { margin-left: 0; }
}
