:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e6eaf1;
  --text: #1d2433;
  --muted: #7c8699;
  --primary: #2e6be6;
  --primary-soft: #eaf2ff;
  --green: #18a058;
  --orange: #e69138;
  --red: #e25656;
  --radius: 10px;
  --shadow: 0 1px 8px rgba(28, 45, 80, .05);
}
* { box-sizing: border-box; }
/* 作者样式中的 display:flex 会覆盖浏览器默认的 [hidden]{display:none}，必须显式声明 */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef3fb, #dfe9fb); }
.login-card { width: 340px; background: #fff; border-radius: 14px; padding: 28px 26px; box-shadow: 0 10px 30px rgba(30, 60, 120, .12); }
.login-logo { font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.login-sub { color: var(--muted); margin: 2px 0 18px; }
.login-tip { margin-top: 14px; font-size: 11px; color: var(--muted); }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 196px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 16px 18px 12px; font-size: 17px; font-weight: 700; border-bottom: 1px solid var(--line); }
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 1px; }
#nav { padding: 8px 8px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 11px; color: var(--muted); padding: 10px 10px 3px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; color: #48536a; }
.nav-item:hover { background: #f5f8fd; }
.nav-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-ico { width: 17px; text-align: center; }
.side-foot { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 4px 0 0; font-size: 11px; }
.main { flex: 1; min-width: 0; }
.topbar { height: 46px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; position: sticky; top: 0; z-index: 5; }
.crumb { font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.view { padding: 14px 18px 40px; }

/* 通用 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.card h3 { margin: 0 0 2px; font-size: 15px; }
.card .desc { color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 980px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } .sidebar { width: 56px; } .brand, .nav-item span:not(.nav-ico), .side-foot { display: none; } .nav-item { justify-content: center; } .view { padding: 12px; } }

.field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.field > span { font-size: 11px; color: var(--muted); }
input, select, textarea { width: 100%; padding: 6px 9px; border: 1px solid #dfe4ed; border-radius: 6px; background: #fff; outline: none; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(46, 107, 230, .1); }
textarea { min-height: 58px; resize: vertical; }
textarea.tall { min-height: 96px; line-height: 1.6; }
/* 固定值：只读但可见，明确灰化，避免误以为能改 */
input[readonly], textarea[readonly] { background: #f2f4f8; color: #98a2b3; border-color: #e8ecf2; cursor: not-allowed; box-shadow: none; }
.field.is-ro > span { color: #a2abba; }
.hint-ro { font-size: 10px; color: #a2abba; }
.check { display: flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.check input { width: 14px; height: 14px; }

.btn { border: 1px solid #dfe4ed; background: #fff; padding: 5px 11px; border-radius: 6px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { opacity: .9; color: #fff; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 3px 8px; font-size: 11px; }
.btn.block { width: 100%; margin-top: 6px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.toolbar .right { display: flex; gap: 6px; align-items: center; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 6px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; background: #fafbfd; white-space: nowrap; }
tr:hover td { background: #fcfdff; }
.cell-limit { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 10px; background: #eef1f6; color: #667085; white-space: nowrap; }
.badge.on, .badge.granted, .badge.done { background: #e6f7ee; color: var(--green); }
.badge.off, .badge.failed { background: #fdeaea; color: var(--red); }
.badge.wait, .badge.pending { background: #fff3e0; color: var(--orange); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }

/* 概览 */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat .k { font-size: 11px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; margin: 3px 0 1px; }
.stat .s { font-size: 11px; color: var(--muted); }

/* 预览 */
.preview-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fafbfd; }
.preview-title { color: var(--primary); font-weight: 600; margin-bottom: 2px; }
.preview-desc { color: var(--muted); font-size: 11px; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

.upload-mini { position: relative; overflow: hidden; flex: none; }
.upload-mini input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; }

/* 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 30, 50, .42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-card { width: 520px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; }
.modal-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; justify-content: space-between; }
.modal-x { cursor: pointer; color: var(--muted); }
.modal-body { padding: 14px 16px; overflow-y: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 6px; }
.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 8px 14px; border-radius: 7px; font-size: 12px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast.err { background: var(--red); }

/* ===== 企业级配置页：页面头 / 编号分区 / 子组 ===== */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.page-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.page-head .sub { color: var(--muted); font-size: 12px; margin-top: 4px; max-width: 860px; line-height: 1.6; }
.page-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.switch-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #48536a; white-space: nowrap; cursor: pointer; }
.switch-line input { width: 15px; height: 15px; }
.config-note { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; background: var(--primary-soft); color: #3b5f9e; border: 1px solid #d7e5fb; border-radius: 8px; font-size: 12px; margin-bottom: 14px; line-height: 1.5; }

.section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.section-head { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.section-no { flex: none; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.section-title { font-size: 14px; font-weight: 600; }
.section-desc { margin-left: auto; color: var(--muted); font-size: 11px; text-align: right; }
.section-body { padding: 15px 16px; }
.section-body > .field { margin-bottom: 10px; }
.subgroup { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: #fcfdff; min-width: 0; }
.subgroup-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #3c4760; margin-bottom: 11px; }
.subgroup-title .dot-ico { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }
.subgroup-title .tag { margin-left: auto; font-size: 10px; font-weight: 400; color: var(--muted); background: #eef1f6; padding: 1px 7px; border-radius: 20px; }
.subgroup .field { margin-bottom: 10px; }
.subgroup .field:last-child { margin-bottom: 0; }

/* 海报表格化列表 */
.pg-scroll { overflow-x: auto; }
.pg-grid { min-width: 1000px; }
.pg-head, .pg-row { display: grid; grid-template-columns: 34px 62px minmax(140px, 1.1fr) minmax(180px, 1.7fr) minmax(180px, 1.4fr) 56px 58px; gap: 8px; align-items: center; }
.pg-head { padding: 0 8px 9px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.pg-row { padding: 8px; border-bottom: 1px solid #f0f3f7; }
.pg-row:last-child { border-bottom: 0; }
.pg-row:hover { background: #fbfcfe; }
.pg-no { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pg-thumb { width: 52px; height: 52px; border-radius: 6px; border: 1px dashed var(--line); background: #f7f9fc; overflow: hidden; }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.pg-field { min-width: 0; }
.pg-field input, .pg-field textarea { width: 100%; padding: 5px 8px; }
.pg-field textarea { min-height: 40px; height: 40px; line-height: 1.3; resize: vertical; }
.pg-img { display: flex; align-items: center; gap: 5px; }
.pg-state { display: flex; justify-content: center; }
.pg-ops { display: flex; gap: 3px; justify-content: flex-end; }
.pg-ops .btn { padding: 2px 6px; }

/* 微信卡片效果预览 */
.preview-wrap { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 18px; align-items: start; }
.wx-card { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; box-shadow: 0 2px 10px rgba(28,45,80,.06); }
.wx-card .cover { width: 100%; height: 150px; object-fit: cover; display: block; background: #eef3fb; }
.wx-card .body { padding: 11px 12px; }
.wx-card .ttl { font-size: 14px; font-weight: 600; line-height: 1.45; }
.wx-card .dsc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.55; }
.wx-card .src { font-size: 11px; color: #a2abba; margin-top: 8px; padding-top: 7px; border-top: 1px solid #f0f3f7; }
.preview-note { font-size: 12px; color: #5b657a; line-height: 1.85; }
.preview-note b { color: #3c4760; }
.preview-note ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 1100px) { .preview-wrap { grid-template-columns: 1fr; } .pg-head, .pg-row { grid-template-columns: 34px 62px 160px 200px 180px 56px 58px; } }
