:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --ink: #162029;
  --muted: #667382;
  --soft: #eef3f4;
  --line: #d9e1e5;
  --panel: #ffffff;
  --accent: #0d6b63;
  --accent-dark: #084e49;
  --accent-soft: #e7f3f1;
  --danger: #c01818;
  --danger-bg: #fff0ef;
  --shadow: 0 16px 42px rgba(29, 42, 54, .08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eef4f5 0, #f7f8f9 260px, var(--bg) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
  min-height: 100vh;
  padding: 36px 28px 48px;
}

.shell.compact {
  max-width: 880px;
  margin: 0 auto;
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 10px 24px rgba(22, 32, 41, .16);
}

.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

.status {
  min-width: 104px;
  border: 1px solid rgba(13, 107, 99, .18);
  background: rgba(255, 255, 255, .78);
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 8px 20px rgba(29, 42, 54, .06);
}

.panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(217, 225, 229, .96);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.admin-panel {
  border-top: 4px solid var(--accent);
}

.upload-panel {
  border-top: 4px solid #2d5163;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.section-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.danger-note {
  border: 1px solid #f0b8b8;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 8px 11px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.upload-panel form,
.maintenance-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: stretch;
}

.maintenance-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
}

.file-drop {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 15px 126px 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.file-drop:hover,
.file-drop:focus-within {
  border-color: rgba(13, 107, 99, .42);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 107, 99, .08);
}

.file-drop span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-drop strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.file-drop::after {
  content: "选择文件";
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.file-drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.primary,
.secondary {
  align-self: stretch;
  border-radius: 8px;
  padding: 0 18px;
  min-height: 46px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, opacity .16s ease;
}

.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover {
  border-color: #9aa8b8;
  background: #f7f9fb;
}

.primary:disabled,
.secondary:disabled {
  cursor: wait;
  opacity: .65;
}

.primary:active,
.secondary:active {
  transform: translateY(1px);
}

.maintenance-grid > .primary,
.upload-panel form > .primary {
  align-self: end;
  min-height: 52px;
}

.admin-result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
  padding: 12px;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric,
.details > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
}

.metric span,
.details span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.metric strong,
.details strong {
  display: block;
  overflow-wrap: anywhere;
}

.metric strong {
  font-size: 18px;
}

.details {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.warnings {
  border: 1px solid #edc06f;
  background: #fff7e8;
  color: #8f5200;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  line-height: 1.55;
}

.panel-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: stretch;
}

.panel-actions .primary,
.panel-actions .secondary {
  align-self: auto;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f5f5;
  color: #3c4b56;
  font-size: 13px;
  font-weight: 800;
}

td {
  color: #25313b;
  font-size: 14px;
}

tbody tr:hover {
  background: #f8fbfb;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .shell {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .danger-note {
    white-space: normal;
  }

  .upload-panel form,
  .maintenance-grid,
  .summary-grid,
  .details {
    grid-template-columns: 1fr;
  }

  .panel-actions {
    flex-direction: column;
  }

  .file-drop {
    padding-right: 15px;
    padding-bottom: 58px;
  }

  .file-drop::after {
    left: 14px;
    right: auto;
  }
}
