:root {
  --bg: #f4f7fb;
  --panel: #fff;
  --text: #1a2433;
  --muted: #5b6b80;
  --line: rgba(27, 55, 96, 0.12);
  --ok: #1b7a4b;
  --warn: #f07a1a;
  --bad: #c62828;
  --accent: #1b6fd6;
  --blue-deep: #0b3d91;
  --font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(800px 400px at 10% -10%, rgba(27,111,214,.14), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(240,122,26,.1), transparent 50%),
    linear-gradient(180deg, #eef4ff, #f7f9fc 45%, #fff);
}
.hidden { display: none !important; }
.panel, header, section, .tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}
.login-panel {
  margin-top: 12vh;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
h1 { margin: 0 0 0.25rem; font-size: 1.55rem; font-weight: 600; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 0.75rem; }
.muted { color: var(--muted); margin: 0; font-size: 0.9rem; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 0.4rem; }
input, select, button {
  font: inherit;
}
input, select {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
input:focus, select:focus {
  outline: 2px solid rgba(27,111,214,.28);
  border-color: rgba(27,111,214,.45);
}
button {
  padding: 0.55rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--blue-deep));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.login-panel a.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--blue-deep));
  color: #fff;
  font-weight: 700;
}
button.ghost, .tabs button {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}
.tabs { display: flex; gap: 0.5rem; padding-top: 0; padding-bottom: 0; flex-wrap: wrap; }
.tabs button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--blue-deep));
}
.err { color: var(--bad); min-height: 1.2em; font-size: 0.85rem; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: none;
  padding: 0.75rem 1.1rem;
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-actions { display: flex; gap: 0.5rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  padding-top: 0.75rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}
.card.clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card.clickable:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.card.clickable:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}
.card .n { font-size: 1.65rem; font-weight: 650; margin-top: 0.35rem; }
.card .hint { margin-top: 0.35rem; font-size: 0.75rem; color: var(--muted); }
.card .n.ok { color: var(--ok); }
.card .n.bad { color: var(--bad); }
.card .n.warn { color: var(--warn); }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.88rem;
}
th, td { padding: 0.6rem 0.7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 0.78rem; }
tr:last-child td { border-bottom: 0; }
.dot {
  display: inline-block;
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.dot.on { background: var(--ok); }
.dot.off { background: var(--muted); }
.dot.degraded { background: var(--warn); }
.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
}
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.badge.warn { color: var(--warn); }
.events { list-style: none; margin: 0; padding: 0; }
.events li {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.events .sev-critical { border-left: 3px solid var(--bad); }
.events .sev-warn { border-left: 3px solid var(--warn); }
.events .sev-info { border-left: 3px solid var(--accent); }
.upload {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.row-between { display: flex; justify-content: space-between; align-items: center; }
.detail {
  margin-top: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
.detail-text { white-space: pre-wrap; }
.tunnel-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
  margin-top: 0.85rem;
}
.tunnel-form label { min-width: 8rem; }
.tunnel-form .muted { flex: 1 1 100%; margin: 0; }
.plugin-panel {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.plugin-panel h3 { margin: 0 0 .35rem; }
.plugin-panel h4 { margin: 1rem 0 .4rem; font-size: 0.95rem; }
.tip-list { margin: 0; padding-left: 1.1rem; }
.tip-list li { margin: 0.35rem 0; }
.plugin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.plugin-table th,
.plugin-table td {
  border: 1px solid var(--line);
  padding: 0.4rem 0.55rem;
  text-align: left;
}
.plugin-table th { background: rgba(27, 111, 214, 0.06); }
.plugin-cell { max-width: 16rem; font-size: 0.82rem; line-height: 1.35; }
.site-frame {
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 640px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.job-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
}
.linkish { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 500; cursor: pointer; }
.install-hero h2 { margin: 0 0 .35rem; }
.install-hero { margin-bottom: .85rem; }
.seed-status {
  display: inline-flex; align-items: center;
  margin: .55rem 0 0; padding: .45rem .75rem; border-radius: 999px;
  font-size: .82rem; font-weight: 700; background: #fff; border: 1px solid var(--line);
}
.seed-status.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.seed-status.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.install-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: .85rem;
  display: grid;
  gap: .7rem;
}
.install-card h3 { margin: 0; font-size: 1rem; }
.install-card textarea {
  width: 100%; min-height: 88px; resize: vertical;
  padding: .85rem .9rem; border-radius: 14px;
  border: 1px solid var(--line); font: inherit; line-height: 1.45;
}
.btn-block {
  width: 100%; min-height: 48px; border-radius: 14px; font-size: 1rem;
}
.ghost-block {
  background: #fff !important;
  color: var(--blue-deep) !important;
  border: 1px solid var(--line) !important;
}
.install-out {
  white-space: pre-wrap; word-break: break-all;
  padding: .85rem .9rem; border-radius: 14px;
  background: #f7faff; border: 1px solid var(--line);
  font-size: .92rem; line-height: 1.5;
}
.install-out.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.install-out.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.install-out.err { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }
.install-list { display: grid; gap: .65rem; }
.install-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem .9rem;
  background: #fff;
  display: grid;
  gap: .35rem;
}
.install-item-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.install-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem; word-break: break-all; font-weight: 700; color: var(--blue-deep);
}
.install-machine {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem; word-break: break-all; color: var(--muted);
}
.install-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.install-actions button {
  min-height: 40px; padding: .55rem 1rem;
}
.install-actions button.danger {
  background: #fff;
  color: var(--bad);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line));
}
.install-empty {
  padding: 1rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 14px;
}
@media (max-width: 800px) {
  table { display: block; overflow-x: auto; }
  .panel, header, section, .tabs { padding-left: .85rem; padding-right: .85rem; }
  header { gap: .55rem; align-items: flex-start; }
  header h1 { font-size: 1.15rem; }
  .tabs { gap: .4rem; }
  .tabs button { min-height: 40px; padding: .45rem .8rem; font-size: .86rem; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload { grid-template-columns: 1fr; }
  .row-between { flex-wrap: wrap; gap: .45rem; }
  .site-frame { min-height: 70vh; height: calc(100vh - 120px); }
  input, select, textarea, button { font-size: 16px; } /* 避免 iOS 自动放大 */
}
