:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c1f23;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #1f6feb;
  --brand-soft: #e8f0fe;
  --ok: #0f7b4f;
  --ok-soft: #e6f4ec;
  --warn: #9a6700;
  --warn-soft: #fff6dd;
  --err: #b42318;
  --err-soft: #fdeceb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --card: #1e2128;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --line: #2e333c;
    --brand: #5b9bff;
    --brand-soft: #1d2a44;
    --ok: #4cc38a;
    --ok-soft: #16302a;
    --warn: #e2b341;
    --warn-soft: #3a2f14;
    --err: #f97066;
    --err-soft: #3a1d1a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.site {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 16px;
}

.site h1 { margin: 0 0 8px; font-size: 24px; font-weight: 600; }
.site .sub { margin: 0; color: var(--muted); }
.site .privacy {
  display: inline-block;
  margin: 10px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
}

.preset-group { margin-bottom: 12px; }
.preset-group-name { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.opts label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.opts select,
.opts input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  min-width: 150px;
}

.opts input[type="number"] { min-width: 110px; }
.opts select:disabled,
.opts input:disabled { opacity: .5; }

.note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.muted { color: var(--muted); font-size: 12px; }

.drop {
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drop.over { border-color: var(--brand); background: var(--brand-soft); }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.quota { font-size: 12px; color: var(--muted); }
.quota.warn { color: var(--warn); }
.quota.ok { color: var(--ok); }

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.status { font-size: 12px; color: var(--muted); }

.grid { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.grid th, .grid td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
.grid th { color: var(--muted); font-weight: 500; font-size: 12px; }
.grid td.cell-name { max-width: 220px; word-break: break-all; }
.grid tr.empty td { color: var(--muted); text-align: center; padding: 18px; }
.grid tr.locked td { color: var(--warn); }

.tag {
  display: inline-block;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.error { background: var(--err-soft); color: var(--err); }

.link {
  border: 0;
  background: none;
  color: var(--brand);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.ad {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}

.prose h2 { margin-top: 22px; }
.prose h3 { margin: 18px 0 6px; font-size: 14px; font-weight: 500; }
.prose p { color: var(--text); }
.prose table.grid td:first-child { white-space: nowrap; color: var(--muted); width: 120px; }

.crumb {
  font-size: 12px;
  color: var(--muted);
  padding: 0 2px 12px;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--brand); }
.crumb span { color: var(--text); }

.cta { display: inline-block; text-decoration: none; padding: 10px 18px; margin: 6px 0 0; }
.cta-card h2 { margin-top: 0; }
.cta-card p { color: var(--muted); font-size: 13px; }

.rel { margin: 0; padding-left: 18px; font-size: 13px; }
.rel li { margin: 6px 0; }
.rel a { color: var(--brand); text-decoration: none; }
.rel a:hover { text-decoration: underline; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  overflow: auto;
  padding: 20px;
}

.modal.show { display: flex; }

.modal-box {
  background: var(--card);
  border-radius: 12px;
  padding: 22px;
  width: 320px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-box h3 { margin: 0; font-size: 15px; }

.site-foot {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 40px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.9;
}

.foot-line { margin: 4px 0; }

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  font-variant-numeric: tabular-nums;
}

/* 标签与编号作为一组，避免被父级 flex 的 gap 拉开、也避免换行时两者分离 */
.foot-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.foot-label { white-space: nowrap; }

.foot-icp {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 1px;
}

.foot-icp:hover { color: var(--accent); border-bottom-color: var(--accent); }

.foot-todo {
  color: #b4690e;
  background: #fdf0d9;
  border: 1px dashed #e0a544;
  border-radius: 4px;
  padding: 1px 6px;
}
