
    :root {
      color-scheme: light;
      --bg: #f5f7fb;
      --panel: #ffffff;
      --ink: #111827;
      --muted: #667085;
      --line: #d8dee9;
      --blue: #3157ff;
      --green: #0f9f6e;
      --red: #d92d20;
      --amber: #b86b00;
      --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: var(--ink);
    }
    main {
      width: min(1180px, calc(100vw - 32px));
      margin: 24px auto;
    }
    header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
      margin-bottom: 18px;
    }
    h1 {
      margin: 0;
      font-size: 28px;
      line-height: 1.1;
      letter-spacing: 0;
    }
    .subtitle {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 14px;
    }
    .status-card, .log-card, .side-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }
    .status-card {
      padding: 18px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 16px;
      align-items: center;
      margin-bottom: 16px;
    }
    .status-line {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }
    .pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 32px;
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid var(--line);
      font-size: 13px;
      font-weight: 700;
    }
    .dot {
      width: 9px;
      height: 9px;
      border-radius: 99px;
      background: var(--muted);
    }
    .running .dot { background: var(--green); }
    .stopped .dot { background: var(--red); }
    .external .dot { background: var(--amber); }
    .meta {
      color: var(--muted);
      font-size: 13px;
      margin-top: 10px;
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
    }
    .actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    button {
      border: 1px solid transparent;
      border-radius: 8px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 800;
      cursor: pointer;
      min-height: 42px;
      background: #eef2ff;
      color: #2433a7;
    }
    button.primary { background: var(--blue); color: white; }
    button.danger { background: #fff1f0; color: var(--red); border-color: #ffc9c4; }
    button.secondary { background: white; color: #344054; border-color: var(--line); }
    button:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
    .grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 320px;
      gap: 16px;
    }
    .log-card {
      overflow: hidden;
    }
    .log-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
    }
    .log-head h2, .side-card h2 {
      margin: 0;
      font-size: 16px;
      letter-spacing: 0;
    }
    label {
      color: var(--muted);
      font-size: 13px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      user-select: none;
    }
    .logs {
      height: min(64vh, 680px);
      overflow: auto;
      background: #0b1020;
      color: #e6edf7;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 12px;
      line-height: 1.45;
      padding: 14px;
      white-space: pre-wrap;
    }
    .log-row { margin: 0 0 4px; }
    .log-row.stdout { margin: 0; }
    .log-row .time { color: #8ea4c8; }
    .log-row .stream { color: #9bd4ff; }
    .log-row.stderr .stream, .log-row.stderr .line { color: #ffb4a9; }
    .log-row.panel .stream { color: #b7f7cc; }
    .side-card {
      padding: 16px;
    }
    .side-card + .side-card {
      margin-top: 16px;
    }
    .kv {
      display: grid;
      grid-template-columns: 88px 1fr;
      gap: 8px;
      padding: 10px 0;
      border-bottom: 1px solid var(--line);
      font-size: 13px;
    }
    .kv:last-child { border-bottom: 0; }
    .key { color: var(--muted); font-weight: 700; }
    .value { overflow-wrap: anywhere; }
    .groups {
      margin: 10px 0 0;
      padding: 0;
      list-style: none;
      display: grid;
      gap: 8px;
      font-size: 13px;
    }
    .groups li {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: #fbfcff;
    }
    .group-manager {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }
    .group-tools {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      align-items: center;
    }
    .group-tools input {
      width: 100%;
      min-height: 40px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 9px 10px;
      font: inherit;
      font-size: 13px;
      color: var(--ink);
      background: white;
    }
    .group-picker {
      list-style: none;
      margin: 0;
      padding: 0;
      display: grid;
      gap: 8px;
      max-height: 380px;
      overflow: auto;
    }
    .group-picker li {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfcff;
      padding: 10px;
    }
    .group-option {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 10px;
      align-items: start;
      color: var(--ink);
      font-size: 13px;
    }
    .group-option input {
      width: 18px;
      height: 18px;
      margin: 1px 0 0;
    }
    .group-name {
      display: block;
      font-weight: 800;
      overflow-wrap: anywhere;
    }
    .group-id {
      display: block;
      color: var(--muted);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 11px;
      margin-top: 4px;
      overflow-wrap: anywhere;
    }
    .group-badge {
      display: inline-flex;
      margin-top: 7px;
      border: 1px solid #b7ebd5;
      color: #087443;
      background: #ecfdf3;
      border-radius: 999px;
      padding: 3px 7px;
      font-size: 11px;
      font-weight: 800;
    }
    .group-status {
      min-height: 18px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .hint {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
      margin: 10px 0 0;
    }
    @media (max-width: 860px) {
      header, .status-card { grid-template-columns: 1fr; }
      header { display: block; }
      .actions { justify-content: flex-start; }
      .grid { grid-template-columns: 1fr; }
      main { width: min(100vw - 20px, 1180px); margin: 14px auto; }
      .logs { height: 58vh; }
    }

select,input[type=password],input[type=text],input[type=tel] { width:100%; padding:10px; border:1px solid var(--line); border-radius:6px; background:white; font:inherit; }
label.field { display:block; margin:12px 0; font-size:13px; }
.qr { width:220px; max-width:100%; }
.notice { padding:12px; border-radius:8px; background:#fff6df; color:#725000; margin:12px 0; }

.login-page { min-height:100vh; display:grid; place-items:center; background:radial-gradient(ellipse at top, #e9edff, var(--bg) 58%); }
.login-main { width:min(440px, calc(100vw - 32px)); margin:24px auto; }
.login-card { padding:clamp(22px, 6vw, 36px); }
.login-brand { display:flex; align-items:center; gap:10px; margin-bottom:28px; font-size:14px; font-weight:700; }
.login-brand span { display:grid; place-items:center; width:34px; height:34px; border-radius:8px; background:#e9edff; color:#2847d5; font-size:12px; }
.login-card form { margin-top:26px; }
.login-password { display:flex; gap:8px; }
.login-password input { min-width:0; }
.login-submit { width:100%; margin-top:20px; }
.login-error { background:#fff0ef; color:#9d231a; font-size:14px; }
[hidden] { display:none!important; }
.side-card + .side-card { margin-top:16px; }
.stat { font-size:13px; color:var(--muted); line-height:1.7; }
