:root {
  --bg: #f8efe1;
  --bg-strong: #f2dcc3;
  --card: rgba(255, 251, 245, 0.9);
  --card-strong: #fffdf8;
  --line: rgba(88, 58, 22, 0.12);
  --ink: #18221f;
  --muted: #6d665f;
  --accent: #cb5a2e;
  --accent-strong: #9f3f1e;
  --success-bg: #eaf7ef;
  --success-ink: #145c32;
  --error-bg: #fff0eb;
  --error-ink: #8a2f13;
  --shadow: 0 24px 48px rgba(71, 43, 12, 0.12);
  --radius: 28px;
  --font-ui: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 214, 186, 0.78), transparent 26%),
    linear-gradient(135deg, var(--bg) 0%, #f8f3e9 42%, var(--bg-strong) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(153, 108, 52, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(153, 108, 52, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 90%);
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 420px);
  gap: 28px;
}

.hero--single {
  grid-template-columns: 1fr;
}

.hero-copy,
.qr-card,
.admin-grid > section,
.login-card,
.error-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero-copy {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -72px;
  top: -72px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(203, 90, 46, 0.2), rgba(255, 255, 255, 0));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(203, 90, 46, 0.18);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.title {
  margin: 20px 0 14px;
  font-size: clamp(2rem, 4vw, 3.65rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 32rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.qr-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-card h2,
.panel-title {
  margin: 0;
  font-size: 1.1rem;
}

.qr-frame {
  background: var(--card-strong);
  border-radius: 24px;
  border: 1px solid rgba(17, 34, 29, 0.08);
  padding: 18px;
}

.qr-frame--light {
  background: #ffffff;
}

.qr-frame img {
  width: 100%;
  border-radius: 18px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.main-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title-wrap p,
.panel-footer {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.panel-footer {
  margin-top: 18px;
  font-size: 0.94rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.actions,
.form-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
button,
.upload-trigger {
  appearance: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
button:hover,
.upload-trigger:hover {
  transform: translateY(-1px);
}

.button-primary,
button[type="submit"] {
  background: linear-gradient(135deg, var(--accent) 0%, #da7347 100%);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(203, 90, 46, 0.28);
}

.button-secondary,
.upload-trigger {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-danger {
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  border: 1px solid rgba(203, 90, 46, 0.18);
}

.admin-shell {
  width: min(980px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.admin-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.admin-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.admin-grid > section {
  padding: 22px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.preview-grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-card h3 {
  margin: 0;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(17, 34, 29, 0.14);
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  color: var(--ink);
}

.field input:focus {
  outline: 2px solid rgba(203, 90, 46, 0.18);
  border-color: rgba(203, 90, 46, 0.36);
}

.field-help,
.toolbar-note,
.footnote,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.field-help,
.toolbar-note,
.footnote {
  font-size: 0.92rem;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  font-weight: 700;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-ink);
  border: 1px solid rgba(20, 92, 50, 0.14);
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-ink);
  border: 1px solid rgba(138, 47, 19, 0.14);
}

.login-page,
.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card,
.error-card {
  width: min(460px, 100%);
  padding: 26px;
}

.title-sm {
  margin: 0 0 10px;
  font-size: 1.9rem;
}

.upload-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(17, 34, 29, 0.16);
}

.file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.file-row input[type="file"] {
  display: none;
}

.file-name {
  color: var(--muted);
  font-size: 0.94rem;
}

.link-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  word-break: break-all;
}

@media (max-width: 900px) {
  .hero,
  .main-grid,
  .preview-grid,
  .preview-grid--triple {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .hero-copy,
  .panel,
  .qr-card,
  .admin-grid > section {
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .button,
  button,
  .upload-trigger {
    width: 100%;
  }

  .field input {
    min-height: 50px;
  }
}

.front-page {
  background: #f7f7f7;
}

.front-page::before {
  display: none;
}

.front-shell {
  width: min(960px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.front-header {
  text-align: center;
  margin-bottom: 24px;
}

.front-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  font-weight: 800;
  color: #111111;
}

.front-subtitle {
  margin: 10px 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #666666;
}

.front-qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.front-qr-card {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  padding: 18px;
}

.front-qr-card h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: #222222;
}

.front-qr-frame {
  background: #ffffff;
  border: 1px solid #efefef;
  border-radius: 14px;
  padding: 12px;
}

.front-qr-frame img {
  width: 100%;
  border-radius: 10px;
}

@media (max-width: 700px) {
  .front-qr-grid {
    grid-template-columns: 1fr;
  }

  .front-shell {
    width: min(100% - 20px, 960px);
    padding-top: 20px;
  }

  .front-qr-card {
    padding: 16px;
  }
}

.preview-grid--dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.status-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(17, 34, 29, 0.08);
}

.status-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-value {
  display: block;
  margin-top: 8px;
  font-size: 1.3rem;
}

.admin-hero-frame {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-empty {
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.pool-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: rgba(59, 76, 112, 0.08);
  color: #3b4c70;
  font-size: 0.86rem;
  font-weight: 700;
}

.large-empty {
  padding: 26px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed rgba(17, 34, 29, 0.14);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.checkbox-row input {
  margin-top: 4px;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.radio-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.radio-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 34, 29, 0.12);
  color: var(--muted);
  font-weight: 700;
}

.radio-chip input:checked + span {
  background: rgba(203, 90, 46, 0.12);
  border-color: rgba(203, 90, 46, 0.28);
  color: var(--accent-strong);
}

.pool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pool-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(17, 34, 29, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pool-order {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.pool-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(203, 90, 46, 0.12);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.pool-image-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(17, 34, 29, 0.08);
  background: #ffffff;
}

.pool-image-wrap img {
  width: 100%;
  display: block;
}

.pool-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.pool-meta strong {
  color: var(--ink);
  word-break: break-all;
}

.pool-target-ok {
  color: #1b6b3b;
  font-weight: 700;
}

.pool-target-empty {
  color: #8b5d0f;
  font-weight: 700;
}

.pool-target-text {
  word-break: break-all;
}

.pool-type-text {
  color: #3b4c70;
  font-weight: 700;
}

.pool-delete {
  width: 100%;
}

.inline-actions form {
  margin: 0;
}

.showcase-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top center, rgba(255, 214, 153, 0.78), transparent 30%),
    radial-gradient(circle at bottom center, rgba(255, 208, 120, 0.35), transparent 34%),
    linear-gradient(180deg, #fff7ea 0%, #fffdf8 100%);
}

.showcase-page::before {
  display: none;
}

.showcase-shell {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 34px 18px 46px;
}

.showcase-header {
  text-align: center;
  margin-bottom: 22px;
}

.showcase-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #445f96 0%, #6f5f59 36%, #c28917 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.showcase-stage {
  display: flex;
  justify-content: center;
}

.showcase-card {
  width: 100%;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 28px 60px rgba(235, 188, 83, 0.18),
    0 10px 24px rgba(75, 56, 18, 0.08);
}

.showcase-guidance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 16px;
  animation: showcase-guidance-bob 0.95s ease-in-out infinite;
  transform-origin: center top;
}

.showcase-top-note {
  margin: 0;
  text-align: center;
  color: #a35a18;
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.04em;
  text-shadow: 0 6px 18px rgba(235, 188, 83, 0.28);
}

@keyframes showcase-guidance-bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.showcase-guidance-arrow {
  width: 34px;
  height: 30px;
  margin: 0 auto;
  background: linear-gradient(180deg, #ffd07a 0%, #ef9a33 45%, #d7611c 100%);
  clip-path: polygon(41% 0, 59% 0, 59% 46%, 84% 46%, 50% 100%, 16% 46%, 41% 46%);
  filter: drop-shadow(0 8px 12px rgba(224, 141, 39, 0.28));
}

.showcase-image-frame {
  background: #ffffff;
  border-radius: 22px;
  padding: 14px;
  border: 1px solid rgba(41, 41, 41, 0.06);
}

.showcase-image-frame img {
  width: 100%;
  display: block;
  border-radius: 16px;
}

.showcase-note {
  margin: 16px 0 0;
  text-align: center;
  color: #928674;
  font-size: 0.96rem;
}

.showcase-empty {
  text-align: center;
  color: #8f836f;
}

.showcase-empty-box {
  display: grid;
  place-items: center;
  min-height: 360px;
  border-radius: 22px;
  border: 1px dashed rgba(188, 146, 58, 0.4);
  background: rgba(255, 250, 242, 0.85);
  font-size: 1.1rem;
  font-weight: 700;
}

.showcase-footer {
  margin-top: 26px;
}

.showcase-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.showcase-brand-line {
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, rgba(195, 142, 40, 0), rgba(195, 142, 40, 0.7), rgba(195, 142, 40, 0));
}

.showcase-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.95);
  box-shadow: 0 10px 24px rgba(235, 188, 83, 0.14);
  color: #6a5b42;
  font-weight: 700;
}

.showcase-brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd16a 0%, #efb243 100%);
  box-shadow: 0 0 0 4px rgba(255, 209, 106, 0.18);
}

@media (max-width: 900px) {
  .admin-status-grid,
  .preview-grid--dual,
  .pool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .showcase-shell {
    padding-left: 20px;
    padding-right: 20px;
  }

  .showcase-card {
    width: calc(100% - 4px);
    margin: 0 auto;
    padding: 16px;
    border-radius: 24px;
  }

  .showcase-top-note {
    font-size: 1.26rem;
  }

  .showcase-guidance {
    margin-bottom: 14px;
  }

  .showcase-guidance-arrow {
    width: 30px;
    height: 27px;
  }

  .showcase-image-frame {
    padding: 10px;
  }
}
