:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --panel-2: #fafbfe;
  --line: #e7e9f2;
  --line-strong: #d7dae8;
  --text: #171a26;
  --text-2: #4b5162;
  --muted: #8b90a3;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-weak: #eef0ff;
  --ok: #15803d;
  --ok-weak: #e8f7ee;
  --warn: #b45309;
  --warn-weak: #fef3e2;
  --danger: #b91c1c;
  --danger-weak: #fdecec;
  --info-weak: #e8f2ff;
  --info: #1d4ed8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 8px 24px rgba(20, 24, 40, .06);
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5d8e5; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------- 登录 ------------------------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #fff;
}
.login-side {
  background: radial-gradient(1200px 600px at 10% 0%, #4f46e5 0%, #312e81 45%, #1b1b3a 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-side::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -180px; bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 60%);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.login-logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center; font-size: 19px;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(4px);
}
.login-side h1 { font-size: 34px; line-height: 1.3; margin: 0 0 14px; letter-spacing: -.5px; }
.login-side p { color: rgba(255,255,255,.75); max-width: 420px; margin: 0; }
.login-feats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.login-feats span {
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
}
.login-foot { font-size: 12px; color: rgba(255,255,255,.5); }
.login-main { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.3px; }
.login-card .sub { color: var(--muted); margin: 0 0 26px; font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; height: 42px; margin-top: 8px; }
.login-hint {
  margin-top: 22px; padding: 12px 14px; border-radius: 10px;
  background: var(--panel-2); border: 1px dashed var(--line-strong);
  font-size: 12px; color: var(--muted); line-height: 1.8;
}
.login-hint b { color: var(--text-2); font-weight: 600; }

/* ------------------------------- 布局 ------------------------------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-top { padding: 14px 14px 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 10px rgba(79,70,229,.28);
}
.brand-txt { font-weight: 700; font-size: 14.5px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }

.site-switch {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; background: var(--panel-2);
  transition: border-color .15s, background .15s;
}
.site-switch:hover { border-color: var(--line-strong); background: #fff; }
.site-avatar {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--primary-weak); color: var(--primary); font-size: 13px; font-weight: 700; flex: none;
}
.site-switch .st { min-width: 0; flex: 1; }
.site-switch .st b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-switch .st small { color: var(--muted); font-size: 10.5px; }
.site-switch .caret { color: var(--muted); font-size: 10px; }
.site-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px; z-index: 60; display: none;
}
.site-menu.open { display: block; }
.site-menu .sm-item { display: flex; gap: 9px; align-items: center; padding: 8px 9px; border-radius: 7px; cursor: pointer; }
.site-menu .sm-item:hover { background: var(--panel-2); }
.site-menu .sm-item.active { background: var(--primary-weak); }
.site-menu .sm-item b { font-size: 12.5px; font-weight: 600; display: block; }
.site-menu .sm-item small { color: var(--muted); font-size: 10.5px; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group-label { font-size: 10.5px; color: var(--muted); letter-spacing: .8px; padding: 14px 10px 6px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text-2); font-size: 13px; margin-bottom: 2px;
  transition: background .13s, color .13s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.nav-item .badge-mini {
  margin-left: auto; font-size: 10.5px; background: var(--danger); color: #fff;
  border-radius: 999px; padding: 0 6px; line-height: 16px; font-weight: 600;
}
.nav-item .badge-mini.gray { background: var(--line-strong); color: var(--text-2); }

.sb-bottom { border-top: 1px solid var(--line); padding: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 8px; cursor: pointer; }
.user-chip:hover { background: var(--panel-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.user-chip .uc { min-width: 0; }
.user-chip b { display: block; font-size: 12.5px; font-weight: 600; }
.user-chip small { color: var(--muted); font-size: 10.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  position: sticky; top: 0; z-index: 40;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .tb-link { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding: 6px 10px; border-radius: 7px; cursor: pointer; }
.topbar .tb-link:hover { background: var(--panel-2); color: var(--text); }

.content { padding: 22px 24px 48px; max-width: 1480px; width: 100%; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------- 组件 ------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 34px; padding: 0 13px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .13s, border-color .13s, box-shadow .13s;
}
.btn:hover { background: var(--panel-2); border-color: #c9cdde; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.22); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { color: var(--danger); border-color: #f0c9c9; background: #fff; }
.btn.danger:hover { background: var(--danger-weak); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn.xs { height: 24px; padding: 0 7px; font-size: 11.5px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.card-head .hint { color: var(--muted); font-size: 12px; }
.card-head .acts { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid.k4, .grid.k5 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid.k3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) { .grid.k2, .grid.k3, .grid.k4, .grid.k5 { grid-template-columns: 1fr; } }

.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .lbl { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi .sub b { color: var(--ok); font-weight: 600; }
.kpi .sub b.down { color: var(--danger); }

.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius) var(--radius) 0 0;
}
.search {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; min-width: 220px;
}
.search input { border: none; outline: none; flex: 1; background: transparent; font-size: 13px; }
select.ctl, input.ctl, textarea.ctl {
  height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px;
  background: #fff; outline: none; font-size: 13px; min-width: 0;
}
select.ctl { padding-right: 26px; cursor: pointer; }
select.ctl:focus, input.ctl:focus, textarea.ctl:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
textarea.ctl { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px;
  letter-spacing: .3px; padding: 10px 12px; background: var(--panel-2);
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid #f1f2f8; vertical-align: middle; }
table.tbl tbody tr:hover { background: #fbfbfe; }
table.tbl tbody tr.dragging { opacity: .45; background: var(--primary-weak); }
table.tbl tbody tr.drop-target { box-shadow: inset 0 2px 0 var(--primary); }
table.tbl td.num { font-variant-numeric: tabular-nums; color: var(--text-2); }
table.tbl .row-acts { display: flex; gap: 4px; justify-content: flex-end; opacity: .55; transition: opacity .12s; }
table.tbl tr:hover .row-acts { opacity: 1; }
.tname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ticon {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1;
  background: var(--panel-2); border: 1px solid var(--line);
}
.ticon img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.tname .tn { min-width: 0; }
.tname .tn b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.tname .tn small { color: var(--muted); font-size: 11px; }

.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 11.5px; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.hot { background: #fff1f0; color: #c2410c; border-color: #ffd9d2; }
.tag.free { background: var(--ok-weak); color: var(--ok); border-color: #cdeed9; }
.tag.draft { background: var(--warn-weak); color: var(--warn); border-color: #f6e0bd; }
.tag.offline { background: #f1f2f6; color: var(--muted); border-color: var(--line); }
.tag.broken { background: var(--danger-weak); color: var(--danger); border-color: #f3cfcf; }
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; opacity: .75; }
.tags-cell { display: flex; gap: 4px; flex-wrap: wrap; max-width: 220px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.pager .pg { display: flex; gap: 4px; margin-left: auto; }
.pager .pg button {
  min-width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 12px; color: var(--text-2);
}
.pager .pg button.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 32px; opacity: .5; margin-bottom: 8px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 550; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .tip { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.field input.ctl, .field select.ctl, .field textarea.ctl { width: 100%; }
.field .row { display: flex; gap: 8px; }
.field .row > * { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: #d6d9e6; position: relative; transition: background .16s; flex: none; }
.switch .track::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform .16s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch span.lbl { font-size: 12.5px; color: var(--text-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: #fff;
  font-size: 12.5px; cursor: pointer; color: var(--text-2); transition: all .13s;
}
.chip:hover { border-color: #c3c7d9; }
.chip.on { background: var(--primary-weak); border-color: #c7caff; color: var(--primary); font-weight: 550; }
.chip .x { opacity: .6; font-size: 11px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(17,20,34,.42); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 200; padding: 24px;
}
.modal {
  background: #fff; border-radius: 14px; box-shadow: 0 24px 64px rgba(15,18,35,.28);
  width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.wide { width: min(880px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--panel-2); border-radius: 0 0 14px 14px; }

.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1b1e2b; color: #fff; padding: 9px 15px; border-radius: 9px; font-size: 13px;
  box-shadow: 0 10px 28px rgba(0,0,0,.22); display: flex; align-items: center; gap: 8px;
  animation: slideDown .18s ease-out;
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast.warn { background: #78350f; }
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

.notice {
  display: flex; gap: 10px; padding: 11px 14px; border-radius: 9px; font-size: 12.5px;
  background: var(--info-weak); color: var(--info); border: 1px solid #d5e5ff; margin-bottom: 14px;
}
.notice.warn { background: var(--warn-weak); color: var(--warn); border-color: #f6e0bd; }
.notice.ok { background: var(--ok-weak); color: var(--ok); border-color: #cdeed9; }
.notice b { font-weight: 650; }

.bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.bar-row .bl { width: 92px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bt { flex: 1; height: 8px; border-radius: 999px; background: #eef0f7; overflow: hidden; }
.bar-row .bf { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #818cf8, #4f46e5); }
.bar-row .bv { width: 62px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chart { width: 100%; height: 190px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 12px; font-size: 13px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 预览 */
.preview-frame {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: var(--panel-2);
}
.preview-topbar {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #eef0f7;
  border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted);
}
.preview-dot { width: 8px; height: 8px; border-radius: 50%; background: #d5d8e5; }
.front {
  background: #fbfbfd; padding: 20px;
}
.front-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.front-logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg,#6366f1,#4338ca); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.front-title { font-weight: 700; font-size: 14px; }
.front-nav { margin-left: auto; display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); }
.front-h1 { font-size: 20px; font-weight: 750; letter-spacing: -.4px; margin: 6px 0 4px; }
.front-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.front-card {
  display: flex; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; box-shadow: 0 2px 10px rgba(20,24,40,.05);
}
.front-card .fi { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.front-card .fi img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.front-card h4 { margin: 0 0 3px; font-size: 14px; }
.front-card p { margin: 0 0 7px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.front-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.front-cta { margin-left: auto; align-self: center; font-size: 12px; color: var(--primary); border: 1px solid #c7caff; background: var(--primary-weak); padding: 5px 11px; border-radius: 7px; white-space: nowrap; }
.front-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.front-mini { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px; display: flex; gap: 7px; align-items: center; font-size: 11.5px; }
.front-mini .fm { width: 24px; height: 24px; border-radius: 6px; background: var(--panel-2); display: grid; place-items: center; font-size: 12px; flex: none; }
.front-sec-title { font-size: 12px; font-weight: 650; margin: 16px 0 8px; color: var(--text-2); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; position: relative; }
.media-item .thumb { height: 96px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; }
.media-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-item .meta { padding: 8px 9px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }
.media-item .meta b { display: block; font-weight: 550; color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-item .del { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.92); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; font-size: 12px; color: var(--danger); opacity: 0; transition: opacity .13s; }
.media-item:hover .del { opacity: 1; }

.drop-zone {
  border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 22px;
  text-align: center; color: var(--muted); font-size: 12.5px; cursor: pointer;
  background: var(--panel-2); transition: all .15s;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--primary); background: var(--primary-weak); color: var(--primary); }

.role-pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--primary-weak); color: var(--primary); }
.role-pill.super { background: #f3e8ff; color: #7e22ce; }
.role-pill.viewer { background: #eef2f7; color: #475569; }

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
  background: #0f1220; color: #d6e2ff; padding: 14px 16px; border-radius: 10px;
  overflow: auto; max-height: 420px; line-height: 1.6;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.badge-count { font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 7px; border-radius: 999px; color: var(--muted); }

.loading { display: grid; place-items: center; padding: 60px; color: var(--muted); font-size: 13px; }
.skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #eef0f7 25%, #f7f8fc 50%, #eef0f7 75%); background-size: 400% 100%; animation: sh 1.2s infinite; }
@keyframes sh { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
