:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111722;
  --line: #253044;
  --muted: #8f9aae;
  --text: #f3f6fb;
  --blue: #4d8dff;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 20% 0, #13223e 0, transparent 34%), var(--bg); color: var(--text); font: 15px/1.55 Inter, "Microsoft YaHei", system-ui, sans-serif; }
.shell { width: min(1180px, calc(100% - 32px)); margin: auto; padding: 30px 0 50px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.header-actions, .login-row, .panel-head, .proxy-setting, .proxy-actions { display: flex; align-items: center; gap: 12px; }
.card { background: rgba(17, 23, 34, .94); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .24); }
button, input, select { font: inherit; border-radius: 11px; }
button { border: 0; background: var(--blue); color: #fff; font-weight: 700; padding: 11px 18px; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
.ghost { background: #182132; border: 1px solid #303d54; }
.badge { padding: 6px 11px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.neutral { background: #20293a; color: #b9c2d1; }
.ok { background: rgba(52, 211, 153, .14); color: var(--green); }
.bad { background: rgba(251, 113, 133, .14); color: var(--red); }
.login { max-width: 560px; margin: 80px auto; padding: 28px; }
.login p { color: var(--muted); margin-top: 5px; }
.login-row { margin-top: 22px; }
.login input { flex: 1; min-width: 0; background: #090d15; border: 1px solid #344057; color: #fff; padding: 12px 14px; outline: none; }
.login input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77, 141, 255, .15); }
.error { color: var(--red) !important; min-height: 22px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metrics .card { padding: 18px; }
.metrics span { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { display: block; margin-top: 5px; font-size: 22px; }
.notice { padding: 15px 18px; margin: 14px 0; color: #d4dbea; }
.proxy-setting { position: relative; justify-content: space-between; padding: 16px 18px 28px; margin: 14px 0; }
.proxy-setting p { color: var(--muted); font-size: 13px; }
.proxy-actions select { min-width: 120px; background: #090d15; border: 1px solid #344057; color: #fff; padding: 10px 34px 10px 12px; }
.proxy-message { position: absolute; right: 18px; bottom: 5px; min-height: 18px; }
.proxy-message.bad { background: none; }
.panel { padding: 20px; margin-top: 14px; }
.panel-head { justify-content: space-between; margin-bottom: 16px; }
.panel-head p { color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid #222c3e; }
th { color: var(--muted); font-size: 12px; }
td.message { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.state { font-weight: 800; color: var(--blue); }
.logs { height: 380px; overflow: auto; background: #080c13; border: 1px solid #202a3b; border-radius: 12px; padding: 12px; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.log-line { display: grid; grid-template-columns: 82px 80px 1fr; gap: 9px; padding: 3px 5px; border-radius: 6px; }
.log-line:hover { background: #121a27; }
.log-line .time, .log-line .stage { color: #758198; }
.log-line.error .msg { color: var(--red); }
.log-line.warning .msg { color: var(--amber); }

@media (max-width: 800px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 14px; }
  .panel-head { align-items: flex-start; }
  .log-line { grid-template-columns: 68px 1fr; }
  .log-line .stage { display: none; }
}

@media (max-width: 480px) {
  header { align-items: flex-start; }
  .header-actions { gap: 7px; }
  .metrics { gap: 9px; }
  .metrics .card { padding: 14px; }
  .login { margin-top: 45px; padding: 20px; }
  .login-row { align-items: stretch; flex-direction: column; }
  .proxy-setting { align-items: flex-start; flex-direction: column; padding-bottom: 16px; }
  .proxy-actions { width: 100%; }
  .proxy-actions select, .proxy-actions button { flex: 1; }
  .proxy-message { position: static; }
}
