/* 矩元信发 v4 · 运营后台
   视觉严格对齐三合一原型：暖白 #F5F5F3 / 墨 #1D1D1F / 橙 #FF6700，
   发丝级描边 rgba(0,0,0,.07)、大圆角 28px、数字全走等宽字体。 */

@font-face {
  font-family: 'Noto Sans SC';
  src: url('/fonts/sans.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif SC';
  src: url('/fonts/serif.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/mono.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #F5F5F3;
  --pure: #FFFFFF;
  --travertine: #EAE8E1;
  --sand: #DFDDD4;
  --ink: #1D1D1F;
  --muted: #5E5D59;
  --subtle: #86868B;
  --orange: #FF6700;
  --orange-hover: #E55A00;
  --maple: #E8D8C0;
  --walnut: #6B4832;
  --oak: #C8A882;

  --hair: rgba(0, 0, 0, .07);
  --hair-2: rgba(0, 0, 0, .06);
  --hair-3: rgba(0, 0, 0, .10);

  --green: #047857;
  --green-soft: rgba(16, 185, 129, .12);
  --red: #B91C1C;
  --red-soft: rgba(239, 68, 68, .10);
  --amber: #B45309;
  --amber-soft: rgba(245, 158, 11, .13);

  --r-xl: 28px;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: 'Noto Serif SC', 'Songti SC', serif;
  --shadow-2xs: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .03);
  --shadow: 0 10px 30px -14px rgba(29, 29, 31, .22);
  --shadow-lg: 0 28px 60px -20px rgba(29, 29, 31, .3), 0 2px 6px rgba(29, 29, 31, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(255, 103, 0, .16); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #B8B2A6; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* ================================================================ 顶栏 */

.shell-top {
  height: 52px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--orange);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: -.3px;
  flex: 0 0 26px;
}

.brand-text {
  font-size: 12px; font-weight: 700; letter-spacing: -.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tag-live {
  font-size: 10px;
  font-family: var(--mono);
  background: rgba(16, 185, 129, .2);
  color: #6EE7B7;
  border: 1px solid rgba(52, 211, 153, .3);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-family: var(--mono);
  background: rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .1);
  white-space: nowrap;
}
.chip.live { background: rgba(16, 185, 129, .18); color: #6EE7B7; border-color: rgba(52, 211, 153, .28); }
.chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: .2px;
}

.top-btn {
  height: 26px; padding: 0 10px; border-radius: 8px;
  font-size: 11.5px; color: rgba(255, 255, 255, .62);
  transition: background .15s, color .15s;
}
.top-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ================================================================ 页签 */

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 18px;
  background: var(--pure);
  border-bottom: 1px solid var(--hair-2);
  position: sticky;
  top: 52px;
  z-index: 35;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 11px 13px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .14s, border-color .14s;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--orange); border-bottom-color: var(--orange); font-weight: 700; }
.tab .badge-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--orange);
}

/* ================================================================ 主体 */

.view { padding: 16px 18px 48px; max-width: 1560px; margin: 0 auto; }
.view[hidden] { display: none; }

.row-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; padding: 0 2px;
}
.row-head h2 {
  font-size: 13px; font-weight: 700; margin: 0; letter-spacing: -.1px;
  display: flex; align-items: center; gap: 8px;
}
.row-head h2::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink); display: inline-block;
}
.row-head p { margin: 0; font-size: 11px; color: var(--muted); }
.row-head .grow { flex: 1; }

/* ---- 容器卡片 ---- */
.shell {
  background: var(--pure);
  border: 1px solid var(--hair);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2xs);
  overflow: hidden;
}

.shell-head {
  background: var(--ink);
  color: #fff;
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.shell-head h3 {
  margin: 0; font-size: 12px; font-weight: 700; letter-spacing: -.1px;
  display: flex; align-items: center; gap: 8px;
}
.shell-head .desc {
  font-size: 11px; color: rgba(255, 255, 255, .55); margin-top: 4px; line-height: 1.55;
}
.shell-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---- KPI 分栏 ---- */
.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg);
  border-bottom: 1px solid var(--hair-2);
  text-align: center;
}
.strip > div { padding: 11px 8px; border-right: 1px solid var(--hair-2); }
.strip > div:last-child { border-right: 0; }
.strip .k {
  font-size: 10px; color: var(--muted); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip .v {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.2px;
  font-variant-numeric: tabular-nums;
}
.strip .v.orange { color: var(--orange); }
.strip .v.green { color: var(--green); }
.strip .v small { font-size: 9.5px; font-weight: 500; color: var(--subtle); margin-left: 2px; }

/* ---- 内联卡片 ---- */
.card {
  background: var(--pure);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2xs);
}

.panel { padding: 14px 16px; }

.panel-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.panel-head h4 {
  margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: -.05px;
}
.panel-head .hint {
  margin-left: auto; font-size: 10px; color: var(--subtle);
  font-family: var(--mono);
}

.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---- 折线 ---- */
.spark { width: 100%; height: 150px; display: block; overflow: visible; }

/* ---- 排行 ---- */
.rank { display: flex; flex-direction: column; gap: 11px; }
.rank-row { display: grid; grid-template-columns: 16px 1fr auto; gap: 9px; align-items: center; }
.rank-idx { font-family: var(--mono); font-size: 10px; color: var(--subtle); }
.rank-idx.top { color: var(--orange); font-weight: 700; }
.rank-body { min-width: 0; }
.rank-title {
  font-size: 11.5px; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-bar { height: 4px; border-radius: 999px; background: var(--travertine); overflow: hidden; }
.rank-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #FFA05C, var(--orange));
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.rank-val { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* ---- 信号流 ---- */
.feed { display: flex; flex-direction: column; }
.feed-row {
  display: grid; grid-template-columns: 52px 1fr; gap: 9px;
  padding: 7px 2px; font-size: 11.5px;
  border-bottom: 1px dashed rgba(0, 0, 0, .06);
  animation: feedIn .26s cubic-bezier(.2, .8, .2, 1);
}
.feed-row:last-child { border-bottom: 0; }
.feed-time { font-family: var(--mono); font-size: 10px; color: var(--subtle); padding-top: 2px; }
.feed-main { min-width: 0; }
.feed-kind {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 600; margin-right: 6px;
  background: var(--travertine); color: var(--muted);
  vertical-align: 1px;
}
.feed-kind.k-publish { background: rgba(255, 103, 0, .12); color: var(--orange); }
.feed-kind.k-ack { background: var(--green-soft); color: var(--green); }
.feed-kind.k-fail { background: var(--red-soft); color: var(--red); }
.feed-text { color: var(--ink); }
.feed-dev { color: var(--subtle); }

@keyframes feedIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* ---- 表格 ---- */
.table-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--muted);
  font-size: 10px; padding: 9px 14px;
  border-bottom: 1px solid var(--hair-2);
  background: var(--bg); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--hair-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #FCFCFA; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.dev-name { display: flex; align-items: center; gap: 9px; }
.dev-ico {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px;
  display: grid; place-items: center;
  background: var(--travertine); color: var(--ink);
}
.dev-ico svg { width: 13px; height: 13px; }
.dev-meta { min-width: 0; }
.dev-meta b { font-weight: 600; font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-meta span { color: var(--subtle); font-size: 10px; font-family: var(--mono); }

.state { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.state i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.state.online { color: var(--green); }
.state.offline { color: var(--subtle); }
.state.error { color: var(--red); }

.battery { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; }
.battery .bar {
  width: 22px; height: 8px; border-radius: 2px;
  border: 1px solid var(--sand); padding: 1px;
}
.battery .bar i { display: block; height: 100%; border-radius: 1px; background: var(--green); }
.battery.low .bar i { background: var(--red); }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--r-sm);
  font-size: 11.5px; font-weight: 600;
  background: var(--pure); border: 1px solid var(--hair-3);
  color: var(--ink);
  transition: background .14s, border-color .14s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg); border-color: rgba(0, 0, 0, .16); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { width: 13px; height: 13px; }

.btn.primary {
  background: var(--orange); border-color: var(--orange); color: #fff;
  box-shadow: 0 2px 8px -2px rgba(255, 103, 0, .5);
}
.btn.primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }

.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #2A2A2E; border-color: #2A2A2E; }

.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--travertine); color: var(--ink); }

.btn.danger { color: var(--red); border-color: rgba(185, 28, 28, .25); }
.btn.danger:hover { background: var(--red-soft); }

.btn.sm { height: 24px; padding: 0 8px; font-size: 10.5px; border-radius: 6px; }
.btn.icon { width: 28px; padding: 0; }

/* ---- 表单 ---- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 10px; color: var(--subtle); line-height: 1.5; }

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  height: 32px; padding: 0 10px;
  border: 1px solid var(--hair-3); border-radius: var(--r-sm);
  background: var(--pure); outline: none;
  transition: border-color .14s, box-shadow .14s;
  width: 100%; font-size: 12px;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 64px; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 103, 0, .1);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235E5D59' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
}

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; border-radius: 999px;
  background: var(--sand); outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--pure); border: 2.5px solid var(--orange); cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.seg { display: inline-flex; background: var(--travertine); border-radius: 7px; padding: 2px; gap: 1px; }
.seg button {
  height: 24px; padding: 0 9px; border-radius: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.seg button.on { background: var(--pure); color: var(--ink); box-shadow: var(--shadow-2xs); }

.switch { display: inline-flex; align-items: center; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 32px; height: 18px; border-radius: 999px; background: var(--sand);
  position: relative; transition: background .18s;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.switch input:checked + .track { background: var(--orange); }
.switch input:checked + .track::after { transform: translateX(14px); }

/* ---- 节目单 ---- */
.prog-grid { display: grid; grid-template-columns: 288px 1fr; gap: 12px; align-items: start; }

.prog-list { display: flex; flex-direction: column; padding: 5px; gap: 1px; max-height: 640px; overflow: auto; }
.prog-item {
  display: flex; gap: 9px; align-items: center;
  padding: 8px 9px; border-radius: var(--r-md); cursor: pointer;
  transition: background .13s;
}
.prog-item:hover { background: var(--bg); }
.prog-item.on { background: rgba(255, 103, 0, .09); }
.prog-item.on .prog-name { color: var(--orange); }
.prog-thumb {
  width: 30px; height: 40px; border-radius: 5px; flex: 0 0 30px;
  background: var(--travertine);
  background-size: cover; background-position: center;
  border: 1px solid var(--hair);
}
.prog-info { min-width: 0; flex: 1; }
.prog-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-sub { font-size: 10px; color: var(--subtle); margin-top: 1px; font-family: var(--mono); }

.slide-list { display: flex; flex-direction: column; gap: 7px; }
.slide-row {
  display: grid; grid-template-columns: 22px 50px 1fr auto; gap: 11px; align-items: center;
  padding: 9px 11px; border: 1px solid var(--hair-2); border-radius: var(--r-md);
  background: var(--pure);
  transition: border-color .14s, box-shadow .14s;
}
.slide-row:hover { border-color: var(--hair-3); box-shadow: var(--shadow-2xs); }
.slide-row.off { opacity: .45; }
.slide-handle {
  color: var(--sand); font-family: var(--mono); font-size: 10px;
  text-align: center; user-select: none;
}
.slide-thumb {
  width: 50px; height: 66px; border-radius: 5px; object-fit: cover;
  background: var(--travertine); border: 1px solid var(--hair); display: block;
}
.slide-body { min-width: 0; }
.slide-title { font-size: 11.5px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-tags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.tag {
  font-size: 9.5px; padding: 1px 6px; border-radius: 999px;
  background: var(--travertine); color: var(--muted);
  font-family: var(--mono);
}
.tag.accent { background: rgba(255, 103, 0, .12); color: var(--orange); }
.slide-ops { display: flex; align-items: center; gap: 3px; }

/* ---- 海报工坊 ---- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 16px; align-items: start; }

.stage {
  background: #141416;
  border-radius: var(--r-xl);
  padding: 22px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border: 1px solid var(--hair);
}
.stage::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 28% 18%, rgba(255, 103, 0, .14), transparent 52%);
  pointer-events: none;
}
#studioCanvas {
  max-height: 64vh; max-width: 100%;
  border-radius: 4px;
  display: block;
}

/* 木纹机框：让预览看起来就是那台机器 */
.device-frame {
  position: relative;
  padding: 13px;
  border-radius: 16px;
  background:
    linear-gradient(155deg, #B98A5E 0%, #8C6239 42%, #6B4832 100%);
  box-shadow:
    0 40px 80px -34px rgba(0, 0, 0, .9),
    0 0 0 1px rgba(255, 255, 255, .1),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}
.device-frame::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 16px;
  background-image: repeating-linear-gradient(
    92deg,
    rgba(0, 0, 0, .055) 0px,
    rgba(0, 0, 0, .055) 1px,
    transparent 1px,
    transparent 5px
  );
  pointer-events: none;
}
.device-frame::after {
  content: '';
  position: absolute; left: 50%; bottom: 5px;
  width: 26px; height: 3px; border-radius: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .3);
}
.device-frame > canvas {
  position: relative;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 8px 24px -8px rgba(0, 0, 0, .8);
}
.stage-badge {
  position: absolute; top: 13px; left: 15px;
  font-size: 10px; color: rgba(255, 255, 255, .45);
  font-family: var(--mono);
  display: flex; align-items: center; gap: 5px;
}
.stage-badge i { width: 4px; height: 4px; border-radius: 50%; background: #34D399; }

.controls { display: flex; flex-direction: column; gap: 10px; }
.ctrl-card { padding: 12px 14px; }
.ctrl-card h5 {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--subtle); margin: 0 0 10px; font-weight: 700;
  font-family: var(--mono);
}
.ctrl-rows { display: flex; flex-direction: column; gap: 10px; }
.ctrl-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctrl-line > label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ctrl-val { font-family: var(--mono); font-size: 10px; color: var(--subtle); min-width: 34px; text-align: right; }

.swatches { display: flex; gap: 5px; }
.swatch {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid transparent; transition: transform .13s, border-color .13s;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: var(--ink); }

.poster-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; max-height: 200px; overflow: auto; }
.poster-pick img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover;
  border-radius: 4px; cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .13s, transform .13s;
}
.poster-pick img:hover { transform: translateY(-1px); }
.poster-pick img.on { border-color: var(--orange); }

/* ---- 抽屉 ---- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(29, 29, 31, .34);
  backdrop-filter: blur(2px);
  z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(500px, 94vw);
  background: var(--bg);
  border-left: 1px solid var(--hair);
  box-shadow: var(--shadow-lg);
  z-index: 91;
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head {
  padding: 13px 16px; border-bottom: 1px solid var(--hair-2);
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
}
.drawer-head h3 { margin: 0; font-size: 12.5px; font-weight: 700; }
.drawer-head .sub { font-size: 10px; color: rgba(255, 255, 255, .5); font-family: var(--mono); margin-top: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 14px 16px 26px; display: flex; flex-direction: column; gap: 10px; }
.drawer-foot {
  padding: 11px 16px; border-top: 1px solid var(--hair-2);
  background: var(--pure); display: flex; gap: 8px; justify-content: flex-end;
}

.kv { display: grid; grid-template-columns: 78px 1fr; gap: 7px 12px; font-size: 11.5px; }
.kv dt { color: var(--muted); font-size: 10.5px; }
.kv dd { margin: 0; word-break: break-all; font-family: var(--mono); font-size: 11px; }

/* ---- 空状态 ---- */
.empty {
  padding: 40px 20px; text-align: center; color: var(--subtle);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
.empty svg { width: 34px; height: 34px; color: var(--sand); }
.empty b { color: var(--ink); font-weight: 600; font-size: 12px; display: block; }
.empty p { margin: 0; font-size: 11px; max-width: 300px; line-height: 1.65; }

/* ---- 提示 ---- */
.toasts {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff;
  padding: 8px 15px; border-radius: 999px;
  font-size: 11.5px; font-family: var(--mono);
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s cubic-bezier(.2, .8, .2, 1);
  display: flex; align-items: center; gap: 7px;
  max-width: 82vw;
}
.toast.ok::before { content: '✓'; color: #6EE7B7; font-weight: 700; }
.toast.err { background: #7F1D1D; }
.toast.err::before { content: '!'; color: #FCA5A5; font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---- 登录 ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 440px; }
.auth-art {
  background: var(--ink); position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px; color: #fff;
}
.auth-art::before {
  content: ''; position: absolute; inset: -30%;
  background: radial-gradient(circle at 30% 26%, rgba(255, 103, 0, .26), transparent 46%),
              radial-gradient(circle at 78% 72%, rgba(232, 216, 192, .1), transparent 42%);
}
.auth-art > * { position: relative; }
.auth-art .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13px; }
.auth-art h2 {
  font-family: var(--serif);
  font-size: 38px; line-height: 1.28; font-weight: 600; letter-spacing: -.5px;
  margin: 0; max-width: 13em;
}
.auth-art p { color: rgba(255, 255, 255, .5); font-size: 12.5px; line-height: 1.75; max-width: 30em; margin: 14px 0 0; }
.auth-art .foot { color: rgba(255, 255, 255, .28); font-size: 10.5px; font-family: var(--mono); }

.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 40px; background: var(--pure); }
.auth-form h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; letter-spacing: -.3px; font-weight: 600; }
.auth-form .lead { color: var(--muted); font-size: 11.5px; margin: 0 0 22px; }
.auth-form form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .btn { height: 38px; font-size: 12.5px; }
.auth-form .swap { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 14px; }
.auth-form .swap button { color: var(--orange); font-weight: 700; }
.auth-err {
  background: var(--red-soft); color: var(--red);
  padding: 8px 11px; border-radius: 7px; font-size: 11px;
  margin-bottom: 12px;
}

/* ---- 响应 ---- */
@media (max-width: 1180px) {
  .grid-2, .grid-3, .studio, .prog-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 720px) {
  .view { padding: 12px 10px 40px; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip > div:nth-child(2) { border-right: 0; }
  .strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--hair-2); }
  .brand-text { max-width: 130px; }
  .tag-live { display: none; }
}
