:root {
  --brand: #e91e8c;
  --brand-dark: #c2185b;
  --brand-soft: #fce4f0;
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1f1f1f;
  --muted: #6b6b6b;
  --border: rgba(0,0,0,0.09);
  --ok: #2e7d32;
  --warn: #b26a00;
  --err: #c62828;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--card);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 11px; }

.logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0%, #ff6fb1 100%);
  flex-shrink: 0;
}

.topbar h1 { font-size: 15px; font-weight: 500; letter-spacing: -0.2px; }
.sub { font-size: 12px; color: var(--muted); }

.badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-on { background: #e6f4ea; color: var(--ok); }
.badge-off { background: #fdecea; color: var(--err); }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  overflow-x: auto;
  background: var(--card);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 63px;
  z-index: 19;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.tab.active { background: var(--brand); color: #fff; font-weight: 500; }
/* 「去采集」是跳转而非内容页，给个渐变底色区分，避免误以为点开还有更多内容 */
.tab-go {
  background: linear-gradient(135deg, #e91e8c, #ff6b9d);
  color: #fff; font-weight: 500; border: none;
}
.tab-go.active { background: linear-gradient(135deg, #d81b7a, #f5578f); color: #fff; }

main { padding: 16px 14px 40px; max-width: 780px; margin: 0 auto; }

.panel { display: none; }
.panel.active { display: block; }

.card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  padding: 18px;
  margin-bottom: 14px;
}

.card h2 { font-size: 14px; font-weight: 500; margin-bottom: 6px; }

.hint { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }

label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}

input, textarea, select {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border: 0.5px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
textarea { resize: vertical; line-height: 1.6; }

input[type="range"] { padding: 0; background: transparent; border: none; accent-color: var(--brand); }

output { float: right; color: var(--brand); font-variant-numeric: tabular-nums; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  font-weight: 500;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.primary:disabled { background: #f0b8d4; cursor: not-allowed; }
.btn.ghost { background: var(--brand-soft); color: var(--brand-dark); }

.row { display: flex; gap: 10px; }
.row .btn { width: auto; flex: 1; }
.row input { flex: 2; margin-top: 0; }

.notice {
  background: #fff8e1;
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  color: #6d4c00;
  margin-bottom: 14px;
}

.preview, .result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  font-size: 12.5px;
  background: var(--bg);
  border: 0.5px solid var(--border);
}
.hidden { display: none; }

.preview table { width: 100%; border-collapse: collapse; }
.preview td { padding: 5px 0; border-bottom: 0.5px solid var(--border); vertical-align: top; }
.preview td:first-child { width: 34px; color: var(--muted); }
.preview td:last-child { width: 44px; text-align: right; color: var(--muted); }

.result audio { width: 100%; margin: 10px 0; }
.result .meta { color: var(--muted); word-break: break-all; font-family: ui-monospace, monospace; font-size: 11.5px; }
.result pre {
  background: #1f1f1f; color: #e8e8e8;
  padding: 10px; border-radius: 8px;
  overflow-x: auto; font-size: 11.5px;
  margin-top: 8px; line-height: 1.5;
}

.list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.item {
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg);
}
.item .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item .nm { font-size: 14px; font-weight: 500; }
.item .mt { font-size: 11.5px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap;
}

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.chk input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--brand);
}
input:disabled, textarea:disabled, select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
h3 { margin-top: 16px; }

.verdict {
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.55;
}
.verdict.ok { background: #e6f4ea; color: #1b5e20; }
.verdict.warn { background: #fff8e1; color: #6d4c00; }
.verdict.danger { background: #fdecea; color: #b71c1c; }

.check-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 11px;
  background: var(--color-background-secondary);
  border-radius: 8px;
  margin-bottom: 7px;
}
.check-item .lv {
  flex-shrink: 0;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  color: #fff;
}
.check-item .tt { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.check-item .dt { font-size: 12px; color: var(--color-text-secondary); line-height: 1.5; }
.check-item .law { font-size: 11px; color: var(--color-text-tertiary); margin-top: 3px; }

.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translate(-50%, 20px);
  background: #1f1f1f; color: #fff;
  padding: 10px 20px; border-radius: 24px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 99; max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }