/* ===== 巴音杭盖管理后台样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
}
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px;
  background: #111827;
  color: #d1d5db;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  padding: 20px 16px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid #1f2937;
}
.brand span { display: block; font-size: 12px; font-weight: 400; color: #9ca3af; margin-top: 2px; }
.nav { padding: 10px 0; }
.nav a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  line-height: 1.45;
  color: #d1d5db;
  text-decoration: none;
  transition: background .15s;
}
.nav a:hover { background: #1f2937; color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav-group {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  padding: 16px 20px 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: #cbd5e1;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .15s;
}
.nav-group:hover { color: #f3f4f6; }
.nav-group .nav-arrow {
  font-size: 10px;
  transition: transform .15s;
}
.nav-group.expanded .nav-arrow { transform: rotate(90deg); }
.nav-items { padding-bottom: 6px; }
/* 分组内的菜单项：缩进 + 比父级“分组标题”更小更淡，避免层级倒挂 */
.nav-items > a {
  padding-left: 34px;
  font-size: 12px;
  color: #9ca3af;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.page-title { font-size: 17px; font-weight: 600; }
.admin-info { color: var(--muted); }
.content { padding: 20px 24px; flex: 1; }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.card-desc { color: var(--muted); font-size: 12px; margin: -8px 0 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs .tab {
  padding: 8px 14px;
  font-size: 13px;
  color: #4b5563;
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--primary); background: #f3f4f6; }
.tabs .tab.active { color: var(--primary); background: #fff; border-color: var(--border); font-weight: 600; }

/* ===== 分类树展开/收起 ===== */
.cate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.cate-toggle:hover strong { color: var(--primary); }
.cate-arrow {
  display: inline-block;
  width: 14px;
  font-size: 12px;
  color: var(--muted);
  transition: transform .15s;
}
.cate-toggle[aria-expanded="true"] .cate-arrow { transform: rotate(90deg); }
tr.cate-child > td:first-child { color: var(--muted); }
.form-section-title {
  font-size: 14px; font-weight: 600; color: #374151;
  margin: 4px 0 14px; padding-top: 16px; border-top: 1px dashed var(--border);
}

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat-card .sub { color: var(--success); font-size: 12px; margin-top: 2px; }
.stat-card .sub.warn { color: var(--warning); }
.stat-card .sub.danger { color: var(--danger); }

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { background: #f9fafb; font-weight: 600; white-space: nowrap; }
.table td { vertical-align: middle; }
.table tr:hover td { background: #f9fafb; }
.table td.form-inline { display: table-cell; white-space: nowrap; }
.table td.form-inline > * + * { margin-left: 8px; }
.table .thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--bg); }
.table .thumb.empty { display: inline-block; text-align: center; line-height: 48px; color: var(--muted); }

/* ===== 标签 ===== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-gray  { background: #f3f4f6; color: #6b7280; }
.badge-red   { background: #fee2e2; color: #b91c1c; }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-yellow{ background: #fef3c7; color: #b45309; }
.badge-purple{ background: #ede9fe; color: #6d28d9; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-link { color: var(--primary); text-decoration: none; margin-left: 12px; }

/* ===== 表单 ===== */
.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; color: #001f5b; font-weight: 700; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-item { flex: 1; min-width: 200px; }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-inline .form-control { width: auto; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ===== 关键词映射可视化编辑器（系统配置 · 微信推送模板） ===== */
.kvmap { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fafbfc; }
.kvmap-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.kvmap-bar .kv-pick { width: auto; flex: 1 1 260px; min-width: 200px; }
.kvmap-head { display: grid; grid-template-columns: 170px 1fr 72px; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.kvmap-rows { display: flex; flex-direction: column; gap: 8px; }
.kvrow { display: grid; grid-template-columns: 170px 1fr 72px; gap: 8px; align-items: center; }
@media (max-width: 768px) {
  .kvmap-head { display: none; }
  .kvrow { grid-template-columns: 1fr 72px; }
  .kvrow .kv-key { grid-column: 1; grid-row: 1; }
  .kvrow .kv-val { grid-column: 1 / -1; grid-row: 2; }
  .kvrow button { grid-column: 2; grid-row: 1; }
  .kv-tip { grid-column: 1 / -1; grid-row: 3; }
}

/* 每行下方的类型 / 长度提示 */
.kv-tip { grid-column: 2 / -1; grid-row: 2; color: var(--muted); font-size: 12px; line-height: 1.5; }
.kv-tip.is-err { color: var(--danger); }
.kv-warns { margin-top: 4px; color: var(--danger); }

/* ===== 字段类型速查面板（系统配置 · 微信推送模板） ===== */
.cheat { border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; margin-bottom: 16px; }
.cheat > summary { cursor: pointer; padding: 10px 12px; font-size: 13px; font-weight: 600; user-select: none; }
.cheat[open] > summary { border-bottom: 1px solid var(--border); }
.cheat-body { padding: 10px 12px 14px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.cheat-body p { margin-bottom: 8px; }
.cheat-body b { color: var(--text); }
.cheat-body code,
.cheat-table code { background: #eef1f4; border-radius: 3px; padding: 1px 4px; }
.cheat-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 12px; }
.cheat-table th,
.cheat-table td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; vertical-align: top; }
.cheat-table th { background: #f0f2f5; color: var(--text); font-weight: 600; white-space: nowrap; }
.cheat-list { padding-left: 18px; }
.cheat-list li { margin-bottom: 4px; }

/* ===== 筛选栏 ===== */
.filter-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===== 分页 ===== */
.pagination { margin-top: 16px; display: flex; gap: 6px; align-items: center; }
.pagination a, .pagination span {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .total { color: var(--muted); margin-left: 8px; }

/* ===== 登录页 ===== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
}
.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
}
.login-box h1 { font-size: 22px; margin-bottom: 4px; }
.login-box h1 span { color: var(--muted); font-size: 14px; font-weight: 400; display: block; margin-bottom: 18px; }
.login-box .form-item label { margin-bottom: 8px; }

/* 登录方式切换（账号密码 / 扫码） */
.login-tabs { display: flex; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.login-tab {
  flex: 1;
  padding: 8px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.login-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.login-pane.hide { display: none; }
/* 关闭账号密码登录后：代替切换标签的提示文案 */
.login-only-tip { padding: 4px 0 16px; color: var(--muted); font-size: 13px; text-align: center; }
/* 账号密码登录失败：表单上方错误提示 */
.login-error {
  margin-bottom: 14px;
  text-align: center;
  color: #dc2626;
  font-size: 14px;
  line-height: 1.5;
}

/* 扫码登录 */
.qr-box { text-align: center; }
.qr-canvas { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.qr-canvas img { display: block; width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 8px; }
.qr-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, .94);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}
.qr-mask.hide { display: none; }
.qr-tip { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }

/* ===== 图片上传预览 ===== */
.upload-box { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.upload-box img, .upload-box .upload-placeholder {
  width: 96px; height: 96px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  background: #fafafa;
  cursor: pointer;
}
.img-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.img-list .img-item { position: relative; }
.img-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.img-list .img-del {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; line-height: 16px;
  text-align: center; border-radius: 50%;
  background: var(--danger); color: #fff;
  font-size: 12px; cursor: pointer;
}
.img-list .img-main {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 11px; line-height: 20px; text-align: center;
  color: #fff; background: rgba(17,24,39,.6); cursor: pointer;
  border-radius: 0 0 6px 6px;
  opacity: 0; transition: opacity .15s;
}
.img-list .img-item:hover .img-main { opacity: 1; }
.img-list .img-item.img-main-active .img-main { opacity: 1; background: var(--primary); }
.img-list .img-item.img-main-active img { border-color: var(--primary); }

/* 无主图附件列表（data-no-main，如投放单资质附件）：图块/扩展名 + 文件名，无主图角标 */
.img-list .img-item.file-item { width: 96px; text-align: center; }
.img-list .img-item.file-item .file-icon {
  width: 72px; height: 72px; margin: 0 auto;
  border: 1px dashed var(--border); border-radius: 6px;
  background: #fafafa; color: var(--muted);
  font-size: 12px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
}
.img-list .img-item.file-item .file-name {
  display: block; width: 96px; margin-top: 2px;
  font-size: 11px; color: var(--muted); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.img-list .img-item.file-item a.file-name:hover { color: var(--primary); }
.img-list .img-item.file-item .img-del { right: 6px; }
.upload-box .upload-placeholder.upload-file {
  width: auto; height: auto; min-height: 72px; padding: 0 16px;
}

/* ===== 广告图裁剪弹窗 ===== */
.crop-mask {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .6);
}
.crop-panel {
  width: min(780px, 94vw);
  max-height: 92vh;
  background: #fff; border-radius: 12px;
  padding: 18px 20px; box-sizing: border-box;
  box-shadow: 0 24px 48px rgba(0,0,0,.25);
  overflow: auto;
}
.crop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.crop-head b { font-size: 15px; }
.crop-tip { font-size: 12px; color: var(--muted); }
.crop-stage {
  position: relative; margin: 0 auto;
  background: #000; touch-action: none;
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
}
.crop-stage img { display: block; width: 100%; height: 100%; }
.crop-sel { position: absolute; z-index: 2; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); cursor: move; }
.crop-sel::before, .crop-sel::after {
  content: ''; position: absolute; background: rgba(255,255,255,.4);
}
.crop-sel::before { left: 33.333%; right: 33.333%; top: 0; bottom: 0; }
.crop-sel::after { top: 33.333%; bottom: 33.333%; left: 0; right: 0; }
.crop-handle { position: absolute; z-index: 3; width: 22px; height: 22px; transform: translate(-50%, -50%); }
.crop-handle::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  box-sizing: border-box; border: 1px solid #fff;
  background: var(--primary); border-radius: 2px;
}
.crop-handle[data-dir="nw"], .crop-handle[data-dir="se"] { cursor: nwse-resize; }
.crop-handle[data-dir="ne"], .crop-handle[data-dir="sw"] { cursor: nesw-resize; }
.crop-handle[data-dir="n"], .crop-handle[data-dir="s"] { cursor: ns-resize; }
.crop-handle[data-dir="e"], .crop-handle[data-dir="w"] { cursor: ew-resize; }
.crop-hint { margin-top: 10px; font-size: 12px; color: var(--muted); }
.crop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* 裁剪上传的结果预览：按业务比例显示，不压成正方形 */
.upload-box .crop-result {
  width: 220px;
  height: auto;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
/* 广告列表缩略图：按首页轮播 71:30 展示 */
.table .thumb.thumb-ad { width: 142px; height: 60px; border-radius: 4px; }

/* 投放地区三级级联下拉 */
.area-cascade { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.area-cascade select.form-control { width: auto; flex: 0 1 auto; min-width: 150px; }
.area-cascade select.form-control:disabled { color: var(--muted); background: #f3f4f6; }

/* ===== 双列表单 ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* ===== 上传预览弹窗（多图 / 附件共用）===== */
.up-mask {
  position: fixed; inset: 0; z-index: 2100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .6);
}
.up-panel {
  width: min(720px, 94vw); max-height: 90vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 12px;
  padding: 16px 18px; box-sizing: border-box;
  box-shadow: 0 24px 48px rgba(0,0,0,.25);
}
.up-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.up-head .up-sum { font-size: 12px; color: var(--muted); }
.up-body { position: relative; flex: 1; min-height: 0; overflow: auto; }
.up-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px; }

/* ---------- 查看详情弹层（列表内异步加载详情片段） ---------- */
.pd-mask {
  position: fixed; inset: 0; z-index: 2200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .6);
}
.pd-panel {
  width: min(760px, 94vw); max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--card); border-radius: 12px; box-sizing: border-box;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .25);
}
.pd-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.pd-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; }
.pd-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.pd-title { font-size: 16px; font-weight: 600; }
.pd-note { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #fff7ed; color: #9a3412; font-size: 13px; }
.pd-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.pd-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.pd-table th { width: 110px; color: var(--muted); font-weight: 500; }
.pd-block { margin-top: 16px; }
.pd-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pd-text { line-height: 1.7; word-break: break-word; }
.up-item {
  width: 108px; padding: 6px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.up-item.up-uploading { border-color: var(--primary); }
.up-item.up-done { border-color: var(--success); }
.up-item.up-fail { border-color: var(--danger); }
.up-thumb {
  width: 94px; height: 94px; border-radius: 6px; overflow: hidden;
  background: #fafafa; color: var(--muted); font-size: 12px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
}
.up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-name {
  margin-top: 4px; font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-state { margin-top: 2px; min-height: 16px; font-size: 11px; color: var(--muted); }
.up-item.up-done .up-state { color: var(--success); }
.up-item.up-fail .up-state { color: var(--danger); }
.up-tools { display: flex; gap: 6px; margin-top: 4px; }
.up-btn {
  flex: 1; padding: 2px 0; font-size: 11px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--text);
}
.up-btn:hover { border-color: var(--primary); color: var(--primary); }
.up-btn-del:hover { border-color: var(--danger); color: var(--danger); }
.up-hint { margin-top: 10px; font-size: 12px; color: var(--muted); }
.up-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* 弹窗内裁剪：自由比例选框
   注意：不能用 position:absolute/inset:0 —— 此时 .up-grid 已 display:none，
   .up-body（flex:1）高度会塌陷为 0，裁剪界面将完全看不见、也无法拖动。 */
.up-crop { position: relative; background: #fff; }
.up-crop-stage {
  position: relative; margin: 0 auto; touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.up-crop-stage > img {
  width: 100%; height: 100%; display: block;
  user-select: none; -webkit-user-drag: none;
}
.up-crop-sel {
  position: absolute; box-sizing: border-box;
  border: 1px solid #fff; outline: 1px dashed rgba(0,0,0,.5);
  cursor: move;
}
.up-crop-handle {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  background: #fff; border: 1px solid var(--primary); border-radius: 50%;
}
.up-crop-handle[data-dir="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.up-crop-handle[data-dir="n"] { left: 50%; top: 0; cursor: ns-resize; }
.up-crop-handle[data-dir="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.up-crop-handle[data-dir="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.up-crop-handle[data-dir="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.up-crop-handle[data-dir="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.up-crop-handle[data-dir="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.up-crop-handle[data-dir="w"] { left: 0; top: 50%; cursor: ew-resize; }
.up-crop-foot { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }

/* ===== 待上传状态：文件只在浏览器本地，点表单“保存”后才上传 ===== */
.img-list .img-item.img-pending { border-style: dashed; border-color: var(--primary); }
.img-list .img-item.img-pending img { opacity: .75; }
.img-list .img-item .img-pending-tip {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 11px; line-height: 20px; text-align: center; cursor: default;
  color: #fff; background: rgba(37, 99, 235, .82); border-radius: 0 0 6px 6px;
}
.img-list .img-item.file-item .img-pending-tip { position: static; margin-top: 2px; border-radius: 4px; }
.up-pending-hint { width: 100%; margin-top: 4px; font-size: 12px; color: #b45309; }

/* ===== 数据统计：趋势柱状图 / 环比 / 排行 ===== */
.trend-row { padding: 10px 0; border-top: 1px solid var(--border); }
.trend-row:first-of-type { border-top: none; padding-top: 0; }
.trend-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.trend-title .form-hint { display: inline-block; margin-left: 8px; font-weight: 400; }
.bar-chart {
  display: flex; align-items: flex-end; gap: 2px;
  height: 84px; padding: 4px 0 0;
  border-bottom: 1px solid var(--border);
}
.bar-chart .bar {
  flex: 1 1 0; min-width: 3px;
  background: var(--primary); border-radius: 2px 2px 0 0;
  opacity: .85; transition: opacity .15s;
}
.bar-chart .bar:hover { opacity: 1; }
.bar-chart .bar.empty { background: #e5e7eb; }
.bar-legend {
  display: flex; justify-content: space-between;
  margin-top: 4px; font-size: 12px; color: var(--muted);
}
.metric-delta { margin-left: 4px; font-size: 12px; }
.metric-delta.up { color: var(--success); }
.metric-delta.down { color: var(--danger); }
.metric-delta.flat { color: var(--muted); }
