/* 易学好资料 · 管理后台 —— 侧边栏 + 多页面布局 */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --sidebar: #111827;
  --sidebar-2: #1b2740;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e8ecf3;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --green: #16a34a;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --orange: #ea580c;
  --blue: #2563eb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.big { width: 32px; height: 32px; stroke-width: 1.5; }
button, input, select, textarea { font-family: inherit; }
a { text-decoration: none; }

/* ===== 通用控件 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 9px; padding: 9px 16px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: .16s;
  white-space: nowrap; line-height: 1.4;
}
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(79, 70, 229, .2); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { border-color: #c7d2fe; color: var(--primary); background: #fafaff; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.danger:hover { background: #fee2e2; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  color: var(--text-2); cursor: pointer; font-size: 20px; line-height: 1;
}
.icon-btn:hover { color: var(--primary); border-color: #c7d2fe; }

.field {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14px; color: var(--text); background: #fff;
  outline: none; transition: .16s;
}
.field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.field.sm { width: auto; min-width: 108px; padding: 8px 10px; font-size: 13px; }
textarea.field { resize: vertical; min-height: 76px; line-height: 1.6; }
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 7px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.msg { font-size: 13px; line-height: 1.6; margin: 10px 0 0; min-height: 0; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }
.msg:empty { display: none; }

/* ===== 登录页 ===== */
.login-screen { min-height: 100vh; display: flex; background: #fff; }
.login-side {
  width: 44%; min-width: 360px; padding: 44px 56px;
  background: linear-gradient(150deg, #111827 0%, #1e2a52 55%, #3730a3 140%);
  color: #fff; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.login-side::after {
  content: ''; position: absolute; width: 420px; height: 420px; right: -160px; bottom: -180px;
  border-radius: 50%; background: rgba(129, 140, 248, .14);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5); box-shadow: 0 4px 12px rgba(79, 70, 229, .35);
}
.brand-mark .ico { width: 20px; height: 20px; }
.login-pitch { margin: auto 0; position: relative; z-index: 1; }
.login-pitch h1 { font-size: 38px; line-height: 1.35; margin: 0 0 18px; font-weight: 700; letter-spacing: 1px; }
.login-pitch > p { color: #c7d2fe; font-size: 15px; line-height: 1.8; margin: 0 0 36px; }
.pitch-list { display: flex; flex-direction: column; gap: 16px; }
.pitch-list > div { display: flex; align-items: center; gap: 12px; color: #e2e8f0; font-size: 14px; }
.pitch-list .ico { width: 18px; height: 18px; color: #a5b4fc; }
.login-foot { color: #94a3b8; font-size: 12px; position: relative; z-index: 1; }
.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 372px; }
.login-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.login-card .field { margin-bottom: 18px; padding: 12px 14px; }
.login-card .btn { margin-top: 8px; }

/* 连接自检状态 */
.conn {
  margin-top: 16px; padding: 10px 12px; border-radius: 9px;
  font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-all;
  background: #f1f5f9; color: var(--text-2); border: 1px solid var(--line);
}
.conn:empty { display: none; }
.conn.ok { background: var(--green-soft); color: #15803d; border-color: #bbf7d0; }
.conn.err { background: var(--red-soft); color: #b91c1c; border-color: #fecaca; }
.rule-box {
  margin-top: 10px; padding: 12px; background: #1f2937; color: #e5e7eb;
  border-radius: 9px; font-size: 11px; line-height: 1.6; white-space: pre-wrap;
  word-break: break-all; cursor: copy; max-height: 240px; overflow: auto;
}

/* ===== 后台骨架 ===== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; flex: none; background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #cbd5e1; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 20;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 16px 18px; border-bottom: 1px solid rgba(255,255,255,.07); flex-wrap: wrap; }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; overflow: hidden; }
.brand-text b { color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; }
.brand-text small { color: #7c8aa5; font-size: 11px; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-group { color: #64748b; font-size: 11px; font-weight: 600; letter-spacing: 1.2px; padding: 18px 12px 8px; }
.nav-group:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 3px;
  border-radius: 9px; color: #aeb9cd; font-size: 14px; cursor: pointer; transition: .16s;
  white-space: nowrap; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.32); }
.nav-item .ico { width: 18px; height: 18px; }
/* 菜单未读数红点（表单数据）：靠右贴边，0 条时整体隐藏 */
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  font-style: normal; flex: 0 0 auto;
}
.sidebar-foot { padding: 14px 12px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: #e0e7ff; color: var(--primary); font-weight: 700; font-size: 13px;
}
.avatar.sm { width: 30px; height: 30px; background: rgba(129,140,248,.25); color: #c7d2fe; }
.user-meta { display: flex; flex-direction: column; line-height: 1.4; overflow: hidden; }
.user-meta b { color: #e2e8f0; font-size: 13px; font-weight: 600; }
.user-meta small { color: #7c8aa5; font-size: 11px; }
.logout-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: transparent; border: 1px solid rgba(255,255,255,.09); border-radius: 9px;
  color: #aeb9cd; font-size: 13px; cursor: pointer; transition: .16s;
}
.logout-btn:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: #fca5a5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; flex: none; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  position: sticky; top: 0; z-index: 10;
}
.menu-toggle { display: inline-flex; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb span { margin: 0 8px; color: #cbd5e1; }
.crumb b { color: var(--text); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
/* 隐控走 hidden 属性：防止 .btn 的 display 规则把 hidden 顶掉 */
.top-actions [hidden] { display: none !important; }
.top-actions .btn { padding: 7px 12px; font-size: 13px; }
/* H5 编辑器顶部「页面名称」：与右侧整体设置共用同一份 h5State.editing.title */
.h5-top-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.h5-top-title .field.sm { width: 190px; padding: 6px 10px; }
.conn-badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2);
  background: #f8fafc; border: 1px solid var(--line); padding: 6px 11px; border-radius: 20px;
}
.conn-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.conn-badge.ok i { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.conn-badge.err i { background: #ef4444; box-shadow: 0 0 0 3px #fee2e2; }
/* 「在线」徽标搬到侧边栏品牌区：更小的胶囊，与深色底兼容 */
.sidebar-brand .conn-badge {
  flex-basis: 100%; justify-content: center; gap: 6px;
  padding: 3px 0; border-radius: 12px; font-size: 11px;
  background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #aeb9cd;
}
/* 桌面端收起侧边栏（H5 编辑页自动收起 / 左上角按钮手动切换）；手机端不受影响 */
@media (min-width: 961px) {
  .app-shell.side-collapsed .sidebar { display: none; }
}
/* 宽屏不再留右侧空白：去掉 1480 上限，整块内容跟着窗口铺满 */
.content { padding: 28px 32px 48px; width: 100%; }
.page[hidden] { display: none !important; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head-btns { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* 页面大标题已删，操作按钮统一右上角；左侧只剩统计小字（如「共 N 份资料」） */
.ph-note { color: var(--muted); font-size: 13px; }
.ph-note .total-num { color: var(--primary); font-weight: 600; }

/* ===== 卡片 / 通用块 ===== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-note { color: var(--muted); font-size: 12px; }
.card-actions { margin-top: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-col > .card { margin-bottom: 18px; }
.notice {
  background: #f8fafc; border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: 9px; padding: 12px 14px; font-size: 13px; color: var(--text-2);
  line-height: 1.75; margin-bottom: 18px;
}
.notice b { color: var(--text); font-weight: 600; }
/* Banner 弹窗里的尺寸建议：比普通 hint 更醒目，去掉 .notice 默认底部大留白 */
.bn-size-tip { margin: 10px 0 0; font-size: 12px; line-height: 1.7; }
.bn-size-tip code { font-size: 11px; }
.form-row label small { margin-left: 6px; font-size: 11px; font-weight: 400; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }

/* ===== 概览 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow);
}
.stat-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat-ico .ico { width: 22px; height: 22px; }
.stat-ico.blue { background: #eef2ff; color: #4f46e5; }
.stat-ico.green { background: #ecfdf5; color: #16a34a; }
.stat-ico.orange { background: #fff7ed; color: #ea580c; }
.stat-ico.purple { background: #f5f3ff; color: #9333ea; }
.stat-ico.teal { background: #f0fdfa; color: #0d9488; }
/* 概览「用户数据」迷你行（7.0.32） */
.u-mini { display: flex; flex-direction: column; }
.u-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid #f1f5f9; font-size: 13px; color: #475569; }
.u-row:first-child { border-top: none; }
.u-row b { font-size: 15px; color: #0f172a; }
/* 概览「浏览偏好」小标题（7.0.33） */
.pref-title { font-size: 12px; color: #94a3b8; margin: 12px 0 8px; }
.pref-title:first-child { margin-top: 0; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-body > span { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.stat-body b { font-size: 26px; font-weight: 700; line-height: 1.25; letter-spacing: .5px; }
.stat-body small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #f1f5f9; }
.rank-item:first-child { border-top: none; }
.rank-no {
  width: 22px; height: 22px; border-radius: 6px; flex: none; display: flex;
  align-items: center; justify-content: center; background: #f1f5f9; color: #64748b;
  font-size: 12px; font-weight: 700;
}
.rank-item:nth-child(1) .rank-no { background: #fef3c7; color: #d97706; }
.rank-item:nth-child(2) .rank-no { background: #e2e8f0; color: #475569; }
.rank-item:nth-child(3) .rank-no { background: #ffedd5; color: #c2410c; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rank-val { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.dist-list { display: flex; flex-direction: column; gap: 13px; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dist-name { width: 54px; flex: none; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-bar { flex: 1; height: 8px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #818cf8, #4f46e5); }
.dist-val { width: 30px; text-align: right; color: var(--muted); font-size: 12px; }
.recent-list { display: flex; flex-direction: column; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f1f5f9; font-size: 13px; }
.recent-item:first-child { border-top: none; }
.recent-item .fico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.recent-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ===== 工具栏 / 表格 ===== */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 18px; }
.search-wrap { position: relative; flex: 1; min-width: 190px; max-width: 280px; }
.search-wrap .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-wrap .field { padding-left: 34px; width: 100%; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.tbl th, .tbl td { text-align: left; padding: 13px 10px; border-bottom: 1px solid #f1f5f9; }
.tbl th { color: #64748b; font-weight: 600; font-size: 12px; background: #fafbfd; }
.tbl tbody tr:hover { background: #fafbff; }
.tbl .ta-r { text-align: right; }
.tbl td.ta-r { white-space: nowrap; }
.cell-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
/* 「有答案」小标签：跟在资料标题后面 */
.ans-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px;
  background: #ecfdf5; color: #059669; font-size: 11px; font-weight: 600; vertical-align: 1px;
}
/* 编辑弹窗里的答案文件行 */
.ans-row { display: flex; align-items: center; gap: 8px; }
.ans-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.ans-name.has { color: var(--text); }
.form-tip { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.6; }
/* 答案弹窗：拖拽区 / 已选提示 / 资料标题行 */
.ans-mat { color: var(--text); font-size: 13px; line-height: 1.5; padding: 8px 10px; background: #f8fafc; border-radius: 8px; }
.ans-drop {
  border: 2px dashed var(--line); border-radius: 12px; background: #fafbfc;
  padding: 22px 16px; text-align: center; cursor: pointer; transition: .15s;
}
.ans-drop p { margin: 0 0 6px; color: var(--text-2); font-size: 13px; }
.ans-drop b { color: var(--primary); }
.ans-drop small { color: var(--muted); font-size: 12px; }
.ans-drop:hover, .ans-drop.on { border-color: var(--primary); background: var(--primary-soft); }
.ans-drop.ok { border-style: solid; border-color: #10b981; background: #ecfdf5; }
/* 7.0.29 多文件答案：缩略图列表 */
.ans-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.ans-item {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.ans-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.ans-item .ans-ico { flex: none; width: 44px; height: 44px; border-radius: 8px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.ans-item .ans-meta { flex: 1; min-width: 0; }
.ans-item .ans-meta b { display: block; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ans-item .ans-meta small { color: #10b981; font-size: 11px; }
.ans-drop.ok p { color: #065f46; }
.ans-picked { margin-top: 10px; color: #065f46; font-size: 13px; background: #ecfdf5; border-radius: 8px; padding: 8px 10px; }
/* 列表「答案」按钮：已有答案时描个绿边 */
.row-btn.has-ans { color: #059669; border-color: #a7f3d0; background: #f0fdf4; }
.cell-sub { color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 3px; }
.tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.tag-pdf { background: #fef2f2; color: #dc2626; }
.tag-word { background: #eff6ff; color: #2563eb; }
.tag-ppt { background: #fff7ed; color: #ea580c; }
.tag-other { background: #f1f5f9; color: #64748b; }
.tag-on { background: var(--green-soft); color: #15803d; }
.tag-off { background: #f1f5f9; color: #94a3b8; }
/* 表单数据页 */
.tag.new { background: #fef2f2; color: #dc2626; }
.tag.done { background: #f1f5f9; color: #64748b; }
.form-cell { font-size: 13px; line-height: 1.7; color: var(--text-2); word-break: break-word; }
.form-cell b { color: var(--text); font-weight: 600; margin-right: 2px; }
.mini { color: var(--muted); font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.row-btn {
  border: 1px solid transparent; background: var(--primary-soft); color: var(--primary);
  padding: 5px 10px; border-radius: 7px; margin-right: 6px; cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; gap: 4px; transition: .15s;
}
.row-btn:hover { background: #e0e7ff; }
.row-btn.danger { background: var(--red-soft); color: var(--red); }
.row-btn.danger:hover { background: #fee2e2; }
.row-btn.plain { background: #f1f5f9; color: var(--text-2); }
.row-btn.plain:hover { background: #e2e8f0; }
.row-btn .ico { width: 13px; height: 13px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; color: var(--muted); font-size: 12px; }
.pager > div { display: flex; gap: 8px; }

/* ===== 上传页 ===== */
.upload-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 7px; }
.form-row label em { color: var(--red); font-style: normal; }
/* 栏目图标 / 主题色预设点选 */
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.icon-pick {
  width: 38px; height: 38px; padding: 0; font-size: 20px; line-height: 1;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;
}
.icon-pick:hover { border-color: var(--primary); }
.icon-pick.on, .color-pick.on { outline: 2px solid var(--primary); outline-offset: 2px; }
.color-pick { width: 26px; height: 26px; padding: 0; border: 2px solid #fff; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px #e2e8f0; }
.drop-zone {
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 34px 18px; text-align: center;
  background: #fafbff; cursor: pointer; transition: .18s; position: relative;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.drop-zone .ico.big { color: var(--primary); margin-bottom: 10px; }
.drop-title { margin: 0; font-size: 14px; color: var(--text-2); font-weight: 500; }
.drop-zone .hint { margin-top: 6px; }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.file-chip {
  margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #f8fafc; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px;
}
.file-chip b { color: var(--text); font-weight: 600; word-break: break-all; }
.upload-layout .notice { margin-top: 20px; margin-bottom: 0; }

/* ===== 上传资料：三步式（选文件 → 自动带出 → 核对上传）===== */
.up-step .card-head h3 { display: flex; align-items: center; gap: 8px; }
.up-step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700;
}
.up-file-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: stretch; }
.drop-zone.compact { padding: 20px 16px; }
.up-file-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.up-file-side .file-chip { margin-top: 0; }
.up-auto-hint {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: #f8fafc; color: var(--muted); font-size: 12px; line-height: 1.8;
}
.up-auto-hint.ok { background: var(--primary-soft); border-color: #c7d2fe; color: var(--text-2); }
.up-auto-hint b { color: var(--primary); font-weight: 600; }
.up-file-side .btn { align-self: flex-start; }
.up-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
.up-form .form-row.up-wide { grid-column: 1 / -1; }
.up-form .form-row label small.up-auto-tag {
  margin-left: 8px; padding: 1px 7px; border-radius: 99px;
  background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 500;
}
.up-auto-tag[hidden] { display: none; }
.form-row.auto-filled .field { border-color: #c7d2fe; }
.up-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.up-submit-row b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.up-submit-row .hint { margin: 6px 0 0; }
.up-submit .notice { margin-top: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 960px) {
  .up-file-row, .up-form { grid-template-columns: 1fr; }
  .up-form .form-row.up-wide { grid-column: auto; }
}

/* ===== 批量上传 ===== */
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; background: #f1f5f9; border-radius: 10px; margin-bottom: 18px; }
.seg { border: 0; background: transparent; padding: 8px 20px; border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; font-family: inherit; }
.seg.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 23, 42, .09); }
.batch-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.batch-actions .btn { flex: 1; white-space: nowrap; }
.batch-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.batch-progress .bar { flex: 1; height: 8px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.batch-progress .bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .25s; }
.batch-progress span { white-space: nowrap; }
.batch-list { display: flex; flex-direction: column; }
.batch-row { display: grid; grid-template-columns: minmax(0, 1fr) 78px 92px 28px; gap: 10px; align-items: center; padding: 10px 8px; border-top: 1px solid #f1f5f9; font-size: 13px; }
.batch-row:first-child { border-top: none; }
.batch-title-input { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; color: var(--text); font-family: inherit; box-sizing: border-box; }
.batch-title-input:focus { outline: none; border-color: var(--primary); }
.batch-fname { color: var(--muted); font-size: 11px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-size { color: var(--muted); font-size: 12px; }
.batch-state { font-size: 12px; color: var(--muted); }
.batch-state.ok { color: var(--green); }
.batch-state.err { color: var(--red); }
.batch-state.uploading { color: var(--primary); }
.batch-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px; }
.batch-del:hover { color: var(--red); }
.batch-del:disabled, .batch-title-input:disabled { opacity: .5; cursor: not-allowed; }
#batch-msg { white-space: pre-line; }
@media (max-width: 700px) {
  .batch-row { grid-template-columns: minmax(0, 1fr) 78px 26px; }
  .batch-row .batch-size { display: none; }
}

/* ===== 分类管理 ===== */
.cat-list { display: flex; flex-direction: column; }

/* 分类管理 → 教材版本勾选区（按学科分组，同名版本联动勾选） */
.book-sel { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.book-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fcfcff; }
.book-group h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.book-opt { display: flex; align-items: center; gap: 7px; font-size: 12px; line-height: 1.9; color: var(--text-2); cursor: pointer; }
.book-opt input { margin: 0; accent-color: var(--primary); cursor: pointer; }
.book-opt:hover { color: var(--primary); }
@media (max-width: 960px) { .book-sel { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.cat-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 12px;
  border-top: 1px solid #f1f5f9; border-radius: 8px;
}
.cat-row:hover { background: #fafbff; }
.cat-row:first-child { border-top: none; }
.cat-badge {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex: none;
}
.cat-name { flex: 1; min-width: 0; }
.cat-name b { font-size: 14px; font-weight: 600; }
.cat-name small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.cat-sort { color: var(--muted); font-size: 12px; width: 42px; text-align: center; }
.cat-acts { display: flex; gap: 4px; }
.cat-acts .icon-btn { width: 30px; height: 30px; font-size: 16px; }
.cat-acts .icon-btn .ico { width: 15px; height: 15px; }

/* ===== 二维码 ===== */
.qr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.qr-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); text-align: center;
}
.qr-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.qr-card-head b { font-size: 14px; }
.qr-state { font-size: 11px; color: var(--muted); }
.qr-state.has { color: var(--green); }
.qr-thumb {
  width: 100%; height: 148px; object-fit: contain; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; cursor: zoom-in;
}
.qr-none {
  width: 100%; height: 148px; display: flex; align-items: center; justify-content: center;
  border: 2px dashed #dbe2ec; border-radius: 9px; color: var(--muted);
  font-size: 12px; background: #fafbfd;
}
.qr-file { display: none; }
.qr-acts { display: flex; gap: 8px; margin-top: 14px; }
.qr-acts .btn { flex: 1; padding: 7px 8px; font-size: 12px; }
.qr-acts label.btn { cursor: pointer; }

/* ===== 设置页 ===== */
.kv-list { display: flex; flex-direction: column; }
.kv-row { display: flex; gap: 16px; padding: 11px 0; border-top: 1px solid #f1f5f9; font-size: 13px; }
.kv-row:first-child { border-top: none; }
.kv-row span { width: 96px; flex: none; color: var(--muted); }
.kv-row b { font-weight: 500; color: var(--text); word-break: break-all; }
.doc-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.doc-list li { font-size: 13px; color: var(--text-2); line-height: 1.75; padding-left: 14px; border-left: 2px solid var(--primary-soft); }
.doc-list b { color: var(--text); font-weight: 600; }

/* ===== 运维速查卡片（跨两栏） ===== */
.ops-card { grid-column: 1 / -1; }
.ops-alert { display: flex; align-items: center; gap: 12px; background: var(--red-soft); border: 1px solid #fecaca; border-left: 4px solid var(--red); border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; }
.ops-alert-txt { flex: 1; font-size: 13px; color: var(--text); line-height: 1.6; }
.ops-alert-txt b { color: var(--red); font-weight: 600; }
.ops-pill { display: inline-block; flex: none; font-size: 11px; font-weight: 500; line-height: 1.5; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.ops-pill-red { background: var(--red); color: #fff; }
.ops-pill-orange { background: #fff7ed; color: var(--orange); }
.ops-pill-green { background: var(--green-soft); color: var(--green); }
.ops-pill-gray { background: #f1f5f9; color: var(--text-2); }
.ops-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 16px 0 10px; }
.ops-hint { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.ops-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ops-mini { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fafbfe; }
.ops-mini-t { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.ops-mini-d { font-size: 20px; font-weight: 600; color: var(--red); line-height: 1.3; margin-bottom: 8px; }
.ops-mini-p { font-size: 12px; color: var(--text-2); line-height: 1.7; }
.ops-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.ops-row-txt { flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.ops-row-txt b { color: var(--text); font-weight: 600; }
.ops-row a, .ops-mini-p a { color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--primary); }
.ops-row a:hover, .ops-mini-p a:hover { color: var(--primary-dark); }
.ops-detail { border-top: 1px solid var(--line); }
.ops-detail-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.7; }
.ops-detail-row:last-child { border-bottom: 0; }
.ops-k { width: 92px; flex: none; color: var(--text-2); font-weight: 600; }
.ops-v { color: var(--text-2); }
.ops-due { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 6px; margin-bottom: 18px; background: #fafbfe; }
.ops-due-head { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.ops-due-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.ops-due-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ops-due-name { width: 150px; flex: none; font-size: 13px; color: var(--text); font-weight: 500; }
.ops-due-name i { display: block; font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.ops-due-row input[type="date"] { flex: 1; min-width: 0; height: 34px; padding: 0 10px; font-size: 13px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 7px; outline: none; }
.ops-due-row input[type="date"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.ops-due-count { width: 88px; flex: none; text-align: right; font-size: 12px; font-weight: 600; }
.ops-cd-red { color: var(--red); }
.ops-cd-orange { color: var(--orange); }
.ops-cd-green { color: var(--green); }
.ops-cd-gray { color: var(--muted); }
@media (max-width: 900px) { .ops-grid { grid-template-columns: 1fr; } .ops-due-grid { grid-template-columns: 1fr; } .ops-k { width: 72px; } .ops-due-name { width: 120px; } }

/* ===== 弹窗 / toast ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .48); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; box-shadow: 0 24px 60px rgba(15,23,42,.24); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 22px; max-height: 62vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
/* H5 页面设置弹窗：沿用通用 modal 骨架，仅加宽并补一条保存提示 */
.pageset-modal { max-width: 540px; }
.pageset-modal .h5-ppane { min-width: 0; }
.pageset-modal .h5-ppane .form-row { margin-bottom: 12px; }
.h5-pageset-tip {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 12px;
}
@media (max-width: 700px) {
  .top-actions .h5-top-title { flex-wrap: wrap; white-space: normal; }
  .pageset-modal { max-width: 100%; }
}
.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: #111827; color: #fff; padding: 11px 18px; border-radius: 9px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(15,23,42,.24); max-width: 80vw;
}
.toast.ok { background: #15803d; }
.toast.err { background: #dc2626; }

/* ===== 响应式 ===== */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .qr-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .two-col, .upload-layout { grid-template-columns: 1fr; }
  .sidebar { width: 72px; }
  .sidebar-brand { padding: 20px 14px; justify-content: center; }
  .brand-text, .nav-group, .nav-item span, .user-meta, .logout-btn span { display: none; }
  .sidebar-brand .conn-badge { display: none; }
  .nav { padding: 12px 10px; }
  .nav-item { justify-content: center; padding: 11px; }
  .user-chip { justify-content: center; padding: 6px 0 12px; }
  .logout-btn { justify-content: center; }
  .content { padding: 22px 20px 40px; }
}
@media (max-width: 640px) {
  .login-side { display: none; }
  .login-panel { padding: 24px; }
  .sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s; width: 200px; }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .brand-text,
  .app-shell.sidebar-open .nav-group,
  .app-shell.sidebar-open .nav-item span,
  .app-shell.sidebar-open .user-meta,
  .app-shell.sidebar-open .logout-btn span { display: flex; }
  .app-shell.sidebar-open .nav-item { justify-content: flex-start; padding: 10px 12px; }
  .app-shell.sidebar-open .nav { padding: 14px 12px 20px; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-body b { font-size: 21px; }
  .qr-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 36px; }
  .page-head { flex-wrap: wrap; }
}

/* ===== AI 功能：大模型配置 / 知识点树 ===== */
.head-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.notice code { background: #eef2ff; color: #3730a3; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.ai-status-note { font-size: 13px; color: #475569; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.ai-status-note.err { color: #b45309; background: #fffbeb; border-color: #fde68a; }

.ai-provider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.ai-provider { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ap-head b { font-size: 15px; color: var(--text); }
.ap-row { display: flex; gap: 8px; align-items: baseline; font-size: 12px; margin-top: 6px; color: var(--muted); }
.ap-row span { flex: 0 0 60px; }
.ap-row code { font-size: 11px; color: #334155; word-break: break-all; }
.ap-note { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

.ai-form { display: flex; flex-direction: column; gap: 16px; }
.ai-card .card-note { margin: 0 0 14px; }
.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.ai-grid .form-row { margin: 0; }
.ai-grid .form-row.wide { grid-column: 1 / -1; }
.ai-grid textarea.field { min-height: 110px; }
.ai-grid .hint { margin-top: 5px; }

.kp-trees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kp-tree-card { margin: 0; }
.kp-tree-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.kt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.kt-head b { font-size: 15px; color: var(--text); }
.kt-meta { font-size: 12px; color: var(--text-2); }
.kt-key { font-size: 11px; color: var(--muted); margin-top: 8px; font-family: monospace; }

.kp-points { display: flex; flex-direction: column; }
.kp-point { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.kp-point:last-child { border-bottom: none; }
.kp-pid { flex: 0 0 190px; font-family: monospace; font-size: 11px; color: var(--muted); }
.kp-plabel { flex: 1; color: var(--text); }
.kp-punit { flex: 0 0 220px; color: var(--muted); font-size: 12px; }

@media (max-width: 1180px) {
  .ai-provider-grid, .kp-trees { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .ai-grid, .ai-provider-grid, .kp-trees { grid-template-columns: 1fr; }
  .kp-pid, .kp-punit { flex-basis: auto; }
  .kp-point { flex-wrap: wrap; }
}

/* ===== 首页 Banner 配置 ===== */
.banner-row { gap: 12px; }
.banner-thumb {
  width: 132px; height: 74px; flex-shrink: 0;
  object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); background: #f8fafc; cursor: zoom-in;
}
.banner-none {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted); border-style: dashed; cursor: default;
}
.bn-preview {
  display: block; max-width: 100%; max-height: 160px;
  border-radius: 8px; border: 1px solid var(--line);
}

/* ===== 资料管理：宽屏铺满 + 左表格 / 右类目分布 ===== */
#page-materials { min-height: calc(100vh - 190px); display: flex; flex-direction: column; }
.mat-layout { flex: 1; display: flex; gap: 18px; min-height: 0; }
.mat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-bottom: 0; }
.mat-side {
  width: 252px; flex: none; min-height: 0; margin-bottom: 0; padding: 18px 14px;
  display: flex; flex-direction: column;
}
#page-materials .toolbar { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
#page-materials .search-wrap { max-width: 320px; }
/* 7.0.29 钦定：页面本身不滚，工具栏固定；表格区域内滚出滚动条，表头吸顶 */
#page-materials { height: calc(100vh - 140px); display: flex; flex-direction: column; overflow: hidden; }
#page-materials .mat-layout { flex: 1; min-height: 0; }
#page-materials .table-wrap { flex: 1; min-height: 80px; overflow: auto; scrollbar-width: thin; }
#page-materials .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
#page-materials .table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
#page-materials .table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
#page-materials .tbl th { position: sticky; top: 0; z-index: 1; }
#page-materials .mat-side { overflow-y: auto; scrollbar-width: thin; }
#page-materials .mat-side::-webkit-scrollbar { width: 8px; }
#page-materials .mat-side::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
#page-materials .tbl th:first-child { min-width: 240px; }
#page-materials .tbl .cell-title { max-width: 380px; }
#page-materials .tbl td.ta-r { padding-right: 4px; }
#page-materials .pager { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.page-head .total-num { color: var(--primary); font-weight: 600; }

/* 右侧栏：类名统一加 mat- 前缀，避免与概览页 .dist-list / .dist-bar 冲突 */
.mat-side .card-head { margin-bottom: 12px; }
.mat-tabs { display: flex; gap: 4px; background: #f1f5f9; padding: 3px; border-radius: 9px; margin-bottom: 12px; }
.mat-tab {
  flex: 1; border: 0; background: transparent; padding: 7px 0; border-radius: 7px;
  font-size: 12px; color: var(--text-2); cursor: pointer; transition: .15s;
}
.mat-tab:hover { color: var(--primary); }
.mat-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.mat-note { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.mat-dist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.mat-row {
  width: 100%; text-align: left; border: 1px solid transparent; background: transparent;
  border-radius: 9px; padding: 8px 10px; cursor: pointer; transition: .14s;
}
.mat-row:hover { background: #f8fafc; }
.mat-row.active { background: var(--primary-soft); border-color: #c7d2fe; }
.mat-row-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mat-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.mat-row.active .mat-row-name { color: var(--primary); font-weight: 600; }
.mat-row-num { font-size: 14px; font-weight: 700; color: var(--text); }
.mat-row.active .mat-row-num { color: var(--primary); }
.mat-row-unit { font-size: 11px; color: var(--muted); }
.mat-track { display: block; height: 5px; background: #f1f5f9; border-radius: 5px; overflow: hidden; margin-top: 7px; }
.mat-track i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #818cf8, #4f46e5); }
.mat-row.warn .mat-row-num { color: var(--orange); }
.mat-row.warn .mat-track i { background: linear-gradient(90deg, #fbbf24, #ea580c); }
.mat-foot { border-top: 1px solid var(--line); padding-top: 11px; margin-top: 11px; font-size: 11px; color: var(--muted); line-height: 1.6; }

@media (max-width: 1280px) {
  .mat-side { width: 224px; }
}
@media (max-width: 960px) {
  #page-materials { height: auto; min-height: 0; display: block; overflow: visible; }
  .mat-layout { display: block; }
  .mat-main { display: block; margin-bottom: 18px; }
  .mat-side { width: auto; display: block; }
  .mat-dist { max-height: 320px; }
  #page-materials .table-wrap { flex: none; }
  #page-materials .pager { margin-top: 0; }
  #page-materials .tbl th:first-child { min-width: 200px; }
  #page-materials .tbl .cell-title { max-width: 260px; }
}

/* ===== 自建 H5 页面（7.0.19）===== */
/* 列表视图 / 编辑视图、Banner 弹窗里的动态行都用 hidden 切换，统一兜底 */
[hidden] { display: none !important; }

.h5-base-row { display: flex; gap: 10px; align-items: center; }
.h5-base-row .field { flex: 1; min-width: 0; }
.h5-row-emoji {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: var(--primary-soft);
}
.h5-row .cat-name small { word-break: break-all; }

/* 三栏编辑：左=组件库/结构，中=画布，右=属性面板（7.0.24） */
.h5-layout {
  display: grid; grid-template-columns: 232px minmax(0, 1fr) 340px;
  gap: 16px; align-items: start;
}
.h5-col { min-width: 0; }
.h5-col-left .card { padding: 14px; }
.h5-col-right { position: sticky; top: 16px; }
.h5-col-mid { padding-top: 4px; }
.h5-phone {
  width: 320px; max-width: 100%; margin: 0 auto; overflow: hidden;
  border: 8px solid #1f2937; border-radius: 26px; background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}
.h5-preview { display: block; width: 100%; height: 560px; border: 0; background: #f5f6fa; }

/* 组件库：3 列图标按钮 */
.h5-lib { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.h5-lib-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px 9px; border: 1px solid var(--line); border-radius: 10px;
  background: #fcfdff; color: var(--text-2); font: inherit; font-size: 12px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.h5-lib-btn span { font-size: 19px; line-height: 1; }
.h5-lib-btn:hover {
  border-color: var(--primary); color: var(--primary-dark);
  box-shadow: 0 6px 16px -12px rgba(37, 99, 235, .55); transform: translateY(-1px);
}
.h5-lib-btn:active { transform: translateY(0); }

/* 页面结构列表 */
.h5-structure { display: flex; flex-direction: column; gap: 2px; }
.h5-str-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; color: var(--text-2); line-height: 1.4;
}
.h5-str-row:hover { background: #f4f7fc; }
.h5-str-row.on {
  background: var(--primary-soft); border-color: rgba(37, 99, 235, .28);
  color: var(--primary-dark); font-weight: 600;
}
.h5-str-row .n { flex: 0 0 16px; text-align: right; color: var(--muted); font-size: 11.5px; }
.h5-str-row.on .n { color: var(--primary-dark); }
.h5-str-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 属性面板 tab */
.h5-ptabs { display: flex; gap: 6px; margin-bottom: 12px; }
.h5-ptab {
  flex: 1; padding: 9px 0; border-radius: 10px; border: 1px solid var(--line);
  background: #f6f8fc; color: var(--text-2); font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.h5-ptab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.h5-ppane .form-row { margin-bottom: 12px; }
.h5-props .empty { padding: 26px 12px; }

.h5-blocks { display: flex; flex-direction: column; gap: 12px; }
.h5-block {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; background: #fcfdff;
}
.h5-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.h5-tag {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 12px; font-weight: 600;
}
.h5-block-acts { display: flex; gap: 4px; }
.h5-block-acts .icon-btn { width: 28px; height: 28px; }
.h5-block-acts .icon-btn .ico { width: 14px; height: 14px; }
.h5-block .field + .field { margin-top: 8px; }
.h5-block textarea.field { resize: vertical; min-height: 88px; }
.h5-img-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.h5-img-pick .hint { margin: 0; }
.h5-thumb {
  display: block; width: 100%; max-height: 180px; object-fit: contain;
  border-radius: 8px; background: #eef2f7; margin-bottom: 8px;
}
.h5-thumb.wide { max-height: 220px; }

/* H5 整体设置：分享三件套 + 页脚（沿用 .field / .form-row 的蓝色中性风格） */
.h5-share-sec { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.h5-sec-title { font-size: 13px; font-weight: 600; color: var(--primary-dark); margin-bottom: 12px; }
.h5-sh-thumb {
  width: 100%; min-height: 96px; max-height: 160px; overflow: hidden;
  border: 1px dashed #c7d2fe; border-radius: 10px; background: #f8faff;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.h5-sh-thumb img { display: block; width: 100%; max-height: 160px; object-fit: contain; }
.h5-sh-ph { font-size: 12px; color: var(--muted); }
.h5-sh-pick { width: 100%; cursor: pointer; }
.h5-foot-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.h5-foot-switch input { width: 16px; height: 16px; accent-color: var(--primary); }

/* 一键模板 */
.h5-tpl-row { display: flex; gap: 10px; flex-wrap: wrap; }
.h5-tpl {
  flex: 1 1 150px; min-width: 150px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: #fcfdff;
  padding: 12px 14px; font-family: inherit; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.h5-tpl:hover { border-color: var(--primary); box-shadow: 0 6px 18px -12px rgba(37,99,235,.5); transform: translateY(-1px); }
.h5-tpl b { display: block; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.h5-tpl span { display: block; font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* 图集：缩略图网格 + 右上角删除 */
.h5-gal-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.h5-gal-item { position: relative; width: 74px; height: 74px; border-radius: 8px; overflow: hidden; background: #eef2f7; }
.h5-gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h5-gal-x {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border: 0;
  border-radius: 50%; background: rgba(15,23,42,.66); color: #fff; font-size: 13px;
  line-height: 18px; text-align: center; cursor: pointer; padding: 0;
}

/* 图文卡片项（7.0.24 起支持配图：左图右文） */
.h5-card-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px; margin-bottom: 8px; border: 1px dashed var(--line); border-radius: 10px; background: #fff;
}
.h5-card-media { flex: 0 0 72px; display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.h5-card-media img, .h5-card-media-empty {
  width: 72px; height: 56px; border-radius: 8px; background: #eef2f7;
  object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.h5-card-up {
  padding: 3px 0 !important; font-size: 11.5px !important;
  text-align: center; justify-content: center; width: 100%;
}
.h5-card-rmimg { width: 24px; height: 24px; align-self: center; }
.h5-card-rmimg .ico { width: 12px; height: 12px; }
.h5-card-fields { flex: 1; min-width: 0; }
.h5-card-fields .field + .field { margin-top: 6px; }
.h5-card-item .icon-btn { flex: 0 0 28px; }
.h5-two { display: flex; gap: 8px; margin-top: 8px; }
.h5-two .field { flex: 1; min-width: 0; }
.h5-two .field + .field { margin-top: 0; }

/* 表单块的字段配置 */
.h5-fgrid .field + .field { margin-top: 8px; }
.h5-fields {
  margin: 12px 0 10px; padding: 10px; border: 1px dashed var(--line);
  border-radius: 10px; background: #fbfcfe;
}
.h5-fields .hint { margin: 0; }
.h5-frow {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 8px; border-radius: 8px; background: #fff; border: 1px solid var(--line);
}
.h5-frow + .h5-frow { margin-top: 8px; }
.h5-frow .field { flex: 1 1 130px; min-width: 0; }
.h5-frow select.field { flex: 0 0 112px; }
.h5-frow .icon-btn { flex: 0 0 28px; }
.h5-fchk {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none;
}
.h5-fchk input { margin: 0; }
.h5-frow .h5-fopt { flex: 1 1 100%; }

@media (max-width: 1360px) {
  .h5-layout { grid-template-columns: 200px minmax(0, 1fr) 306px; gap: 12px; }
  .h5-lib { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .h5-layout { grid-template-columns: 1fr; }
  .h5-col-right { position: static; }
  .h5-lib { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ===== 分享设置（7.0.24）===== */
.share-note {
  padding: 12px 16px; margin: 0 0 16px; border-radius: 10px;
  background: var(--primary-soft); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.7; color: var(--text-2);
}
.share-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.share-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 16px; min-width: 0;
}
.share-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.share-card-head b { font-size: 14px; color: var(--text); }
.share-state { font-size: 12px; color: var(--muted); }
.share-state.has { color: var(--green); }
.share-thumb {
  display: block; width: 100%; height: 180px; object-fit: contain;
  border: 1px dashed var(--line); border-radius: 10px;
  background: #f8fafc; margin-bottom: 10px;
}
.share-none {
  display: flex; align-items: center; justify-content: center;
  height: 180px; border: 1px dashed var(--line); border-radius: 10px;
  background: #f8fafc; color: var(--muted); font-size: 13px; margin-bottom: 10px;
}
.share-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.share-file { display: none; }
.share-acts { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.share-url { width: 100%; box-sizing: border-box; }
.share-foot { font-size: 13px; line-height: 1.7; color: var(--text-2); }

@media (max-width: 900px) {
  .share-grid { grid-template-columns: 1fr; }
}

/* 小程序用户明细：手机号点击查看明文（7.0.35） */
.ph-show { cursor: pointer; border-bottom: 1px dashed #94a3b8; }
.ph-show.shown { color: #0f172a; border-bottom-color: #0f172a; font-weight: 600; }

/* 学习工具词库（7.0.42） */
.tb-config { display: flex; align-items: center; gap: 16px; padding: 4px 0 8px; }
.tb-switch { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.tb-switch input { width: 18px; height: 18px; accent-color: var(--primary); }
.tb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.tb-preview { margin: 12px 0; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.tb-preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tb-preview th, .tb-preview td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; text-align: left; white-space: nowrap; }
.tb-preview th { background: #fafbfd; color: #64748b; font-weight: 600; }
.tb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--primary-soft); color: var(--primary); }
.tb-tag.hanzi { background: #ecfdf5; color: #15803d; }
.tb-tag.sentence { background: #eff6ff; color: #2563eb; }
.tb-off { color: var(--muted); }
@media (max-width: 900px) { .tb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* H5 列表：地址可点复制 + 二维码弹窗（7.0.42） */
.h5-url-copy { color: var(--primary, #4f46e5); cursor: pointer; border-bottom: 1px dashed currentColor; }
.h5-url-copy:hover { opacity: .75; }
.qr-modal { max-width: 380px; }
.qr-body { text-align: center; }
.qr-img { display: flex; align-items: center; justify-content: center; min-height: 220px; margin: 4px auto 14px; }
.qr-img img, .qr-img canvas { width: 220px !important; height: 220px !important; image-rendering: pixelated; }
.qr-err { color: var(--red, #dc2626); font-size: 13px; }
.qr-url-row { display: flex; gap: 8px; align-items: center; }
.qr-url-row .field { flex: 1; min-width: 0; font-size: 12px; }
.qr-tip { margin-top: 12px; font-size: 12px; color: var(--ink-3, #94a3b8); line-height: 1.6; text-align: left; }

/* ============================================================
   H5 编辑器重构（7.0.46）：左组件库 / 中工作台 / 右检查器
   保持蓝色中性配色；这里的规则放在最后，覆盖早期同名类。
   ============================================================ */
.h5-layout-v2 {
  grid-template-columns: 240px minmax(720px, 1fr) 360px;
  gap: 14px; align-items: start;
}
.h5-panel { padding: 14px !important; border-radius: 12px !important; }
.h5-panel + .h5-panel { margin-top: 12px; }
.h5-card-head { align-items: center; }
.h5-card-head h3 { font-size: 14px; letter-spacing: .2px; }
.h5-fold {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; color: var(--text-2); cursor: pointer;
}
.h5-fold .ico { width: 15px; height: 15px; transition: transform .18s; }
.h5-fold.folded .ico { transform: rotate(-90deg); }
.h5-lib-btn { position: relative; padding: 9px 3px 8px; font-size: 11.5px; border-radius: 9px; }
.h5-lib-btn.featured { border-color: rgba(37,99,235,.4); background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.h5-lib-btn.featured .ico { width: 20px; height: 20px; }
.h5-lib-old {
  position: absolute; top: 3px; right: 4px; font-size: 9px; line-height: 1;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 3px; background: #fff;
}
.h5-upgrade {
  display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.h5-upgrade .btn { width: 100%; }
.h5-mini-hint { margin-top: 8px; font-size: 11px; color: var(--muted); text-align: center; }
.h5-str-row { gap: 7px; padding: 7px 7px; }
.h5-grip, .h5-qdrag {
  flex: 0 0 16px; width: 16px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  color: #b6c2d4; cursor: grab; border-radius: 4px;
}
.h5-grip:hover, .h5-qdrag:hover { color: var(--primary); background: var(--primary-soft); }
.h5-grip .ico, .h5-qdrag .ico { width: 14px; height: 14px; }
.h5-str-row.dragover, .h5-qrow.dragover, .h5-ol-row.dragover {
  outline: 1.5px dashed var(--primary); outline-offset: -1px; background: var(--primary-soft);
}

/* 中栏工具条 */
.h5-col-mid { min-width: 720px; }
.h5-workbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 48px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.03), 0 8px 22px -20px rgba(15,23,42,.5);
}
.h5-workbar-l, .h5-workbar-c, .h5-workbar-r { display: flex; align-items: center; gap: 8px; }
.h5-workbar-c { flex: 1; justify-content: center; }
.h5-workbar-r { margin-left: auto; }
.h5-seg { display: inline-flex; padding: 3px; border-radius: 9px; background: #f1f5f9; border: 1px solid var(--line); }
.h5-seg button {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent;
  padding: 6px 11px; border-radius: 7px; font: inherit; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; white-space: nowrap;
}
.h5-seg button .ico { width: 14px; height: 14px; }
.h5-seg button.on { background: #fff; color: var(--primary-dark); font-weight: 700; box-shadow: 0 1px 4px rgba(15,23,42,.1); }
.h5-dev-wrap { position: relative; }
.h5-dev-btn {
  display: flex; align-items: center; gap: 8px; min-width: 216px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 9px; background: #fcfdff;
  font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.h5-dev-btn:hover { border-color: var(--primary); }
.h5-dev-btn > .ico { width: 17px; height: 17px; color: var(--primary); }
.h5-dev-btn .chev { width: 14px; height: 14px; color: var(--muted); margin-left: auto; }
.h5-dev-txt { display: flex; flex-direction: column; line-height: 1.25; }
.h5-dev-txt b { font-size: 12.5px; font-weight: 700; }
.h5-dev-txt small { font-size: 10.5px; color: var(--muted); }
.h5-dev-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  width: 296px; max-height: min(66vh, 560px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: 0 18px 44px -18px rgba(15,23,42,.35); padding: 6px;
}
.h5-dev-group + .h5-dev-group { margin-top: 6px; border-top: 1px solid #eef2f7; padding-top: 6px; }
.h5-dev-group-t { padding: 4px 8px; font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .6px; }
.h5-dev-item {
  display: flex; flex-direction: column; width: 100%; gap: 1px; padding: 6px 9px;
  border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; font: inherit;
}
.h5-dev-item:hover { background: #f4f7fc; }
.h5-dev-item.on { background: var(--primary-soft); }
.h5-dev-item b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.h5-dev-item.on b { color: var(--primary-dark); }
.h5-dev-item small { font-size: 11px; color: var(--muted); }
.h5-dev-custom {
  display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px;
  border-top: 1px solid #eef2f7; font-size: 11px; color: var(--text-2);
}
.h5-dev-custom label { display: flex; align-items: center; gap: 4px; }
.h5-dev-custom .field { width: 66px; padding: 5px 6px; font-size: 11px; }
.h5-zoom { display: inline-flex; align-items: center; gap: 4px; }
.h5-zoom .field { width: 96px; padding: 6px 7px; font-size: 12px; }
.h5-zoom-btn {
  width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px;
  background: #fcfdff; color: var(--text-2); cursor: pointer; font-size: 15px; line-height: 1;
}
.h5-zoom-btn:hover { border-color: var(--primary); color: var(--primary); }
.h5-workbar .btn .ico { width: 14px; height: 14px; }
.h5-statusbar {
  display: flex; align-items: center; gap: 3px; margin-top: 9px; padding: 7px 12px;
  border-radius: 9px; background: #f6f8fc; color: var(--text-2); font-size: 11.5px; line-height: 1.5;
}
.h5-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--primary); margin-right: 6px; }
.h5-dot.try { background: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }

/* 设备画布：固定视口高度，内层按逻辑尺寸渲染再等比缩放 */
.h5-canvas-viewport {
  position: relative; height: clamp(430px, calc(100vh - 268px), 900px);
  margin-top: 10px; padding: 28px 12px 16px; overflow: auto;
  border: 1px solid var(--line); border-radius: 14px;
  background-color: #eef1f6;
  background-image: radial-gradient(#cfd8e6 .8px, transparent .8px);
  background-size: 16px 16px;
}
.h5-canvas-viewport.trying { background-color: #eef0fa; }
.h5-device-stage {
  position: relative; margin: 0 auto; transition: width .2s, height .2s;
}
.h5-device-badge {
  position: absolute; top: -21px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 2px 9px; border-radius: 6px;
  background: rgba(30,41,59,.82); color: #fff; font-size: 10.5px; letter-spacing: .2px;
}
.h5-device-frame {
  border: 7px solid #1f2937; border-radius: 22px; overflow: hidden;
  background: #fff; box-shadow: 0 14px 34px -16px rgba(15,23,42,.5);
}
.h5-preview { display: block; width: 100%; height: 100%; border: 0; background: #f5f6fa; }
.h5-tryctl {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 9px;
  padding: 7px 10px; border: 1px solid #dbeafe; border-radius: 10px; background: #f8fbff;
}
.h5-try-progress { font-size: 12.5px; color: var(--primary-dark); font-weight: 700; min-width: 96px; text-align: center; }
.h5-canvas-hint { margin-top: 8px !important; text-align: center; }

/* 右栏检查器 */
.h5-inspector {
  position: sticky; top: 16px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; padding: 12px; box-shadow: 0 12px 30px -26px rgba(15,23,42,.55);
  max-height: calc(100vh - 108px); overflow-y: auto;
}
.h5-inspector-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.h5-ptabs { display: flex; gap: 4px; flex: 1; }
.h5-ptab {
  flex: 1; min-width: 0; padding: 8px 0; border-radius: 8px; border: 1px solid var(--line);
  background: #f6f8fc; color: var(--text-2); font: inherit; font-size: 11.5px;
  font-weight: 600; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap;
}
.h5-ptab:hover { border-color: var(--primary); }
.h5-ptab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.h5-page-btn { flex: 0 0 30px; width: 30px; height: 30px; }
.h5-page-btn.on { background: var(--primary-soft); color: var(--primary-dark); }
.h5-ppane .h5-pane-hint { margin-top: 10px; font-size: 11.5px; }
.h5-sub-t { margin: 12px 0 6px; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.h5-block { border-radius: 10px; }
.h5-block .field { font-size: 12.5px; padding: 8px 9px; }
.h5-block .h5-fgrid .field + .field { margin-top: 7px; }
.h5-switch { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.h5-switch input { width: 16px; height: 16px; accent-color: var(--primary); }
.h5-swatches { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
.h5-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 2px;
  border: 1px solid var(--line); border-radius: 8px; background: #fcfdff; cursor: pointer; font: inherit; font-size: 10.5px; color: var(--text-2);
}
.h5-swatch i { width: 20px; height: 20px; border-radius: 50%; }
.h5-swatch.blue i { background: #3b82f6; } .h5-swatch.green i { background: #10b981; }
.h5-swatch.orange i { background: #f59e0b; } .h5-swatch.ink i { background: #475569; }
.h5-swatch.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); color: var(--primary-dark); font-weight: 700; }

/* 互动卡题目列表 / 题目大纲 */
.h5-qhead { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 7px; font-size: 12px; color: var(--text-2); }
.h5-qhead b { color: var(--text); }
.h5-questions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 9px; }
.h5-qrow { border: 1px solid var(--line) !important; border-radius: 9px !important; background: #fff !important; padding: 5px 6px !important; margin: 0 !important; }
.h5-qrow.open { border-color: rgba(37,99,235,.42) !important; background: #fcfdff !important; }
.h5-qrow-main { display: flex; align-items: center; gap: 5px; }
.h5-qrow-t {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px;
  border: 0; background: transparent; cursor: pointer; font: inherit; padding: 3px 0; text-align: left;
}
.h5-qn { flex: 0 0 18px; height: 18px; border-radius: 5px; background: #eef2f7; color: var(--text-2); font-size: 10.5px; line-height: 18px; text-align: center; }
.h5-qtype { flex: 0 0 auto; font-size: 10px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 4px; padding: 2px 4px; white-space: nowrap; }
.h5-qlabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--text); }
.h5-qreq { flex: 0 0 auto; font-size: 9.5px; color: #b91c1c; background: #fef2f2; border-radius: 4px; padding: 2px 4px; }
.h5-qeye { flex: 0 0 22px; width: 22px; height: 22px; border: 0; border-radius: 5px; background: #f4f7fc; color: var(--muted); cursor: pointer; }
.h5-qeye:hover { color: var(--primary); }
.h5-qeye .ico { width: 13px; height: 13px; }
.h5-qedit { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); }
.h5-qedit .field + .field { margin-top: 6px; }
.h5-qacts { display: flex; gap: 5px; margin-top: 8px; }
.h5-qacts .btn { flex: 1; padding: 5px 2px; font-size: 11px; }
.h5-outline { display: flex; flex-direction: column; gap: 3px; }
.h5-ol-row {
  display: flex; align-items: center; gap: 5px; padding: 6px 5px;
  border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-size: 11.5px; color: var(--text-2);
}
.h5-ol-row:hover { background: #f4f7fc; }
.h5-ol-row.on { background: var(--primary-soft); border-color: rgba(37,99,235,.28); color: var(--primary-dark); }
.h5-ol-n { flex: 0 0 16px; text-align: right; color: var(--muted); font-size: 10.5px; }
.h5-ol-type { flex: 0 0 auto; font-size: 9.5px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 4px; padding: 2px 4px; white-space: nowrap; }
.h5-ol-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h5-ol-req { flex: 0 0 auto; font-size: 9.5px; color: #b91c1c; }

/* hidden 属性优先于 display:flex / grid（合并页签、模板小条、试走条都靠它切换） */
[hidden] { display: none !important; }

/* ===== 方案 A：合并页签 / 次级模板 / 选中条 / 保存状态 ===== */
.h5-st-head { gap: 8px; }
.h5-st-tabs { display: inline-flex; gap: 4px; padding: 2px; border-radius: 8px; background: #f1f5f9; }
.h5-st-tab {
  border: 0; border-radius: 6px; background: transparent; color: var(--text-2);
  padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.h5-st-tab.on { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.h5-lib-limit { margin-top: 10px; color: var(--muted); }
.h5-tpl-panel { padding: 10px 14px !important; }
.h5-tpl-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent;
  padding: 2px 0; font: inherit; text-align: left; cursor: pointer;
}
.h5-tpl-toggle b { font-size: 13px; color: var(--text); }
.h5-tpl-toggle .card-note { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.h5-tpl-toggle .ico { width: 14px; height: 14px; color: var(--muted); transition: transform .18s; }
.h5-tpl-toggle.open .ico { transform: rotate(90deg); }
.h5-tpl-panel .h5-tpl-row { margin-top: 10px; }
.h5-tpl-panel .h5-tpl { flex: 1 1 100%; }
.h5-save-dot { color: #f59e0b; margin-left: 6px; font-size: 11px; }
.h5-save-state { margin-left: 6px; font-size: 11px; opacity: .85; font-weight: 500; }
.h5-sel-bar {
  display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--primary-dark);
  background: var(--primary-soft); border-radius: 8px; padding: 6px 9px; margin-bottom: 10px;
}
.h5-group-t {
  font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .5px;
  margin: 0 0 6px 2px;
}

@media (max-width: 1400px) {
  .h5-layout-v2 { grid-template-columns: 220px minmax(660px, 1fr) 330px; gap: 12px; }
  .h5-col-mid { min-width: 660px; }
  .h5-workbar { gap: 8px; padding: 7px 9px; }
  .h5-dev-btn { min-width: 180px; }
}
@media (max-width: 1180px) {
  .h5-layout-v2 { grid-template-columns: 200px minmax(560px, 1fr); }
  .h5-col-right { grid-column: 1 / -1; position: static; }
  .h5-inspector { position: static; max-height: none; }
}
