/* admin-components.css —— 通用组件（卡片 / 表格 / 控件 / 标签 / Toast / 弹窗 / 空态） */
/* ---------- 卡片 / 表格 / 控件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card > h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card > h3 .h3-extra { margin-left: auto; font-size: 12px; color: var(--ink2); font-weight: 400; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line2); padding: 10px 8px; text-align: left; word-break: break-all; vertical-align: middle; }
th { color: var(--ink2); font-weight: 500; font-size: 12px; background: #FAFAFC; }
th:first-child, td:first-child { padding-left: 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFBFF; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer;
  margin-right: 8px; font-size: 12.5px; transition: all .15s; font-family: inherit; }
button:hover { opacity: .88; }
button.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
button.ghost { background: #fff; color: var(--accent); border: 1px solid #FFD9B8; }
button.ghost:hover { border-color: var(--accent); }
button.plain { background: #F4F5F9; color: var(--ink2); }
button.plain:hover { background: #ECEDF3; color: var(--ink); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; margin-right: 8px;
  font-size: 12.5px; outline: none; font-family: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.switch-item { display: inline-block; margin: 4px 14px 4px 0; }
.ok { color: var(--green); } .warn { color: var(--orange); }
.accent-t { color: var(--accent); } .danger-t { color: var(--danger); }
.muted { color: var(--ink2); font-size: 12px; }
.money { color: var(--accent); font-weight: 600; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; background: #F1F2F6; color: var(--ink2); white-space: nowrap; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.orange { background: var(--orange-soft); color: var(--orange); }
.tag.gold { background: var(--gold-soft); color: #B97E00; }

/* ---------- 工作台表单（广告激励同款 · 全后台统一） ---------- */
.frow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.frow > button { margin-right: 0; margin-bottom: 1px; }
.frow > span { padding-bottom: 7px; }
.field { display: flex; flex-direction: column; }
.field .f-label { font-size: 11px; color: var(--ink2); margin-bottom: 4px; line-height: 1.3; }
.field input, .field select, .field textarea { margin-right: 0; }
/* 实时联动预览条 */
.hint-live { margin-top: 10px; font-size: 12px; color: var(--ink2); background: var(--accent-soft);
  border: 1px dashed #E8C9CB; border-radius: 10px; padding: 8px 14px; line-height: 1.7; }
.hint-live b { color: var(--accent); }
/* 渐变进度条（IP 进度同款） */
.prog { display: flex; align-items: center; gap: 6px; }
.prog .p-track { flex: 1; height: 6px; background: #F1E7DC; border-radius: 3px; overflow: hidden; min-width: 70px; }
.prog .p-fill { height: 100%; width: 0; background: linear-gradient(90deg, #C2410C, #E08A3C); border-radius: 3px; transition: width .3s; }
.prog .p-num { color: var(--ink2); font-size: 12px; white-space: nowrap; }

/* 权限勾选 chips（账号与权限页） */
.perm-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; user-select: none; background: #fff; color: var(--ink2); transition: all .15s; }
.perm-chip:hover { border-color: #E3C6C8; }
.perm-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.perm-chip input { margin: 0; accent-color: var(--accent); }
.perm-chip .pc-g { font-size: 10px; opacity: .65; }
/* 列表内联权限标签（可点切换） */
.ptag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; background: #F1F2F6; color: var(--ink3);
  cursor: pointer; margin: 2px 4px 2px 0; transition: all .12s; }
.ptag:hover { background: #E9EAEF; }
.ptag.on { background: var(--accent-soft); color: var(--accent); }

/* 广告中心 V4.2：效果看板 / 封面缩略 / 素材预览 */
.stat-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.stat-strip .s-item { flex: 1; min-width: 108px; background: var(--accent-soft); border: 1px solid #F1E7DC; border-radius: 8px; padding: 10px 12px; }
.stat-strip .s-item .s-num { font-size: 18px; font-weight: 700; color: var(--accent); }
.stat-strip .s-item .s-lab { font-size: 11px; color: var(--ink2); margin-top: 2px; }
.adv-thumb { width: 52px; height: 34px; border-radius: 5px; object-fit: cover; background: #F1E7DC; vertical-align: middle; margin-right: 6px; }
.adv-thumb-ph { display: inline-flex; width: 52px; height: 34px; border-radius: 5px; background: #F1E7DC; color: #B98A63; align-items: center; justify-content: center; font-size: 14px; vertical-align: middle; margin-right: 6px; }
.media-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.media-preview img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid #F1E7DC; }

/* 广告中心分区标题 */
.zone-title { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 12px; padding-left: 10px; border-left: 3px solid var(--accent); font-size: 15px; font-weight: 600; }
.zone-title:first-child { margin-top: 0; }
.zone-title .z-sub { font-size: 12px; color: var(--ink2); font-weight: 400; }
/* 广告中心三个业务域（页内 tab）：同一时间只显示一个 */
.ad-zone { display: none; }
.ad-zone.on { display: block; }
.zone-sub { margin: 0 0 12px; font-size: 12px; color: var(--ink2); line-height: 1.7; }

/* ---------- Tab 筛选行（拼多多式） ---------- */
.tabrow { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap;
  /* 高频页长列表筛选体验：tab 始终贴顶栏红通栏下面，滚列表不会弄丢 tab；背景色防止内容透出 */
  position: sticky; top: var(--topbar-h); background: var(--bg); z-index: 12; padding-top: 10px; padding-bottom: 8px; }
.tabrow .tr-item { padding: 9px 16px; font-size: 13px; color: var(--ink2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none; }
.tabrow .tr-item:hover { color: var(--ink); }
.tabrow .tr-item.on { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.tabrow .tr-item b { font-weight: 600; margin-left: 3px; font-size: 12px; }
.tabrow .tr-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; padding-bottom: 6px; }

/* ---------- 经营看板 ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 16px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12px; color: var(--ink2); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.kpi .k-label::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); flex: none; }
.kpi b { font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: .3px; line-height: 1.15; display: block; }
.kpi .k-note { margin-top: 8px; font-size: 11.5px; color: var(--ink2); }
.kpi.hot b { color: var(--accent); }
.kpi.hot .k-label::before { background: var(--accent-grad); box-shadow: none; }
.kpi .k-up { color: var(--green); } .kpi .k-down { color: var(--danger); }

/* 履约待办大入口 */
.todo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.todo-cell { border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px 13px; cursor: pointer; transition: all .15s; background: #fff; }
.todo-cell:hover { border-color: #FFD9B8; box-shadow: 0 6px 18px rgba(183, 121, 31,.08); transform: translateY(-1px); }
.todo-cell .tc-label { font-size: 12.5px; color: var(--ink2); display: flex; align-items: center; gap: 7px; }
.todo-cell .tc-num { font-size: 24px; font-weight: 600; margin-top: 8px; color: var(--ink); }
.todo-cell.alert .tc-num { color: var(--danger); }
.todo-cell.alert .tc-dot { background: var(--danger); }
.todo-cell .tc-dot { width: 7px; height: 7px; border-radius: 50%; background: #D4D7DE; flex: none; }
.todo-cell .tc-go { font-size: 11.5px; color: var(--ink3); margin-top: 7px; }

/* 文案配置列表 */
.ct-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.ct-group-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.ct-item { padding: 8px 0; border-top: 1px dashed var(--line2); }
.ct-item:first-of-type { border-top: 0; }
.ct-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-head b { font-size: 12.5px; }
.ct-note { font-size: 11.5px; margin-top: 4px; }

/* 趋势图容器 */
#trendChart svg { display: block; width: 100%; height: auto; }
/* 整列 hover 高亮（列底衬在最底层，柱/点在上层，各自也有 tooltip） */
#trendChart .tc-col { fill: transparent; pointer-events: all; transition: fill .15s ease; }
#trendChart .tc-col:hover { fill: #FFF7F1; }
#trendChart .tc-bar { transition: opacity .15s ease; }
#trendChart .tc-bar:hover { opacity: .82; }
#trendChart .tc-dot { transition: r .15s ease; }
#trendChart .tc-dot:hover { r: 4.6; }

/* 系统开关 chips */
.sw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 12px; border-radius: 999px; background: #F4F5F9; color: var(--ink2); }
.sw-chip i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.sw-chip.on i { background: var(--green); }
.sw-chip.off i { background: #C9CDD6; }
.sw-chip.alert { background: var(--danger-soft); color: var(--danger); }
.sw-chip.alert i { background: var(--danger); }

/* 商品/订单缩略图 */
.thumb { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: #F4F5F9; flex: none; border: 1px solid var(--line2); }
.thumb-ph { width: 42px; height: 42px; border-radius: 9px; background: #F4F5F9; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.prod-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prod-cell .p-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* 空态 */
.empty { text-align: center; color: var(--ink3); padding: 34px 0; font-size: 13px; }
/* 空态图标统一：一套 24 网格线性托盘图标覆盖所有 <div class="e-icon">，
   内嵌 emoji 文本以 font-size:0 + transparent 隐藏，避免各端彩色 emoji 渲染不一致 */
.empty .e-icon {
  width: 32px; height: 32px; margin: 0 auto 8px;
  font-size: 0; color: transparent; opacity: 1;
  background-color: #C9C2B8;
  -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.4 13.6h5.2l1.4 2.4h4l1.4-2.4h5.2'/%3E%3Cpath d='M5.6 5.4h12.8l2.2 8.2v4.6a2 2 0 0 1-2 2H5.4a2 2 0 0 1-2-2v-4.6z'/%3E%3C/svg%3E");
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.4 13.6h5.2l1.4 2.4h4l1.4-2.4h5.2'/%3E%3Cpath d='M5.6 5.4h12.8l2.2 8.2v4.6a2 2 0 0 1-2 2H5.4a2 2 0 0 1-2-2v-4.6z'/%3E%3C/svg%3E");
}

/* ---------- 审计日志 ---------- */
#audit tbody tr.audit-alert-row { background: #FDF6F6; }
#audit tbody tr.audit-alert-row:hover { background: #FBEBEC; }
.audit-link { color: var(--accent); cursor: pointer; border-bottom: 1px dashed var(--accent); font-weight: 500; }
.audit-link:hover { opacity: .75; }
#audit td { vertical-align: top; }

/* ---------- Toast ---------- */
#toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(20,22,30,.12);
  padding: 11px 16px; font-size: 13px; display: flex; align-items: center; gap: 9px; animation: toastIn .22s ease; max-width: 340px; }
.toast-item.ok { border-color: #BFE8D2; } .toast-item.ok .t-ic { color: var(--green); }
.toast-item.err { border-color: #F8C9CB; } .toast-item.err .t-ic { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 弹窗（修改密码等） ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(24,26,32,.44); z-index: 150; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 16px; padding: 26px 28px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.modal input { width: 100%; margin-bottom: 12px; padding: 10px 12px; }
.modal .m-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal .m-err { color: var(--danger); font-size: 12px; min-height: 16px; margin: 0 0 6px; }
/* 凭据展示：只读输入框 + 复制按钮 */
.secret-row { margin-bottom: 12px; }
.secret-row .s-label { font-size: 12px; color: var(--ink2); margin-bottom: 4px; }
.secret-line { display: flex; gap: 8px; align-items: center; }
.secret-line input { flex: 1; min-width: 0; margin: 0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.secret-line button { flex: none; margin: 0; }
.secret-note { font-size: 12px; color: var(--orange); margin: 0 0 12px; }

/* ---------- 右侧详情抽屉（商家详情等） ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(24,26,32,.44); z-index: 150; display: none; }
.drawer-mask.on { display: block; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: 420px; max-width: 92vw; background: #fff;
  box-shadow: -12px 0 40px rgba(0,0,0,.14); display: flex; flex-direction: column; animation: drawerIn .18s ease; }
@keyframes drawerIn { from { transform: translateX(26px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.drawer-h h3 { margin: 0; font-size: 15px; }
.drawer-h button { margin-right: 0; }
.drawer-body { padding: 4px 20px 24px; overflow-y: auto; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; padding: 11px 0; border-bottom: 1px dashed var(--line2); font-size: 13px; }
.kv .k { color: var(--ink2); font-size: 12px; }
.kv .v { word-break: break-all; }
.drawer-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 0; }
.drawer-acts button { margin-right: 0; }

.pane { display: none; } .pane.on { display: block; }

/* 合规提示列表 */
.rule-list { font-size: 13px; line-height: 2; margin: 0; padding-left: 20px; }
.rule-list b { color: var(--ink); }

