:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel2: #f8f9fa;
  --line: #e8eaee;
  --line2: #d9dce2;
  --text: #1d2129;
  --muted: #868c98;
  --accent: #16a34a;
  --accent-soft: #ecfdf3;
  --green: #16a34a;
  --red: #dc2626;
  --blue: #2563eb;
  --amber: #b7791f;
  --purple: #7c3aed;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; display: flex; min-height: 100vh; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; font-weight: 600; }
h3 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
h4 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; }
.grow { flex: 1; }
.right { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.flex { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; }
.full { width: 100%; }

/* 侧边栏 */
.side { width: 210px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; display: grid; place-items: center; font-size: 14px; }
nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #4b5260; }
nav a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav a i { font-style: normal; width: 16px; text-align: center; }
nav a.dev { margin-top: 12px; border-top: 1px dashed var(--line); border-radius: 0 0 8px 8px; padding-top: 14px; }
.nbadge { margin-left: auto; background: #f59e0b; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.nbadge.blue { background: var(--blue); }
.side-foot { margin-top: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); }

/* 主区 */
.wrap { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(244, 245, 247, .92); backdrop-filter: blur(8px); z-index: 5; }
main { padding: 20px 24px 60px; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.nopad { padding: 0; overflow: auto; }
.stat .num { font-size: 28px; font-weight: 700; margin: 4px 0; }
.stat.warn .num { color: #d97706; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.alert { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert.small { font-size: 12px; margin: 10px 0 0; }

/* 表单控件 */
input, select, textarea { background: #fff; border: 1px solid var(--line2); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 36px; width: 100%; }
textarea { width: 100%; resize: vertical; }
.toolbar input:not([type=checkbox]) { width: 220px; }
input.search { padding: 10px 12px 10px 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23868c98' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; width: 100%; }
.btn { background: #fff; border: 1px solid var(--line2); color: var(--text); border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--panel2); border-color: #c5c9d1; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #15803d; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.form label input, .form label select, .form label textarea { color: var(--text); font-size: 14px; }
.form .req::after { content: " *"; color: var(--red); }
.fsec { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.fsec > .fsec-title { font-size: 13px; font-weight: 600; color: var(--text); margin: -2px 0 0; }
.fhint { font-size: 11px; color: var(--muted); font-weight: 400; }

/* 多值输入（语言 / 地区 / 标签） */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 16px; background: #f1f3f5; color: #374151; font-size: 12px; border: 1px solid transparent; }
.chip button { border: 0; background: none; color: #9ca3af; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
.chip button:hover { color: var(--red); }
.chip.opt { background: #fff; border: 1px dashed var(--line2); color: var(--muted); cursor: pointer; padding: 4px 10px; }
.chip.opt:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: #86efac; color: #15803d; }
.chipadd { display: flex; gap: 6px; }
.chipadd input { flex: 1; padding: 6px 10px; font-size: 13px; }
.chipadd .btn { padding: 6px 12px; }
.mtags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mtag { font-size: 11px; color: #6b7280; background: #f3f4f6; padding: 1px 6px; border-radius: 4px; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch.sm { width: 32px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d1d5db; border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.sm span::before { width: 12px; height: 12px; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch.sm input:checked + span::before { transform: translateX(14px); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel2); position: sticky; top: 0; letter-spacing: .02em; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafbfc; }
.tbl tr.off td { opacity: .5; }
.cname { font-weight: 600; }

/* 标签 */
.pbadge { --c: #6b7280; display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--c) 12%, white); color: color-mix(in srgb, var(--c) 80%, black); border: 1px solid color-mix(in srgb, var(--c) 35%, white); white-space: nowrap; }
.pbadge.sm { font-size: 11px; padding: 1px 6px; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: #f1f3f5; color: #5b6170; white-space: nowrap; }
.tag.green { background: #dcfce7; color: #15803d; }
.tag.red { background: #fee2e2; color: #b91c1c; }
.tag.blue { background: #dbeafe; color: #1d4ed8; }
.tag.purple { background: #ede9fe; color: #6d28d9; }
.tag.gray { background: #f1f3f5; color: #6b7280; }
.dot { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot.green { color: var(--green); } .dot.red { color: var(--red); } .dot.blue { color: var(--blue); } .dot.gray { color: #9ca3af; }
.dot.blue::before { display: none; }
.status { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: #f1f3f5; color: #4b5260; white-space: nowrap; }
.status.green { background: #f0fdf4; color: #15803d; }
.status.red { background: #fef2f2; color: #b91c1c; }
.status.gray { background: #f3f4f6; color: #9ca3af; }

/* 服务商卡片 */
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.provider { border-top: 3px solid var(--c); }
.phead { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.phead h3 { margin: 0; }
.pavatar { width: 40px; height: 40px; border-radius: 10px; background: var(--c); display: grid; place-items: center; font-weight: 700; color: #fff; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv span { color: var(--muted); flex-shrink: 0; }
.kv b { font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addcard { border: 1px dashed var(--line2); background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; min-height: 200px; }
.addcard:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 频道管理：分类 + 频道 ===== */
.split { display: grid; grid-template-columns: 280px 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-height: calc(100vh - 120px); }
.catpane { border-right: 1px solid var(--line); background: #fbfbfc; display: flex; flex-direction: column; min-width: 0; }
.chpane { min-width: 0; display: flex; flex-direction: column; }
.panehead { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 64px; }
.panehead h3 { margin: 0; }
.panepad { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); }
.crumbcur { color: var(--accent); font-size: 15px; }
.pill { background: #f1f3f5; color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 8px; }
.catlist { padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow: auto; max-height: calc(100vh - 260px); }
.catcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; overflow: hidden; transition: border-color .15s, box-shadow .15s; flex-shrink: 0; }
.catcard:hover { border-color: #c9cdd4; }
.catcard.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.catcard.sel .cattop b { color: var(--accent); }
.catcard.dim { opacity: .55; }
.cattop { display: flex; align-items: center; gap: 6px; padding: 12px 14px 4px; font-size: 15px; }
.catmeta { padding: 0 14px 10px; color: var(--muted); font-size: 12px; display: flex; gap: 14px; }
.catfoot { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); background: #fdfbf5; font-size: 12px; min-height: 38px; }
.catcard.sel .catfoot { background: rgba(255,255,255,.5); }
.catfoot .warn { color: #b45309; }
.catfoot .ok { color: #15803d; }

.ctable { overflow: visible; }
.cgrid { display: grid; grid-template-columns: 14px minmax(220px, 1.8fr) 56px 120px minmax(120px, 1fr) 96px 20px; align-items: center; gap: 12px; padding: 14px 20px; }
.chead { background: var(--panel2); color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .03em; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; padding-top: 11px; padding-bottom: 11px; }
.crow { border-bottom: 1px solid var(--line); }
.crow > .cgrid { cursor: pointer; }
.crow > .cgrid:hover { background: #fafbfc; }
.crow.open > .cgrid { background: #fcfcfd; }
.cch { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cch > div { min-width: 0; }
.cch .cname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfull { font-size: 12px; color: #4b5260; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clogo { width: 48px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #6b7280; flex-shrink: 0; overflow: hidden; }
.clogo img { max-width: 100%; max-height: 100%; object-fit: contain; }
select.inline, input.inline { padding: 5px 8px; font-size: 13px; border-color: transparent; background: transparent; width: 100%; }
select.inline:hover, input.inline:hover { border-color: var(--line2); background: #fff; }
input.inline.num { width: 64px; }
select.inline.prem { color: var(--purple); font-weight: 600; }
.csrc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.caret { color: var(--muted); display: inline-block; width: 16px; text-align: center; }
.cbody { padding: 4px 18px 14px 78px; background: #fcfcfd; }

.ibtn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: #6b7280; cursor: pointer; font-size: 12px; display: inline-grid; place-items: center; vertical-align: middle; }
.ibtn:hover { color: var(--text); border-color: #c5c9d1; background: var(--panel2); }
.ibtn:disabled { opacity: .35; cursor: default; }
.ibtn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.ibtn.danger:hover { color: var(--red); border-color: #fca5a5; background: #fef2f2; }
.ibtn.ph { border-color: transparent; cursor: default; background: none; }
.ibtn.ghostbtn { border-color: transparent; background: transparent; font-size: 16px; }

/* 源行 */
.srow { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; border: 1px solid transparent; }
.srow + .srow { margin-top: 4px; }
.srow:hover { background: #f6f7f9; }
.srow.on { background: #f0fdf4; border-color: #bbf7d0; }
.srow.off { opacity: .5; }
.srow.empty-row { justify-content: center; padding: 16px; }
.sp { width: 48px; flex-shrink: 0; }
.sinfo { flex: 1; min-width: 0; }
.sname { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.surl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sact { display: flex; gap: 4px; flex-shrink: 0; }
.radio { position: relative; width: 20px; height: 20px; flex-shrink: 0; cursor: pointer; }
.radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #c5c9d1; background: #fff; transition: .15s; }
.radio input:checked + span { border-color: var(--green); background: radial-gradient(var(--green) 0 42%, #fff 47%); }
.radio input:disabled + span { border-style: dashed; }
.radio:hover span { border-color: var(--green); }
.chfoot { display: flex; align-items: center; gap: 8px; padding: 10px 10px 0; margin-top: 6px; border-top: 1px dashed var(--line); }
.chfoot select, .chfoot input { font-size: 13px; padding: 6px 8px; }
.chfoot2 { padding: 8px 10px 0; }

/* 日志 */
.log { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log:last-child { border-bottom: 0; }
.diff { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; word-break: break-all; }
.diff .del { color: #b91c1c; } .diff .del::before { content: "− "; }
.diff .add { color: #15803d; } .diff .add::before { content: "+ "; }
.code { margin: 0; max-height: 70vh; overflow: auto; font: 12px/1.5 "SF Mono", Menlo, monospace; color: #334155; white-space: pre-wrap; word-break: break-all; }

.tabs { display: flex; gap: 6px; }
.tabs button { --c: #6b7280; background: #fff; border: 1px solid var(--line2); color: var(--muted); padding: 7px 16px; border-radius: 8px; cursor: pointer; font: inherit; }
.tabs button.on { border-color: var(--c); color: color-mix(in srgb, var(--c) 80%, black); background: color-mix(in srgb, var(--c) 10%, white); font-weight: 600; }

/* 弹窗 */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); display: none; align-items: flex-start; justify-content: center; z-index: 50; padding: 5vh 16px; overflow: auto; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; width: 540px; max-width: 100%; box-shadow: 0 20px 60px rgba(15, 23, 42, .18); }
.modal.wide { width: 780px; }
.modal-head { display: flex; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; flex: 1; justify-content: flex-start; gap: 8px; }
.x { background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 99; }
.toast { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 10px 14px; border-radius: 8px; max-width: 380px; transition: .3s; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }
.toast.err { border-left-color: var(--red); }
.toast.hide { opacity: 0; transform: translateY(8px); }

.spin { width: 12px; height: 12px; border: 2px solid rgba(0, 0, 0, .15); border-top-color: currentColor; border-radius: 50%; display: inline-block; animation: sp .7s linear infinite; }
.btn.primary .spin { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 1200px) {
  .split { grid-template-columns: 240px 1fr; }
}
@media (max-width: 900px) {
  body { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  nav { flex-direction: row; overflow: auto; }
  .side-foot { display: none; }
  .split { grid-template-columns: 1fr; }
  .catlist { flex-direction: row; overflow: auto; max-height: none; }
  .catcard { min-width: 220px; }
  .grid.two { grid-template-columns: 1fr; }
  main, .top { padding-left: 14px; padding-right: 14px; }
}

/* 搜索选源 */
.chfoot + .chfoot { border-top: 0; margin-top: 0; padding-top: 8px; }
.footlabel { font-size: 12px; color: var(--muted); width: 84px; flex-shrink: 0; }
.picker { position: relative; }
.picker input.search { padding-top: 7px; padding-bottom: 7px; font-size: 13px; }
.pickprov { width: 120px; }
.picklist { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .14); max-height: 340px; overflow: auto; z-index: 20; padding: 4px; }
.picklist.show { display: block; }
.pickhint { font-size: 11px; color: var(--muted); padding: 6px 10px 4px; }
.pickitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pickitem:hover, .pickitem.act { background: var(--accent-soft); }
.pickitem mark { background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ===== 精简列表 + 右侧抽屉 ===== */
.crow.sel > .cgrid { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.crow .right { font-size: 18px; }
.prembadge { font-size: 12px; font-weight: 600; color: var(--purple); background: #f5f3ff; padding: 3px 8px; border-radius: 6px; }
.dotnew { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); display: inline-block; }
.catfoot .ok { color: var(--muted); }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 600px; max-width: 100vw; background: #fff; border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(15, 23, 42, .10); z-index: 40; display: flex; flex-direction: column; overflow: auto; transform: translateX(105%); transition: transform .22s ease; }
.drawer.show { transform: none; }
.dhead { display: flex; align-items: center; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.clogo.lg { width: 60px; height: 44px; font-size: 12px; }
.dtitle { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.dprops { display: grid; grid-template-columns: 1.4fr 80px 1.2fr 60px; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.dprops label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.dprops select, .dprops input { font-size: 13px; padding: 7px 8px; width: 100%; }
.dsec { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dsec-title { font-weight: 600; margin-bottom: 12px; }
.dfoot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.emptysrc { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--line2); border-radius: 10px; }
.mtlink { display: inline-block; margin-top: 12px; }
.drawer .srow { padding: 10px 12px; border: 1px solid var(--line); }
.drawer .srow.on { border-color: #86efac; }
.drawer .sname { gap: 8px; }
.drawer .sact { opacity: 0; transition: opacity .15s; }
.drawer .srow:hover .sact { opacity: 1; }
.drawer .picklist { max-height: 300px; }

/* 精简频道表单 */
.form.simple { gap: 14px; }
.frow { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 12px; }
.flabel { font-size: 13px; color: #4b5260; }
.flabel.req::after { content: " *"; color: var(--red); }
.frow .clogo { width: 52px; height: 36px; }
.chipline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 38px; padding: 4px 6px; border: 1px solid var(--line2); border-radius: 8px; background: #fff; }
.chipline:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); }
.chipinput { border: 0 !important; box-shadow: none !important; padding: 4px 4px !important; flex: 1; min-width: 160px; font-size: 13px; }
details.adv { border-top: 1px dashed var(--line); padding-top: 10px; }
details.adv summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
details.adv input { width: 100%; font-size: 13px; }
.prembadge.basic { color: var(--blue); background: #eff6ff; }
.catmeta { gap: 10px; white-space: nowrap; overflow: hidden; } .catmeta span { white-space: nowrap; }

/* 拖动排序 */
.handle { color: #c5c9d1; cursor: grab; font-size: 13px; letter-spacing: -3px; user-select: none; }
.crow:hover .handle, .catcard:hover .handle { color: #868c98; }
.crow[draggable], .catcard[draggable] { position: relative; }
.catcard[draggable] { cursor: grab; }
.dragging { opacity: .4; }
.drop-before::before, .drop-after::after { content: ""; position: absolute; left: 8px; right: 8px; height: 3px; border-radius: 3px; background: var(--accent); z-index: 3; }
.drop-before::before { top: -2px; }
.drop-after::after { bottom: -2px; }
.catcard.drop-before::before { top: -7px; }
.catcard.drop-after::after { bottom: -7px; }
.catcard { overflow: visible; }
.catcard .catfoot { border-radius: 0 0 12px 12px; }

/* 权限分段切换 */
.seg { display: inline-flex; background: #f1f3f5; border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 12px; color: #6b7280; padding: 4px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); font-weight: 600; }
.seg button.on.p0 { color: #4b5260; }
.seg button.on.p1 { color: var(--blue); }
.seg button.on.p2 { color: var(--purple); }
.dtitle .switch { margin-left: 2px; }

/* 权限（需确认） */
.permchip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; background: #f3f4f6; color: #4b5260; }
.permchip.p1 { background: #eff6ff; color: var(--blue); }
.permchip.p2 { background: #f5f3ff; color: var(--purple); }
.permchip .pen { opacity: 0; font-weight: 400; font-size: 11px; transition: opacity .15s; }
.permchip:hover { border-color: currentColor; }
.permchip:hover .pen { opacity: .8; }
label .permchip { cursor: inherit; }
.permopts { display: flex; flex-direction: column; gap: 8px; }
.permopt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.permopt:hover { border-color: #c5c9d1; }
.permopt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.permopt .permchip { min-width: 110px; justify-content: center; }
.permwarn { margin-top: 12px; font-size: 13px; color: #92400e; background: #fffbeb; border-radius: 8px; padding: 0 12px; }
.permwarn:not(:empty) { padding: 10px 12px; border: 1px solid #fde68a; }

/* 抽屉头部对齐 */
.dhead { align-items: center; }
.dhact { display: flex; align-items: center; gap: 14px; flex-shrink: 0; align-self: center; }
.dtoggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.dsep { width: 1px; height: 20px; background: var(--line); }
.dhead .x { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; font-size: 22px; line-height: 1; padding: 0; }
.dhead .x:hover { background: var(--panel2); color: var(--text); }
.dtitle { line-height: 1.3; }
