:root {
  --bg: #07111f;
  --panel: rgba(16, 29, 48, 0.88);
  --panel-2: rgba(12, 24, 42, 0.92);
  --line: rgba(142, 170, 211, 0.16);
  --text: #eef6ff;
  --muted: #8ea1bc;
  --blue: #5ea7ff;
  --cyan: #56d9e8;
  --green: #57d5a2;
  --amber: #f0c77a;
  --danger: #ff7285;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 15% -10%, #183766 0, transparent 32%), radial-gradient(circle at 100% 15%, #0d3648 0, transparent 26%), var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.ambient { position: fixed; border-radius: 999px; filter: blur(90px); opacity: .2; pointer-events: none; }
.ambient-one { width: 300px; height: 300px; background: #296cdf; top: 20%; left: -180px; }
.ambient-two { width: 340px; height: 340px; background: #1ecdc7; bottom: 5%; right: -230px; }
.shell { width: min(980px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 72px; position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 19px; letter-spacing: .04em; }
.brand small { color: var(--muted); display: block; font-size: 10px; letter-spacing: .2em; margin-top: 2px; }
.logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #22467b, #14305a); color: #9adcf9; box-shadow: inset 0 1px rgba(255,255,255,.1), 0 10px 28px rgba(12, 87, 180, .2); font-size: 22px; }
.guest-chip { display: flex; align-items: center; gap: 9px; background: rgba(13, 24, 40, .72); border: 1px solid var(--line); padding: 8px 10px; border-radius: 999px; box-shadow: var(--shadow); }
.live-dot, .notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(87,213,162,.12); }
.notice-dot { background: var(--danger); display: inline-block; box-shadow: none; margin-left: 4px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; line-height: 1; border: 1px solid var(--line); }
.pill.success { color: #95edcb; background: rgba(47, 178, 128, .12); border-color: rgba(87,213,162,.2); }
.pill.cyan { color: #9cebf4; background: rgba(64, 190, 208, .12); }
.pill.warning { color: #f5d898; background: rgba(207, 153, 50, .11); border-color: rgba(240,199,122,.2); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border: 1px solid var(--line); background: rgba(13, 24, 40, .82); border-radius: 16px; box-shadow: var(--shadow); }
.tab { color: var(--muted); border: 0; background: transparent; padding: 13px 10px; border-radius: 11px; cursor: pointer; font-weight: 700; transition: .2s ease; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.035); }
.tab.active { color: #fff; background: linear-gradient(135deg, rgba(50, 91, 157, .85), rgba(37, 71, 128, .85)); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.announcement { margin: 16px 0; display: flex; overflow: hidden; border-radius: 16px; border: 1px solid rgba(82, 171, 235, .26); background: linear-gradient(135deg, rgba(18,42,67,.9), rgba(12,25,42,.9)); box-shadow: var(--shadow); }
.notice-rail { width: 4px; flex: 0 0 4px; background: linear-gradient(var(--cyan), var(--blue)); }
.notice-content { padding: 15px 17px; flex: 1; min-width: 0; }
.notice-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.notice-head > div { display: flex; align-items: center; gap: 8px; }
.notice-text { white-space: pre-line; color: #dbe9fb; line-height: 1.75; margin: 10px 0 0; font-size: 14px; }
.notice-text.clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-button { color: #b7cee9; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 999px; padding: 5px 9px; cursor: pointer; }
.panel { display: none; }
.panel.active { display: block; animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(22,34,54,.94), rgba(15,27,45,.94)); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-head.compact { margin-bottom: 10px; }
.card h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: .01em; }
.eyebrow { display: block; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.link-button { color: #9fddff; border-bottom: 1px solid rgba(159,221,255,.25); padding: 4px 0; font-size: 14px; }
.connection-list { border-top: 1px solid var(--line); }
.connection-row { display: grid; grid-template-columns: 116px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.connection-row .key { color: var(--muted); font-size: 13px; }
.required { font-style: normal; color: #ff9ba8; font-size: 10px; background: rgba(255,114,133,.1); border-radius: 5px; padding: 2px 4px; margin-left: 4px; }
code, .value-box { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.value-box { min-width: 0; overflow-wrap: anywhere; color: #eef7ff; background: rgba(5,12,24,.38); border-radius: 9px; padding: 8px 10px; }
.copy-button, .secondary, .primary, .danger { border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text); padding: 10px 14px; transition: transform .16s ease, filter .16s ease, background .16s ease; }
.copy-button:hover, .secondary:hover, .primary:hover, .danger:hover { transform: translateY(-1px); filter: brightness(1.08); }
.copy-button { background: rgba(255,255,255,.055); padding: 8px 12px; }
.primary { background: linear-gradient(135deg, #3978df, #2b5fbb); border-color: rgba(113,166,255,.4); font-weight: 750; }
.secondary { background: rgba(255,255,255,.055); }
.danger { background: rgba(180,48,69,.14); color: #ff9daa; border-color: rgba(255,114,133,.24); }
.small { padding: 7px 11px; font-size: 13px; }
.row-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
.muted { color: var(--muted); line-height: 1.65; }
.info-note { margin: 14px 0 0; padding: 11px 13px; border-radius: 10px; color: #afd6ec; background: rgba(55,151,191,.08); border: 1px solid rgba(86,217,232,.12); font-size: 13px; }
.steps { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: rgba(5,12,24,.28); border: 1px solid rgba(142,170,211,.1); border-radius: 13px; padding: 13px; color: #cedaed; line-height: 1.6; font-size: 14px; }
.steps li > span { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; color: #8edcea; background: rgba(86,217,232,.1); border-radius: 8px; font-weight: 800; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid.two > .card { margin-bottom: 16px; }
label { display: flex; justify-content: space-between; color: #b9c8dd; font-size: 13px; margin: 14px 0 7px; }
input, textarea, select { width: 100%; color: var(--text); background: rgba(6,14,26,.55); border: 1px solid rgba(142,170,211,.18); border-radius: 11px; padding: 12px 13px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: rgba(94,167,255,.72); box-shadow: 0 0 0 3px rgba(94,167,255,.08); }
textarea { resize: vertical; min-height: 118px; }
.card > .primary { margin-top: 14px; }
.form-message { min-height: 20px; margin-top: 10px; font-size: 13px; color: var(--green); }
.form-message.error { color: #ff9daa; }
.operations-card { display: flex; flex-direction: column; }
.operation-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.operation-row p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.danger-row { margin-top: auto; }
.empty-state { text-align: center; padding: 38px 20px; }
.empty-icon { width: 62px; height: 62px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 22px; background: rgba(86,217,232,.08); color: var(--cyan); font-size: 32px; }
.empty-state p { color: var(--muted); }
.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.region-btn { border: 1px solid var(--line); color: #c4d1e4; background: rgba(255,255,255,.035); padding: 13px 10px; border-radius: 11px; cursor: pointer; }
.region-btn.active { color: #fff; border-color: rgba(94,167,255,.6); background: rgba(57,120,223,.2); box-shadow: inset 0 0 0 1px rgba(94,167,255,.2); }
.primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.feedback-thread { display: grid; gap: 10px; margin: 15px 0; }
.message { max-width: 78%; border-radius: 13px; padding: 11px 13px; line-height: 1.55; }
.message.user { margin-left: auto; background: rgba(57,120,223,.22); border: 1px solid rgba(94,167,255,.2); }
.message.system { background: rgba(86,217,232,.08); border: 1px solid rgba(86,217,232,.14); }
.message small { color: var(--muted); display: block; margin-bottom: 4px; }
.feedback-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.history-item { border-top: 1px solid var(--line); padding: 13px 0; }
.history-item:first-child { border-top: 0; }
.history-item p { margin: 6px 0 0; color: var(--muted); }
.counter { color: var(--muted); font-variant-numeric: tabular-nums; }
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.profile-grid > div { background: rgba(7,16,30,.65); padding: 15px; }
.profile-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.profile-grid code { overflow-wrap: anywhere; }
.danger-card { border-color: rgba(255,114,133,.16); }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(1,7,15,.76); backdrop-filter: blur(10px); }
.modal-card { width: min(420px, 100%); background: #111e31; border: 1px solid var(--line); border-radius: 20px; padding: 24px; text-align: center; box-shadow: 0 28px 90px rgba(0,0,0,.5); }
.modal-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; color: #ffadba; background: rgba(255,114,133,.1); font-weight: 900; }
.modal-card p { color: var(--muted); line-height: 1.7; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 28px; transform: translateX(-50%); color: #eafff7; background: rgba(21,55,50,.96); border: 1px solid rgba(87,213,162,.25); padding: 11px 16px; border-radius: 999px; box-shadow: var(--shadow); }
.hidden { display: none !important; }

.viewer-body { background: #050b14; overflow-x: hidden; }
.viewer-shell { width: min(1060px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.brand.mini .logo { width: 36px; height: 36px; border-radius: 11px; font-size: 16px; }
.viewer-stage { position: relative; aspect-ratio: 16/9; max-height: 680px; overflow: hidden; border: 1px solid rgba(86,217,232,.2); border-radius: 22px; background: radial-gradient(circle, rgba(26,119,130,.25) 0, rgba(5,16,27,.92) 48%, #030912 100%); box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.radar-ring { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(86,217,232,.22); border-radius: 50%; transform: translate(-50%,-50%); }
.r1 { width: 26%; aspect-ratio: 1; } .r2 { width: 52%; aspect-ratio: 1; } .r3 { width: 78%; aspect-ratio: 1; }
.viewer-stage::before, .viewer-stage::after { content: ""; position: absolute; background: rgba(86,217,232,.14); }
.viewer-stage::before { width: 1px; top: 8%; bottom: 8%; left: 50%; }
.viewer-stage::after { height: 1px; left: 8%; right: 8%; top: 50%; }
.radar-sweep { position: absolute; width: 39%; height: 39%; left: 50%; top: 11%; transform-origin: left bottom; background: conic-gradient(from 90deg at 0 100%, rgba(86,217,232,.28), transparent 28deg); animation: sweep 5s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #7ff6e1; box-shadow: 0 0 0 6px rgba(87,213,162,.08), 0 0 16px #57d5a2; animation: pulse 1.8s infinite alternate; }
.b1 { left: 63%; top: 31%; } .b2 { left: 37%; top: 58%; animation-delay: .6s; } .b3 { left: 72%; top: 67%; animation-delay: 1.1s; }
@keyframes pulse { from { opacity: .35; transform: scale(.7); } to { opacity: 1; transform: scale(1.2); } }
.viewer-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 2; display: grid; text-align: center; gap: 7px; }
.viewer-center > span { color: var(--cyan); font-size: 34px; }
.viewer-center strong { font-size: clamp(18px,3vw,30px); }
.viewer-center small { color: #6d94a2; letter-spacing: .2em; }
.scanline { position: absolute; inset: 0; opacity: .2; background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(159,236,255,.06) 4px); }
.viewer-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 14px; }
.viewer-stats div { border: 1px solid var(--line); background: rgba(14,26,43,.8); border-radius: 13px; padding: 14px; }
.viewer-stats span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 5px; }
.green { color: var(--green); }
.viewer-note { text-align: center; color: var(--muted); margin-top: 18px; }

@media (max-width: 720px) {
  .shell { width: min(100% - 22px, 980px); padding-top: 18px; }
  .brand small, #guestName { display: none; }
  .guest-chip { padding: 7px 9px; }
  .tabs { position: sticky; top: 8px; z-index: 8; backdrop-filter: blur(15px); }
  .tab { font-size: 13px; padding: 12px 5px; }
  .notice-head { align-items: flex-start; }
  .notice-head > div:last-child .muted { display: none; }
  .grid.two, .steps { grid-template-columns: 1fr; }
  .connection-row { grid-template-columns: 90px minmax(0,1fr) auto; gap: 7px; }
  .connection-row .key { font-size: 12px; }
  .value-box { font-size: 12px; padding: 7px; }
  .copy-button { padding: 7px 9px; font-size: 12px; }
  .region-grid { grid-template-columns: repeat(2,1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .row-actions, .operation-row { align-items: flex-start; }
  .viewer-stats { grid-template-columns: 1fr; }
}
