:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --line: #e2e0da;
  --text: #23221f;
  --muted: #6f6d66;
  --accent: #1d6f5c;
  --accent-soft: #e1f5ee;
  --danger: #a32d2d;
  --danger-soft: #fcebeb;
  --warning: #854f0b;
  --warning-soft: #faeeda;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.topbar {
  padding: 18px 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
.topbar .sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

main { padding: 12px; max-width: 720px; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.card h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

.btn {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
}
.btn:active { opacity: .75; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.small { display: inline-block; width: auto; padding: 8px 12px; font-size: 13px; border-radius: 8px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.progress-wrap { margin-top: 12px; }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.progress-wrap .muted { margin: 8px 0 0; }

.result { margin-top: 12px; font-size: 13px; }

.state-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; }
.state-row .label { color: var(--muted); flex: 0 0 auto; }
.state-row .value { text-align: right; word-break: break-word; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.tag.ok { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warning-soft); color: var(--warning); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }

.notice { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 10px 0 0; }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice.warn { background: var(--warning-soft); color: var(--warning); }
.notice.bad { background: var(--danger-soft); color: var(--danger); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.field { margin: 10px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.details summary { font-size: 15px; font-weight: 600; cursor: pointer; }
.details[open] summary { margin-bottom: 10px; }

.bundle-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.bundle-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.bundle-row:last-child { border-bottom: none; }
.bundle-row input { width: 18px; height: 18px; flex: 0 0 auto; }
.bundle-row .name { flex: 1 1 auto; word-break: break-all; }
.bundle-row .meta { color: var(--muted); font-size: 12px; flex: 0 0 auto; }

.report { margin-top: 14px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; overflow-x: auto; }
.report h1 { font-size: 16px; margin: 12px 0 6px; }
.report h2 { font-size: 14px; margin: 14px 0 6px; }
.report h3 { font-size: 13px; margin: 12px 0 4px; }
.report p { margin: 6px 0; }
.report ul { margin: 6px 0; padding-left: 20px; }
.report code { background: var(--bg); padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.report table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12px; }
.report th, .report td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; vertical-align: top; }
.report th { background: var(--bg); font-weight: 600; }
.report blockquote { margin: 8px 0; padding: 6px 10px; border-left: 3px solid var(--line); color: var(--muted); }
.report hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }

.archive-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.archive-item:last-child { border-bottom: none; }
.archive-item .name { word-break: break-all; }
.archive-item button {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  flex: 0 0 auto;
  cursor: pointer;
}

.footer { padding: 0 16px 28px; max-width: 720px; margin: 0 auto; }
.footer .muted { font-size: 12px; }

@media (min-width: 721px) {
  .topbar { padding: 26px 28px 16px; }
  main { padding: 20px; }
}
