:root {
  --bg: #f6f1ea;
  --card: #fffdf9;
  --ink: #2b2620;
  --ink-soft: #6f665c;
  --line: #e8dfd3;
  --accent: #c8733f;
  --accent-soft: #f3ddcb;
  --ok: #3d8b63;
  --err: #c0473c;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.header .logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.header h1 { font-size: 19px; margin: 0; }
.header .sub { font-size: 12px; color: var(--ink-soft); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { font-size: 15px; margin: 0 0 12px; }

.preview {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
  background: #f0e9df;
}
.preview-empty {
  aspect-ratio: 3/4;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 14px; text-align: center; padding: 20px;
}

label.field { display: block; font-size: 13px; color: var(--ink-soft); margin: 12px 0 6px; }

.presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.resets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.preset {
  padding: 10px 8px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: center;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.preset small { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.preset.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.custom-size { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.custom-size input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  background: #fff;
}
.custom-size span { color: var(--ink-soft); }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px;
}
.switch-row .t { font-size: 14px; }
.switch-row .d { font-size: 12px; color: var(--ink-soft); }
.switch { position: relative; width: 46px; height: 27px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #d8cfc2; border-radius: 999px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(19px); }

.btn {
  display: block; width: 100%;
  padding: 14px;
  border: none; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 600;
  cursor: pointer;
}
.btn:active { opacity: .85; }
.btn[disabled] { background: #cdbfae; cursor: not-allowed; }
.btn.ghost {
  background: #fff; color: var(--accent); border: 1.5px solid var(--accent); margin-top: 8px;
}

input[type="text"], input[type="password"] {
  width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: #fff;
}

.status { margin-top: 10px; font-size: 13px; min-height: 20px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.status.muted { color: var(--ink-soft); }

.loading {
  display: none; text-align: center; color: var(--ink-soft); font-size: 14px; padding: 16px 0;
}
.spinner {
  width: 22px; height: 22px; border: 3px solid var(--accent-soft);
  border-top-color: var(--accent); border-radius: 50%;
  display: inline-block; vertical-align: middle; margin-right: 8px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint { font-size: 12.5px; color: var(--ink-soft); }
.hint b { color: var(--ink); }
ol.steps { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--ink-soft); }
ol.steps li { margin: 6px 0; }
.pill { display:inline-block; background:var(--accent-soft); color:var(--accent); font-size:11px; padding:2px 8px; border-radius:999px; font-weight:600;}
.result-meta { font-size: 13px; color: var(--ink-soft); margin: 8px 0; }

/* ===== 批量版 ===== */
.rule-card { padding: 12px 16px; }
.rule-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--ink-soft); padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.rule-row:last-child { border-bottom: none; }
.rule-row b { color: var(--ink); font-weight: 600; }
.center { text-align: center; }

.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress-head > span { font-size: 14px; font-weight: 600; }
.mini-btn {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 14px; font-size: 13px; cursor: pointer;
}
.progress-bar {
  margin-top: 10px; height: 8px; border-radius: 999px; background: #ece3d7; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0; background: var(--accent); border-radius: 999px;
  transition: width .3s ease;
}

.qrow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.qrow:last-child { border-bottom: none; }
.qthumb {
  width: 54px; height: 54px; flex: none; border-radius: 10px;
  object-fit: cover; border: 1px solid var(--line); background: #f0e9df;
}
.qinfo { flex: 1; min-width: 0; }
.qname {
  font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qstatus { margin-top: 3px; font-size: 12.5px; }
.qtag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
}
.qtag.pending { background: #eee6da; color: var(--ink-soft); }
.qtag.processing { background: var(--accent-soft); color: var(--accent); }
.qtag.done { background: #e0efe6; color: var(--ok); }
.qtag.error { background: #f6e1df; color: var(--err); }
.qarch { font-size: 12px; margin-left: 6px; }
.qarch.ok { color: var(--ok); }
.qarch.err { color: var(--err); }
.qerr { color: var(--err); font-size: 12px; margin-top: 2px; word-break: break-all; }

.spinner.mini { width: 13px; height: 13px; border-width: 2px; margin: 0; }
