:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --panel-soft: #eef3f5;
  --text: #14191d;
  --muted: #60707c;
  --line: #d8e0e4;
  --ok: #157a4d;
  --warn: #9a6500;
  --accent: #0f5f7a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
header {
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}
.wrap {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: 0;
}
.subtitle,
.stamp,
.note {
  color: var(--muted);
}
.subtitle,
.stamp,
.back {
  font-size: 0.875rem;
}
main {
  padding: 24px 0 40px;
}
.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric,
section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metric {
  padding: 14px 16px;
  min-height: 92px;
}
.metric .label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}
.metric .value {
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}
.metric .detail {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.35;
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
section {
  overflow: hidden;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}
h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}
.section-body {
  padding: 14px 16px 16px;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: 0;
}
code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--panel-soft);
  color: #26333a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.status.ok {
  background: #e7f5ee;
  color: var(--ok);
}
.status.warn {
  background: #fff4da;
  color: var(--warn);
}
.action-feedback {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: right;
}
.action-feedback.error {
  color: #9c1c1c;
}
.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--accent);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  white-space: nowrap;
}
.control-button:hover {
  border-color: var(--accent);
}
.control-button:disabled {
  cursor: wait;
  opacity: 0.68;
}
.control-button.primary {
  border-color: #b8d7c8;
  background: #e7f5ee;
  color: var(--ok);
}
.control-button.danger {
  border-color: #f0c6c6;
  background: #fff1f1;
  color: #9c1c1c;
}
.note {
  margin: 10px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
}
a {
  color: var(--accent);
}
.code-link {
  color: inherit;
  text-decoration: none;
}
.code-link:hover code {
  outline: 1px solid var(--accent);
  color: var(--accent);
}
.back {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-weight: 700;
  text-decoration: none;
}
.back:hover {
  text-decoration: underline;
}
.metric-status {
  font-size: 1rem;
}
.metric-code {
  font-size: 0.95rem;
}
.detail-card {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.detail-card .label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.detail-card-main {
  margin-top: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
}
.operation-panel {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.field-label,
.detail-subhead {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}
.detail-subhead {
  margin-top: 18px;
}
.file-input {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.35;
}
.operation-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.operation-panel .action-feedback {
  margin-top: 10px;
  text-align: left;
}
.log-lines {
  margin: 14px 0 0;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14191d;
  color: #edf3f5;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
@media (max-width: 980px) {
  .summary {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .wrap {
    width: min(100% - 20px, 1440px);
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .action-feedback {
    text-align: left;
  }
  th,
  td {
    padding: 8px 6px;
  }
}
