:root {
  --ink: #202124;
  --muted: #6d7075;
  --line: #e8e8e6;
  --paper: #ffffff;
  --wash: #f5f5f2;
  --accent: #e63c36;
  --accent-dark: #bd2824;
  --green: #19744f;
  --shadow: 0 12px 36px rgba(24, 24, 24, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 18px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--accent);
  border-radius: 7px;
  font-size: 14px;
}
.top-link { color: var(--muted); text-decoration: none; font-size: 14px; }

.page { width: min(100%, 760px); margin: 0 auto; padding: 32px 18px 80px; }
.hero { padding: 8px 0 30px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
h1 { margin: 0; font-size: clamp(28px, 8vw, 42px); line-height: 1.2; letter-spacing: 0; }
.lead { margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 28px;
  padding: 18px 0 17px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 0 18px;
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 0;
  width: 1px;
  height: 20px;
  background: var(--line);
}
.step b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.step span { display: block; padding-left: 10px; font-size: 13px; line-height: 1.45; }

.section { padding: 26px 0; border-top: 1px solid var(--line); }
.steps + .section { padding-top: 20px; border-top: 0; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section h2 { margin: 0; font-size: 19px; line-height: 1.35; }
.section-kicker { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.copy-box { position: relative; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--accent); box-shadow: var(--shadow); }
.copy-text { margin: 0; padding-right: 42px; font-size: 16px; line-height: 1.85; white-space: pre-wrap; }
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.copy-box .icon-button { position: absolute; top: 14px; right: 14px; }
.icon-button:hover { border-color: #b9b9b6; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.upload {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 120px;
  padding: 14px;
  background: var(--paper);
  border: 1px dashed #c9c9c5;
  transition: border-color .2s, background .2s;
}
.upload.dragging { border-color: var(--accent); background: #fff8f7; }
.preview {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  overflow: hidden;
  color: var(--muted);
  background: #efefec;
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview .icon { width: 30px; height: 30px; }
.upload-title { margin: 0 0 5px; font-weight: 700; }
.upload-meta { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.secondary-button { padding: 8px 13px; color: var(--ink); background: #fff; border: 1px solid #cfcfcb; border-radius: 6px; }
.secondary-button:hover { border-color: #999; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field.full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.required { color: var(--accent); }
input, textarea {
  display: block;
  width: 100%;
  border: 1px solid #cfcfcb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input { height: 46px; padding: 0 13px; }
textarea { min-height: 110px; padding: 12px 13px; resize: vertical; line-height: 1.65; }
input:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(32,33,36,.08); }
.consent { display: flex; align-items: flex-start; gap: 9px; margin: 21px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.consent input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  font-weight: 750;
}
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; }
.primary-button.wide { width: 100%; }
.status { min-height: 22px; margin: 11px 0 0; font-size: 13px; text-align: center; }
.status.error { color: var(--accent-dark); }
.status.success { color: var(--green); }

.success-view { display: none; padding: 56px 0; text-align: center; }
.success-view.visible { display: block; }
.success-check { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; color: #fff; background: var(--green); border-radius: 50%; }
.success-view h2 { margin: 0 0 9px; font-size: 27px; }
.success-view p { margin: 0; color: var(--muted); line-height: 1.7; }
.hidden { display: none !important; }

.admin-page { width: min(1180px, 100%); }
.admin-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.admin-header h1 { font-size: 34px; }
.admin-grid { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(420px, 1.25fr); gap: 34px; align-items: start; }
.panel { padding: 22px; background: #fff; border: 1px solid var(--line); }
.panel h2 { margin: 0 0 18px; font-size: 19px; }
.panel .field { margin-bottom: 15px; }
.admin-settings { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(190px, .8fr) auto; gap: 8px; }
.admin-settings input { min-width: 0; }
.campaign-list { display: grid; gap: 12px; margin-top: 18px; }
.campaign-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.campaign-item:first-child { border-top: 0; }
.campaign-item h3 { margin: 0 0 5px; font-size: 15px; }
.campaign-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.qr { width: 74px; height: 74px; object-fit: cover; border: 1px solid var(--line); }
.campaign-actions { display: flex; gap: 7px; margin-top: 10px; }
.text-button { padding: 0; color: var(--accent-dark); background: none; border: 0; font-size: 12px; font-weight: 700; }
.records { width: 100%; border-collapse: collapse; font-size: 13px; }
.records th, .records td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.records th { color: var(--muted); font-size: 12px; font-weight: 650; }
.thumb { width: 50px; height: 50px; object-fit: cover; background: var(--wash); }
.empty { padding: 40px 10px; color: var(--muted); text-align: center; }
.table-wrap { overflow-x: auto; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translateX(-50%) translateY(20px); padding: 11px 16px; color: #fff; background: #242424; border-radius: 6px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 760px) {
  .page { padding-top: 24px; }
  .steps { grid-template-columns: 1fr; }
  .step { grid-template-columns: 30px 1fr; padding: 8px 0; }
  .step:not(:last-child)::after { top: 44px; right: auto; left: 14px; width: 1px; height: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .admin-header { display: block; }
  .admin-settings { grid-template-columns: 1fr; margin-top: 18px; }
  .admin-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
}

@media (max-width: 420px) {
  .upload { grid-template-columns: 76px 1fr; gap: 12px; }
  .preview { width: 76px; height: 88px; }
  .copy-text { padding-right: 34px; font-size: 15px; }
}
