* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #182026;
  background: #f5f7f8;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  color: #fff;
  background: #1f4d4a;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Microsoft YaHei", serif;
  font-size: 24px;
  font-weight: 700;
}

.brand-logo,
.title-logo {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.page-title span {
  line-height: 1.2;
}

.title-logo {
  width: 42px;
  height: 42px;
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

nav a {
  color: #fff;
  text-decoration: none;
}

.nav-phone {
  color: #cfe5df;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
}

section {
  margin-bottom: 24px;
}

h1,
h2 {
  margin: 0 0 16px;
  font-weight: 700;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

.narrow {
  max-width: 520px;
  margin-inline: auto;
}

.auth-page {
  max-width: 560px;
  margin-inline: auto;
}

.auth-heading {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

.auth-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.auth-heading h1 {
  margin: 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.auth-panel[hidden] {
  display: none;
}

.auth-toggle {
  width: 100%;
}

.panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #dde5e3;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 77, 74, 0.08);
}

.panel h2 {
  margin: 0;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
  align-items: center;
}

.captcha-row img {
  width: 132px;
  height: 46px;
  border: 1px solid #cbd7d4;
  border-radius: 8px;
  background: #f6fbfa;
  cursor: pointer;
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: #66757c;
  font-size: 14px;
  line-height: 1.6;
}

.auth-message.success {
  color: #225d3b;
}

.auth-message.error {
  color: #8a3328;
}

.auth-message.warn {
  color: #8a6414;
}

.forgot-note,
.field-note {
  margin: 0;
  color: #7a4b1a;
  font-size: 13px;
  line-height: 1.6;
}

.subtle-panel {
  align-items: center;
  background: #f8fafc;
  border-color: #dbe4ee;
  color: #334155;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.upload {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.upload-panel {
  align-items: stretch;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.upload-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.parameter-locked {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  color: #315b46;
  background: #eef7f3;
  border: 1px solid #c7ded4;
  border-radius: 8px;
}

.parameter-locked span {
  color: #4f5f64;
  font-size: 14px;
  line-height: 1.6;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.parameter-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.parameter-title-row h2 {
  margin: 0;
}

.parameter-title-row span {
  color: #a14334;
  font-size: 14px;
  font-weight: 700;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
}

.setting-toggle {
  width: fit-content;
  margin-bottom: 10px;
  color: #1f4d4a;
  font-weight: 700;
}

.advanced-settings {
  padding-top: 2px;
}

.advanced-settings summary {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  color: #2f6f68;
  cursor: pointer;
  font-weight: 700;
}

.advanced-settings summary span {
  font-size: 20px;
  color: #172126;
}

.advanced-settings summary small {
  color: #a14334;
  font-size: 14px;
}

.advanced-settings .settings-grid {
  margin-top: 16px;
}

.notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  color: #315b46;
  background: #e7f5ec;
  border: 1px solid #b9dec8;
  border-radius: 8px;
}

.notice.error {
  color: #8a3328;
  background: #fff0ed;
  border-color: #efc0b7;
}

.notice.success {
  color: #225d3b;
  background: #e4f7ea;
  border-color: #a9dbbb;
}

.desktop-download-actions {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 22px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #46535a;
  font-size: 14px;
}

input,
textarea,
select,
button {
  min-height: 40px;
  border-radius: 6px;
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd7d4;
  background: #fff;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

button {
  padding: 0 16px;
  border: 0;
  color: #fff;
  background: #2f6f68;
  cursor: pointer;
}

button:hover {
  background: #255b56;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

button.secondary {
  color: #2f4b4a;
  background: #e7eeec;
  border: 1px solid #cbd7d4;
}

button.secondary:hover {
  background: #dce7e4;
}

button.danger {
  background: #a14334;
}

button.danger:hover {
  background: #823226;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title-row h2 {
  margin: 0;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 180px;
}

.result-actions a {
  color: #2f6f68;
  font-weight: 700;
  text-decoration: none;
}

.link-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.nc-preview-panel[hidden] {
  display: none;
}

.nc-preview-panel {
  gap: 12px;
}

.nc-preview-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.nc-preview-toolbar h2 {
  margin-bottom: 6px;
}

.nc-preview-meta {
  min-height: 20px;
  margin: 0;
  color: #52616a;
  font-size: 14px;
  line-height: 1.5;
}

.nc-preview-meta.error {
  color: #8a3328;
}

.nc-preview-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nc-preview-controls select {
  width: 92px;
}

.nc-visualizer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: stretch;
}

.nc-visualizer-stage {
  min-width: 0;
}

.nc-preview-line-control {
  display: grid;
  grid-template-columns: auto minmax(86px, 1fr) 42px;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  color: #52616a;
  font-size: 13px;
  white-space: nowrap;
}

.nc-preview-line-control input {
  width: 100%;
}

.nc-preview-line-control span {
  text-align: right;
}

#nc-preview-canvas {
  width: 100%;
  height: 620px;
  border: 1px solid #d4dfdc;
  border-radius: 8px;
  background: #fbfdfc;
  cursor: grab;
  touch-action: none;
}

#nc-preview-canvas.is-dragging {
  cursor: grabbing;
}

.nc-visualizer-side {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.nc-visualizer-block {
  padding: 12px;
  border: 1px solid #dde5e3;
  border-radius: 8px;
  background: #fbfdfc;
}

.nc-visualizer-title {
  margin-bottom: 10px;
  color: #33464c;
  font-size: 13px;
  font-weight: 700;
}

.nc-visualizer-step-buttons {
  display: grid;
  gap: 8px;
}

.nc-visualizer-step {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  text-align: left;
}

.nc-visualizer-step span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #547069;
  background: #e9f1ee;
  font-size: 12px;
}

.nc-visualizer-step b {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nc-visualizer-step.is-active {
  color: #fff;
  background: #1f6f68;
  border-color: #1f6f68;
}

.nc-visualizer-step.is-active span {
  color: #1f6f68;
  background: #fff;
}

.nc-visualizer-step.is-done span {
  color: #fff;
  background: #2e7d63;
}

.nc-visualizer-step:disabled {
  cursor: default;
  opacity: 0.62;
}

.nc-visualizer-block select {
  width: 100%;
}

.nc-visualizer-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-top: 8px;
  color: #52616a;
  font-size: 13px;
}

.nc-visualizer-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: #1f6f68;
}

.nc-visualizer-stats {
  display: grid;
  gap: 7px;
}

.statLine {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  color: #52616a;
  font-size: 13px;
}

.statLine b {
  color: #263f43;
}

.statLine span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nc-visualizer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #52616a;
  font-size: 12px;
}

.nc-visualizer-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nc-visualizer-legend i {
  width: 20px;
  height: 0;
  border-top: 3px solid currentColor;
}

.nc-line-original {
  color: #147d64;
}

.nc-line-repair {
  color: #d62728;
}

.nc-line-active {
  color: #00965a;
}

.nc-line-rapid {
  color: #5b666b;
  border-top-style: dashed !important;
}

.nc-yneg-viewer {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid #29333f;
  border-radius: 8px;
  background: #15181d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.nc-yneg-viewer #nc-preview-canvas {
  width: 100%;
  height: 620px;
  display: block;
  border: 0;
  border-radius: 0;
  background: #15181d;
}

.nc-yneg-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(20, 24, 31, 0.86);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.nc-yneg-bar button {
  min-height: 32px;
  padding: 0 12px;
  border-color: rgba(255, 255, 255, 0.16);
  color: #e8eef6;
  background: rgba(255, 255, 255, 0.08);
}

.nc-yneg-bar button:hover:not(:disabled),
.nc-yneg-bar button.is-active {
  color: #ffffff;
  border-color: rgba(64, 208, 255, 0.82);
  background: #0b6680;
}

.nc-yneg-bar button:disabled {
  cursor: default;
  opacity: 0.46;
}

.nc-yneg-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: #d8e4ef;
  font-size: 13px;
  white-space: nowrap;
}

.nc-yneg-bar label > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nc-yneg-bar input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: #40d0ff;
}

.nc-yneg-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.nc-yneg-dot.normal {
  color: #d8e8ff;
  background: #d8e8ff;
}

.nc-yneg-dot.repair {
  color: #00d4ff;
  background: #00d4ff;
}

.nc-yneg-dot.rapid {
  color: #ffb13b;
  background: #ffb13b;
}

.nc-yneg-stats {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  max-width: 760px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #dce7f2;
  background: rgba(20, 24, 31, 0.8);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
  font-size: 13px;
  line-height: 1.6;
  backdrop-filter: blur(8px);
}

@media (max-width: 980px) {
  .nc-visualizer-layout {
    grid-template-columns: 1fr;
  }

  #nc-preview-canvas,
  .nc-yneg-viewer #nc-preview-canvas {
    height: 520px;
  }

  .nc-yneg-viewer {
    min-height: 520px;
  }
}

.clear-records {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.status {
  display: inline-block;
  min-width: 60px;
  padding: 4px 8px;
  border-radius: 6px;
  color: #3f4c53;
  background: #eef2f3;
  text-align: center;
}

.status-queued {
  color: #6c4d14;
  background: #fff4d8;
}

.status-running {
  color: #175b77;
  background: #e4f5fb;
}

.status-succeeded {
  color: #225d3b;
  background: #e4f7ea;
}

.status-failed {
  color: #8a3328;
  background: #fff0ed;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.summary div,
.admin-card {
  padding: 18px;
  background: #fff;
  border: 1px solid #dde5e3;
  border-radius: 8px;
}

.summary strong {
  display: block;
  margin-bottom: 6px;
  font-size: 24px;
  color: #1f4d4a;
}

.summary span {
  color: #66757c;
}

.checkin-card form {
  margin-top: 10px;
}

.checkin-card button {
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dde5e3;
  border-radius: 8px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f0;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #415158;
  background: #eef5f3;
}

tr:last-child td {
  border-bottom: 0;
}

.settings-table {
  table-layout: fixed;
}

.settings-table input {
  width: 100%;
  min-height: 38px;
}

.processor-param-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 14px;
}

.local-param-import {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334247;
  font-size: 14px;
}

.local-param-import input {
  max-width: 260px;
}

.processor-limit-table th:first-child {
  width: 150px;
}

.processor-default-table th:first-child {
  width: 190px;
}

.processor-limit-table th:nth-child(2),
.processor-limit-table th:nth-child(3) {
  width: 120px;
}

.processor-limit-table tbody th {
  background: #fff;
  color: #1f4d4a;
  font-weight: 700;
}

.processor-limit-table tbody tr:last-child th {
  border-bottom: 0;
}

.admin-jobs-table {
  min-width: 1280px;
}

.record-detail {
  min-width: 220px;
  line-height: 1.65;
  color: #324247;
}

.source-detail {
  min-width: 180px;
}

small {
  color: #a14334;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.admin-card {
  color: #1f4d4a;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.admin-search-panel {
  grid-template-columns: minmax(220px, 360px) auto auto 1fr;
  align-items: end;
}

.admin-job-search-panel {
  grid-template-columns: minmax(110px, 140px) minmax(180px, 220px) minmax(220px, 1fr) minmax(140px, 170px) auto auto auto;
  align-items: end;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #2f6f68;
  text-decoration: none;
  font-weight: 700;
}

.admin-search-panel span,
.admin-job-search-panel span {
  align-self: center;
  color: #66757c;
  font-size: 14px;
}

.inline {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 8px;
}

.inline + .inline {
  margin-top: 8px;
}

.role-form {
  grid-template-columns: 1fr auto;
}

.reset-form {
  grid-template-columns: 1fr;
}

.delete-user-form {
  grid-template-columns: 1fr;
}

.desktop-form {
  grid-template-columns: minmax(90px, 120px) minmax(140px, 1fr) auto;
  align-items: center;
}

.desktop-identity-line {
  gap: 8px;
}

.desktop-help {
  display: grid;
  gap: 8px;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border: 1px solid #d7e2df;
  border-radius: 8px;
  background: #f7fbfa;
}

.inline input {
  min-height: 34px;
}

.inline button {
  min-height: 34px;
}

@media (max-width: 760px) {
  header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .summary,
  .admin-grid,
  .auth-grid,
  .address-grid,
  .admin-search-panel,
  .admin-job-search-panel,
  .upload,
  .upload-row,
  .inline {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .upload-actions {
    justify-content: flex-start;
  }

  .upload-actions button {
    width: 100%;
  }

  .captcha-row {
    grid-template-columns: 1fr;
  }

  .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .nc-preview-toolbar {
    flex-direction: column;
  }

  .nc-preview-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .nc-preview-controls button {
    flex: 1 1 76px;
  }

  #nc-preview-canvas {
    height: 360px;
  }

  .nc-yneg-viewer {
    min-height: 360px;
  }

  .nc-yneg-viewer #nc-preview-canvas {
    height: 360px;
  }

  .nc-yneg-bar,
  .nc-yneg-stats {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}
