:root {
      --primary: #1677ff;
      --primary-hover: #4096ff;
      --primary-active: #0958d9;
      --primary-soft: #e6f4ff;
      --bg: #f5f5f5;
      --panel: #ffffff;
      --text: rgba(0, 0, 0, 0.88);
      --muted: rgba(0, 0, 0, 0.45);
      --border: #f0f0f0;
      --border-strong: #d9d9d9;
      --fill: #fafafa;
      --ok: #52c41a;
      --ok-bg: #f6ffed;
      --warn: #faad14;
      --warn-bg: #fffbe6;
      --bad: #ff4d4f;
      --bad-bg: #fff2f0;
      --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px rgba(0, 0, 0, 0.02);
      --radius: 8px;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      color: var(--text);
      background: var(--bg);
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
    }
    button, input, select { font: inherit; color: inherit; }
    code {
      font-family: "SF Mono", Menlo, Consolas, ui-monospace, monospace;
      font-size: 14px;
      background: var(--fill);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 2px 8px;
    }
    .app { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
    .nav {
      border-right: 1px solid var(--border);
      background: linear-gradient(180deg, #1677ff 0%, #0958d9 100%);
      padding: 20px 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      color: #fff;
    }
    .brand {
      background: rgba(255, 255, 255, 0.14);
      border: 1px solid rgba(255, 255, 255, 0.22);
      border-radius: var(--radius);
      padding: 14px 12px;
      margin-bottom: 18px;
      font-weight: 650;
      letter-spacing: 0.02em;
      font-size: 16px;
    }
    .brand small {
      display: block;
      font-weight: 400;
      color: rgba(255, 255, 255, 0.75);
      margin-top: 6px;
      font-size: 12px;
    }
    .nav button {
      text-align: left;
      background: transparent;
      border: 1px solid transparent;
      border-radius: 6px;
      padding: 12px 14px;
      cursor: pointer;
      color: rgba(255, 255, 255, 0.88);
      font-size: 14px;
    }
    .nav button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
    .nav button.active {
      background: #fff;
      color: var(--primary);
      font-weight: 600;
      box-shadow: var(--shadow);
    }
    .nav-sep {
      height: 1px;
      margin: 10px 10px;
      background: rgba(255, 255, 255, 0.28);
      flex-shrink: 0;
    }
    .main { display: flex; flex-direction: column; min-width: 0; }
    .top {
      border-bottom: 1px solid var(--border);
      background: var(--panel);
      padding: 12px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }
    .top-left, .top-right {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .nav-toggle {
      display: none;
      width: 40px;
      height: 40px;
      padding: 0;
      border: 1px solid var(--border-strong);
      border-radius: 8px;
      background: var(--panel);
      cursor: pointer;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .nav-toggle:hover { border-color: var(--primary); }
    .nav-toggle-bars,
    .nav-toggle-bars::before,
    .nav-toggle-bars::after {
      display: block;
      width: 18px;
      height: 2px;
      background: var(--text);
      border-radius: 1px;
      position: relative;
      transition: transform 0.2s ease, opacity 0.2s ease;
    }
    .nav-toggle-bars::before,
    .nav-toggle-bars::after {
      content: "";
      position: absolute;
      left: 0;
    }
    .nav-toggle-bars::before { top: -6px; }
    .nav-toggle-bars::after { top: 6px; }
    .app.nav-open .nav-toggle-bars { background: transparent; }
    .app.nav-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
    .app.nav-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }
    .nav-backdrop {
      display: none;
    }
    .badge {
      border: 1px solid var(--primary-soft);
      padding: 2px 10px;
      background: var(--primary-soft);
      color: var(--primary);
      border-radius: 999px;
      font-size: 12px;
    }
    .content { padding: 28px; min-width: 0; overflow-x: hidden; }
    h1 { font-size: 22px; margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; }
    .sub { color: var(--muted); margin-bottom: 18px; font-size: 14px; }
    .page-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 16px;
    }
    .page-head .sub { margin-bottom: 18px; }
    .page-head-actions {
      flex-shrink: 0;
      padding-top: 2px;
    }
    .row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
    .card {
      border: 1px solid var(--border);
      background: var(--panel);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 18px 20px;
      min-width: 160px;
      flex: 1;
    }
    .card .n { font-size: 32px; font-weight: 650; color: var(--primary); }
    .card .l { color: var(--muted); font-size: 14px; margin-top: 6px; }
    table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: var(--shadow);
    }
    th, td {
      border-bottom: 1px solid var(--border);
      padding: 14px 16px;
      text-align: left;
      vertical-align: middle;
    }
    tr:last-child td { border-bottom: none; }
    .ellipsis {
      display: inline-block;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      vertical-align: bottom;
    }
    th {
      background: var(--fill);
      font-weight: 600;
      color: rgba(0, 0, 0, 0.65);
      font-size: 14px;
    }
    th.sortable {
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }
    th.sortable:hover { color: var(--primary); }
    th.num, td.num {
      text-align: right;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }
    .table-scroll { overflow-x: auto; }
    /* 异常日志桌面表：定宽 + 省略，尽量不横向滚动 */
    .list-desktop:has(.log-table) { overflow-x: hidden; }
    table.log-table { table-layout: fixed; }
    table.log-table th,
    table.log-table td {
      padding: 12px 10px;
      overflow: hidden;
      vertical-align: middle;
    }
    table.log-table .col-time { width: 10.5rem; }
    table.log-table .col-inst { width: 11%; }
    table.log-table .col-rid { width: 15%; }
    table.log-table .col-status { width: 18%; }
    table.log-table .col-cat { width: 16%; }
    table.log-table .col-outcome { width: 7.5rem; }
    table.log-table td.log-time {
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    table.log-table code.log-rid {
      display: block;
      max-width: 100%;
      overflow: hidden;
      font-size: 12px;
    }
    table.log-table code.log-rid .ellipsis {
      display: block;
      max-width: 100%;
    }
    /* 双轨列表：桌面只表格，手机只卡片。勿在 .list-cards 上单独写 display:flex，
       否则会盖掉 .list-mobile { display:none }（同 specificity 后写覆盖）。 */
    .list-mobile,
    .list-cards.list-mobile { display: none; }
    .list-cards {
      flex-direction: column;
      gap: 10px;
    }
    .list-card {
      border: 1px solid var(--border);
      background: var(--fill);
      border-radius: var(--radius);
      padding: 14px 16px;
      transition: border-color 0.15s ease, background 0.15s ease;
    }
    .list-card.clickable { cursor: pointer; }
    .list-card.clickable:hover {
      border-color: var(--primary-hover);
      background: var(--primary-soft);
    }
    .list-card-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
    }
    .list-card-title {
      font-weight: 600;
      font-size: 15px;
      word-break: break-all;
      min-width: 0;
    }
    .list-card-title small {
      display: block;
      margin-top: 4px;
      font-weight: 400;
      font-size: 12px;
      color: var(--muted);
    }
    .list-card-status {
      flex-shrink: 0;
      font-size: 13px;
      white-space: nowrap;
    }
    .list-card-meta {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px 12px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }
    .list-card-meta span {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
      font-size: 14px;
      font-variant-numeric: tabular-nums;
      word-break: break-word;
    }
    .list-card-meta em {
      font-style: normal;
      font-size: 12px;
      color: var(--muted);
    }
    .list-empty {
      padding: 18px 12px;
      text-align: center;
      color: var(--muted);
      font-size: 14px;
      border: 1px dashed var(--border-strong);
      border-radius: var(--radius);
      background: var(--panel);
    }
    .list-card-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }
    .list-card-actions .btn { margin-left: 0 !important; }
    .list-card-check {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      min-width: 0;
      cursor: pointer;
    }
    .list-card-check input { margin-top: 4px; flex-shrink: 0; }
    .list-card-meta .list-card-span-2 { grid-column: 1 / -1; }
    @media (min-width: 720px) {
      .list-card-meta {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
    }
    tr.clickable { cursor: pointer; }
    tr.clickable:hover td { background: #fafafa; }
    tr.clickable td.row-actions { cursor: default; }
    td.row-actions { white-space: nowrap; }
    td.row-actions .btn + .btn { margin-left: 8px; }
    .dot {
      display: inline-block;
      width: 10px; height: 10px;
      border-radius: 50%;
      margin-right: 10px;
      vertical-align: middle;
    }
    .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.15); }
    .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(250, 173, 20, 0.18); }
    .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.15); }
    .dot.unk { background: #bfbfbf; }
    .state-hold { color: var(--bad); font-weight: 600; }
    .state-muted { color: var(--muted); }
    .pool-table td { vertical-align: top; }
    .pool-sub { color: var(--muted); font-size: 12px; line-height: 1.45; }
    .pool-name { min-width: 160px; max-width: 260px; }
    .util-stack { min-width: 168px; display: flex; flex-direction: column; gap: 4px; }
    .util-row { display: grid; grid-template-columns: 22px 1fr 42px auto; gap: 4px; align-items: center; font-size: 12px; }
    .util-lab { color: var(--muted); }
    .util-track { height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
    .util-fill { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
    .util-fill.warm { background: var(--warn); }
    .util-fill.hot { background: var(--bad); }
    .util-pct { text-align: right; font-variant-numeric: tabular-nums; }
    .util-reset { color: var(--muted); white-space: nowrap; }
    .util-miss { color: var(--muted); }
    .tok-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; min-width: 140px; font-variant-numeric: tabular-nums; }
    .tok-stack em { color: var(--muted); font-style: normal; margin-right: 4px; }
    .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
    .btn {
      border: 1px solid var(--border-strong);
      background: var(--panel);
      border-radius: 6px;
      padding: 8px 18px;
      cursor: pointer;
      transition: all .15s;
      font-size: 14px;
    }
    .btn:hover { color: var(--primary); border-color: var(--primary); }
    .btn.primary {
      background: var(--primary);
      border-color: var(--primary);
      color: #fff;
      font-weight: 500;
    }
    .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
    .btn.danger {
      color: var(--bad);
      border-color: #ffccc7;
      background: var(--bad-bg);
    }
    .btn.danger:hover { border-color: var(--bad); }
    .btn:disabled { opacity: 0.45; cursor: not-allowed; }
    .tabs {
      display: flex;
      gap: 0;
      margin-bottom: 14px;
      border-bottom: 1px solid var(--border);
      background: transparent;
    }
    .tabs button {
      position: relative;
      border: none;
      border-bottom: 2px solid transparent;
      background: transparent;
      padding: 14px 20px;
      cursor: pointer;
      color: var(--muted);
      margin-bottom: -1px;
      font-size: 14px;
    }
    .tabs button.has-update {
      padding-right: 52px;
    }
    .tabs button:hover { color: var(--primary); }
    .tabs button.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
      font-weight: 600;
    }
    .tabs button .tab-update {
      position: absolute;
      top: 4px;
      right: 6px;
      display: inline-block;
      padding: 0 5px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 700;
      line-height: 16px;
      letter-spacing: 0.02em;
      color: #fff;
      background: #d4380d;
      pointer-events: none;
      animation: tab-update-pulse 1.6s ease-in-out infinite;
    }
    @keyframes tab-update-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.45; }
    }
    .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
    .field-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      color: var(--muted);
      white-space: nowrap;
    }
    .field-label .field { min-width: 180px; }
    .field-clearable {
      position: relative;
      display: inline-flex;
      align-items: center;
      flex: 0 1 auto;
      min-width: 140px;
    }
    .field-clearable .field {
      width: 100%;
      min-width: 0;
      padding-right: 32px;
      box-sizing: border-box;
    }
    .field-clearable .field-clear {
      position: absolute;
      right: 4px;
      top: 50%;
      transform: translateY(-50%);
      width: 24px;
      height: 24px;
      padding: 0;
      border: none;
      border-radius: 4px;
      background: transparent;
      color: rgba(0, 0, 0, 0.35);
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
    }
    .field-clearable .field-clear:hover {
      color: rgba(0, 0, 0, 0.65);
      background: rgba(0, 0, 0, 0.04);
    }
    .field {
      border: 1px solid var(--border-strong);
      background: var(--panel);
      border-radius: 6px;
      padding: 8px 12px;
      min-width: 160px;
      outline: none;
      font-size: 14px;
    }
    .field.field-block {
      min-width: 220px;
      max-width: 100%;
    }
    .field:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15); }
    .switch {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      user-select: none;
    }
    .switch .track {
      width: 40px; height: 22px;
      border: none;
      border-radius: 100px;
      background: rgba(0, 0, 0, 0.25);
      position: relative;
      transition: background .2s;
    }
    .switch .knob {
      position: absolute;
      top: 2px; left: 2px;
      width: 18px; height: 18px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      transition: left .2s;
    }
    .switch.on .track { background: var(--primary); }
    .switch.on .knob { left: 20px; }
    .panel {
      border: 1px solid var(--border);
      background: var(--panel);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 16px 18px;
      min-width: 0;
      overflow-wrap: anywhere;
    }
    .kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 14px; }
    .kv.kv-compact { grid-template-columns: 100px minmax(0, 1fr); gap: 10px 12px; }
    .kv > div { min-width: 0; }
    .kv div:nth-child(odd) { color: var(--muted); }
    .gateway-url-row {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      gap: 8px 10px;
    }
    .gateway-url-text {
      flex: 1 1 12rem;
      min-width: 0;
      word-break: break-all;
      color: var(--text, #1f1f1f);
      line-height: 1.5;
    }
    .gateway-key-list { display: flex; flex-direction: column; gap: 8px; }
    .gateway-key-row {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      gap: 10px 12px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }
    .gateway-key-row:last-child { border-bottom: none; }
    .gateway-key-pick {
      flex: 0 0 auto;
      padding-top: 4px;
    }
    .gateway-key-meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
      flex: 1 1 16rem;
    }
    .gateway-key-secret {
      display: block;
      font-size: 13px;
      line-height: 1.45;
      word-break: break-all;
      white-space: pre-wrap;
      color: var(--text, #1f1f1f);
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    }
    .gateway-key-meta .sub { margin: 0; color: var(--muted); font-size: 12px; }
    .gateway-key-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      flex: 0 0 auto;
    }
    .host-image-hint {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
    }
    .host-image-actions {
      flex-wrap: wrap;
      gap: 8px;
    }
    .health-list { list-style: none; padding: 0; margin: 0; }
    .health-list li {
      display: grid;
      grid-template-columns: 80px 1fr 100px;
      gap: 8px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }
    .health-list li:last-child { border-bottom: none; }
    .modal-back {
      position: fixed; inset: 0;
      background: rgba(0, 0, 0, 0.45);
      display: flex; align-items: center; justify-content: center;
      /* 高于 busy(80)，避免确认框被加载遮罩挡住点不到 */
      z-index: 90; padding: 20px;
    }
    .modal {
      background: var(--panel);
      border: none;
      border-radius: 12px;
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12);
      width: min(480px, 100%);
      max-height: 86vh;
      overflow: auto;
      padding: 20px 24px;
    }
    .modal h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
    .modal p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
    .modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
    .secret-box {
      border: 1px dashed var(--primary);
      border-radius: 8px;
      padding: 12px;
      background: var(--primary-soft);
      color: var(--primary-active);
      word-break: break-all;
      margin: 12px 0;
      font-family: "SF Mono", Menlo, Consolas, monospace;
      font-size: 14px;
    }
    .probe-answer {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px 14px;
      background: #fff;
      color: var(--text);
      white-space: pre-wrap;
      word-break: break-word;
      min-height: 4.5em;
      line-height: 1.55;
      font-size: 14px;
    }
    .toast {
      position: fixed; right: 16px; bottom: 16px;
      border: none;
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.85);
      color: #fff;
      padding: 14px 18px;
      z-index: 60;
      max-width: 360px;
      box-shadow: var(--shadow);
      font-size: 14px;
    }
    .wire-tag {
      display: inline-block;
      border: none;
      background: var(--primary-soft);
      color: var(--primary);
      font-size: 11px;
      padding: 2px 10px;
      margin-left: 8px;
      vertical-align: middle;
      border-radius: 4px;
      font-weight: 500;
    }
    .crumb { color: var(--muted); margin-bottom: 8px; font-size: 14px; }
    .crumb a { color: var(--primary); cursor: pointer; text-decoration: none; }
    .crumb a:hover { color: var(--primary-hover); }
    .split {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 12px;
      width: 100%;
    }
    .host-detail-split {
      align-items: stretch;
    }
    .host-detail-split > .panel {
      height: 100%;
      display: flex;
      flex-direction: column;
    }
    @media (max-width: 900px) {
      .app { grid-template-columns: 1fr; }
      .nav-toggle { display: inline-flex; }
      .top { padding: 10px 14px; }
      .top-badge { display: none; }
      .content { padding: 16px 14px; }
      .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
      }
      .app.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
      }
      .nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(280px, 86vw);
        z-index: 50;
        border-right: none;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
      .app.nav-open .nav { transform: translateX(0); }
      .app.nav-open { overflow: hidden; }
      .brand { margin-bottom: 12px; }
      .split { grid-template-columns: 1fr; }
      .list-desktop { display: none !important; }
      .list-mobile.list-cards { display: flex; }
      .list-card { padding: 12px 14px; }
      .list-card-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      /* 转接服务详情等：头栏 / Tab / kv / 健康层 */
      h1 { font-size: 20px; }
      .page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
      }
      .page-head .sub { margin-bottom: 0; }
      .page-head-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 0;
      }
      .page-head-actions .btn { flex: 1 1 auto; }
      .tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-left: -14px;
        margin-right: -14px;
        padding: 0 14px;
      }
      .tabs::-webkit-scrollbar { display: none; }
      .tabs button {
        flex: 0 0 auto;
        padding: 12px 14px;
        white-space: nowrap;
      }
      .tabs button.has-update { padding-right: 48px; }
      .kv,
      .kv.kv-compact {
        grid-template-columns: 1fr;
        gap: 2px 0;
      }
      .kv > div:nth-child(odd) {
        margin-top: 10px;
        font-size: 12px;
        line-height: 1.3;
      }
      .kv > div:nth-child(1) { margin-top: 0; }
      .kv > div:nth-child(even) {
        font-size: 14px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
      }
      .kv > div:nth-last-child(-n+2):nth-child(even),
      .kv > div:last-child:nth-child(even) { border-bottom: none; padding-bottom: 0; }
      .health-list li {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 12px 0;
      }
      .health-list li > span:last-child {
        color: var(--muted);
        font-size: 13px;
        word-break: break-word;
      }
      .panel { padding: 14px; }
      .toolbar { align-items: stretch; }
      .toolbar .field,
      .toolbar > .btn,
      .toolbar .field-label,
      .toolbar .field-clearable {
        flex: 1 1 auto;
        min-width: 0;
      }
      .toolbar .field-label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
      .toolbar .field-label .field,
      .toolbar .field-clearable .field,
      .toolbar .field { width: 100%; min-width: 0; }
      .kv .field,
      .field.field-block {
        display: block;
        width: 100%;
        min-width: 0 !important;
        max-width: 100%;
        box-sizing: border-box;
      }
      .kv .sub { display: block; margin: 6px 0 0 !important; }
      .secret-box {
        font-size: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
    }
.login{max-width:440px;margin:12vh auto;padding:32px;background:#fff;border-radius:12px;box-shadow:0 6px 16px rgba(0,0,0,.08)}
.login h1{font-size:21px;margin:0 0 12px}
.login-label{display:block;margin:0 0 6px;color:rgba(0,0,0,.65);font-size:13px}
.req{color:#cf1322;margin-left:2px}
.field-hint{margin:-2px 0 10px;color:rgba(0,0,0,.45);font-size:12px}
.field-hint.err{color:#ff4d4f}
.batch-ota-form{display:flex;flex-wrap:wrap;gap:16px 24px;align-items:flex-end}
.batch-ota-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted);min-width:140px}
.batch-ota-form .field{width:120px;margin:0}
.err{color:#ff4d4f;margin:8px 0;font-size:14px}
#inst-error{padding:8px 10px;background:rgba(255,77,79,.08);border:1px solid rgba(255,77,79,.35);border-radius:6px}
.alert-danger{
  display:flex;gap:12px;align-items:flex-start;
  margin:12px 0 16px;padding:14px 16px;
  color:#a8071a;background:#fff1f0;border:1px solid #ffa39e;border-radius:8px;
  font-size:14px;line-height:1.55;font-weight:600;
}
.alert-danger .alert-icon{
  flex:0 0 auto;width:22px;height:22px;margin-top:1px;color:#cf1322;
}
.alert-danger .alert-body{flex:1;min-width:0;white-space:pre-wrap;word-break:break-word}
.alert-danger .alert-body strong{color:#820014}
.spin-row{padding:16px 0}
.spin{display:inline-block;width:18px;height:18px;border:2px solid #d9d9d9;border-top-color:#1677ff;border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.busy-back{
  position:fixed;inset:0;z-index:80;
  background:rgba(255,255,255,.45);
  display:flex;align-items:center;justify-content:center;
  cursor:wait;
  -webkit-backdrop-filter:blur(1px);
  backdrop-filter:blur(1px);
}
.busy-card{
  display:flex;flex-direction:column;align-items:center;gap:12px;
  padding:22px 28px;border-radius:12px;
  background:var(--panel);
  box-shadow:0 6px 16px rgba(0,0,0,.08),0 3px 6px -4px rgba(0,0,0,.12);
}
.busy-spin{
  width:32px;height:32px;
  border:3px solid #d9d9d9;border-top-color:var(--primary);
  border-radius:50%;
  animation:spin .7s linear infinite;
}
.busy-text{font-size:14px;color:var(--muted);user-select:none}

.stats-kpi-head{
  display:flex;flex-wrap:wrap;gap:8px 14px;align-items:baseline;margin-bottom:12px;
}
.stats-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  align-items:stretch;
}
.stats-kpi-card{
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:14px 12px 12px;
  display:flex;flex-direction:column;gap:12px;align-items:stretch;
  min-width:0;height:100%;
}
.stats-kpi-card-title{
  display:flex;align-items:center;gap:6px;
  min-height:20px;
  font-size:13px;font-weight:600;color:var(--text);
}
.stats-kpi-tip{
  position:relative;display:inline-flex;align-items:center;justify-content:center;
  width:16px;height:16px;border-radius:50%;
  border:1px solid #faad14;color:#d48806;font-size:11px;font-weight:700;
  line-height:1;cursor:help;flex:0 0 auto;user-select:none;
}
.stats-kpi-tip-pop{
  display:none;position:absolute;left:0;top:calc(100% + 8px);z-index:5;
  min-width:260px;max-width:min(340px,70vw);padding:10px 12px;
  border-radius:8px;background:#1f1f1f;color:#fff;font-size:12px;font-weight:400;
  line-height:1.55;box-shadow:0 6px 18px rgba(0,0,0,.18);white-space:normal;
  pointer-events:none;text-align:left;
}
.stats-kpi-card:nth-child(n+3) .stats-kpi-tip-pop{
  left:auto;right:0;
}
.stats-kpi-tip:hover .stats-kpi-tip-pop,
.stats-kpi-tip:focus .stats-kpi-tip-pop,
.stats-kpi-tip:focus-within .stats-kpi-tip-pop{display:block}
.stats-kpi-nums{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px 12px;
  align-items:end;
  min-height:52px;
}
.stats-kpi-metric{min-width:0}
.stats-kpi-n{
  font-size:22px;font-weight:600;line-height:1.15;color:var(--text);
  font-variant-numeric:tabular-nums;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.stats-kpi-l{font-size:12px;color:var(--muted);margin-top:4px}
.stats-donut-wrap{
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  gap:8px;margin-top:auto;min-height:148px;
}
.stats-donut{position:relative;width:108px;height:108px;flex:0 0 auto}
.stats-donut svg{display:block}
.stats-donut-center{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-size:13px;font-weight:600;color:var(--text);pointer-events:none;
  text-align:center;padding:0 10px;line-height:1.2;
}
.stats-donut-legend{
  display:flex;flex-wrap:wrap;gap:6px 12px;justify-content:center;
  font-size:12px;color:var(--muted);min-height:18px;
}
.stats-donut-leg{display:inline-flex;align-items:center;gap:5px}
.stats-donut-leg i{
  width:8px;height:8px;border-radius:50%;display:inline-block;flex:0 0 auto;
}
@media (max-width:1100px){
  .stats-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stats-kpi-card:nth-child(even) .stats-kpi-tip-pop{left:auto;right:0}
  .stats-kpi-card:nth-child(odd) .stats-kpi-tip-pop{left:0;right:auto}
}
@media (max-width:900px){
  .stats-kpi-grid{grid-template-columns:1fr}
  .stats-kpi-n{font-size:20px}
  .stats-kpi-card .stats-kpi-tip-pop{left:0;right:auto}
}

.overview-req-stats-head{
  display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;justify-content:space-between;
}
.overview-req-stats-tools{margin:0;flex-wrap:wrap}
.overview-req-stats-meta{
  display:flex;flex-wrap:wrap;gap:12px 18px;align-items:center;
  margin:10px 0 6px;min-height:22px;font-size:13px;
}
.req-stats-legend{display:inline-flex;align-items:center;gap:6px;color:var(--text)}
.req-stats-dot{
  width:8px;height:8px;border-radius:50%;display:inline-block;
}
.req-stats-dot.ok{background:#389e0d}
.req-stats-dot.fail{background:#cf1322}
.overview-req-stats-chart{
  position:relative;
  width:100%;min-height:220px;border:1px solid var(--border);border-radius:8px;
  background:#fff;overflow:hidden;touch-action:pan-y;user-select:none;
}
.req-stats-zoom{
  position:absolute;top:8px;right:8px;z-index:2;
  display:flex;gap:4px;
}
.req-stats-zoom-btn{
  min-width:36px;padding:6px 10px;font-size:16px;line-height:1.1;
  background:rgba(255,255,255,.94);box-shadow:0 1px 2px rgba(0,0,0,.06);
}
.req-stats-svg{display:block;cursor:crosshair}
.req-stats-grid{stroke:#f0f0f0;stroke-width:1}
.req-stats-axis{fill:rgba(0,0,0,.45);font-size:11px}
.req-stats-line{stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.req-stats-line.ok{stroke:#389e0d}
.req-stats-line.fail{stroke:#cf1322}
.req-stats-line.token-in{stroke:#1677ff}
.req-stats-line.token-out-cli{stroke:#722ed1}
.req-stats-line.token-out-user{stroke:#eb2f96}
.req-stats-line.token-cache-cli{stroke:#13c2c2}
.req-stats-line.token-cache-user{stroke:#fa8c16}
.req-stats-dot.token-in{background:#1677ff}
.req-stats-dot.token-out-cli{background:#722ed1}
.req-stats-dot.token-out-user{background:#eb2f96}
.req-stats-dot.token-cache-cli{background:#13c2c2}
.req-stats-dot.token-cache-user{background:#fa8c16}
.req-stats-brush{fill:rgba(22,119,255,.12);stroke:rgba(22,119,255,.35);stroke-width:1}
@media (max-width:900px){
  .overview-req-stats-head{align-items:flex-start}
  .overview-req-stats-tools .btn{flex:1 1 auto}
}
