:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, #172033 0%, #0b1120 55%, #060912 100%);
  color: #e5e7eb;
}
header {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 16px 28px; border-bottom: 1px solid rgba(148,163,184,0.12);
  position: sticky; top: 0; background: rgba(6,9,18,0.75); backdrop-filter: blur(10px); z-index: 10;
}
.brand { font-size: 19px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.tabs {
  display: flex; gap: 6px; background: rgba(17,24,39,0.6);
  padding: 6px; border-radius: 12px; border: 1px solid rgba(148,163,184,0.12);
}
.tab {
  padding: 8px 16px; border-radius: 8px; font-size: 14px; color: #94a3b8;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.tab:hover { color: #e5e7eb; }
.tab.active { background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff; }
.logout {
  margin-left: auto; font-size: 13px; color: #94a3b8; background: none;
  border: 1px solid rgba(148,163,184,0.25); padding: 7px 14px; border-radius: 8px; cursor: pointer;
}
.logout:hover { color: #e5e7eb; border-color: #3b82f6; }
main { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }
.card {
  background: rgba(17,24,39,0.8); border: 1px solid rgba(148,163,184,0.14);
  border-radius: 14px; padding: 24px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card .desc, .desc { color: #94a3b8; font-size: 13px; margin: 0 0 18px; line-height: 1.55; }
label { display: block; font-size: 13px; color: #cbd5e1; margin: 14px 0 6px; }
label:first-of-type { margin-top: 0; }
input, select {
  width: 100%; padding: 10px 12px; border-radius: 9px; font-size: 14px;
  border: 1px solid rgba(148,163,184,0.22); background: #0b1220; color: #e5e7eb; outline: none;
  transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
input:focus, select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.22); }
select { cursor: pointer; }
.hint { color: #64748b; font-size: 12px; margin-top: 6px; }
.btn {
  margin-top: 18px; padding: 10px 22px; border: 0; border-radius: 9px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-sm {
  padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; text-decoration: none;
  border: 1px solid rgba(59,130,246,0.5); background: none; color: #93c5fd; display: inline-flex; align-items: center;
}
.btn-sm:hover { border-color: #3b82f6; color: #e5e7eb; }
.btn-sm.danger { border-color: rgba(248,113,113,0.4); color: #fca5a5; }
.btn-sm.danger:hover { border-color: #f87171; color: #fecaca; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > div { flex: 1; min-width: 180px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.code-block {
  margin: 0; padding: 14px; border-radius: 9px; background: #060912;
  border: 1px solid rgba(148,163,184,0.18); font-size: 12px; line-height: 1.55;
  overflow-x: auto; color: #cbd5e1;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(148,163,184,0.12); }
.table th { color: #94a3b8; font-weight: 500; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 20px; display: inline-block; }
.badge.on { background: rgba(34,197,94,0.16); color: #4ade80; }
.badge.preview { background: rgba(251,191,36,0.16); color: #fbbf24; }
.badge.off { background: rgba(148,163,184,0.16); color: #94a3b8; }
.empty { color: #64748b; font-size: 14px; text-align: center; margin: 0; padding: 8px 0; }
.arch-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.arch-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.arch-title h3 { margin: 0; font-size: 16px; font-weight: 600; }
.arch-count { font-size: 12px; color: #64748b; }
.channel-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
  padding: 14px 16px; border-radius: 11px; background: rgba(11,18,32,0.75);
  border: 1px solid rgba(148,163,184,0.13); margin-bottom: 14px;
}
.channel-bar label { margin: 0 0 6px; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.channel-bar select.set-stable { border-color: rgba(34,197,94,0.45); }
.channel-bar select.set-preview { border-color: rgba(251,191,36,0.45); }
.pkg-item { border: 1px solid rgba(148,163,184,0.12); border-radius: 10px; padding: 13px 15px; margin-top: 10px; background: rgba(11,18,32,0.4); }
.pkg-item.is-active { border-color: rgba(59,130,246,0.28); background: rgba(15,23,42,0.65); }
.pkg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pkg-title { font-weight: 600; font-size: 14px; }
.pkg-meta { color: #64748b; font-size: 12px; margin-top: 4px; }
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.pager button {
  min-width: 30px; height: 28px; padding: 0 8px; border-radius: 7px; font-size: 12px;
  border: 1px solid rgba(148,163,184,0.2); background: rgba(11,18,32,0.8); color: #cbd5e1; cursor: pointer;
}
.pager button.on { background: #2563eb; border-color: #3b82f6; color: #fff; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .gap, .pager .total { font-size: 12px; color: #64748b; padding: 0 4px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1e293b; border: 1px solid rgba(148,163,184,0.25); padding: 12px 22px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: all .25s; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 80;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.ok { border-color: rgba(34,197,94,0.5); }
.toast.err { border-color: rgba(248,113,113,0.5); }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none;
  align-items: center; justify-content: center; z-index: 60; padding: 16px;
}
.modal.show { display: flex; }
.modal-box {
  width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: #0f172a; border: 1px solid rgba(148,163,184,0.2); border-radius: 14px; padding: 22px;
}
.modal-box h3 { margin: 0 0 4px; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.progress { height: 10px; border-radius: 6px; background: #1e293b; overflow: hidden; margin-top: 16px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg,#3b82f6,#22c55e); transition: width .3s; }
.sync-msg { font-size: 12px; color: #94a3b8; margin-top: 8px; min-height: 18px; }
.sync-msg.err { color: #fca5a5; }
.sync-msg.ok { color: #4ade80; }
