:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef5f1;
  --text: #14221b;
  --muted: #5b6b62;
  --primary: #16784f;
  --primary-strong: #0f5c3b;
  --accent: #1f6feb;
  --warning: #b35c00;
  --danger: #b42318;
  --border: #d8e2dc;
  --shadow: 0 12px 32px rgba(18, 48, 36, 0.1);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #f8fbf9 0%, var(--bg) 48%, #edf4f0 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(31, 111, 235, 0.28);
  outline-offset: 2px;
}

.app-shell {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.46);
}

.page-content {
  padding: 16px 16px 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.25;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
}

.hero-panel,
.form-panel,
.pay-panel,
.empty-state,
.order-card,
.detail-block,
.dash-panel,
.metric-grid article {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 22px;
}

.hero-copy h1,
.section-heading h1,
.pay-panel h1,
.dashboard-head h1 {
  margin: 4px 0 8px;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-copy h1 {
  font-size: 28px;
}

.hero-copy p,
.section-heading p,
.pay-panel p,
.order-card p,
.detail-block p,
.empty-state p {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.hero-actions,
.card-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-actions {
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

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

.btn.secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--primary-strong);
}

.btn.ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.btn.danger {
  background: #fff2f0;
  border-color: #ffd1cc;
  color: var(--danger);
}

.btn.full {
  width: 100%;
}

.btn.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.banner-slider {
  position: relative;
  min-height: 132px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
}

.banner-slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.banner-slide.active {
  opacity: 1;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-slide span {
  position: absolute;
  left: 16px;
  bottom: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-weight: 800;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.quick-card {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.quick-card strong,
.quick-card span {
  display: block;
}

.quick-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.section-heading {
  margin: 4px 0 16px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.form-panel,
.pay-panel {
  padding: 20px;
}

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

.stack-form label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.stack-form label > span,
legend {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

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

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.segmented input:checked + span {
  border-color: var(--primary);
  background: #e8f5ef;
  color: var(--primary-strong);
}

.helper-text,
.warn-text {
  color: var(--warning);
  font-size: 13px;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.order-card {
  padding: 16px;
}

.card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.status {
  padding: 5px 8px;
  border-radius: 8px;
  background: #e8f5ef;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.meta-grid div {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.meta-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.meta-grid dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 12px;
  padding: 28px 20px;
  text-align: center;
}

.pay-panel {
  display: grid;
  gap: 12px;
  text-align: center;
}

.pay-panel h1 {
  font-size: 40px;
}

.notice {
  padding: 12px;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--warning);
  line-height: 1.55;
}

.map-shell {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.map-placeholder {
  display: grid;
  min-height: 320px;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(22, 120, 79, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(22, 120, 79, 0.08) 1px, transparent 1px),
    #f7fbf8;
  background-size: 28px 28px;
  text-align: center;
}

.track-list {
  max-height: 220px;
  margin: 0;
  padding: 12px 12px 12px 36px;
  overflow: auto;
}

.track-list li {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
}

.order-detail {
  display: grid;
  gap: 14px;
}

.detail-block {
  padding: 16px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.reject-form {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.exception-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 540px;
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.bottom-nav a {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bottom-nav a:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 88px;
  left: 16px;
  z-index: 60;
  display: none;
  max-width: 508px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: #14221b;
  color: #fff;
  text-align: center;
}

.toast.show {
  display: block;
}

.admin-body .app-shell,
.dashboard-body .app-shell {
  max-width: none;
  background: transparent;
}

.admin-body .page-content,
.dashboard-body .page-content {
  padding: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  padding: 20px;
  border-right: 1px solid var(--border);
  background: #ffffff;
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.admin-sidebar nav a {
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover {
  background: var(--surface-2);
  color: var(--primary-strong);
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-section {
  margin-bottom: 28px;
}

.admin-section h2 {
  margin: 0 0 12px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.config-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.config-card label {
  display: grid;
  gap: 6px;
}

.config-card label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.admin-photo-grid a {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.admin-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.admin-photo-grid span,
.admin-photo-grid small {
  overflow-wrap: anywhere;
}

.admin-photo-grid small {
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7faf8;
  color: var(--muted);
  font-size: 13px;
}

.dashboard {
  min-height: 100vh;
  padding: 28px;
  background: #0f1f19;
  color: #f7fbf8;
}

.dashboard .eyebrow {
  color: #7ee0ad;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.metric-grid article,
.dash-panel {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.metric-grid span,
.dash-panel p {
  color: #b9cbc3;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.dash-panel {
  padding: 18px;
}

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

.bars,
.status-list {
  display: grid;
  gap: 10px;
}

.bar-row,
.status-row {
  display: grid;
  gap: 6px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.bar-fill {
  height: 100%;
  border-radius: 8px;
  background: #7ee0ad;
}

.inline-form {
  display: inline;
}

@media (max-width: 760px) {
  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-main {
    padding: 16px;
  }

  .admin-form,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .exception-mini {
    grid-template-columns: 1fr;
  }

  .dashboard {
    padding: 16px;
  }

  .dashboard-head,
  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-head {
    display: grid;
  }
}

@media (max-width: 380px) {
  .page-content {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero-copy h1 {
    font-size: 24px;
  }

  .segmented,
  .quick-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
