:root {
  --bg0: #0f1c17;
  --bg1: #163028;
  --ink: #e8f2ec;
  --muted: #9bb5a8;
  --accent: #3dcf8e;
  --panel: rgba(255, 255, 255, 0.06);
  --line: rgba(232, 242, 236, 0.12);
  --warn: #f0c674;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #1f4d3a 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #245a7a 0%, transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
}
.shell {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}
.shell.narrow { width: min(640px, calc(100% - 1.25rem)); }
.hero { margin-bottom: 1.5rem; }
.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.75rem;
  margin: 0 0 0.5rem;
}
h1 { margin: 0 0 0.6rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { margin: 0 0 0.8rem; font-size: 1.1rem; }
.lead { margin: 0; color: var(--muted); line-height: 1.6; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}
.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
}
.btn.primary {
  background: linear-gradient(135deg, #3dcf8e, #2aa8c8);
  color: #062016;
  font-weight: 700;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.status { color: var(--warn); margin: 0.8rem 0 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.identity .id-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 0.6rem;
}
.id-card > div {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  overflow: hidden;
}
.id-card strong { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.id-card .val {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 1.35;
  font-size: 0.92rem;
}
.id-card .val.mono {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.55rem 0.35rem;
}
.raw {
  margin-top: 0.8rem;
  max-height: 240px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.78rem;
}
.history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font: inherit;
}
.history-item:hover,
.history-item.active {
  border-color: rgba(61, 207, 142, 0.45);
  background: rgba(61, 207, 142, 0.08);
}
.history-item .meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.2rem;
}
.history-item .meta .line1 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}
.history-item .meta .line2 {
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.4;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.ok {
  color: #9ef0c5;
  border-color: rgba(61, 207, 142, 0.35);
  background: rgba(61, 207, 142, 0.12);
}
.badge.wait {
  color: var(--warn);
  border-color: rgba(240, 198, 116, 0.35);
  background: rgba(240, 198, 116, 0.1);
}
.history-item .chev {
  color: var(--muted);
  flex-shrink: 0;
}
.detail-empty {
  color: var(--muted);
  margin: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}
.field.inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.field span { color: var(--muted); font-size: 0.85rem; }
input, select, textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
}
.machine-list { display: grid; gap: 0.8rem; margin-bottom: 1rem; }
.machine-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(0, 0, 0, 0.16);
}
.machine-card header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  color: var(--accent);
}
code {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
