:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #66716d;
  --line: #dbe3df;
  --paper: #f8faf7;
  --panel: #ffffff;
  --accent: #116a5b;
  --accent-strong: #0b4b41;
  --gold: #a37423;
  --red: #a33b3b;
  --blue: #315f91;
  --shadow: 0 18px 50px rgba(24, 33, 31, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(248, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
}

h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

nav,
.hero-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  transition: 0.18s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

button:hover {
  transform: translateY(-1px);
}

.nav-button,
.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.nav-button.active,
.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-strong);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: stretch;
  min-height: 420px;
  padding: clamp(26px, 5vw, 56px);
  background:
    linear-gradient(120deg, rgba(17, 106, 91, 0.94), rgba(24, 33, 31, 0.76)),
    url("https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
}

.hero p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

.price-panel {
  align-self: end;
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.price-panel span {
  color: var(--muted);
}

.price-panel strong {
  display: block;
  margin: 10px 0;
  font-size: 34px;
}

.band,
.policy-grid,
.metrics,
.admin-layout {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

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

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

.band section,
.policy-grid section,
.metric,
.detail-panel,
.table-wrap,
.order-card,
.qr-panel,
.payment-notice {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.notice {
  border-color: rgba(163, 59, 59, 0.34) !important;
}

ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.9;
}

.check-list li::marker {
  color: var(--accent);
}

.warn-list li::marker {
  color: var(--red);
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

label,
fieldset {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  color: var(--muted);
  font-weight: 800;
}

fieldset label,
.confirmations label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.confirmations {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #f1f6f4;
  border-radius: 8px;
}

.metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.toolbar {
  align-items: center;
  margin: 18px 0;
}

.toolbar input {
  flex: 1 1 260px;
}

.toolbar select {
  width: auto;
}

.admin-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #eef6f3;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf2f0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  background: #dceee8;
  color: var(--accent-strong);
}

.badge.red {
  background: #f5dfdf;
  color: var(--red);
}

.badge.blue {
  background: #dfeaf6;
  color: var(--blue);
}

.detail-panel {
  position: sticky;
  top: 100px;
}

.detail-panel .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.detail-panel dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 12px;
  margin: 0;
  line-height: 1.6;
}

.detail-panel dt {
  color: var(--muted);
}

.detail-panel dd {
  margin: 0;
  word-break: break-word;
}

.admin-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.reply-box {
  margin-top: 16px;
  padding: 14px;
  background: #f1f6f4;
  border-radius: 8px;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.payment-shell {
  display: grid;
  gap: 18px;
}

.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: center;
}

.order-summary {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
}

.order-summary dt {
  color: var(--muted);
}

.order-summary dd {
  margin: 0;
  word-break: break-word;
}

.amount-box {
  padding: 20px;
  border: 1px solid rgba(163, 116, 35, 0.32);
  border-radius: 8px;
  background: #fff9ed;
}

.amount-box span {
  color: var(--muted);
}

.amount-box strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
  color: var(--gold);
}

.amount-box p {
  margin-bottom: 0;
  color: var(--muted);
}

.payment-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
}

.qr-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.qr-wrap {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.qr-image,
.qr-placeholder {
  width: min(280px, 100%);
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.qr-image {
  display: block;
  object-fit: cover;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(17, 106, 91, 0.08) 50%, transparent 50%),
    linear-gradient(rgba(17, 106, 91, 0.08) 50%, transparent 50%);
  background-size: 22px 22px;
  color: var(--accent-strong);
}

.qr-placeholder span {
  max-width: 210px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.payment-notice {
  line-height: 1.8;
}

.risk-text {
  margin: 18px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #f7eeee;
  color: var(--red);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
}

.modal.show {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 33, 31, 0.58);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 26px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .band,
  .policy-grid,
  .form-grid,
  .admin-layout,
  .order-card,
  .payment-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-panel {
    position: static;
  }
}
