:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #23241f;
  --ink-2: #5f5e58;
  --ink-3: #8d8b82;
  --line: #e3e0d8;
  --brand: #185fa5;
  --brand-bg: #e6f1fb;
  --ok: #0f6e56;
  --ok-bg: #e1f5ee;
  --warn: #854f0b;
  --warn-bg: #faeeda;
  --err: #a32d2d;
  --err-bg: #fcebeb;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 18px 64px; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}
.topbar-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 600; font-size: 16px; }
.brand-sub { font-size: 13px; color: var(--ink-3); }

h1 { font-size: 21px; font-weight: 600; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 600; margin: 28px 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; }
p { margin: 0 0 12px; }

.lead { color: var(--ink-2); font-size: 14px; margin-bottom: 22px; }

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

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.price { font-size: 20px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.price small { font-size: 13px; font-weight: 400; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag {
  font-size: 12px; color: var(--ink-2);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 99px; padding: 2px 10px;
}

.btn {
  display: inline-block; width: 100%; text-align: center;
  background: var(--brand); color: #fff;
  border: none; border-radius: 8px;
  padding: 12px 18px; font-size: 15px; font-family: inherit;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: #134e88; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-bg); }
.btn.small { width: auto; padding: 6px 14px; font-size: 13px; }

input[type=text], input[type=password], input[type=tel] {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus { outline: 2px solid var(--brand-bg); border-color: var(--brand); }
label { display: block; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; }

.note { font-size: 13px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.err { background: var(--err-bg); color: var(--err); }

.order-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px; font-weight: 600; letter-spacing: 1px;
  background: var(--warn-bg); color: var(--warn);
  border-radius: 8px; padding: 12px; text-align: center; user-select: all;
}

.qr-box {
  text-align: center; padding: 16px; background: var(--bg);
  border-radius: var(--radius); margin: 14px 0;
}
.qr-box img { width: 220px; height: 220px; object-fit: contain; background: #fff; border-radius: 8px; }

.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.step {
  flex: 1; text-align: center; font-size: 12px; color: var(--ink-3);
  padding: 7px 4px; border-radius: 6px; background: var(--card); border: 1px solid var(--line);
}
.step.on { background: var(--brand-bg); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.step.done { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }

.code-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 600; letter-spacing: 3px;
  text-align: center; padding: 16px;
  background: var(--ok-bg); color: var(--ok);
  border-radius: 8px; user-select: all;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
th { background: var(--bg); font-weight: 600; }

ul, ol { padding-left: 22px; margin: 0 0 12px; }
li { margin-bottom: 5px; }

.muted { color: var(--ink-3); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.center { text-align: center; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- 内容页 + 水印 ---------- */
.watermark-layer {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none; overflow: hidden;
}
.content-wrap {
  position: relative; z-index: 2;
  max-width: 720px; margin: 0 auto; padding: 24px 18px 80px;
}
.content-page { position: relative; min-height: 100vh; }

.content-banner {
  background: var(--warn-bg); color: var(--warn);
  font-size: 13px; padding: 9px 18px; text-align: center;
  border-bottom: 1px solid #f0dcb8;
}

/* ---------- 列表头 ---------- */
.list-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 2px 10px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
}

/* ---------- 后台标签页 ---------- */
.tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line); padding-bottom: 0;
}
.tab {
  padding: 9px 16px; font-size: 14px; color: var(--ink-2);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .dot {
  display: inline-block; min-width: 17px; height: 17px; line-height: 17px;
  background: var(--warn); color: #fff; border-radius: 99px;
  font-size: 11px; text-align: center; margin-left: 6px; padding: 0 5px;
}

/* ---------- 表单 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
textarea {
  width: 100%; padding: 11px 13px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink); line-height: 1.6; resize: vertical; min-height: 110px;
}
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
select {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
textarea:focus, select:focus { outline: 2px solid var(--brand-bg); border-color: var(--brand); }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

label.chk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; margin: 0; color: var(--ink-2); cursor: pointer;
}
label.chk input { width: auto; }

/* ---------- 后台商品行 ---------- */
.prod-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.prod-row:last-child { border-bottom: none; }
.prod-row .grow { flex: 1; min-width: 0; }
.prod-name { font-weight: 600; font-size: 15px; }
.prod-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pill {
  display: inline-block; font-size: 11px; padding: 1px 8px;
  border-radius: 99px; vertical-align: middle; margin-left: 6px;
}
.pill.on { background: var(--ok-bg); color: var(--ok); }
.pill.off { background: #eeece6; color: var(--ink-3); }
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 9px; font-size: 12px; cursor: pointer;
  color: var(--ink-2); font-family: inherit; background: #fff;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn.danger:hover { border-color: var(--err); color: var(--err); }

.modal-mask {
  position: fixed; inset: 0; background: rgba(35,36,31,0.35);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 16px; overflow-y: auto; z-index: 50;
}
.modal {
  background: var(--card); border-radius: var(--radius);
  width: 100%; max-width: 620px; padding: 20px;
}
.modal h3 { margin-top: 0; }
