/* ============================================================
   YG.hub — 中转站 / 准入 / 控制台
   ============================================================ */

:root {
  --bg: #080b12;
  --bg2: #0c1120;
  --panel: rgba(255, 255, 255, 0.045);
  --panel2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.10);
  --line2: rgba(255, 255, 255, 0.18);
  --text: #e9eef8;
  --dim: #98a6bd;
  --mute: #6a7890;
  --accent: #6c8cff;
  --accent2: #57e0c0;
  --accent3: #b47cff;
  --danger: #ff6b81;
  --ok: #57e0c0;
  --radius: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

.hidden { display: none !important; }

/* ---------- 背景 ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.aurora i:nth-child(1) {
  width: 46vw; height: 46vw; left: -14vw; top: -16vw;
  background: radial-gradient(circle, #3355ff, transparent 68%);
  animation: drift1 24s ease-in-out infinite;
}
.aurora i:nth-child(2) {
  width: 38vw; height: 38vw; right: -12vw; top: 4vh;
  background: radial-gradient(circle, #12b391, transparent 66%);
  animation: drift2 30s ease-in-out infinite;
}
.aurora i:nth-child(3) {
  width: 40vw; height: 40vw; left: 30vw; bottom: -22vw;
  background: radial-gradient(circle, #7b3fd4, transparent 68%);
  animation: drift3 34s ease-in-out infinite;
}
@keyframes drift1 { 50% { transform: translate3d(5vw, 4vh, 0) scale(1.08); } }
@keyframes drift2 { 50% { transform: translate3d(-5vw, 6vh, 0) scale(.94); } }
@keyframes drift3 { 50% { transform: translate3d(3vw, -6vh, 0) scale(1.1); } }

/* ---------- 启动 ---------- */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--mute);
  z-index: 100;
  background: var(--bg);
  transition: opacity .3s var(--ease);
}
.boot.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.spin {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line2);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 通用视图 ---------- */
.view {
  min-height: 100vh;
  animation: fade .35s var(--ease);
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 门禁 ---------- */
#viewGate, #viewBlocked {
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.gate {
  width: min(430px, 100%);
  padding: 38px 32px 30px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(520px circle at 50% -10%, rgba(108, 140, 255, .18), transparent 62%),
    rgba(13, 18, 30, .82);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px);
}
.gate-logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(105deg, var(--accent), var(--accent2) 55%, var(--accent3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gate-logo span { font-weight: 500; }
.gate-sub {
  margin-top: 6px;
  margin-bottom: 26px;
  color: var(--dim);
  font-size: 14px;
}

.fld { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.fld > span { font-size: 12.5px; color: var(--mute); letter-spacing: .06em; font-weight: 600; }
.fld input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.fld input::placeholder { color: var(--mute); }
.fld input:focus {
  border-color: var(--accent);
  background: rgba(108, 140, 255, .07);
  box-shadow: 0 0 0 3.5px rgba(108, 140, 255, .18);
}

/* 密码行：名字填 12 时展开 */
.pwd {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  transform: translateY(-6px);
  transition: max-height .35s var(--ease), opacity .3s var(--ease),
              margin-bottom .35s var(--ease), transform .35s var(--ease);
}
.pwd.show {
  max-height: 120px;
  opacity: 1;
  margin-bottom: 16px;
  transform: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s var(--ease),
              border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #06101f;
  box-shadow: 0 14px 34px rgba(108, 140, 255, .32);
}
.btn.primary:hover { box-shadow: 0 18px 44px rgba(108, 140, 255, .45); transform: translateY(-1px); }
.btn.ghost {
  border-color: var(--line);
  color: var(--dim);
  font-weight: 500;
}
.btn.ghost:hover { color: var(--text); border-color: var(--line2); background: var(--panel); }
.btn.danger { border-color: rgba(255, 107, 129, .35); color: var(--danger); font-weight: 500; }
.btn.danger:hover { background: rgba(255, 107, 129, .12); }
.btn.wide { width: 100%; margin-top: 6px; padding: 12px; }
.btn[disabled] { opacity: .55; cursor: default; }

.msg {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--danger);
  text-align: center;
}
.gate-tip {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--mute);
}

/* 封禁 */
.blocked { text-align: center; }
.blocked-icon {
  font-size: 44px;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 24px rgba(255, 107, 129, .4));
}
.blocked h1 { font-size: 22px; margin-bottom: 10px; }
.blocked-reason { color: var(--dim); font-size: 14px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(16px, 3vw, 34px);
  background: rgba(8, 11, 18, .78);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(105deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.logo span { font-weight: 500; }
.spacer { flex: 1; }

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 380px;
  padding: 0 12px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--mute);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 140, 255, .15); }
.searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.searchbox input::placeholder { color: var(--mute); }

.who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--dim); white-space: nowrap; }
.who-name { color: var(--text); font-weight: 600; }
.tag {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #06101f;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
}

/* ---------- 内容区 ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px) clamp(16px, 3vw, 34px) 72px;
}

.hero-line { margin-bottom: 30px; }
.hero-line h1 {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero-line p { color: var(--mute); font-size: 14px; margin-top: 6px; }

.cats { display: flex; flex-direction: column; gap: 34px; }

.cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cat-head h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}
.cat-emoji { font-size: 17px; }
.cat-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.cat-count { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.lnk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: transform .22s var(--ease), border-color .22s var(--ease),
              background-color .22s var(--ease), box-shadow .25s var(--ease);
}
.lnk:hover {
  transform: translateY(-3px);
  border-color: var(--line2);
  background: var(--panel2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}
.ico {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 800;
  color: #06101f;
  background: linear-gradient(135deg,
    hsl(var(--h, 225) 90% 68%),
    hsl(calc(var(--h, 225) + 42) 85% 62%));
  box-shadow: 0 8px 20px hsla(var(--h, 225), 90%, 60%, .28);
}
.lnk-meta { min-width: 0; flex: 1; }
.lnk-name {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lnk-host {
  display: block;
  font-size: 12px;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lnk .go {
  color: var(--mute);
  font-size: 15px;
  transition: transform .22s var(--ease), color .22s var(--ease);
}
.lnk:hover .go { color: var(--accent2); transform: translate(2px, -2px); }

.empty { margin-top: 30px; text-align: center; color: var(--mute); }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 22px 16px 34px;
  color: var(--mute);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}
.dotsep { opacity: .5; }

/* ---------- 控制台 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 38px;
}
.stat {
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.stat b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--dim));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat span { font-size: 12.5px; color: var(--mute); letter-spacing: .04em; }
.stat.alert b { background: linear-gradient(135deg, var(--danger), #ff9db0); -webkit-background-clip: text; background-clip: text; }

.panel-head { margin: 34px 0 12px; }
.panel-head h2 { font-size: 16px; font-weight: 700; }
.panel-head p { font-size: 12.5px; color: var(--mute); margin-top: 4px; }

.tablewrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
.tbl th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--mute);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(255, 255, 255, .02);
}
.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  color: var(--dim);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .03); }
.tbl .t-name { color: var(--text); font-weight: 600; }
.tbl .mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: var(--mute);
}
.tbl .ua {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tbl .none { color: var(--mute); text-align: center; padding: 26px; }
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line2);
  color: var(--dim);
}
.badge.admin { color: #06101f; background: var(--accent2); border-color: transparent; }
.badge.blocked { color: var(--danger); border-color: rgba(255, 107, 129, .4); }
.badge.online { color: var(--ok); border-color: rgba(87, 224, 192, .4); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(16, 22, 36, .96);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255, 107, 129, .5); color: #ffc2cb; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .searchbox { order: 3; flex-basis: 100%; max-width: none; }
  .who { margin-left: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .gate { padding: 30px 22px 24px; }
}
@media (max-width: 480px) {
  .lnk { padding: 12px; }
  .ico { width: 34px; height: 34px; font-size: 14px; }
  .hero-line h1 { font-size: 22px; }
}

/* ============================================================
   下载卡 / 聊天框 / 受控设备
   ============================================================ */

/* ---------- 下载卡 ---------- */
.download { margin-top: 40px; }
.dl-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px circle at 0% 0%, rgba(108, 140, 255, .16), transparent 60%),
    var(--panel);
}
.dl-icon {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  font-size: 20px;
  color: #06101f;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
}
.dl-body h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.dl-body p { font-size: 13.5px; color: var(--dim); max-width: 56ch; }
.dl-body b { color: var(--text); }
.dl-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.dl-note { font-size: 12.5px; color: var(--mute); }

/* ---------- 聊天框 ---------- */
.chatbox {
  position: fixed;
  right: 20px;
  bottom: 18px;
  width: min(370px, calc(100vw - 32px));
  z-index: 90;
  border-radius: 18px;
  border: 1px solid var(--line2);
  background: rgba(12, 17, 28, .94);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .6);
  overflow: hidden;
  transition: transform .32s var(--ease), opacity .28s var(--ease);
}
.chatbox.collapsed { transform: translateY(calc(100% - 48px)); }
.chatbox.collapsed .chat-body { opacity: 0; pointer-events: none; }

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 8px 0 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  user-select: none;
}
.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.chat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 0 0 rgba(87, 224, 192, .5);
  animation: pulseDot 2.4s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(87, 224, 192, .5); }
  70% { box-shadow: 0 0 0 8px rgba(87, 224, 192, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 224, 192, 0); }
}
.chat-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  color: #06101f;
  background: var(--accent3);
}
.chat-quota {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.chat-min {
  width: 30px; height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: transform .3s var(--ease), background-color .2s var(--ease);
}
.chat-min:hover { background: var(--panel2); color: var(--text); }
.chatbox.collapsed .chat-min { transform: rotate(180deg); }

.chat-body { display: flex; flex-direction: column; transition: opacity .2s var(--ease); }

.quota-line { height: 2px; background: rgba(255, 255, 255, .07); }
.quota-line i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width .4s var(--ease);
}
.quota-line i.full { background: linear-gradient(90deg, #ff8a6b, var(--danger)); }

.chat-log {
  height: 300px;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
}
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.msg-row { display: flex; }
.msg-row.me { justify-content: flex-end; }
.bubble {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-row.ai .bubble {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  color: var(--text);
}
.msg-row.me .bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #06101f;
  border-bottom-right-radius: 5px;
  font-weight: 500;
}
.msg-row.err .bubble {
  background: rgba(255, 107, 129, .13);
  border-color: rgba(255, 107, 129, .35);
  color: #ffc2cb;
}
.bubble.typing { display: flex; gap: 4px; padding: 12px 14px; }
.bubble.typing i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--dim);
  animation: blink 1.2s infinite;
}
.bubble.typing i:nth-child(2) { animation-delay: .18s; }
.bubble.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}
.chat-form textarea {
  flex: 1;
  min-height: 38px;
  max-height: 96px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  resize: none;
  outline: none;
  transition: border-color .2s var(--ease);
}
.chat-form textarea:focus { border-color: var(--accent); }
.chat-form textarea::placeholder { color: var(--mute); }
.chat-form .btn { padding: 9px 16px; font-size: 13.5px; }

/* ---------- 受控设备 / 回传 ---------- */
.tbl .ops { white-space: nowrap; }
.tbl .ops .btn { padding: 4px 9px; font-size: 12px; margin-right: 3px; }

.events { display: grid; gap: 10px; }
.ev {
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
}
.ev-time { color: var(--mute); font-size: 11.5px; margin-right: 10px; font-variant-numeric: tabular-nums; }
.ev-name { color: var(--accent2); font-weight: 650; font-size: 12.5px; }
.kv { margin-top: 8px; }
.kv b { display: block; font-size: 11.5px; color: var(--mute); letter-spacing: .05em; margin-bottom: 4px; font-weight: 600; }
.kv code {
  display: block;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .3);
  color: var(--dim);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 190px;
  overflow: auto;
}
.hi { font-size: 12px; color: var(--dim); padding: 2px 0; }

@media (max-width: 620px) {
  .chatbox { right: 10px; left: 10px; width: auto; bottom: 10px; }
  .chat-log { height: 240px; }
  .dl-card { flex-direction: column; }
}

/* ============================================================
   远程控制台
   ============================================================ */
body.rc-lock { overflow: hidden; }

.rc {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 7, 12, .78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 22px;
  animation: rcIn .25s var(--ease);
}
@keyframes rcIn { from { opacity: 0; } }

.rc-wrap {
  width: min(1180px, 100%);
  height: min(760px, 100%);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--line2);
  background: #0a0f1a;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
  overflow: hidden;
}

.rc-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
  flex-wrap: wrap;
}
.rc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent2);
  animation: pulseDot 2.4s infinite;
}
.rc-head b { font-size: 14px; margin-right: 4px; }
.rc-meta { font-size: 11.5px; color: var(--mute); margin-right: 10px; }
.rc-sp { flex: 1; }

.rc-tab {
  padding: 6px 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.rc-tab:hover { background: var(--panel2); color: var(--text); }
.rc-tab.active {
  background: rgba(108, 140, 255, .16);
  border-color: rgba(108, 140, 255, .35);
  color: #a8bcff;
  font-weight: 600;
}

.rc-x {
  width: 32px; height: 32px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--dim);
  font-size: 15px;
  cursor: pointer;
}
.rc-x:hover { background: rgba(255, 107, 129, .16); color: var(--danger); }

.rc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 16px 12px;
}

.rc-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.rc-path {
  flex: 1;
  min-width: 180px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-family: ui-monospace, Consolas, monospace;
  outline: none;
}
.rc-path:focus { border-color: var(--accent); }
.rc-drive {
  height: 34px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.rc-auto { font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 6px; }

.rc-listwrap {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
  min-height: 0;
}
.rc-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rc-list th {
  position: sticky; top: 0;
  text-align: left;
  padding: 9px 12px;
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--mute);
  font-weight: 600;
  background: #0e1421;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rc-list td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  color: var(--dim);
  vertical-align: middle;
}
.rc-list tr:hover td { background: rgba(108, 140, 255, .06); }
.rc-name { cursor: pointer; color: var(--text) !important; }
.rc-name:hover { color: var(--accent) !important; text-decoration: underline; }
.rc-op { white-space: nowrap; }
.rc-op .btn { padding: 3px 8px; font-size: 11.5px; margin-right: 3px; }
.rc-none { text-align: center; color: var(--mute); padding: 28px !important; }

.rc-status {
  margin-top: 9px;
  font-size: 12px;
  color: var(--mute);
  min-height: 17px;
}

/* 屏幕 */
.rc-screen-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    repeating-conic-gradient(rgba(255,255,255,.02) 0% 25%, transparent 0% 50%) 50% / 18px 18px,
    rgba(0, 0, 0, .25);
  overflow: auto;
  min-height: 0;
}
#rcImg {
  display: none;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.rc-empty { color: var(--mute); font-size: 13px; }

/* 命令输出 */
.rc-out {
  flex: 1;
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #060a12;
  color: #9fe8c8;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 0;
}

@media (max-width: 780px) {
  .rc { padding: 0; }
  .rc-wrap { border-radius: 0; height: 100%; width: 100%; }
  .rc-tab { padding: 5px 9px; font-size: 12px; }
  .rc-meta { display: none; }
}

/* ============================================================
   萌系主题（猫粮属性）—— 门禁 + 主界面
   ============================================================ */

/* 背景光斑粉化 */
.aurora i:nth-child(1) { background: radial-gradient(circle, #ff8fab, transparent 68%); }
.aurora i:nth-child(2) { background: radial-gradient(circle, #ffb3c6, transparent 66%); }
.aurora i:nth-child(3) { background: radial-gradient(circle, #ffc3a0, transparent 68%); }

/* 门禁 + 主界面：粉嫩配色 */
#viewGate, #viewPortal {
  --bg: #fff5f7;
  --bg2: #ffeef2;
  --panel: rgba(255, 255, 255, .72);
  --panel2: rgba(255, 255, 255, .94);
  --line: rgba(255, 143, 171, .26);
  --line2: rgba(255, 143, 171, .5);
  --text: #5a3b45;
  --dim: #8a6b74;
  --mute: #b58c99;
  --accent: #ff8fab;
  --accent2: #ffb3c6;
  --accent3: #ff9e7d;
  --danger: #ff5c8a;
}

/* 门禁卡片粉化 */
#viewGate .gate {
  background:
    radial-gradient(560px circle at 50% -12%, rgba(255, 143, 171, .30), transparent 62%),
    rgba(255, 255, 255, .94);
  border-color: var(--line2);
  box-shadow: 0 30px 80px rgba(160, 90, 110, .28);
}
#viewGate .fld input {
  background: rgba(255, 143, 171, .06);
  border-color: var(--line);
}
#viewGate .fld input:focus {
  background: rgba(255, 143, 171, .10);
  box-shadow: 0 0 0 3.5px rgba(255, 143, 171, .22);
}

/* 顶栏粉化 */
#viewPortal .topbar {
  background: rgba(255, 245, 247, .82);
  border-bottom-color: var(--line);
}
#viewPortal .searchbox { background: rgba(255, 143, 171, .07); }

/* ---------- 分区卡片（两级导航第一级） ---------- */
#viewPortal .cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.sec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 2px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease),
              border-color .2s var(--ease), background-color .2s var(--ease);
}
.sec-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--accent);
  background: var(--panel2);
  box-shadow: 0 16px 36px rgba(255, 143, 171, .28);
}
.sec-card:active { transform: translateY(-1px) scale(1.01); }
.sec-emoji { font-size: 30px; flex: 0 0 auto; }
.sec-name { font-size: 15px; font-weight: 800; color: var(--text); flex: 1; line-height: 1.3; }
.sec-num { font-size: 12px; color: var(--mute); white-space: nowrap; }
.sec-paw { font-size: 16px; }
.sec-18 {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff5c8a, #ff8fab);
  border-radius: 7px;
  padding: 2px 7px;
  letter-spacing: .03em;
}
.sec-card.adult { border-color: rgba(255, 92, 138, .4); }
.sec-card.adult:hover { border-color: #ff5c8a; box-shadow: 0 16px 36px rgba(255, 92, 138, .3); }
.sec-card.hack { border-color: rgba(255, 158, 125, .4); }

/* ---------- 分区详情（两级导航第二级） ---------- */
.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-head h2 { font-size: 21px; font-weight: 800; }
.detail-count { font-size: 13px; color: var(--mute); }

/* ---------- 年龄验证弹窗 ---------- */
.age-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(90, 59, 69, .5);
  backdrop-filter: blur(7px);
  animation: rcIn .22s var(--ease);
}
.age-box {
  text-align: center;
  padding: 36px 32px 30px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(90, 59, 69, .35);
  max-width: 380px;
  width: 100%;
}
.age-cat { font-size: 56px; margin-bottom: 8px; }
.age-box h2 { font-size: 20px; color: #5a3b45; font-weight: 800; }
.age-box p { color: #8a6b74; font-size: 14px; margin: 12px 0 24px; line-height: 1.75; }
.age-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 装逼指令区 ---------- */
.zb-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.zb-col { display: flex; flex-direction: column; gap: 10px; }
.zb-h { font-size: 15px; font-weight: 800; color: var(--text); margin: 2px 0 0; }
.zb-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.zb-item:hover { border-color: var(--accent); box-shadow: 0 8px 22px rgba(255, 143, 171, .2); }
.zb-item code {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
}
.zb-desc { font-size: 11.5px; color: var(--mute); }
.zb-copy {
  align-self: flex-start;
  margin-top: 2px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: rgba(255, 143, 171, .1);
  color: #d9466f;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.zb-copy:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

@media (max-width: 780px) {
  .zb-wrap { grid-template-columns: 1fr; }
  #viewPortal .cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .sec-card { padding: 14px 15px; gap: 9px; }
  .sec-emoji { font-size: 24px; }
}

/* ============================================================
   顶部滚动名言栏
   ============================================================ */
.slogan-bar {
  position: sticky;
  top: 0;
  z-index: 51;
  height: 34px;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #b3001b 0%, #e63946 35%, #ff2b56 50%, #e63946 65%, #b3001b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 2px 12px rgba(179, 0, 27, .3);
}
.slogan-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 150s linear infinite;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.slogan-track span {
  padding: 0 10px 0 30px;
  position: relative;
}
.slogan-track span::before {
  content: '';
  width: 5px;
  height: 5px;
  background: rgba(255,255,255,.85);
  transform: translateY(-50%) rotate(45deg);
  border-radius: 1px;
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: .75;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.slogan-bar:hover .slogan-track { animation-play-state: paused; }

/* 顶栏让出名言栏的位置 */
#viewPortal .topbar { top: 34px; z-index: 50; }

@media (max-width: 620px) {
  .slogan-bar { height: 30px; }
  .slogan-track { font-size: 12px; animation-duration: 110s; }
  #viewPortal .topbar { top: 30px; }
}

/* 名言栏可点击 */
.slogan-bar.unused {
  text-decoration: none;
  cursor: pointer;
  transition: filter .2s var(--ease);
}
a.slogan-bar:hover { filter: brightness(1.12); }
a.slogan-bar:active { filter: brightness(.95); }

/* ============================================================
   收藏 / 最近访问 / 深色主题 / 站点管理
   ============================================================ */

/* 主题底色 */
html[data-theme="light"] body { background: #fff5f7; }
html[data-theme="dark"] body { background: #0a0d14; }

/* 深色主题（主界面） */
html[data-theme="dark"] #viewGate,
html[data-theme="dark"] #viewPortal {
  --bg: #0d1018;
  --bg2: #141824;
  --panel: rgba(255, 255, 255, .05);
  --panel2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .10);
  --line2: rgba(255, 255, 255, .18);
  --text: #e9eef8;
  --dim: #98a6bd;
  --mute: #6a7890;
  --accent: #ff8fab;
  --accent2: #ffb3c6;
  --accent3: #ff9e7d;
}
html[data-theme="dark"] #viewPortal .topbar {
  background: rgba(13, 16, 24, .85);
}
html[data-theme="dark"] #viewGate .gate {
  background:
    radial-gradient(560px circle at 50% -12%, rgba(255, 143, 171, .18), transparent 62%),
    rgba(16, 20, 30, .95);
}

/* 收藏区 */
.fav-wrap { margin-bottom: 22px; }
.fav-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--dim);
}
.fav-clear {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 7px;
}
.fav-clear:hover { background: var(--panel); color: var(--danger); }

/* 最近访问 */
.recent-wrap { margin-bottom: 22px; }
.recent-head { font-size: 13px; font-weight: 700; color: var(--dim); margin-bottom: 9px; }
.recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-item {
  padding: 6px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  font-size: 12.5px;
  transition: all .18s var(--ease);
}
.recent-item:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }

/* 收藏星 */
.fav-star {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1;
  color: var(--mute);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: color .15s var(--ease), transform .15s var(--ease);
}
.fav-star:hover { color: #ffb703; transform: scale(1.2); }
.fav-star.on { color: #ffb703; }

/* ---------- 管理后台：站点管理 ---------- */
.sa-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sa-cols {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: start;
}
.sa-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}
.sa-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dim);
}
.sa-list { max-height: 460px; overflow: auto; }
.sa-sec {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  font-size: 13px;
  color: var(--dim);
  transition: background-color .15s var(--ease);
}
.sa-sec:hover { background: var(--panel2); }
.sa-sec.active { background: rgba(108,140,255,.12); color: var(--text); }
.sa-sec.dragging { opacity: .4; }
.sa-sec.drag-over { border-top: 2px solid var(--accent); }
.sa-sec .grip { color: var(--mute); cursor: grab; font-size: 11px; }
.sa-sec .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-sec .cnt { font-size: 11px; color: var(--mute); }

.sa-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13px;
}
.sa-link:hover { background: var(--panel2); }
.sa-link .nm { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-link .hs { font-size: 11.5px; color: var(--mute); }
.sa-link .op { display: flex; gap: 4px; }
.sa-link .op button { padding: 2px 8px; font-size: 11.5px; }

@media (max-width: 820px) {
  .sa-cols { grid-template-columns: 1fr; }
  .sa-list { max-height: 260px; }
}

/* ---------- 统计图表 ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 8px;
}
.chart-card {
  padding: 14px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.chart-card.wide { grid-column: span 1; }
.chart-card h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mute);
  margin: 0 0 10px;
  letter-spacing: .04em;
}
.chart-card canvas { display: block; width: 100%; }
.exp-btns { display: flex; flex-direction: column; gap: 8px; }
.exp-btns .btn { justify-content: flex-start; font-size: 12.5px; }
@media (max-width: 820px) {
  .chart-grid { grid-template-columns: 1fr; }
}

/* 远程输入行 */
#rc-screen .rc-toolbar + .rc-toolbar { margin-top: -4px; }
#rc-screen .rc-toolbar input.rc-path { font-family: inherit; }

/* ---------- TOTP / 批量 / favicon ---------- */
.totp-panel {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.totp-panel img { border-radius: 10px; background: #fff; padding: 6px; }

.ico-rich { position: relative; overflow: hidden; }
.ico-rich img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 6px;
  background: #fff;
  border-radius: inherit;
}
.ico-rich i { display: none; }
.ico-rich img[src=""] { display: none; }

.lnk.dead { opacity: .45; filter: grayscale(1); }
.lnk.dead::after {
  content: '失联';
  position: absolute; top: 8px; right: 10px;
  font-size: 10px; font-weight: 700;
  color: #ff6b81;
}
.lnk { position: relative; }

/* ============================================================
   管理后台标签页
   ============================================================ */
.atabs {
  display: flex;
  gap: 3px;
  margin-left: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.atabs::-webkit-scrollbar { display: none; }
.atab {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.atab:hover { background: var(--panel2); color: var(--text); }
.atab.on {
  background: rgba(108, 140, 255, .16);
  border-color: rgba(108, 140, 255, .42);
  color: #a8bcff;
  font-weight: 650;
}

.apanel { animation: fade .25s var(--ease); }

.sec-title { margin: 34px 0 14px; }
.sec-title:first-child { margin-top: 6px; }
.sec-title h2 { font-size: 16.5px; font-weight: 750; letter-spacing: -.01em; }
.sec-title p { font-size: 12.5px; color: var(--mute); margin-top: 5px; line-height: 1.6; }

.hint-box {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(108, 140, 255, .38);
  background: rgba(108, 140, 255, .07);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--dim);
}
.hint-box b { color: var(--text); font-weight: 700; }
.hint-box code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .32);
  font-size: 11.5px;
  color: #a8bcff;
}

.chart-card.full { grid-column: 1 / -1; }
.exp-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.exp-row .btn { font-size: 12.5px; }

@media (max-width: 900px) {
  .atabs {
    order: 5;
    flex-basis: 100%;
    margin: 8px 0 0;
    padding-bottom: 2px;
  }
  .atab { padding: 6px 11px; font-size: 12.5px; }
}

.chat-free {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(87, 224, 192, .18);
  color: #57e0c0;
  border: 1px solid rgba(87, 224, 192, .35);
  letter-spacing: .02em;
}
