:root {
  --bg: #050711;
  --panel: rgba(11, 18, 36, 0.82);
  --panel-2: rgba(15, 25, 48, 0.74);
  --line: rgba(118, 141, 255, 0.22);
  --line-2: rgba(35, 240, 208, 0.38);
  --text: #f4f7ff;
  --muted: #9fb0ca;
  --dim: #6e7e9d;
  --cyan: #23f0d0;
  --blue: #4f8cff;
  --violet: #9b5cf6;
  --red: #ff7082;
  --green: #31d69b;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(79, 140, 255, .24), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(155, 92, 246, .24), transparent 32%),
    radial-gradient(circle at 78% 82%, rgba(35, 240, 208, .14), transparent 30%),
    linear-gradient(135deg, #050711, #08101f 48%, #071512);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(118, 141, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 141, 255, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  color: #04100e;
  background: linear-gradient(135deg, var(--cyan), var(--blue) 58%, var(--violet));
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(35, 240, 208, .16);
}

button:hover { transform: translateY(-1px); }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 11, 25, .74);
  color: var(--text);
  padding: 0 12px;
}

textarea {
  min-height: 78px;
  padding: 10px 12px;
  resize: vertical;
}

input.center-file-input {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  text-align: center;
}

input.center-file-input::file-selector-button {
  margin: 0 12px 0 0;
  border: 0;
  border-radius: 8px;
  background: rgba(35, 240, 208, .18);
  color: var(--cyan);
  padding: 7px 12px;
  font: inherit;
  font-weight: 800;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-screen {
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  padding: 34px;
}

.ambient i {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: .38;
  animation: drift 13s ease-in-out infinite alternate;
}
.ambient i:nth-child(1) { left: 8%; top: 10%; background: radial-gradient(circle, var(--blue), transparent 65%); }
.ambient i:nth-child(2) { right: 10%; top: 8%; background: radial-gradient(circle, var(--violet), transparent 65%); animation-delay: -4s; }
.ambient i:nth-child(3) { right: 14%; bottom: 8%; background: radial-gradient(circle, var(--cyan), transparent 65%); animation-delay: -8s; }
.ambient i:nth-child(4) { left: 28%; bottom: -12%; background: radial-gradient(circle, #4f46e5, transparent 65%); animation-delay: -10s; }

.landing-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: calc(100dvh - 68px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
  align-items: center;
  gap: 34px;
  padding-bottom: 42px;
}

.landing-copy {
  position: relative;
  z-index: 2;
}

.client-logo-slot, .login-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 72px;
  border: 1px solid rgba(35, 240, 208, .38);
  border-radius: 18px;
  color: var(--cyan);
  background: rgba(6, 12, 26, .62);
  box-shadow: inset 0 0 24px rgba(35, 240, 208, .08), 0 18px 55px rgba(0,0,0,.24);
}

.client-logo-slot span, .login-logo span {
  font-size: 16px;
  font-weight: 900;
}

.client-logo-slot em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.landing-kicker {
  margin: 34px 0 14px;
  color: var(--cyan);
  font-weight: 800;
}

.landing-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.05;
  letter-spacing: 0;
}

.landing-subtitle {
  max-width: 610px;
  margin: 22px 0 0;
  color: #c4d2e8;
  font-size: 18px;
  line-height: 1.7;
}

.landing-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 28px;
}

.landing-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 28px;
  border-radius: 999px;
  color: #04100e;
  text-decoration: none;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue) 68%, var(--violet));
  box-shadow: 0 20px 46px rgba(35,240,208,.22);
}

.landing-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
  margin-top: 42px;
}

.landing-stats article {
  min-height: 116px;
  padding: 18px;
  border: 1px solid rgba(118, 141, 255, .2);
  border-radius: 18px;
  background: rgba(7, 15, 30, .62);
  backdrop-filter: blur(16px);
}

.landing-stats strong {
  display: block;
  margin-bottom: 10px;
  color: #fff;
  font-size: 18px;
}

.landing-stats span {
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.landing-visual {
  position: absolute;
  right: 330px;
  top: 50%;
  width: 330px;
  height: 330px;
  transform: translateY(-54%);
  opacity: .95;
  pointer-events: none;
}

.pack-card {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(35, 240, 208, .28);
  border-radius: 30px;
  background: linear-gradient(160deg, rgba(15,25,48,.78), rgba(4,11,22,.5));
  box-shadow: 0 34px 90px rgba(0,0,0,.42), inset 0 0 60px rgba(35,240,208,.08);
  animation: floatPack 7s ease-in-out infinite;
}

.pack-head {
  display: flex;
  gap: 8px;
  padding: 22px 22px 0;
}

.pack-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(35,240,208,.8);
}

.battery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 28px 22px 18px;
}

.battery-grid i {
  height: 62px;
  border: 1px solid rgba(118, 141, 255, .28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(35,240,208,.22), rgba(79,140,255,.08));
}

.battery-grid i:nth-child(2n) {
  animation: pulseCell 2.8s ease-in-out infinite;
}

.signal-line {
  width: calc(100% - 44px);
  height: 2px;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent);
  animation: scanLine 2.4s linear infinite;
}

.trace-chip {
  width: max-content;
  margin: 0 auto;
  padding: 8px 14px;
  border: 1px solid rgba(35,240,208,.3);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(6,12,26,.8);
  font-size: 12px;
  font-weight: 800;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)), rgba(9, 14, 30, .78);
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(0,0,0,.42);
}

.login-logo {
  display: flex;
  width: 96px;
  height: 62px;
  margin: 0 auto 18px;
}

.login-card h1 { margin: 16px 0 4px; font-size: 32px; }
.login-card h1, .login-card p { text-align: center; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.login-card label { margin-bottom: 14px; }
.login-card button {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 180px;
  margin: 8px auto 0;
}
.login-card small { display: block; min-height: 20px; margin-top: 12px; color: #ffd175; }

.landing-icp {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.brand span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #04100e;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--violet));
  box-shadow: 0 0 32px rgba(35,240,208,.28);
}

.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 0;
  border-right: 1px solid var(--line);
  background: rgba(5, 10, 22, .9);
}

.brand {
  display: block;
  align-items: center;
  margin: 0 14px 16px;
  max-width: calc(100% - 28px);
  color: inherit;
  text-decoration: none;
}
.brand span {
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  border-radius: 14px;
  color: #04100e;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--violet));
  box-shadow: 0 0 32px rgba(35,240,208,.28);
  white-space: nowrap;
  overflow: hidden;
}
.brand strong { display: inline; flex: 0 0 auto; font-size: 16px; }
.brand em { display: inline; min-width: 0; overflow: hidden; color: rgba(4,16,14,.78); font-size: 13px; font-style: normal; text-overflow: ellipsis; }

.sidebar nav {
  padding: 10px 0;
}
.sidebar nav button {
  width: 100%;
  justify-content: flex-start;
  border-radius: 0;
  background: transparent;
  color: #d7e8f4;
  box-shadow: none;
  text-align: left;
  padding-left: 28px;
  border-left: 4px solid transparent;
}
.sidebar nav button.active {
  color: var(--cyan);
  background: linear-gradient(90deg, rgba(35,240,208,.18), transparent);
  border-left-color: var(--cyan);
}
.nav-group .nav-parent {
  color: #eef8ff;
  font-weight: 800;
}
.nav-group .nav-sub {
  display: grid;
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s ease;
}
.nav-group.active .nav-sub {
  max-height: 96px;
}
.nav-group .nav-sub button {
  padding-left: 46px;
  color: #a9c1d1;
  font-size: 13px;
}
.nav-group .nav-sub button.active {
  color: var(--cyan);
}
.copy {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.workspace { padding: 22px 28px 40px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  backdrop-filter: blur(16px);
}
.topbar h1 { margin: 0 0 4px; }
.topbar p { margin: 0; color: var(--muted); }
.userbox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.userbox span { color: var(--cyan); font-weight: 800; }

.view { display: none; }
.view.active { display: block; }
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.metrics article, .panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(0,0,0,.24);
}
.metrics article { min-height: 118px; padding: 18px; }
.metrics span { color: var(--muted); }
.metrics b { display: block; margin-top: 14px; font-size: 34px; }
.panel { padding: 20px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 16px; }
.muted { color: var(--muted); }
.form-span { grid-column: 1 / -1; margin: -4px 0 0; font-size: 12px; line-height: 1.5; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr);
  gap: 16px;
}
.progress-list, .health-list, .node-board, .alert-list, .fail-list {
  display: grid;
  gap: 10px;
}
.progress-item {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(140px, 260px) 52px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(35,240,208,.18);
  border-radius: 14px;
  background: rgba(6,12,26,.58);
}
.progress-item b, .node-card b, .fail-row b {
  color: var(--cyan);
}
.progress-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.progress-item em {
  color: var(--text);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}
.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(118,141,255,.16);
}
.progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}
.trace-health {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
}
.trace-health.text-only { grid-template-columns: 1fr; }
.health-list div, .alert-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgba(118,141,255,.18);
  border-radius: 12px;
  background: rgba(6,12,26,.48);
}
.health-list span, .alert-list span, .node-card span, .fail-row span, .fail-row em {
  color: var(--muted);
  font-size: 12px;
}
.health-list b, .alert-list b {
  color: var(--text);
  font-size: 18px;
}
.node-card {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(35,240,208,.18);
  border-radius: 14px;
  background: rgba(6,12,26,.58);
}
.node-card .ok {
  color: var(--green);
}
.node-card .bad {
  color: var(--red);
}
.fail-row {
  display: grid;
  grid-template-columns: 170px 120px minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,112,130,.22);
  border-radius: 14px;
  background: rgba(255,112,130,.06);
}
.fail-row em {
  font-style: normal;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.empty-state {
  padding: 18px;
  border: 1px dashed rgba(118,141,255,.26);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  background: rgba(6,12,26,.42);
}

.flow, .template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.donut-board {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.donut {
  --rate: 0%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: auto;
  background: conic-gradient(var(--cyan) var(--rate), rgba(118,141,255,.18) 0);
  box-shadow: 0 0 40px rgba(35,240,208,.18);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #07101e;
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: 34px;
  font-weight: 900;
  color: var(--cyan);
}

.stat-list p {
  margin: 0 0 12px;
  color: var(--muted);
}

.api-card code {
  display: block;
  overflow-wrap: anywhere;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--cyan);
  background: rgba(6,12,26,.72);
}
.flow span, .template-card, .trace-result, .report-box, #auditList {
  border: 1px solid rgba(35,240,208,.2);
  border-radius: 16px;
  background: rgba(6, 12, 26, .58);
  padding: 14px;
}
.api-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.api-examples pre {
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(35,240,208,.2);
  border-radius: 12px;
  background: rgba(6,12,26,.72);
  color: #d7e8f4;
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: end;
}
.order-form {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.settings-actions {
  margin: 14px 0 16px;
}
.manual-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  color: #04100e;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--blue) 58%, var(--violet));
  box-shadow: 0 14px 34px rgba(35, 240, 208, .16);
}
.file-action input {
  display: none;
}
.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px; border-bottom: 1px solid rgba(118,141,255,.14); text-align: left; }
th { color: var(--muted); background: rgba(35,240,208,.08); }
td strong { color: var(--cyan); }
.orders-table { min-width: 1320px; table-layout: fixed; }
.orders-table .order-no-col { width: 17%; }
.orders-table .model-col { width: 14%; }
.orders-table .quantity-col { width: 7%; }
.orders-table .batch-col { width: 19%; }
.orders-table .sn-col { width: 20%; }
.orders-table .actions-col { width: 23%; }
.orders-table th, .orders-table td { white-space: nowrap; }
.orders-table td { overflow: hidden; text-overflow: ellipsis; }
.orders-table td:last-child { overflow: visible; }
.orders-table td:last-child > .mini-btn + .mini-btn { margin-inline-start: 8px; }
.orders-table .order-model-cell { font-weight: 600; }
.badge-pass { color: var(--green); }
.badge-fail { color: var(--red); }
.badge-pending { color: #f6c85f; }

.trace-result { margin-top: 16px; }
.trace-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.trace-section-title { margin: 22px 0 10px; font-size: 16px; color: var(--ui-text); }
.trace-certificate { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding: 14px; background: rgba(255,255,255,.72); border: 1px solid var(--ui-border); border-radius: 8px; }
.trace-certificate span { display: flex; flex-direction: column; gap: 3px; }
.trace-certificate b { color: var(--ui-muted); font-size: 12px; font-weight: 600; }
.trace-certificate em { color: var(--ui-text); font-style: normal; font-size: 13px; }
.trace-meta span { color: var(--muted); }
.international-view { max-width: 920px; margin: 28px auto; background:#fff; color:#1f2937; border:1px solid #e5e7eb; padding:28px; }
.international-head { display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid #e5e7eb; }
.international-head .international-brand { border-bottom:0; }
.international-head button { border:1px solid #d1d5db; background:#fff; color:#374151; padding:8px 14px; border-radius:6px; cursor:pointer; }
.international-brand { color:#b91c1c; font-size:24px; font-weight:800; letter-spacing:.4px; border-bottom:1px solid #e5e7eb; padding-bottom:18px; }
.international-logo-row { display:flex; align-items:center; gap:18px; padding:22px 0; border-bottom:1px solid #e5e7eb; }
.international-logo-row h1 { margin:0; font-size:24px; color:#111827; }
.international-logo-row p { margin:5px 0 0; color:#6b7280; }
.international-mark { font-family:Arial,sans-serif; font-size:46px; font-weight:900; letter-spacing:-5px; color:#111827; line-height:1; }
.international-table { margin-top:18px; border-top:1px solid #e5e7eb; }
.international-row { display:grid; grid-template-columns:260px 1fr; min-height:46px; border-bottom:1px solid #e5e7eb; }
.international-row:nth-child(even) { background:#f8f8f8; }
.international-row b,.international-row span { padding:13px 14px; }
.international-row b { font-weight:600; color:#4b5563; }
.international-row span { color:#111827; overflow-wrap:anywhere; }
.international-row a { color:#2563eb; }
.international-note { color:#6b7280; font-size:12px; margin-top:18px; }
.international-query { display:flex; gap:10px; margin:18px 0; }
.international-query input { flex:1; min-width:0; border:1px solid #d1d5db; padding:10px 12px; color:#111827; background:#fff; }
.international-query button { border:0; padding:0 18px; background:#2563eb; color:#fff; cursor:pointer; }
.international-empty { padding:28px 0; color:#6b7280; }
.order-mark-fieldset { border:1px solid var(--ui-border, #d9dee8); border-radius:8px; padding:14px 16px 16px; min-width:0; }
.order-mark-fieldset legend { padding:0 6px; color:var(--ui-text, #20242a); font-weight:700; }
.order-mark-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)); gap:10px 16px; margin-top:10px; }
.chemical-editor { display:grid; gap:14px; }
.chemical-editor-actions { display:flex; align-items:end; gap:10px; flex-wrap:wrap; }
.chemical-rows { display:grid; gap:10px; }
.chemical-row { display:grid; grid-template-columns:minmax(150px, .65fr) minmax(0, 1fr); gap:10px; align-items:center; }
.chemical-name { font-weight:600; color:var(--text-strong); }
.chemical-message { padding:12px 14px; border:1px solid currentColor; border-radius:6px; color:var(--ui-text, #20242a); background:var(--ui-surface, #fff); overflow-wrap:anywhere; }
.chemical-message:empty { display:none; }
.chemical-message[data-status="success"] { color:#166534; background:#f0fdf4; }
.chemical-message[data-status="error"] { color:#991b1b; background:#fef2f2; }
.chemical-message[data-status="loading"] { color:#1e40af; background:#eff6ff; }
html[data-theme="dark"] .chemical-message[data-status="success"] { color:#86efac; background:#143225; }
html[data-theme="dark"] .chemical-message[data-status="error"] { color:#fca5a5; background:#3c2024; }
html[data-theme="dark"] .chemical-message[data-status="loading"] { color:#bfdbfe; background:#1e2d44; }
.chemical-row input[aria-invalid="true"] { outline:2px solid #dc2626; outline-offset:1px; }
.fixed-manufacturer-note { display:grid; gap:4px; padding:12px 14px; border:1px solid var(--border); border-radius:8px; background:var(--surface-muted); }
.fixed-manufacturer-note span { color:var(--text-strong); }
.fixed-manufacturer-note small { color:var(--text-muted); line-height:1.5; }
.order-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
@media(max-width:650px) { .chemical-row { grid-template-columns:1fr; } }
.international-mode #internationalView { display:none; }
.international-mode #docs { display:none; }
#orderCreateMsg { color:var(--ui-text); overflow-wrap:anywhere; margin-bottom:12px; }
#orderCreateMsg:empty { display:none; }
.order-form label { min-width:0; }
.order-form input { width:100%; min-width:0; }
.translation-fields { display:grid; gap:8px; padding:12px; border:1px solid var(--ui-border, #d9dee8); border-radius:8px; color:var(--ui-text, #20242a); }
.translation-fields > b { font-size:13px; }
.translation-fields details { border-top:1px solid var(--ui-border, #d9dee8); padding-top:8px; }
.translation-fields summary { min-height:40px; display:flex; align-items:center; cursor:pointer; font-weight:600; }
.translation-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:10px; padding:8px 0 12px; }
.translation-grid label { display:grid; gap:5px; min-width:0; }
.translation-grid input { width:100%; min-width:0; }
@media (max-width:700px) { .international-view { margin:12px; padding:18px; } .international-row { grid-template-columns: minmax(130px, 42%) 1fr; } .international-query { flex-direction:column; } .international-query button { min-height:40px; } }
.record-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.record-list li { display: grid; grid-template-columns: 160px 1fr 80px 150px; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.record-list em { font-style: normal; color: var(--cyan); font-weight: 800; }
.record-list small { color: var(--muted); }

.trace-page { display: grid; place-items: center; padding: 24px; }
.public-trace { width: min(860px, 100%); text-align: center; }
.public-trace .logo-ring { margin: 0 auto 14px; }
.trace-title-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  margin-bottom: 14px;
  border-radius: 999px;
  color: #04100e;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--violet));
}

@keyframes drift {
  from { transform: translate(-18px, -10px) scale(.96); }
  to { transform: translate(18px, 14px) scale(1.04); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .copy { position: static; margin: 16px 14px 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .progress-item, .fail-row, .node-card { grid-template-columns: 1fr; }
  .trace-health { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .donut-board { grid-template-columns: 1fr; }
}

/* 商用后台按钮规范：实色主操作、描边次操作、轻量危险操作。 */
#app .workspace button:not(.nav-parent),
#app .file-action,
#app .mini-btn,
#app .ghost-btn,
#app .modal-foot button {
  min-height: 36px;
  border: 1px solid var(--ui-border, #d8dee8);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ui-text, #1f2937);
  background: var(--ui-surface, #fff);
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

#app .workspace button:not(.nav-parent):not([data-view]):hover,
#app .file-action:hover,
#app .mini-btn:hover,
#app .ghost-btn:hover,
#app .modal-foot button:hover {
  transform: none;
  border-color: var(--ui-accent, #2563eb);
  color: var(--ui-accent, #2563eb);
  background: var(--ui-surface-soft, #f5f8fc);
  box-shadow: 0 2px 6px rgba(31, 41, 55, .08);
}

#app button[type="submit"],
#app button.primary,
#app .quick-actions button:first-child,
#app .settings-actions button:first-child,
#app .form-grid > button,
#app .search-row > button,
#app .modal-foot button.primary {
  border-color: var(--ui-accent, #2563eb);
  color: #fff;
  background: var(--ui-accent, #2563eb);
}

#app button[type="submit"]:hover,
#app button.primary:hover,
#app .quick-actions button:first-child:hover,
#app .settings-actions button:first-child:hover,
#app .form-grid > button:hover,
#app .search-row > button:hover,
#app .modal-foot button.primary:hover {
  border-color: var(--ui-accent-strong, #1d4ed8);
  color: #fff;
  background: var(--ui-accent-strong, #1d4ed8);
}

#app .mini-btn {
  min-height: 30px;
  padding: 0 10px;
  color: var(--ui-accent, #2563eb);
  border-color: var(--ui-accent, #2563eb);
  background: var(--ui-surface, #fff);
  font-size: 12px;
}

#app .mini-btn.danger,
#app button[style*="dc2626"] {
  color: #b42318 !important;
  border-color: #e6a5a0 !important;
  background: #fff !important;
}

#app .mini-btn.danger:hover,
#app button[style*="dc2626"]:hover {
  color: #fff !important;
  border-color: #b42318 !important;
  background: #b42318 !important;
}

#app button:disabled,
#app .file-action input:disabled {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

#app .quick-actions button[data-view] {
  min-height: 40px;
  justify-content: flex-start;
  text-align: left;
}

#app .sidebar nav button[data-view] {
  border: 0;
  box-shadow: none;
}

html[data-theme="dark"] #app .workspace button:not(.nav-parent),
html[data-theme="dark"] #app .file-action,
html[data-theme="dark"] #app .mini-btn,
html[data-theme="dark"] #app .ghost-btn,
html[data-theme="dark"] #app .modal-foot button {
  color: var(--ui-text, #e5e7eb);
  border-color: var(--ui-border, #364152);
  background: var(--ui-surface, #111827);
}

html[data-theme="dark"] #app .mini-btn,
html[data-theme="dark"] #app .ghost-btn {
  color: var(--ui-accent, #60a5fa);
  border-color: var(--ui-accent, #60a5fa);
}

/* 订单管理沿用扫码追溯的查询按钮：蓝色主操作，页面内操作保持一致。 */
#app #orders button:not([data-view]) {
  min-height: 36px;
  border: 1px solid var(--ui-accent, #1677ff);
  border-radius: 6px;
  color: #fff;
  background: var(--ui-accent, #1677ff);
  box-shadow: none;
  font-weight: 600;
}

#app #orders button:not([data-view]):hover {
  transform: none;
  border-color: var(--ui-accent-strong, #0958d9);
  color: #fff;
  background: var(--ui-accent-strong, #0958d9);
  box-shadow: 0 2px 6px rgba(22, 119, 255, .2);
}

#app #orders button:disabled {
  color: #fff;
  border-color: #91bfff;
  background: #91bfff;
  box-shadow: none;
}

@media (max-width: 560px) {
  .workspace { padding: 16px; }
  .metrics { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
}

/* ===== 新增：首页圆环 ===== */
.donut-board { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.donut-small { position: relative; width: 130px; height: 130px; border-radius: 50%;
  background: conic-gradient(#2563eb var(--rate), #e2e8f0 0); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; }
.donut-small::before { content: ""; position: absolute; inset: 14px; background: #fff; border-radius: 50%; }
.donut-small > * { position: relative; z-index: 1; }
.donut-small span { font-size: 12px; font-weight: 700; color: #2563eb; }
.donut-small .dvalue { font-size: 24px; font-weight: 800; color: #1e293b; line-height: 1.1; }
.donut-small .dlabel { font-size: 12px; color: #64748b; }

/* ===== 新增：打印标签模态框 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.6); display: flex; align-items: center; justify-content: center; z-index: 99; }
.modal { background: #fff; border-radius: 14px; padding: 24px; max-width: 720px; width: 92%; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 17px; }
.modal-head button { border: none; background: none; font-size: 18px; cursor: pointer; }
.label-row { display: flex; gap: 20px; flex-wrap: wrap; }
.label-card { flex: 1; min-width: 260px; border: 1px dashed #94a3b8; border-radius: 10px; padding: 16px; text-align: center; }
.label-card h4 { margin-bottom: 10px; color: #1e293b; }
.label-card .label-line { font-size: 13px; color: #334155; margin: 4px 0; }
.label-card #qrPcba, .label-card #qrCell { display: inline-block; margin-bottom: 8px; }
.modal-foot { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-foot button { padding: 9px 20px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; cursor: pointer; }
.modal-foot button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.mini-btn { padding: 5px 10px; border: 1px solid #2563eb; color: #2563eb; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.mini-btn:hover { background: #2563eb; color: #fff; }
.mini-btn.danger { border-color: #dc2626; color: #dc2626; }
.mini-btn.danger:hover { background: #dc2626; color: #fff; }
.user-row { gap: 12px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media print { .modal-mask { position: static; background: #fff; } .modal { box-shadow: none; max-width: 100%; } .modal-head, .modal-foot { display: none; } }

/* ===== 商用登录页 ===== */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-layout { display: flex; gap: 56px; align-items: center; justify-content: center; padding: 32px; position: relative; z-index: 2; flex-wrap: wrap; }
.login-brand { max-width: 420px; color: #fff; }
.brand-badge .logo-ring { margin: 0 0 20px; }
.brand-badge h1 { font-size: 44px; margin: 0 0 8px; color: #fff; letter-spacing: 1px; }
.brand-badge p { color: rgba(255,255,255,.75); margin: 0 0 28px; font-size: 16px; }
.brand-points { list-style: none; padding: 0; margin: 0 0 24px; }
.brand-points li { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 15px; color: rgba(255,255,255,.9); }
.brand-points li b { color: #ffd175; }
.brand-foot { font-size: 12px; color: rgba(255,255,255,.5); letter-spacing: 3px; }
.login-card { width: 380px; background: rgba(255,255,255,.97); border-radius: 20px; padding: 36px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.login-card .logo-ring.small { width: 48px; height: 48px; font-size: 22px; margin: 0 auto 14px; }
.login-card h2 { text-align: center; margin: 0 0 4px; color: #1e293b; }
.login-card p { text-align: center; color: #94a3b8; font-size: 12px; margin: 0 0 22px; letter-spacing: .5px; }
@media (max-width: 820px) { .login-layout { flex-direction: column; gap: 28px; } .login-brand { max-width: 100%; text-align: center; } .brand-points { text-align: left; } }

/* ===== 商用仪表盘 ===== */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.dash-card { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 4px 20px rgba(15,23,42,.06); border: 1px solid #eef2f7; }
.dash-card .dc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dash-card .dc-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.dash-card .dc-num { font-size: 32px; font-weight: 800; color: #0f172a; line-height: 1; }
.dash-card .dc-label { font-size: 13px; color: #64748b; margin-top: 6px; }
.dash-bottom { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.dash-panel { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 4px 20px rgba(15,23,42,.06); border: 1px solid #eef2f7; }
.dash-panel h3 { margin: 0 0 14px; font-size: 15px; color: #1e293b; }
.dash-list { display: flex; flex-direction: column; gap: 10px; }
.dash-list .item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #f8fafc; border-radius: 10px; font-size: 13px; }
.dash-list .item b { color: #0f172a; }
.dash-list .item .t { color: #64748b; font-size: 12px; }
.donut-board { display: flex; flex-wrap: wrap; gap: 20px; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } .dash-bottom { grid-template-columns: 1fr; } }

/* ===== 极简登录页（深色玻璃） ===== */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 400px; background: rgba(15,23,42,.72); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 40px 36px; box-shadow: 0 24px 80px rgba(0,0,0,.5); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.login-card label { color: rgba(255,255,255,.85); }
.login-card input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.login-card input::placeholder { color: rgba(255,255,255,.4); }
.login-card button { background: #2563eb; color: #fff; }
.login-logo { text-align: center; margin-bottom: 14px; }
.login-logo svg { filter: drop-shadow(0 8px 20px rgba(37,99,235,.45)); }
.login-title { text-align: center; font-size: 26px; letter-spacing: 2px; color: #fff; margin: 0 0 4px; }
.login-card > p { text-align: center; color: rgba(255,255,255,.6); font-size: 13px; margin: 0 0 24px; }

/* ===== 订单资料闭环 ===== */
.doc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.doc-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; gap: 12px; flex-wrap: wrap; }
.doc-card.doc-ok { border-color: #bbf7d0; background: #f0fdf4; }
.doc-card.doc-missing { border-color: #fecaca; background: #fef2f2; }
.doc-info b { font-size: 15px; color: #0f172a; }
.doc-info .t { font-size: 12px; color: #64748b; margin-top: 4px; }
.doc-req { display: inline-block; background: #dc2626; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 8px; margin-left: 8px; }
.doc-opt { display: inline-block; background: #94a3b8; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 8px; margin-left: 8px; }
.doc-link { font-size: 12px; color: #2563eb; margin-left: 10px; }
.doc-actions { display: flex; gap: 6px; align-items: center; }
.badge-pass { background: #f0fdf4; color: #16a34a; font-weight: 600; }
.badge-fail { background: #fef2f2; color: #dc2626; font-weight: 600; }
.search-row { display: flex; gap: 10px; margin: 12px 0; }
.search-row input { flex: 1; }
.search-row button { padding: 10px 22px; background: #2563eb; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; white-space: nowrap; }

/* ===== 3C证书管理 ===== */
.cert-item { border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 8px; background: #fff; }
.cert-item summary { padding: 12px 14px; cursor: pointer; font-size: 14px; list-style: none; }
.cert-item summary::-webkit-details-marker { display: none; }
.cert-item[open] summary { border-bottom: 1px solid #eef2f7; }
.cert-parts { padding: 10px 14px; }
.part-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #e2e8f0; }
.calib-alert { margin-bottom: 12px; }

/* ===== 首页最终样式覆盖：电池Pack厂 3C新国标MES入口 ===== */
.login-screen {
  display: block;
  min-height: 100dvh;
  padding: 34px;
}

.landing-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  min-height: calc(100dvh - 68px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 420px);
  align-items: center;
  gap: 34px;
  padding-bottom: 42px;
}

.landing-copy h1 {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.05;
  letter-spacing: 0;
}

.landing-kicker {
  margin: 34px 0 14px;
  color: var(--cyan);
  font-weight: 800;
}

.landing-subtitle {
  max-width: 610px;
  margin: 22px 0 0;
  color: #c4d2e8;
  font-size: 18px;
  line-height: 1.7;
}

.client-logo-slot, .login-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 72px;
  border: 1px solid rgba(35, 240, 208, .38);
  border-radius: 18px;
  color: var(--cyan);
  text-align: center;
  background: rgba(6, 12, 26, .62);
  box-shadow: inset 0 0 24px rgba(35, 240, 208, .08), 0 18px 55px rgba(0,0,0,.24);
}

.client-logo-slot span, .login-logo span {
  font-size: 16px;
  font-weight: 900;
}

.client-logo-slot em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.landing-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 28px;
}

.landing-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 28px;
  border-radius: 999px;
  color: #04100e;
  text-decoration: none;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue) 68%, var(--violet));
  box-shadow: 0 20px 46px rgba(35,240,208,.22);
}

.landing-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
  margin-top: 42px;
}

.landing-stats article {
  min-height: 116px;
  padding: 18px;
  border: 1px solid rgba(118, 141, 255, .2);
  border-radius: 18px;
  background: rgba(7, 15, 30, .62);
  backdrop-filter: blur(16px);
}

.landing-stats strong {
  display: block;
  margin-bottom: 10px;
  color: #fff;
  font-size: 18px;
}

.landing-stats span {
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.landing-visual {
  position: absolute;
  right: 330px;
  top: 50%;
  width: 330px;
  height: 330px;
  transform: translateY(-54%);
  opacity: .92;
  pointer-events: none;
}

.pack-card {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(35, 240, 208, .28);
  border-radius: 30px;
  background: linear-gradient(160deg, rgba(15,25,48,.78), rgba(4,11,22,.5));
  box-shadow: 0 34px 90px rgba(0,0,0,.42), inset 0 0 60px rgba(35,240,208,.08);
  animation: floatPack 7s ease-in-out infinite;
}

.pack-head {
  display: flex;
  gap: 8px;
  padding: 22px 22px 0;
}

.pack-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(35,240,208,.8);
}

.battery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 28px 22px 18px;
}

.battery-grid i {
  height: 62px;
  border: 1px solid rgba(118, 141, 255, .28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(35,240,208,.22), rgba(79,140,255,.08));
}

.battery-grid i:nth-child(2n) {
  animation: pulseCell 2.8s ease-in-out infinite;
}

.signal-line {
  width: calc(100% - 44px);
  height: 2px;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent);
  animation: scanLine 2.4s linear infinite;
}

.trace-chip {
  width: max-content;
  margin: 0 auto;
  padding: 8px 14px;
  border: 1px solid rgba(35,240,208,.3);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(6,12,26,.8);
  font-size: 12px;
  font-weight: 800;
}

.login-card {
  width: min(400px, 100%);
  padding: 38px 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.025)), rgba(9, 14, 30, .78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(0,0,0,.42);
}

.login-logo {
  display: flex;
  width: 96px;
  height: 62px;
  margin: 0 auto 18px;
}

.login-card h1 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 30px;
  letter-spacing: 0;
  text-align: center;
}

.login-card > p {
  margin: 0 0 24px;
  color: rgba(255,255,255,.68);
  font-size: 13px;
  letter-spacing: 0;
  text-align: center;
}

.login-card label {
  margin-bottom: 14px;
  color: rgba(255,255,255,.85);
}

.login-card input {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  color: #fff;
}

.login-card button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 46px;
  margin: 10px auto 0;
  color: #04100e;
  background: linear-gradient(135deg, var(--cyan), var(--blue) 62%, var(--violet));
}

.landing-icp {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  color: rgba(196,210,232,.72);
  font-size: 13px;
  text-align: center;
}

@keyframes floatPack {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); }
  50% { transform: translate3d(0, -14px, 0) rotate(2deg); }
}

@keyframes pulseCell {
  0%, 100% { box-shadow: inset 0 0 0 rgba(35,240,208,0); }
  50% { box-shadow: inset 0 0 24px rgba(35,240,208,.24), 0 0 20px rgba(35,240,208,.12); }
}

@keyframes scanLine {
  0% { opacity: .25; transform: scaleX(.5); }
  50% { opacity: 1; transform: scaleX(1); }
  100% { opacity: .25; transform: scaleX(.5); }
}

@media (max-width: 1040px) {
  .landing-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 18px;
  }
  .landing-visual {
    display: none;
  }
  .login-card {
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .login-screen {
    padding: 20px;
  }
  .landing-shell {
    min-height: calc(100dvh - 40px);
  }
  .landing-stats {
    grid-template-columns: 1fr;
  }
  .landing-actions {
    justify-content: center;
  }
  .landing-copy h1,
  .landing-subtitle,
  .landing-kicker {
    text-align: center;
  }
  .client-logo-slot {
    display: flex;
    margin: 0 auto;
  }
}

/* ===== 后台最终暗色修正：去掉白底，保留文字和暗色系统质感 ===== */
#app .brand span {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  height: auto;
  min-height: 54px;
  align-items: center;
  justify-content: start;
  padding: 9px 10px;
  border: 1px solid rgba(35,240,208,.24);
  border-radius: 14px;
  color: var(--text);
  background: rgba(6,12,26,.58);
  box-shadow: none;
}

#app .brand strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px dashed rgba(35,240,208,.45);
  border-radius: 10px;
  color: var(--cyan);
  font-size: 12px;
}

#app .brand em {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .copy {
  display: none;
}

#app .contact-card {
  display: block;
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(35,240,208,.18);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(6,12,26,.5);
  font-size: 12px;
  line-height: 1.6;
}

#app .contact-card p {
  margin: 0;
}

#app .dash-card,
#app .dash-panel,
#app .dash-list .item,
#app .doc-card,
#app .cert-item,
#app .modal,
#app .mini-btn,
#app .modal-foot button {
  border-color: var(--line);
  background: rgba(6,12,26,.58);
  color: var(--text);
  box-shadow: none;
}

#app .doc-card.doc-ok {
  border-color: rgba(49,214,155,.35);
  background: rgba(49,214,155,.08);
}

#app .doc-card.doc-missing {
  border-color: rgba(255,112,130,.35);
  background: rgba(255,112,130,.08);
}

#app .dash-card .dc-num,
#app .dash-list .item b,
#app .dash-panel h3,
#app .doc-info b,
#app .cert-item summary,
#app .label-card h4 {
  color: var(--text);
}

#app .dash-card .dc-label,
#app .dash-list .item .t,
#app .doc-info .t {
  color: var(--muted);
}

#app .donut-small::before {
  background: #07101e;
}

#app .donut-small .dvalue {
  color: var(--text);
}

#app .donut-small .dlabel {
  color: var(--muted);
}

#app .mini-btn {
  color: var(--cyan);
}

#app .mini-btn:hover {
  background: rgba(35,240,208,.18);
  color: var(--cyan);
}

#app .storage-note {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid rgba(35,240,208,.2);
  border-radius: 14px;
  background: rgba(35,240,208,.07);
  color: var(--muted);
  font-size: 13px;
}

#app .storage-note b {
  color: var(--cyan);
}

#app .rollback-list {
  display: grid;
  gap: 12px;
}

#app .rollback-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(35,240,208,.16);
  border-radius: 14px;
  background: rgba(6,12,26,.52);
}

#app .rollback-item b,
#app .rollback-item span {
  display: block;
}

#app .rollback-item b {
  color: var(--text);
  margin-bottom: 6px;
  word-break: break-all;
}

#app .rollback-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  #app .rollback-item {
    grid-template-columns: 1fr;
  }
}

#app .vision-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 18px;
  align-items: stretch;
}

#app .vision-form {
  min-width: 0;
}

#app .vision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

#app .vision-preview {
  min-height: 320px;
  border: 1px dashed rgba(35,240,208,.35);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(12,22,46,.72), rgba(8,16,34,.82));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
}

#app .vision-preview img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  background: rgba(0,0,0,.22);
}

#app .vision-preview span {
  padding: 18px;
  text-align: center;
}

@media (max-width: 980px) {
  #app .vision-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #app.app {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  #app .sidebar,
  #app .workspace {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }
  #app .sidebar nav,
  #app .sidebar nav button,
  #app .brand {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  #app .sidebar nav button {
    white-space: normal;
  }
}

/* ===== 成品功能测试追溯卡片 ===== */
.final-test-trace {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  width: 100%;
}

.final-test-trace > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(118,141,255,.24);
  border-radius: 12px;
  background: rgba(6,12,26,.56);
  text-align: left;
}

.final-test-trace > span b {
  color: var(--text);
  font-size: 13px;
}

.final-test-trace > span em {
  justify-self: end;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.final-test-trace > span small {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.final-test-pass {
  border-color: rgba(49,214,155,.34) !important;
  background: rgba(49,214,155,.08) !important;
}

.final-test-pass em {
  color: #31d69b;
  background: rgba(49,214,155,.14);
}

.final-test-fail {
  border-color: rgba(255,112,130,.45) !important;
  background: rgba(255,112,130,.1) !important;
}

.final-test-fail em {
  color: #ff7082;
  background: rgba(255,112,130,.16);
}

.final-test-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(118,141,255,.24);
  border-radius: 12px;
  text-align: left;
}

.final-test-summary b {
  color: var(--muted);
}

.final-test-summary strong {
  font-size: 18px;
}

.final-test-summary.is-pass strong {
  color: #31d69b;
}

.final-test-summary.is-fail strong {
  color: #ff7082;
}

.final-test-reason {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,112,130,.35);
  border-radius: 12px;
  color: #ff9aa7;
  background: rgba(255,112,130,.08);
  text-align: left;
  line-height: 1.6;
}

.final-test-rule {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.k-trace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.k-trace-grid > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(118,141,255,.24);
  border-radius: 12px;
  background: rgba(6,12,26,.56);
  text-align: left;
}

.k-trace-grid b {
  color: var(--muted);
  font-size: 12px;
}

.k-trace-grid em {
  overflow-wrap: anywhere;
  color: var(--text);
  font-style: normal;
  font-weight: 800;
}

@media (max-width: 760px) {
  .record-list li {
    grid-template-columns: 1fr;
  }

  .record-list em {
    justify-self: start;
  }

  .final-test-trace {
    grid-template-columns: 1fr;
  }
}

/* ===== 异次元风格主题与邮件设置 ===== */
body[data-theme] {
  transition: background .28s ease, color .28s ease;
}

body[data-theme="sakura"] {
  --cyan: #ff72b6;
  --blue: #a78bfa;
  --violet: #fb7185;
  --line: rgba(255, 114, 182, .24);
  --line-2: rgba(255, 114, 182, .46);
  --panel: rgba(42, 15, 48, .84);
  --panel-2: rgba(60, 22, 67, .74);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 114, 182, .28), transparent 31%),
    radial-gradient(circle at 86% 12%, rgba(167, 139, 250, .24), transparent 34%),
    radial-gradient(circle at 72% 88%, rgba(251, 113, 133, .18), transparent 32%),
    linear-gradient(135deg, #16091c, #2a0f2d 48%, #160a24);
}

body[data-theme="mint"] {
  --cyan: #34d399;
  --blue: #22d3ee;
  --violet: #60a5fa;
  --line: rgba(52, 211, 153, .24);
  --line-2: rgba(34, 211, 238, .46);
  --panel: rgba(6, 35, 38, .84);
  --panel-2: rgba(8, 48, 50, .72);
  background:
    radial-gradient(circle at 10% 8%, rgba(52, 211, 153, .26), transparent 32%),
    radial-gradient(circle at 84% 10%, rgba(34, 211, 238, .24), transparent 34%),
    radial-gradient(circle at 72% 88%, rgba(96, 165, 250, .16), transparent 32%),
    linear-gradient(135deg, #041b1a, #062f31 48%, #031c2b);
}

body[data-theme="sunset"] {
  --cyan: #fb923c;
  --blue: #f43f5e;
  --violet: #a855f7;
  --line: rgba(251, 146, 60, .24);
  --line-2: rgba(244, 63, 94, .46);
  --panel: rgba(48, 20, 34, .84);
  --panel-2: rgba(64, 25, 41, .72);
  background:
    radial-gradient(circle at 10% 8%, rgba(251, 146, 60, .26), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(244, 63, 94, .24), transparent 34%),
    radial-gradient(circle at 72% 88%, rgba(168, 85, 247, .18), transparent 32%),
    linear-gradient(135deg, #1c0e18, #341520 48%, #1a0d24);
}

body[data-theme="galaxy"] {
  --cyan: #a78bfa;
  --blue: #6366f1;
  --violet: #ec4899;
  --line: rgba(167, 139, 250, .26);
  --line-2: rgba(99, 102, 241, .48);
  --panel: rgba(22, 18, 52, .86);
  --panel-2: rgba(32, 26, 70, .74);
  background:
    radial-gradient(circle at 10% 8%, rgba(167, 139, 250, .30), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(99, 102, 241, .26), transparent 34%),
    radial-gradient(circle at 74% 88%, rgba(236, 72, 153, .18), transparent 32%),
    linear-gradient(135deg, #09081f, #18133d 48%, #170b2e);
}

body[data-theme="ocean"] {
  --cyan: #22d3ee;
  --blue: #2563eb;
  --violet: #14b8a6;
  --line: rgba(34, 211, 238, .24);
  --line-2: rgba(37, 99, 235, .46);
  --panel: rgba(5, 27, 49, .86);
  --panel-2: rgba(7, 39, 67, .74);
  background:
    radial-gradient(circle at 12% 8%, rgba(34, 211, 238, .26), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(37, 99, 235, .26), transparent 34%),
    radial-gradient(circle at 72% 88%, rgba(20, 184, 166, .18), transparent 32%),
    linear-gradient(135deg, #031b2e, #063152 48%, #04172b);
}

body[data-theme="custom"] {
  --cyan: #52e8d4;
  --blue: #6ea8ff;
  --violet: #b388ff;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, .18), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(110, 168, 255, .22), transparent 34%),
    linear-gradient(135deg, var(--custom-bg, #0b1020), #050711 82%);
}

.userbox {
  position: relative;
}

button.ghost-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  box-shadow: none;
}

button.ghost-btn:hover {
  border-color: var(--line-2);
  color: var(--cyan);
  background: rgba(255, 255, 255, .09);
}

.theme-menu {
  position: relative;
}

.theme-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(8, 13, 28, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
  backdrop-filter: blur(20px);
}

.theme-popover > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--cyan);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.theme-choice {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  box-shadow: none;
  font-size: 13px;
}

.theme-choice:hover,
.theme-choice.active {
  border-color: var(--line-2);
  color: var(--cyan);
  background: rgba(255, 255, 255, .09);
}

.theme-choice i {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}

.swatch-neon { background: linear-gradient(135deg, #23f0d0, #4f8cff, #9b5cf6); }
.swatch-sakura { background: linear-gradient(135deg, #ff72b6, #a78bfa); }
.swatch-mint { background: linear-gradient(135deg, #34d399, #22d3ee); }
.swatch-sunset { background: linear-gradient(135deg, #fb923c, #f43f5e); }
.swatch-galaxy { background: linear-gradient(135deg, #a78bfa, #6366f1); }
.swatch-ocean { background: linear-gradient(135deg, #22d3ee, #2563eb); }

.theme-custom {
  display: grid;
  grid-template-columns: 1fr 54px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.theme-custom input[type="color"] {
  width: 54px;
  min-height: 36px;
  padding: 3px;
  cursor: pointer;
}

.email-form {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

#emailSettingsMsg {
  margin-top: 14px;
}

#emailSettingsMsg .email-status-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

#emailSettingsMsg .email-status-grid span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

@media (max-width: 640px) {
  .theme-popover {
    right: -90px;
  }
  .theme-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 明亮系统主题（默认） ===== */
:root {
  --light-bg: #f4f7fb;
  --light-panel: #ffffff;
  --light-panel-soft: #f8fafc;
  --light-line: #e3e8f0;
  --light-text: #172033;
  --light-muted: #667085;
  --light-accent: #2563eb;
  --light-accent-soft: #eff6ff;
}

html[data-theme="light"] body,
html[data-theme="system"] body {
  color: var(--light-text);
  background:
    radial-gradient(circle at 85% 0%, rgba(37, 99, 235, .09), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, var(--light-bg) 55%, #eef3f9 100%);
}

html[data-theme="light"] body::before,
html[data-theme="system"] body::before {
  background-image:
    linear-gradient(rgba(37, 99, 235, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .035) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

html[data-theme="light"] .sidebar,
html[data-theme="system"] .sidebar {
  border-right-color: var(--light-line);
  background: rgba(255, 255, 255, .94);
}

html[data-theme="light"] .topbar,
html[data-theme="system"] .topbar,
html[data-theme="light"] .metrics article,
html[data-theme="system"] .metrics article,
html[data-theme="light"] .panel,
html[data-theme="system"] .panel {
  border-color: var(--light-line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

html[data-theme="light"] .topbar p,
html[data-theme="system"] .topbar p,
html[data-theme="light"] .muted,
html[data-theme="system"] .muted,
html[data-theme="light"] label,
html[data-theme="system"] label,
html[data-theme="light"] .sidebar nav button,
html[data-theme="system"] .sidebar nav button {
  color: var(--light-muted);
}

html[data-theme="light"] .topbar h1,
html[data-theme="system"] .topbar h1,
html[data-theme="light"] .panel h2,
html[data-theme="system"] .panel h2,
html[data-theme="light"] .metrics b,
html[data-theme="system"] .metrics b {
  color: var(--light-text);
}

html[data-theme="light"] input,
html[data-theme="system"] input,
html[data-theme="light"] select,
html[data-theme="system"] select,
html[data-theme="light"] textarea {
  border-color: #d6deea;
  color: var(--light-text);
  background: #fff;
}

html[data-theme="light"] .sidebar nav button.active,
html[data-theme="system"] .sidebar nav button.active {
  color: var(--light-accent);
  background: var(--light-accent-soft);
  border-left-color: var(--light-accent);
}

html[data-theme="light"] .copy,
html[data-theme="system"] .copy {
  border-color: var(--light-line);
  color: var(--light-muted);
  background: #fff;
}

html[data-theme="light"] .progress-item,
html[data-theme="system"] .progress-item,
html[data-theme="light"] .health-list div,
html[data-theme="system"] .health-list div,
html[data-theme="light"] .alert-list div,
html[data-theme="system"] .alert-list div,
html[data-theme="light"] .node-card,
html[data-theme="system"] .node-card,
html[data-theme="light"] .empty-state,
html[data-theme="system"] .empty-state,
html[data-theme="light"] .k-trace-grid > span,
html[data-theme="system"] .k-trace-grid > span {
  border-color: var(--light-line);
  color: var(--light-text);
  background: var(--light-panel-soft);
}

html[data-theme="light"] .progress-item b,
html[data-theme="system"] .progress-item b,
html[data-theme="light"] .node-card b,
html[data-theme="system"] .node-card b,
html[data-theme="light"] .fail-row b,
html[data-theme="system"] .fail-row b {
  color: var(--light-accent);
}

html[data-theme="light"] .settings-actions .ghost-btn,
html[data-theme="system"] .settings-actions .ghost-btn {
  color: var(--light-text);
  border-color: #cdd6e3;
  background: #fff;
}

html[data-theme="light"] .theme-popover,
html[data-theme="system"] .theme-popover {
  background: #fff;
  border-color: var(--light-line);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .15);
}

html[data-theme="light"] .theme-popover > strong,
html[data-theme="system"] .theme-popover > strong {
  color: var(--light-text);
}

.login-clock {
  position: fixed;
  top: 28px;
  right: 34px;
  z-index: 5;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  letter-spacing: 1px;
}

.login-clock time {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 0 22px rgba(35, 240, 208, .55);
}

.appearance-form {
  max-width: 360px;
}

html[data-theme="light"] .login-screen,
html[data-theme="system"] .login-screen {
  background: transparent;
}

html[data-theme="light"] .login-card,
html[data-theme="system"] .login-card {
  border-color: #e1e7f0;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
}

html[data-theme="light"] .login-card h1,
html[data-theme="system"] .login-card h1,
html[data-theme="light"] .login-card p,
html[data-theme="system"] .login-card p,
html[data-theme="light"] .login-card label,
html[data-theme="system"] .login-card label {
  color: var(--light-text);
}

html[data-theme="light"] .login-card input,
html[data-theme="system"] .login-card input {
  border-color: #d6deea;
  color: var(--light-text);
  background: #fff;
}

html[data-theme="light"] .landing-copy h1,
html[data-theme="system"] .landing-copy h1 {
  color: var(--light-text);
}

html[data-theme="light"] .landing-subtitle,
html[data-theme="system"] .landing-subtitle {
  color: var(--light-muted);
}

html[data-theme="light"] .landing-stats article,
html[data-theme="system"] .landing-stats article {
  border-color: var(--light-line);
  background: rgba(255, 255, 255, .76);
}

html[data-theme="light"] .landing-stats article span,
html[data-theme="system"] .landing-stats article span {
  color: var(--light-muted);
}

html[data-theme="dark"] .login-clock {
  color: rgba(255, 255, 255, .82);
}

/* ===== MES后台：浅色运营台视觉，暗色模式完整反转 ===== */
html[data-theme="light"] #app,
html[data-theme="system"] #app {
  --ui-bg: #f3f4f6;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8fafc;
  --ui-border: #e1e4e8;
  --ui-text: #20242a;
  --ui-muted: #5f6670;
  --ui-accent: #1677ff;
  color: var(--ui-text);
  background: var(--ui-bg);
}

html[data-theme="dark"] #app {
  --ui-bg: #11151b;
  --ui-surface: #1a2028;
  --ui-surface-soft: #202832;
  --ui-border: #303943;
  --ui-text: #f3f5f7;
  --ui-muted: #b4bdc8;
  --ui-accent: #5ca3ff;
  color: var(--ui-text);
  background: var(--ui-bg);
}

#app.app {
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--ui-bg);
}

#app .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-right: 1px solid var(--ui-border);
  background: var(--ui-surface);
  box-shadow: 2px 0 12px rgba(31, 35, 41, .04);
}

#app .brand {
  height: 60px;
  flex-shrink: 0;
  max-width: none;
  margin: 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--ui-border);
}

#app .brand span {
  min-height: 0;
  height: 36px;
  padding: 0;
  display: flex;
  gap: 9px;
  border: 0;
  color: var(--ui-text);
  background: transparent;
}

#app .brand strong {
  width: 27px;
  min-height: 27px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #141414;
  font-size: 9px;
}

#app .brand em {
  color: var(--ui-text);
  font-size: 15px;
  font-weight: 700;
}

#app .sidebar nav {
  padding: 22px 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

#app .sidebar nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 16px;
  border-left: 0;
  border-radius: 10px;
  color: var(--ui-text);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}

#app .sidebar nav button .lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 1.8;
}

#app .sidebar nav button span {
  min-width: 0;
  text-align: left;
}

#app .sidebar nav button:hover {
  color: var(--ui-text);
  background: var(--ui-surface-soft);
  transform: none;
}

#app .sidebar nav button.active {
  color: var(--ui-text);
  background: #eaf3ff;
  border-left: 0;
  font-weight: 700;
}

html[data-theme="dark"] #app .sidebar nav button.active {
  color: #fff;
  background: #263b55;
}

#app .nav-group .nav-parent {
  color: var(--ui-text);
  font-weight: 500;
}

#app .nav-group .nav-sub button {
  padding-left: 32px;
  gap: 8px;
  color: var(--ui-muted);
  font-size: 13px;
}

#app .copy,
#app .contact-card {
  position: static;
  flex-shrink: 0;
  margin: 0 16px 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  color: var(--ui-muted);
  background: var(--ui-surface-soft);
  font-size: 11px;
}

#app .workspace {
  min-width: 0;
  padding: 0 30px 36px;
  background: var(--ui-bg);
}

#app .topbar {
  min-height: 60px;
  margin: 0 -30px 22px;
  padding: 0 30px;
  border: 0;
  border-bottom: 1px solid var(--ui-border);
  border-radius: 0;
  background: var(--ui-surface);
  box-shadow: 0 2px 10px rgba(31, 35, 41, .04);
  backdrop-filter: none;
}

#app .topbar h1 {
  margin: 0 0 2px;
  color: var(--ui-text);
  font-size: 22px;
  line-height: 1.25;
}

#app .topbar p {
  color: var(--ui-muted);
  font-size: 12px;
}

#app .userbox span {
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 600;
}

#app .userbox button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ui-accent);
  box-shadow: none;
  font-size: 13px;
}

#app .metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

#app .metrics article,
#app .panel,
#app .dash-card,
#app .dash-panel {
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  background: var(--ui-surface);
  box-shadow: 0 4px 16px rgba(31, 35, 41, .055);
}

#app .metrics article {
  min-height: 98px;
  padding: 18px 20px;
}

#app .metrics span,
#app .muted,
#app label,
#app .topbar p,
#app .health-list span,
#app .alert-list span,
#app .node-card span,
#app .fail-row span,
#app .fail-row em,
#app .trace-meta span,
#app .record-list small {
  color: var(--ui-muted);
}

#app .metrics b {
  margin-top: 10px;
  color: var(--ui-text);
  font-size: 30px;
  line-height: 1;
}

#app .panel {
  padding: 18px;
  margin-bottom: 16px;
}

#app .panel h2,
#app .dash-panel h3 {
  color: var(--ui-text);
  font-size: 16px;
}

#app input,
#app select,
#app textarea {
  border-color: var(--ui-border);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-surface);
}

#app input::placeholder,
#app textarea::placeholder {
  color: var(--ui-muted);
  opacity: .85;
}

#app .progress-item,
#app .health-list div,
#app .alert-list div,
#app .node-card,
#app .empty-state,
#app .k-trace-grid > span,
#app .dash-list .item,
#app .final-test-trace > span {
  border-color: var(--ui-border);
  border-radius: 10px;
  color: var(--ui-text);
  background: var(--ui-surface-soft);
}

#app .progress-item b,
#app .node-card b,
#app .fail-row b,
#app td strong {
  color: var(--ui-accent);
}

#app .progress-item span,
#app .stat-list p,
#app .flow span,
#app .storage-note,
#app .final-test-trace > span small {
  color: var(--ui-muted);
}

#app .progress-bar {
  background: #e5e7eb;
}

html[data-theme="dark"] #app .progress-bar {
  background: #303943;
}

#app .progress-bar i {
  background: var(--ui-accent);
}

#app th {
  color: var(--ui-muted);
  background: var(--ui-surface-soft);
}

#app td,
#app th {
  border-bottom-color: var(--ui-border);
}

#app .donut-small::before {
  background: var(--ui-surface);
}

#app .donut-small .dvalue,
#app .donut-small .dlabel {
  color: var(--ui-text);
}

#app button:not(.nav-parent):not([data-view]) {
  border-radius: 8px;
}

#app #final-test,
#app #kvalue,
#app #incoming-cell,
#app #incoming-pcba {
  --text: var(--ui-text);
  --muted: var(--ui-muted);
}

#app #final-test .flow span,
#app #final-test .api-card code,
#app #final-test .storage-note,
#app #kvalue .flow span,
#app #kvalue .storage-note,
#app #kvalue .rollback-item,
#app #incoming-cell .flow span,
#app #incoming-cell .storage-note,
#app #incoming-pcba .flow span,
#app #incoming-pcba .storage-note {
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-surface);
}

#app #final-test .storage-note b,
#app #kvalue .storage-note b,
#app #kvalue .rollback-item b,
#app #kvalue .rollback-item span,
#app #incoming-cell .storage-note b,
#app #incoming-pcba .storage-note b {
  color: var(--ui-text);
}

#app #final-test label,
#app #kvalue label,
#app #incoming-cell label,
#app #incoming-pcba label {
  color: var(--ui-text);
}

#app #final-test .api-card code {
  color: var(--ui-accent);
  overflow-wrap: anywhere;
}

#app #final-test .api-card pre {
  padding: 14px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  color: var(--ui-text);
  background: var(--ui-surface-soft);
  overflow: auto;
}

html[data-theme="dark"] #app .topbar,
html[data-theme="dark"] #app .metrics article,
html[data-theme="dark"] #app .panel,
html[data-theme="dark"] #app .dash-card,
html[data-theme="dark"] #app .dash-panel,
html[data-theme="dark"] #app .modal,
html[data-theme="dark"] #app .doc-card,
html[data-theme="dark"] #app .cert-item,
html[data-theme="dark"] #app .mini-btn,
html[data-theme="dark"] #app .modal-foot button {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

@media (max-width: 900px) {
  #app.app {
    grid-template-columns: minmax(0, 1fr);
  }
  #app .sidebar {
    position: relative;
    height: auto;
  }
  #app .sidebar nav {
    flex: none;
    overflow-y: visible;
  }
  #app .workspace {
    padding: 0 16px 28px;
  }
  #app .topbar {
    margin: 0 -16px 18px;
    padding: 0 16px;
  }
}

/* Final order action treatment: match the trace search action. */
#app #orders button:not([data-view]) {
  min-height: 36px !important;
  border: 1px solid #1677ff !important;
  border-radius: 6px !important;
  color: #fff !important;
  background: #1677ff !important;
  box-shadow: none !important;
  font-weight: 600;
}

#app #orders button:not([data-view]):hover {
  transform: none !important;
  border-color: #0958d9 !important;
  color: #fff !important;
  background: #0958d9 !important;
  box-shadow: 0 2px 6px rgba(22, 119, 255, .2) !important;
}

#app #orders button:disabled {
  color: #fff !important;
  border-color: #91bfff !important;
  background: #91bfff !important;
}

/* 齐套率圆环中心随明暗主题切换。 */
html[data-theme="light"] #app .donut-small::before,
html[data-theme="system"] #app .donut-small::before {
  background: #fff !important;
}

html[data-theme="dark"] #app .donut-small::before {
  background: #000 !important;
}
