:root {
  --paper: #f7f4ec;
  --pine: #0f3d33;
  --ink: #1a1a1a;
  --ink-2: #3d3d3a;
  --ink-3: #8a887e;
  --line: #e2decf;
  --rust: #d95f2b;
  --danger: #a32d2d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Songti SC", serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 244, 236, 0.92);
  border-bottom: 0.5px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-name { font-size: 17px; font-weight: 700; color: var(--pine); letter-spacing: 0.02em; }
.brand-slogan { font-size: 11px; color: var(--ink-3); letter-spacing: 0.14em; }
.pill {
  font-size: 11px;
  color: var(--ink-3);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  border: 0.5px solid var(--line);
}

.layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 56px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .brand-slogan, .pill { display: none; }
}

.card {
  background: #fff;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.05), 0 2px 8px rgba(26, 26, 26, 0.04);
}
.panel-input { padding: 20px; }
.panel-report { padding: 22px 24px; min-height: 520px; }

.h1 { font-size: 20px; font-weight: 700; color: var(--pine); margin: 0 0 4px; }
.sub { font-size: 12px; color: var(--ink-3); margin: 0 0 16px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.field { display: block; margin-bottom: 12px; }
.label { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }

input[type="text"], select, textarea {
  width: 100%;
  border: 0.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus, select:focus, textarea:focus { border-color: rgba(15, 61, 51, 0.5); }
textarea { resize: vertical; line-height: 1.9; }
.counter { text-align: right; font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link {
  background: none;
  border: none;
  padding: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link:hover { color: var(--pine); }

.dropzone {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.dropzone:hover { border-color: rgba(15, 61, 51, 0.4); color: var(--pine); }
.preview {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border: 0.5px solid var(--line);
  border-radius: 10px;
  margin-top: 8px;
}

.actions { margin-top: 16px; }
.hint { font-size: 11.5px; color: var(--ink-3); }
.hint b { color: var(--ink-2); }

.btn-primary {
  background: var(--pine);
  color: #f2efe4;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  background: #fff;
  border: 0.5px solid var(--line);
  color: var(--ink-2);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover:not(:disabled) { border-color: rgba(15, 61, 51, 0.4); color: var(--pine); }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }

.error { margin: 12px 0 0; font-size: 12px; color: var(--danger); }

.report-head { margin-bottom: 16px; }
.empty { font-size: 13px; line-height: 1.9; color: var(--ink-3); margin-top: 28px; }
.empty p { margin: 0 0 12px; }

.sections { display: flex; flex-direction: column; gap: 18px; }
.section-tag {
  display: inline-block;
  background: rgba(15, 61, 51, 0.08);
  color: var(--pine);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 6px;
}
.section-body p {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-2);
}
.section-body p.q { color: var(--ink); }
.section-body p.fix { color: #1d6b52; }

.caret {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--pine);
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.demo-note {
  margin-top: 20px;
  padding: 8px 12px;
  background: #fbf7ea;
  border: 0.5px solid #ecdfc0;
  border-radius: 8px;
  font-size: 11.5px;
  color: #8a6d2f;
}

.footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 18px 20px 30px;
  border-top: 0.5px solid var(--line);
}

/* ---------- 批量模式 ---------- */
.tabs {
  display: flex;
  gap: 4px;
  background: #f3efe4;
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 7px 0;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab.is-active {
  background: #fff;
  color: var(--pine);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.06);
}

.shared-fields { margin-bottom: 4px; }

.batch-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.batch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-2);
  background: #fbf9f2;
  border: 0.5px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}

.head-actions { display: flex; align-items: center; gap: 10px; }
.progress-text { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.batch-results { display: flex; flex-direction: column; gap: 14px; }
.batch-card {
  border: 0.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fffdf8;
}
.batch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.batch-card-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.chip {
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f1efe8;
  color: var(--ink-3);
}
.chip.running { background: rgba(15, 61, 51, 0.1); color: var(--pine); }
.chip.done { background: rgba(29, 107, 82, 0.12); color: #1d6b52; }
.chip.error { background: rgba(163, 45, 45, 0.1); color: var(--danger); }
.batch-card-body .section-tag { margin-top: 8px; }

.roster-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.roster-row .counter { margin-top: 0; margin-left: auto; }

/* ---------- 额度与兑换 ---------- */
.quota-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 0.5px solid var(--line);
}
.redeem-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.redeem-row input { flex: 1; text-transform: uppercase; }
.buy-box {
  margin-top: 10px;
  padding: 12px;
  background: #fbf7ea;
  border: 0.5px solid #ecdfc0;
  border-radius: 10px;
  text-align: center;
}
.buy-tip { margin: 0 0 8px; font-size: 12.5px; color: #8a6d2f; line-height: 1.7; }
.buy-box img { max-width: 200px; border-radius: 8px; display: block; margin: 0 auto; }

/* ---------- 后台 ---------- */
.admin { max-width: 960px; padding-top: 24px; padding-bottom: 60px; display: flex; flex-direction: column; gap: 16px; }
.admin-login { max-width: 460px; padding: 24px; }
.admin-login code { background: #f3efe4; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); overflow: hidden; padding: 0; }
@media (max-width: 720px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fff; padding: 16px 18px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--pine); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.stat-hint { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.admin-form { padding: 20px 22px; }
.admin-table { padding: 20px 22px; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 0.5px solid var(--line); white-space: nowrap; }
th { color: var(--ink-3); font-weight: 500; font-size: 11.5px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; }
.muted { color: var(--ink-3); }

.fresh { margin-top: 14px; padding: 12px; background: #fbf7ea; border: 0.5px solid #ecdfc0; border-radius: 10px; }
.fresh pre { margin: 8px 0 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.9; white-space: pre-wrap; color: var(--ink); }

/* ---------- Hero / 价格 ---------- */
.hero { padding: 26px 20px 4px; }
.hero-title {
  font-size: 26px;
  line-height: 1.35;
  color: var(--pine);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.hero-sub { font-size: 13.5px; line-height: 1.9; color: var(--ink-2); margin: 0 0 12px; max-width: 640px; }
.hero-points { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.hero-points li { font-size: 12.5px; color: var(--ink-2); }
.hero-points b { color: var(--pine); font-weight: 600; }
@media (max-width: 900px) {
  .hero { padding-top: 18px; }
  .hero-title { font-size: 21px; }
}

.pricing { padding-top: 8px; padding-bottom: 48px; }
.pricing-title { font-size: 17px; color: var(--pine); margin: 0 0 14px; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .price-grid { grid-template-columns: 1fr; } }
.price-card {
  position: relative;
  background: #fff;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04);
}
.price-card.is-hot { border-color: rgba(15, 61, 51, 0.45); }
.price-badge {
  position: absolute;
  top: -9px;
  left: 18px;
  background: var(--pine);
  color: #f2efe4;
  font-size: 10.5px;
  border-radius: 999px;
  padding: 2px 9px;
}
.price-name { font-size: 12.5px; color: var(--ink-3); }
.price-amount { font-size: 26px; font-weight: 700; color: var(--pine); margin: 4px 0 2px; }
.price-amount span { font-size: 13px; font-weight: 500; }
.price-desc { font-size: 11.5px; color: var(--ink-3); }
.price-list { list-style: none; padding: 10px 0 0; margin: 0; border-top: 0.5px solid var(--line); margin-top: 10px; }
.price-list li { font-size: 12.5px; color: var(--ink-2); line-height: 2; }
.price-list li::before { content: '·'; color: var(--ink-3); margin-right: 6px; }
.pricing-note { font-size: 11.5px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.8; }

.buy-wechat { font-size: 12.5px; color: #8a6d2f; margin: 8px 0 0; }
.price-amount em { font-style: normal; }

.order-line { font-size: 12.5px; color: var(--ink); margin: 0 0 8px; }
.order-line b { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.06em; color: var(--pine); }
.buy-price { font-size: 11.5px; color: #8a6d2f; margin: 8px 0 0; }

/* ---------- 自动收款 ---------- */
.price-btn { margin-top: 12px; width: 100%; padding: 9px 12px; font-size: 13px; }
.pay-box {
  margin-top: 14px;
  padding: 14px;
  border: 0.5px solid rgba(15, 61, 51, 0.35);
  border-radius: 10px;
  background: #f4f7f4;
}
.pay-head { display: flex; justify-content: space-between; align-items: center; }
.pay-hint { font-size: 12px; color: var(--ink-2); line-height: 1.8; margin: 8px 0 10px; }
.pay-ref-row { display: flex; gap: 10px; align-items: center; }
.pay-ref {
  flex: 1;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--pine);
  background: #fff;
  border: 0.5px dashed rgba(15, 61, 51, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
}
.pay-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.pay-actions .btn-primary { padding: 8px 16px; font-size: 13px; text-decoration: none; }
.pay-actions .hint { font-size: 12px; color: var(--ink-3); }
.pay-fallback { font-size: 12px; color: #8a6d2f; margin: 10px 0 0; line-height: 1.8; }

/* http 页面下没有 clipboard API，备注号可点击全选、方便 Ctrl+C */
.pay-ref { user-select: all; cursor: pointer; }
.pay-ref:active { background: #eef4ee; }

/* ---------- 对账 ---------- */
.sync-out {
  margin-top: 12px;
  padding: 12px;
  background: #f4f7f4;
  border: 0.5px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
}
.claim-input { width: 110px; padding: 4px 8px; font-size: 12px; }

/* ---------- 多图缩略图 + 全屏预览 ---------- */
.thumb-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.thumb { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 0.5px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.thumb-del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; line-height: 18px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 14px; cursor: pointer; padding: 0;
}
.lightbox {
  position: fixed; inset: 0; z-index: 999; background: rgba(20,20,18,0.88);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
/* 必须显式写：.lightbox 的 display:flex 会盖掉 hidden 自带的 display:none，
   不加这条页面一打开就是全屏黑遮罩 + 一张没 src 的破图 */
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
.lightbox-close {
  position: absolute; top: 16px; right: 20px; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.16); color: #fff; font-size: 22px; line-height: 34px; cursor: pointer;
}
