/* 水门客户端 · 下发管理后台 */

:root {
  --bg: #060E16;
  --card: rgba(15, 30, 44, .66);
  --card-2: rgba(10, 22, 33, .72);
  --line: rgba(126, 196, 232, .11);
  --line-2: rgba(126, 196, 232, .19);
  --text: #E6F0F7;
  --muted: #9CB3C5;
  --dim: #5D7587;
  --sea: #3FB4E8;
  --sea-2: #7FD6F7;
  --sea-soft: rgba(63, 180, 232, .12);
  --ok: #3FD69A;
  --warn: #F0B44C;
  --bad: #FF7B7B;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --r: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font: 13.5px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background:
    radial-gradient(920px 520px at 10% -10%, rgba(38, 124, 176, .22), transparent 62%),
    radial-gradient(780px 440px at 94% 2%, rgba(30, 92, 145, .16), transparent 60%),
    radial-gradient(700px 520px at 50% 118%, rgba(20, 84, 126, .13), transparent 66%),
    linear-gradient(180deg, #071119 0%, #050C14 55%, #040A10 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image:
    linear-gradient(rgba(126, 196, 232, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 196, 232, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(closest-side at 50% 30%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(closest-side at 50% 30%, #000, transparent 78%);
  z-index: 0;
}

#app { position: relative; z-index: 1; }

img { display: block; }

::selection { background: rgba(63, 180, 232, .3); color: #fff; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(126, 196, 232, .16);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(126, 196, 232, .3); background-clip: content-box; }

/* ---------------------------------------------------------------- 首帧占位 */

.boot {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.boot-mark img {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .9);
  animation: bootPulse 1.6s ease-in-out infinite;
}
.boot-bar {
  width: 92px;
  height: 3px;
  border-radius: 99px;
  background: rgba(126, 196, 232, .12);
  overflow: hidden;
}
.boot-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--sea), transparent);
  animation: bootSlide 1.1s ease-in-out infinite;
}
@keyframes bootSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }
@keyframes bootPulse { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.04); opacity: 1; } }

/* ---------------------------------------------------------------- 通用 */

.grow { flex: 1; }
.mono { font-family: var(--mono); }

.ico { display: block; flex: none; }

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--dim);
  display: inline-block; flex: none;
  transition: background .2s, box-shadow .2s;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 9px rgba(63, 214, 154, .65); }
.dot.warn { background: var(--warn); box-shadow: 0 0 9px rgba(240, 180, 76, .6); }
.dot.bad { background: var(--bad); box-shadow: 0 0 9px rgba(255, 123, 123, .6); }

.spin {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .28);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
  display: inline-block;
  margin-right: 7px;
  vertical-align: -2px;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

button { font-family: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- 认证页 */

.auth {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}
.auth::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 620px; height: 620px;
  transform: translate(-50%, -58%);
  background: radial-gradient(circle, rgba(46, 144, 196, .18), transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.auth-card { z-index: 1; }

.auth-card {
  position: relative;
  width: 100%;
  max-width: 372px;
  padding: 34px 30px 28px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 36, 51, .92), rgba(8, 17, 26, .96));
  border: 1px solid rgba(126, 196, 232, .16);
  box-shadow:
    0 44px 100px -44px rgba(0, 0, 0, 1),
    0 0 90px -46px rgba(63, 180, 232, .55),
    inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: rise .45s cubic-bezier(.22, .8, .3, 1) both;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 214, 247, .45), transparent);
}

.auth-mark {
  width: 64px; height: 64px;
  border-radius: 18px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .07) inset;
}
.auth-mark img { width: 100%; height: 100%; }

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: .4px;
}
.auth-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--dim);
  letter-spacing: .2px;
}
.auth-tip {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 14px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ok);
  background: rgba(63, 214, 154, .08);
  border: 1px solid rgba(63, 214, 154, .18);
}
.auth-err {
  display: flex; align-items: center; gap: 7px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--bad);
}
.auth-note {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 20px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--dim);
}
.auth-note .ico { margin-top: 2px; }

.fl {
  display: block;
  margin: 14px 0 7px;
  font-size: 11.5px;
  letter-spacing: .4px;
  color: var(--muted);
}
.fl:first-of-type { margin-top: 0; }

.inp {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 11px;
  background: rgba(4, 14, 22, .62);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.inp:focus {
  border-color: rgba(63, 180, 232, .55);
  box-shadow: 0 0 0 3px rgba(63, 180, 232, .11);
}
.inp::placeholder { color: #4B6376; }

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .3px;
  background: linear-gradient(180deg, #45BCEE, #2A8FC4);
  box-shadow: 0 10px 24px -10px rgba(47, 157, 209, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 12px 28px -10px rgba(47, 157, 209, 1); }
.primary:active:not(:disabled) { transform: scale(.975); }
.primary:disabled {
  opacity: .38;
  cursor: not-allowed;
  box-shadow: none;
  filter: saturate(.4);
}
.primary.wide { width: 100%; height: 46px; margin-top: 22px; font-size: 14.5px; }

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  background: rgba(126, 196, 232, .05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  transition: .16s;
}
.ghost:hover { background: rgba(126, 196, 232, .11); color: var(--text); border-color: var(--line-2); }
.ghost:active { transform: scale(.97); }
.ghost:disabled { opacity: .45; cursor: not-allowed; }

.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  background: rgba(126, 196, 232, .07);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  transition: .16s;
}
.mini:hover { background: rgba(126, 196, 232, .15); color: var(--text); }

.ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  flex: none;
  border-radius: 10px;
  background: rgba(126, 196, 232, .06);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: .16s;
}
.ibtn:active { transform: scale(.94); background: rgba(126, 196, 232, .14); color: var(--text); }

/* ---------------------------------------------------------------- 顶栏 */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 22px;
  background: rgba(7, 16, 25, .8);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .08) inset;
  flex: none;
}
.brand-txt b {
  display: block;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: .3px;
  line-height: 1.3;
}
.brand-txt span {
  display: block;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: .7px;
  margin-top: 1px;
}

.pills { display: flex; align-items: center; gap: 7px; margin-left: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 99px;
  background: rgba(126, 196, 232, .055);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.pill.mono { font-family: var(--mono); letter-spacing: .2px; }

.vm-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .3px;
  margin-left: 3px;
  padding-left: 11px;
  border-left: 1px solid var(--line-2);
  max-width: 36vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.only-m { display: none; }

/* ---------------------------------------------------------------- 布局 */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 22px 96px;
}

.grid {
  display: grid;
  grid-template-columns: 1.16fr .84fr;
  gap: 18px;
  align-items: stretch;
}
.grid-2 { margin-top: 18px; }

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(16, 33, 47, .72), rgba(10, 21, 32, .74));
  border: 1px solid var(--line);
  box-shadow:
    0 26px 60px -38px rgba(0, 0, 0, .95),
    inset 0 1px 0 rgba(255, 255, 255, .045);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  position: relative;
  animation: rise .4s cubic-bezier(.22, .8, .3, 1) both;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 214, 247, .22), transparent);
  pointer-events: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.pane-ch, .pane-nt { min-height: 452px; max-height: 60vh; }
.pane-feed, .pane-hist { min-height: 360px; }

.ph {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.ph h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: .5px;
  color: #D6E7F2;
}
.ph h2 .ico { color: var(--sea); }
.ph .count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.ph .count b { color: var(--muted); font-weight: 600; }
.ph .count.over, .ph .count.over b { color: var(--bad); }

.pb {
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
  min-height: 0;
  padding: 14px 18px 16px;
  overflow: auto;
}

/* ---------------------------------------------------------------- 频道添加 */

.adder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 13px;
  border-radius: 12px;
  background: rgba(4, 14, 22, .62);
  border: 1px solid var(--line-2);
  transition: border-color .18s, box-shadow .18s;
  flex: none;
}
.adder:focus-within {
  border-color: rgba(63, 180, 232, .55);
  box-shadow: 0 0 0 3px rgba(63, 180, 232, .1);
}
.adder-at {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--sea);
  opacity: .85;
  flex: none;
}
.adder input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--mono);
  letter-spacing: .2px;
}
.adder input::placeholder { font-family: inherit; color: #405868; letter-spacing: 0; }

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  flex: none;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #45BCEE, #2A8FC4);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: .16s;
}
.add-btn:disabled {
  background: rgba(126, 196, 232, .08);
  color: #56707F;
  box-shadow: none;
  cursor: not-allowed;
}
.add-btn:not(:disabled):active { transform: scale(.96); }

.preview-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding: 0 2px;
  animation: fadeIn .16s ease;
}
.preview-line code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sea-2);
  background: rgba(63, 180, 232, .1);
  border: 1px solid rgba(63, 180, 232, .18);
  border-radius: 5px;
  padding: 1px 6px;
}
.preview-line .dup { color: var(--warn); }
.preview-line.bad, .preview-line .bad { color: var(--bad); }
.preview-line .ico { color: var(--sea); }
.preview-line.bad .ico { color: var(--bad); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.chips {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: none;
  max-height: 46vh;
  min-height: 0;
  overflow: auto;
  padding: 5px;
  border-radius: 13px;
  background: rgba(3, 11, 18, .3);
}

.chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 8px 8px 9px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(63, 180, 232, .085), rgba(63, 180, 232, .04));
  border: 1px solid rgba(63, 180, 232, .15);
  animation: pop .19s cubic-bezier(.3, 1.4, .5, 1);
  transition: border-color .16s, background .16s;
}
.chip:hover { border-color: rgba(63, 180, 232, .28); background: rgba(63, 180, 232, .1); }

@keyframes pop {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.chip-idx {
  width: 21px;
  height: 21px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(63, 180, 232, .13);
  color: var(--sea-2);
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chip-name {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: #CFE7F6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-del {
  width: 25px; height: 25px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  opacity: 0;
  transition: .16s;
}
.chip:hover .chip-del { opacity: 1; }
.chip-del:hover { background: rgba(255, 123, 123, .13); color: var(--bad); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 30px 18px;
  border-radius: 13px;
  border: 1px dashed rgba(126, 196, 232, .17);
  background: rgba(4, 14, 22, .28);
  text-align: center;
  flex: 1;
  min-height: 132px;
}
.empty-ico {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(126, 196, 232, .07);
  color: rgba(126, 196, 232, .5);
  margin-bottom: 5px;
}
.empty b { font-size: 13px; font-weight: 600; color: var(--muted); }
.empty span { font-size: 11.5px; color: var(--dim); }

.samples {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: none;
}
.samples-t {
  font-size: 10.5px;
  letter-spacing: .6px;
  color: var(--dim);
}
.sample {
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(126, 196, 232, .04);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  transition: .16s;
}
.sample:hover { background: rgba(63, 180, 232, .13); border-color: rgba(63, 180, 232, .3); color: var(--sea-2); }
.sample:active { transform: scale(.96); }

.hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.85;
  color: #6C8496;
}
.hint b { color: var(--muted); font-weight: 600; }
.hint code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(126, 196, 232, .09);
  color: var(--sea-2);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 11.5px;
  transition: color .16s;
}
.text-btn:hover { color: var(--sea-2); }

.batch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px;
  border-radius: 12px;
  background: rgba(4, 14, 22, .5);
  border: 1px solid var(--line);
  animation: fadeIn .18s ease;
}
.batch textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(2, 9, 15, .6);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  outline: none;
}
.batch .ghost { align-self: flex-start; }

/* ---------------------------------------------------------------- 公告 */

.nt-area {
  width: 100%;
  flex: 1;
  min-height: 176px;
  resize: none;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(4, 14, 22, .55);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.78;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.nt-area:focus {
  border-color: rgba(63, 180, 232, .5);
  box-shadow: 0 0 0 3px rgba(63, 180, 232, .09);
}
.nt-area::placeholder { color: #3C5261; }

/* 每次启动都弹 —— 开关 */

.sw {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex: none;
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 11, 18, .32);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.sw:hover { border-color: rgba(63, 180, 232, .38); background: rgba(3, 11, 18, .48); }
.sw:focus-visible { outline: none; border-color: rgba(63, 180, 232, .6); }
.sw-txt { flex: 1; min-width: 0; }
.sw-txt b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--muted);
  transition: color .18s;
}
.sw-txt i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.5;
  color: var(--dim);
}
.sw-knob {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 11px;
  background: rgba(120, 152, 172, .26);
  transition: background .2s;
}
.sw-knob i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #90A8B8;
  transition: left .2s cubic-bezier(.3, .7, .4, 1), background .2s;
}
.sw.on {
  border-color: rgba(63, 180, 232, .45);
  background: rgba(37, 150, 209, .1);
}
.sw.on .sw-txt b { color: #CDE7F5; }
.sw.on .sw-knob { background: rgba(47, 157, 209, .9); }
.sw.on .sw-knob i { left: 19px; background: #fff; }

.pv {
  flex: none;
  padding: 13px 15px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(23, 44, 62, .95), rgba(14, 30, 44, .95));
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -28px #000, inset 0 1px 0 rgba(255, 255, 255, .05);
}
.pv-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pv-top::before {
  content: "";
  width: 18px; height: 18px;
  border-radius: 6px;
  background: rgba(63, 180, 232, .22);
  box-shadow: inset 0 0 0 1px rgba(127, 214, 247, .3);
}
.pv-app { font-size: 11.5px; font-weight: 620; color: #D6E7F2; }
.pv-now { margin-left: auto; font-size: 10.5px; color: var(--dim); }
.pv-body {
  font-size: 12.5px;
  line-height: 1.75;
  color: #B9CEDD;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 128px;
  overflow: auto;
}
.pv-btn {
  margin-top: 11px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--sea-2);
  background: rgba(63, 180, 232, .1);
  border: 1px solid rgba(63, 180, 232, .18);
}

/* ---------------------------------------------------------------- 接入 */

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(4, 14, 22, .55);
  border: 1px solid var(--line);
  align-self: flex-start;
  flex: none;
}
.tab {
  height: 28px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--dim);
  font-size: 12px;
  transition: .16s;
}
.tab:hover { color: var(--muted); }
.tab.on {
  background: rgba(63, 180, 232, .16);
  color: var(--sea-2);
  box-shadow: inset 0 0 0 1px rgba(63, 180, 232, .2);
}

.field {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 4px 4px 11px;
  border-radius: 9px;
  background: rgba(2, 9, 15, .55);
  border: 1px solid var(--line);
  flex: none;
}
.field .url {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--sea-2);
  word-break: break-all;
  padding: 6px 0;
}

.test-btn { align-self: flex-start; margin-top: 3px; }

.tests {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(4, 14, 22, .45);
  border: 1px solid var(--line);
  animation: fadeIn .2s ease;
}
.test {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.test .ico { margin-top: 2px; }
.test.ok .ico { color: var(--ok); }
.test.warn { color: #E8C888; }
.test.warn .ico { color: var(--warn); }
.test.error { color: #FFA3A3; }
.test.error .ico { color: var(--bad); }

.code {
  position: relative;
  border-radius: 12px;
  background: rgba(2, 9, 15, .72);
  border: 1px solid var(--line);
  overflow: hidden;
}
.code pre {
  margin: 0;
  padding: 14px 15px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.85;
  color: #9FD4EC;
  white-space: pre-wrap;
  word-break: break-all;
}
.code-copy { position: absolute; top: 8px; right: 8px; }

.help { display: flex; flex-direction: column; gap: 11px; }
.help-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 11px;
  border-left: 2px solid rgba(63, 180, 232, .22);
}
.help-item b { font-size: 12.5px; font-weight: 600; color: #CFE3F0; }
.help-item span { font-size: 11.5px; line-height: 1.7; color: var(--dim); }

/* ---------------------------------------------------------------- 历史 */

.pb-hist { padding: 8px 12px 12px; }

.hist { display: flex; flex-direction: column; gap: 2px; overflow: auto; }

.hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 9px;
  transition: background .14s;
}
.hist-row:hover { background: rgba(126, 196, 232, .05); }

.ver {
  width: 38px;
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--sea-2);
}
.hist-time {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.hist-meta {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-cur {
  flex: none;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  color: var(--ok);
  background: rgba(63, 214, 154, .08);
  border: 1px solid rgba(63, 214, 154, .28);
}
.hist-empty {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 10px;
  font-size: 11.5px;
  color: var(--dim);
}
.rollback { width: auto; padding: 0 9px; height: 24px; gap: 4px; font-size: 11px; }
.rollback:hover { color: var(--sea-2); border-color: rgba(63, 180, 232, .3); }

/* ---------------------------------------------------------------- 发布条 */

.bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  background: rgba(6, 14, 22, .88);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--line);
  transition: all .22s ease;
}

.bar-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  min-width: 0;
}
.bar-state em {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
  margin-left: 3px;
}

/* ---------------------------------------------------------------- 抽屉 */

.d-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 8, 13, .62);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s;
}
.d-mask.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 65;
  width: 82%;
  max-width: 306px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0F2130, #081420);
  border-right: 1px solid rgba(126, 196, 232, .16);
  box-shadow: 34px 0 80px -40px #000;
  transform: translateX(-103%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.drawer.show { transform: translateX(0); }

.d-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: calc(22px + env(safe-area-inset-top)) 20px 18px;
}
.d-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  flex: none;
  box-shadow: 0 8px 20px -8px #000, 0 0 0 1px rgba(255, 255, 255, .07) inset;
}
.d-txt b { display: block; font-size: 15px; font-weight: 620; letter-spacing: .3px; }
.d-txt span { display: block; font-size: 11px; color: var(--dim); margin-top: 1px; }

.d-nav {
  flex: 1;
  overflow: auto;
  padding: 6px 0;
  border-top: 1px solid rgba(126, 196, 232, .08);
}

.d-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 50px;
  padding: 0 20px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  transition: background .15s, color .15s;
}
.d-item:active { background: rgba(126, 196, 232, .07); }
.d-item.active { color: var(--text); background: rgba(63, 180, 232, .1); }
.d-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 11px; bottom: 11px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sea-2);
  box-shadow: 0 0 12px rgba(127, 214, 247, .6);
}
.d-ico { display: flex; color: var(--dim); flex: none; }
.d-item.active .d-ico { color: var(--sea-2); }
.d-name { flex: 1; }
.d-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.d-item.active .d-val { color: var(--sea-2); }

.d-foot { padding: 10px 16px 4px; border-top: 1px solid rgba(126, 196, 232, .08); }
.d-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 42px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(126, 196, 232, .05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  transition: .16s;
}
.d-sub:active { background: rgba(126, 196, 232, .13); color: var(--text); }
.d-sub.danger { color: #FF9B9B; border-color: rgba(255, 123, 123, .2); }
.d-tip {
  margin: 4px 0 2px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--dim);
  text-align: center;
}

/* ---------------------------------------------------------------- 弹窗 */

.mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 8, 13, .68);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.mask.show { opacity: 1; pointer-events: auto; }

.modal {
  width: 100%;
  max-width: 344px;
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #122636, #0B1926);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -40px #000, inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: translateY(8px) scale(.98);
  transition: transform .24s cubic-bezier(.22, .8, .3, 1);
}
.mask.show .modal { transform: none; }
.modal h3 { margin: 0 0 6px; font-size: 16px; font-weight: 620; }
.m-row { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; }

/* ---------------------------------------------------------------- 提示 */

.toasts {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 28px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 11px;
  font-size: 12.5px;
  color: var(--text);
  background: rgba(14, 31, 45, .96);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -18px #000;
  backdrop-filter: blur(14px);
  animation: toastIn .26s cubic-bezier(.22, .8, .3, 1);
  max-width: 100%;
}
.toast .ico { color: var(--ok); }
.toast.warn .ico { color: var(--warn); }
.toast.bad .ico { color: var(--bad); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- 响应式 */


/* ------------------------------------------------------------ 推荐频道（独立面板） */

.pane-rec {
  margin-top: 18px;
  min-height: 336px;
}

.rec-wrap {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
  align-items: start;
}

.rec-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.rec-area { min-height: 190px; }

.rec-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rec-tip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--dim);
}

.rec-tip svg { color: var(--sea-2); flex: none; }
.rec-foot .text-btn { margin-left: auto; }

.rec-side { min-width: 0; }

.rec-side-h {
  margin-bottom: 8px;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--dim);
}

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 258px;
  overflow: auto;
  padding-right: 2px;
}

.rec-row {
  display: flex;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}

.rec-idx {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--sea-soft);
  color: #9FC6DA;
  font: 11px/20px var(--mono);
  text-align: center;
}

.rec-main { min-width: 0; }

.rec-main b {
  display: block;
  font: 12.5px/1.45 var(--mono);
  color: var(--text);
  word-break: break-all;
}

.rec-main span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  word-break: break-word;
}

.rec-main .rec-dash { color: var(--dim); }

.rec-empty {
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--dim);
  text-align: center;
}

@media (max-width: 900px) {
  .only-m { display: inline-flex; }
  .only-d { display: none !important; }

  .top {
    height: auto;
    padding: calc(9px + env(safe-area-inset-top)) 13px 9px;
    gap: 9px;
  }
  .brand-logo { width: 30px; height: 30px; border-radius: 9px; }
  .brand-txt b { font-size: 13.5px; }
  .brand-txt span { display: none; }
  .vm-title { margin-left: 2px; font-size: 13.5px; }

  main {
    padding: 12px 12px calc(88px + env(safe-area-inset-bottom));
  }

  .grid {
    display: block;
    margin-top: 0;
  }
  .grid-2 { margin-top: 0; }

  .pane { display: none; }
  .pane.active { display: flex; }
  .panel {
    border-radius: 15px;
    min-height: 0;
    max-height: none;
    animation: none;
  }
  .pane.active.pane-ch .pb,
  .pane.active.pane-nt .pb { overflow: visible; }

  .ph { padding: 12px 14px; }
  .ph h2 { font-size: 12.5px; }
  .pb { padding: 12px 14px 14px; gap: 10px; }

  .adder { padding: 4px 4px 4px 12px; }
  .adder input { height: 38px; font-size: 14.5px; }
  .add-btn { height: 38px; padding: 0 14px; }

  .chips { max-height: none; flex: none; }
  .chip { padding: 10px 9px; }
  .chip-name { font-size: 13.5px; }
  .chip-del { opacity: 1; }

  .nt-area { min-height: 40vh; font-size: 15px; padding: 12px; }
  .sw { margin-top: 8px; padding: 10px 12px; }
  .sw-txt b { font-size: 12px; }
  .sw-txt i { font-size: 10.5px; }
  .pv-body { max-height: 140px; }

  .bar {
    padding: 9px 13px calc(9px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .bar-state { font-size: 12px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar-state em { display: none; }
  .bar .primary { height: 44px; padding: 0 28px; font-size: 14px; border-radius: 12px; }

  /* 打字时缩成右下角悬浮胶囊，不挡键盘 */
  .bar.kb {
    left: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    padding: 0;
    gap: 0;
    border: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }
  .bar.kb .bar-state { display: none; }
  .bar.kb .primary {
    height: 48px;
    padding: 0 22px;
    border-radius: 24px;
    box-shadow: 0 14px 30px -8px rgba(47, 157, 209, .85);
  }
  /* 没有可发布内容时不占地方，免得挡着输入 */
  .bar.kb .primary:disabled { opacity: 0; visibility: hidden; }

  .modal { max-width: 340px; }
  .toasts { bottom: calc(78px + env(safe-area-inset-bottom)); }

  .auth-card { padding: 28px 22px 24px; border-radius: 20px; }
  .auth-mark { width: 58px; height: 58px; border-radius: 16px; }
  .auth-card h1 { font-size: 19px; }
}

@media (max-width: 380px) {
  .samples .sample:last-child { display: none; }
  .hist-time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ 推荐频道 */

.sub-block {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.sub-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sub-head b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.sub-head b svg { color: var(--sea-2); }

.sub-head .count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.sub-head .count b { font-size: 12px; color: var(--muted); }
.sub-head .count.over b { color: var(--bad); }

.rec-area { min-height: 88px; }

.rec-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}

.rec-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sea-soft);
  color: #9FC6DA;
  font: 11.5px/1.5 var(--mono);
  white-space: nowrap;
}

.rec-more {
  font-size: 11.5px;
  color: var(--dim);
}

@media (max-width: 900px) {
  .pane-rec { margin-top: 0; }
  .rec-wrap { grid-template-columns: 1fr; gap: 12px; }
  .rec-list { max-height: none; }
  .rec-area { min-height: 150px; font-size: 14.5px; }
  .pane.active.pane-rec .pb { overflow: visible; }
  .rec-row { padding: 9px 10px; }
}
