:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1b2333;
  --ink-2: #5c6880;
  --ink-3: #98a2b6;
  --line: #e7ebf3;
  --primary: #3b62f6;
  --primary-dark: #2b4ed8;
  --primary-soft: #eef2ff;
  --success: #18a972;
  --success-soft: #e6f8f1;
  --warn: #e2952b;
  --warn-soft: #fff4e2;
  --danger: #e3504b;
  --danger-soft: #fdeceb;
  --sidebar: #151d30;
  --sidebar-2: #1d2740;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(24, 38, 75, .07);
  --cell-max-width: 260px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* ── 登录 ── */
.login-screen {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(73, 105, 255, .30), transparent 60%),
    radial-gradient(700px 500px at 88% 92%, rgba(36, 197, 170, .22), transparent 60%),
    linear-gradient(135deg, #111a30, #1c2a4d 55%, #132038);
  padding: 24px;
}
.login-card {
  width: 400px; max-width: 100%;
  background: rgba(255, 255, 255, .97);
  border-radius: 18px; padding: 34px 34px 26px;
  box-shadow: 0 28px 70px rgba(5, 12, 30, .38);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-mark, .brand-mark {
  width: 46px; height: 46px; flex: none; border-radius: 13px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 21px;
  background: linear-gradient(140deg, #5b7cff, #2b46d8);
  box-shadow: 0 8px 20px rgba(59, 98, 246, .35);
}
.login-brand h1 { margin: 0; font-size: 18px; letter-spacing: .2px; }
.login-brand p { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); letter-spacing: .6px; }
.login-card label { display: block; margin: 16px 0 7px; font-size: 13px; color: var(--ink-2); }
.login-card input {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fbfcff;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-error { min-height: 20px; margin: 10px 0 2px; color: var(--danger); font-size: 12px; }

/* ── 布局 ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #cdd6ea; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 38px; height: 38px; font-size: 17px; border-radius: 11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { color: #fff; font-size: 15px; letter-spacing: .5px; }
.brand-text span { font-size: 11px; color: #7f8eae; letter-spacing: 1px; }
.nav { flex: 1; overflow-y: auto; padding: 14px 10px 24px; }
.nav-group { margin-bottom: 12px; }
.nav-group-title {
  padding: 8px 12px 6px; font-size: 11px; letter-spacing: 1.5px;
  color: #6f7d9c; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 0; border-radius: 8px;
  color: #aebbd4; text-decoration: none; font-size: 13px;
  transition: background .15s, color .15s;
}
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 14px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(80,110,255,.35), rgba(80,110,255,.12)); color: #fff; font-weight: 600; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #6f7d9c; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; flex: none; display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 22px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.crumb { font-size: 15px; font-weight: 600; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; font-size: 18px; color: var(--ink-2);
  display: none; padding: 4px 8px;
}
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700;
}
.view { padding: 22px; flex: 1; }

/* ── 通用组件 ── */
.btn {
  border: 1px solid transparent; border-radius: 8px; padding: 8px 15px; cursor: pointer;
  font-size: 13px; transition: transform .12s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(59,98,246,.22); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; height: 42px; margin-top: 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-head h2 { margin: 0 0 5px; font-size: 20px; }
.page-head p { margin: 0; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel-title { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.panel-body { padding: 16px 18px; }

/* 查询条件：form 本身即 flex 容器，字段与按钮同一行按序排布、空间不足自动换行；
   处于独立查询面板内时不再绘制底部分隔线（与下方列表面板由 .panel + .panel 间距分隔） */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.panel-filter .filters { border-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.filters .field { flex: 1 1 190px; min-width: 165px; max-width: 280px; }
.field label { font-size: 11px; color: var(--ink-3); }
.field input, .field select, .modal-field input, .modal-field select, .modal-field textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px;
  background: #fbfcff; outline: none; color: var(--ink);
}
.field input:focus, .field select:focus, .modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.filters .field input, .filters .field select { width: 100%; box-sizing: border-box; }
.filters .field input[type="date"] { width: 100%; }
.filter-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.filters .btn { height: 34px; }

/* 日志批量选择 / 微信用户 / 配置页 */
.selection-cell { width: 40px; }
.selection-cell input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 列表面板顶部工具栏：批量删除 / 全部删除 / 刷新，靠左对齐，与下方表格以分隔线隔开 */
.list-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.wx-user { display: flex; align-items: center; gap: 7px; }
.wx-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; }
.wx-avatar-placeholder {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700;
}
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
/* 固定两列布局（支付配置等场景）：minmax(0,1fr) 防止长文本把列撑破 */
.config-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.config-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.config-field input {
  width: 100%; height: 34px; box-sizing: border-box; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 7px; background: #fbfcff;
  outline: none; color: var(--ink);
}
.config-field input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.config-field textarea {
  width: 100%; min-height: 480px; box-sizing: border-box; padding: 10px 12px; line-height: 1.7;
  border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; color: var(--ink);
  font-family: Consolas, "Courier New", monospace; font-size: 12px; resize: vertical;
}
/* 网格内需要独占一整行的字段（如 PEM 私钥） */
.config-field.config-span-2 { grid-column: 1 / -1; }
/* 私钥/PEM 类文本框：收敛高度（需高于 .config-field textarea 的选择器权重） */
.config-field textarea.config-pem { min-height: 160px; resize: vertical; }
/* 面板管理：输入提示/平台说明是短文案，保留 3 行高度（覆盖大文本框的 480px 与行内控件的 30px） */
.config-field textarea.config-rows-3 { height: auto; min-height: 0; }
.config-tip { font-size: 12px; color: var(--ink-3); line-height: 1.8; margin-top: 8px; }

/* 界面配置：入口/菜单行内编辑控件 */
.cfg-text, .cfg-num {
  height: 30px; padding: 0 8px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 6px; background: #fbfcff; color: var(--ink);
}
.cfg-text { width: 100%; min-width: 120px; }
.cfg-num { width: 78px; }
.cfg-text:focus, .cfg-num:focus { outline: none; border-color: var(--primary); background: #fff; }
.cfg-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }

/* 首页功能入口布局编排：拖拽手柄、宽度下拉与两列效果预览 */
.cfg-select {
  height: 30px; min-width: 118px; padding: 0 8px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 6px; background: #fbfcff; color: var(--ink);
}
.cfg-select:focus { outline: none; border-color: var(--primary); background: #fff; }
.cfg-select:disabled { opacity: .6; }
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 30px; color: var(--ink-3); font-size: 16px;
  cursor: grab; user-select: none;
}
.drag-handle:active { cursor: grabbing; }
tr.cfg-dragging { opacity: .4; }
tr.cfg-drop-target { outline: 2px dashed var(--primary); outline-offset: -2px; }
.config-actions { margin-bottom: 10px; }
/* 拖拽布局面板标题：左侧标题，右侧放自动补齐开关 / 编辑字段 */
.layout-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.layout-panel-tools { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.layout-auto-fill { white-space: nowrap; font-weight: 400; }
.layout-auto-fill .switch { flex: 0 0 auto; }
.layout-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.layout-preview-card {
  display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  box-shadow: var(--shadow); overflow: hidden; cursor: grab;
}
.layout-preview-card:active { cursor: grabbing; }
.layout-preview-card.full { grid-column: 1 / -1; }
.cfg-preview-dragging { opacity: .4; }
.cfg-preview-drop { outline: 2px dashed var(--primary); outline-offset: -2px; }
.layout-preview-tools { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.layout-preview-span {
  height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; cursor: pointer;
}
.layout-preview-span:hover { border-color: var(--primary); }
.layout-preview-grip { color: var(--ink-3); font-size: 15px; cursor: grab; user-select: none; }
.layout-preview-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px;
  background: #f1f4fb; font-size: 18px; line-height: 1;
}
.layout-preview-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.layout-preview-text b,
.layout-preview-text em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout-preview-text b { font-size: 13px; color: var(--ink); }
.layout-preview-text em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.layout-preview .empty { grid-column: 1 / -1; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fafbff; color: var(--ink-2); font-weight: 600; font-size: 12px; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
/* 单元格文本：列宽不足自动省略，悬停由 .cell-tip 显示完整内容（见 app.js initCellTips） */
.cell-clip {
  display: inline-block; max-width: var(--cell-max-width, 260px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
/* 长文本列（标题 / 链接等）上限略宽，其余列统一 260px */
td.cell-wrap { white-space: nowrap; min-width: 160px; }
td.cell-wrap .cell-clip { max-width: 320px; }
.rank-row .cell-clip { width: 150px; flex: none; }
.cell-tip {
  position: fixed; z-index: 9999; max-width: min(460px, 80vw); max-height: 40vh;
  overflow: auto; padding: 8px 11px; border-radius: 8px;
  background: #1b2333; color: #fff; font-size: 12px; line-height: 1.6;
  box-shadow: 0 8px 24px rgba(10, 18, 40, .28); pointer-events: none;
  white-space: pre-wrap; word-break: break-all;
}
.cell-tip[hidden] { display: none; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.row-actions { display: flex; gap: 6px; }
.link-btn { border: 0; background: transparent; color: var(--primary); cursor: pointer; padding: 2px 4px; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-orange { background: var(--warn-soft); color: var(--warn); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-gray { background: #f0f2f7; color: var(--ink-2); }

.empty { padding: 44px 16px; text-align: center; color: var(--ink-3); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }

/* ── 概览 ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content: ''; position: absolute; right: -20px; top: -20px; width: 74px; height: 74px; border-radius: 50%; background: var(--primary-soft); opacity: .7; }
.stat-label { color: var(--ink-3); font-size: 12px; position: relative; z-index: 1; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: .5px; position: relative; z-index: 1; }
.stat-hint { font-size: 11px; color: var(--ink-3); margin-top: 5px; position: relative; z-index: 1; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 168px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-stack { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.bar { width: 11px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-visits { background: linear-gradient(180deg, #6f8dff, #3b62f6); }
.bar-logins { background: linear-gradient(180deg, #58d6ad, #18a972); }
.bar-tasks { background: linear-gradient(180deg, #f5c46f, #e2952b); }
.bar-label { font-size: 11px; color: var(--ink-3); }
.legend { display: flex; gap: 16px; font-size: 11px; color: var(--ink-2); padding: 6px 0 0; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.rank-row:last-child { border-bottom: 0; }
.rank-row .rank-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--primary-soft); overflow: hidden; }
.rank-row .rank-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

/* ── 菜单树 ── */
.menu-tree-row td:first-child { font-weight: 500; }
.menu-group-row { background: #f7f9ff; font-weight: 600; }
.chip { display: inline-block; padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; margin: 2px 4px 2px 0; font-size: 11px; color: var(--ink-2); }
.grant-tree { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.grant-group { margin-bottom: 8px; }
.grant-group > strong { display: block; font-size: 12px; color: var(--ink-2); margin: 8px 0 5px; }
.grant-items { display: flex; flex-wrap: wrap; gap: 8px; }
.grant-item { display: flex; align-items: center; gap: 6px; font-size: 12px; background: #fafbff; border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; cursor: pointer; }
.grant-item input { accent-color: var(--primary); }

/* ── 弹窗 / 提示 ── */
.mask { position: fixed; inset: 0; background: rgba(15, 22, 40, .48); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { width: 480px; max-width: 100%; max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(10, 18, 40, .3); }
/* 任务记录 / 会员购买记录 / 兑换记录等多列弹窗加宽，避免内容挤压 */
.modal-wide { width: 920px; }
/* 任务记录弹窗：用满可用宽度（大屏 1280px），表格按列比例布局、长文本省略，
   弹窗与表格容器都不再产生横向滚动条；窄屏由 max-width:100% 自动收窄 */
/* minmax(0,1fr) 锁住网格轨道，避免固定宽度弹窗把遮罩撑出视口导致右侧列被裁 */
.mask.mask-task-logs { padding: 12px; grid-template-columns: minmax(0, 1fr); }
.modal.modal-task-logs {
  width: 1280px; max-width: 100%; overflow-x: hidden;
}
.modal-task-logs .modal-body { padding: 18px 14px; }
.modal-task-logs .table-wrap { overflow-x: hidden; }
.modal-task-logs table { table-layout: fixed; }
.modal-task-logs th, .modal-task-logs td {
  padding: 11px 6px; overflow: hidden; text-overflow: ellipsis;
}
.modal-task-logs td.cell-wrap { min-width: 0; }
.modal-task-logs td .cell-clip { max-width: 100%; }
.modal-task-logs th:nth-child(1), .modal-task-logs td:nth-child(1) { width: 10%; }
.modal-task-logs th:nth-child(2), .modal-task-logs td:nth-child(2) { width: 10%; }
.modal-task-logs th:nth-child(3), .modal-task-logs td:nth-child(3) { width: 10%; }
.modal-task-logs th:nth-child(4), .modal-task-logs td:nth-child(4) { width: 19%; }
.modal-task-logs th:nth-child(5), .modal-task-logs td:nth-child(5) { width: 20%; }
.modal-task-logs th:nth-child(6), .modal-task-logs td:nth-child(6) { width: 14%; }
.modal-task-logs th:nth-child(7), .modal-task-logs td:nth-child(7) { width: 17%; }
.task-log-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.task-log-tabs .btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.modal-head button { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--ink-3); line-height: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.modal-field input, .modal-field select { width: 100%; height: 38px; }
.modal-field textarea { width: 100%; min-height: 150px; padding: 10px; resize: vertical; line-height: 1.6; }
/* 弹窗单选组：选项横向排布，radio 不套用全宽输入样式；圆点与文字垂直居中 */
.modal-radio-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 4px 0; }
.modal-field label.modal-radio {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 13px; line-height: 20px; color: var(--ink-2); cursor: pointer;
}
.modal-field label.modal-radio input[type="radio"] {
  width: 16px; height: 16px; margin: 0; flex: 0 0 auto;
  accent-color: var(--primary); cursor: pointer;
}
/* 长正文编辑（内容页面等）使用更高的输入区，配合 .modal-wide 提升可读性 */
.modal-field textarea.modal-textarea-tall { min-height: 340px; }
.modal-hint { font-size: 11px; color: var(--ink-3); margin-top: 5px; }
.modal-text { font-size: 13px; line-height: 1.8; color: var(--ink-2); }

/* 列表内联开关（即时保存） */
.switch {
  width: 40px; height: 22px; padding: 0; border: 0; border-radius: 11px;
  background: #c8ced9; position: relative; cursor: pointer; vertical-align: middle;
  transition: background .18s ease;
}
.switch .switch-dot {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(10, 18, 40, .28); transition: left .18s ease;
}
.switch.on { background: var(--primary, #3b62f6); }
.switch.on .switch-dot { left: 20px; }
.toast {
  position: fixed; left: 50%; top: 76px; z-index: 200;
  padding: 11px 18px; border-radius: 9px; background: #1f2b45; color: #fff;
  box-shadow: 0 10px 30px rgba(15,22,40,.25); font-size: 13px; max-width: 90vw;
  text-align: center; white-space: nowrap;
  opacity: 0; transform: translateX(-50%) translateY(-8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.detail-block { margin-bottom: 14px; }
.detail-block h4 { margin: 0 0 8px; font-size: 13px; }
/* 详情类弹窗的标签页：头部按钮 + 单一内容区，切换时只显示当前面板 */
.modal-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.modal-tab {
  border: 0; background: transparent; font: inherit; font-size: 13px; line-height: 1;
  padding: 8px 14px; border-radius: 8px; color: var(--ink-2); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.modal-tab:hover { background: var(--primary-soft); color: var(--primary); }
.modal-tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.modal-tab-panel[hidden] { display: none; }
.modal-tab-panel .kv:last-child { margin-bottom: 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 12px; color: var(--ink-2); }

/* ─────────────── 素材库（图标 / 图片） ─────────────── */
.icon-field { display: flex; align-items: center; gap: 6px; }
.icon-preview {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px;
  background: #f1f4fb; border: 1px solid var(--line); font-size: 16px; line-height: 1;
}
.asset-thumb { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; display: block; }
.asset-emoji { font-size: 22px; line-height: 1; }
.asset-upload { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.asset-upload-preview {
  width: 84px; height: 84px; border-radius: 10px; border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f7f9fe;
}
.asset-upload-preview .asset-thumb { width: 84px; height: 84px; border-radius: 0; }
.asset-upload-preview .asset-emoji { font-size: 30px; }
.asset-section { margin-bottom: 18px; }
.asset-section:last-child { margin-bottom: 0; }
.asset-section-title { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 8px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.asset-item {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer;
  padding: 10px 6px 7px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: inherit; color: var(--ink-2); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.asset-item:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(59,98,246,.16); transform: translateY(-1px); }
.asset-item em { font-style: normal; font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-item .asset-emoji { font-size: 24px; }
.asset-item .asset-thumb { width: 34px; height: 34px; }

/* ─────────────── 会员套餐 ─────────────── */
.modal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.plan-image-field { display: flex; align-items: center; gap: 8px; }
.plan-image-field .icon-preview { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.plan-image-field input { flex: 1 1 auto; min-width: 0; }
.plan-thumb {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; background: #f4f6fc;
  border: 1px solid var(--line);
}
.plan-thumb .asset-thumb { width: 34px; height: 34px; border-radius: 8px; }
.plan-thumb .asset-emoji { font-size: 22px; }
.price-sale { color: #e5484d; font-weight: 600; }

/* ─────────────── range 滑块字段 ─────────────── */
.modal-field input[type='range'] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 10px 0 4px;
  background: var(--line); border-radius: 999px; outline: none; cursor: pointer;
}
.modal-field input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(59, 98, 246, .4); cursor: pointer;
}
.modal-field input[type='range']::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--primary);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(59, 98, 246, .4); cursor: pointer;
}
.range-value {
  display: inline-block; margin-left: 8px; min-width: 64px; padding: 2px 10px;
  font-size: 13px; font-weight: 600; color: var(--primary); background: var(--primary-soft);
  border-radius: 999px; text-align: center; vertical-align: middle;
}

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .icon-btn { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .view { padding: 14px; }
  .topbar { padding: 0 12px; }
  .filters .field { flex: 1 1 100%; max-width: none; }
  .filters .filter-actions { margin-left: 0; width: 100%; }
  .layout-panel-title { align-items: flex-start; flex-direction: column; }
}
