:root {
  --ink: #14211c;
  --muted: #66746f;
  --soft: #8a9691;
  --line: #dce5e1;
  --line-strong: #c8d8d1;
  --paper: #ffffff;
  --wash: #f3f7f5;
  --wash-2: #eaf2ee;
  --brand: #12945f;
  --brand-deep: #0c6b4a;
  --brand-soft: #e4f4ec;
  --mint: #72c6a4;
  --gold: #c5933f;
  --danger: #d94d4d;
  --warning: #c37a21;
  --shadow: 0 14px 34px rgba(24, 48, 38, .08);
  --shadow-soft: 0 8px 22px rgba(24, 48, 38, .06);
  --radius: 8px;
  --bar-h: 58px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: #e7efeb; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  background:
    linear-gradient(180deg, #dfeee7 0, #f5f8f6 210px, #f5f8f6 100%),
    var(--wash);
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}

button, input, select { font: inherit; }
button { cursor: pointer; }
svg { display: block; }
.hidden { display: none !important; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 16px;
  color: var(--ink);
  background: rgba(231, 241, 236, .86);
  border-bottom: 1px solid rgba(190, 208, 199, .65);
  backdrop-filter: blur(18px);
}

.brand-row {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  box-shadow: 0 8px 18px rgba(18, 148, 95, .22);
}

.brand-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
}

.subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.brand-pill {
  padding: 5px 8px;
  border: 1px solid rgba(18, 148, 95, .2);
  border-radius: 999px;
  color: var(--brand-deep);
  background: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 700;
}

.view {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 14px 14px 92px;
}

.prepare-hero {
  padding: 18px 2px 16px;
}

.prepare-hero h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--ink);
}

.prepare-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.sp-warn {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(195, 122, 33, .25);
  color: #8b5515;
  background: #fff8e8;
  font-size: 12px;
}

.card {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(211, 224, 218, .9);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}

.card h2 {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}

.card-desc {
  margin: -5px 0 15px;
  color: var(--muted);
  font-size: 12px;
}

.step-no {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #fff;
  background: var(--brand-deep);
  font-size: 12px;
  font-weight: 800;
}

.card-icon,
.prepare-icon {
  color: var(--brand);
  display: inline-flex;
}

.prepare-item {
  position: relative;
  padding: 15px;
}

.prepare-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prepare-head strong { font-size: 16px; }

.prepare-desc {
  margin: 9px 0 0;
  padding-left: 34px;
  color: var(--muted);
  font-size: 13px;
}

.subject-pick {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.pick input { display: none; }

.pick-box {
  min-height: 86px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}

.pick-box:active { transform: translateY(1px); }

.pick-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.pick-box strong {
  display: block;
  font-size: 16px;
}

.pick-box small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.pick input:checked + .pick-box {
  border-color: var(--brand);
  background: #f2fbf6;
  box-shadow: 0 0 0 3px rgba(18, 148, 95, .1);
}

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  margin-bottom: 7px;
  color: #33433d;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.date-field .date-input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  background: #fbfdfc;
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6f7e78 50%),
    linear-gradient(135deg, #6f7e78 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.field input:focus,
.field select:focus,
.date-field .date-input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 148, 95, .1);
}

.hint,
.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--soft);
  font-size: 11.5px;
}

.field-hint {
  padding: 10px 11px;
  border: 1px solid #e1e8e5;
  border-radius: var(--radius);
  background: #f7faf8;
  color: var(--muted);
}

.image-field .img-preview {
  width: 100%;
  min-height: 124px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background-color: #f8fbf9;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  transition: border-color .18s, background .18s;
}

.image-field .img-preview .up-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf4f1;
  color: var(--brand-deep);
}

.img-preview.uploaded {
  border-style: solid;
  border-color: var(--brand);
}

.img-preview.failed { border-color: var(--danger); }

.rate-list {
  display: grid;
  gap: 10px;
}

.rate-empty,
.empty {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fbfdfc;
  text-align: center;
  font-size: 13px;
}

.rate-item {
  display: grid;
  grid-template-columns: 22px 1fr 20px;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}

.rate-item:active { transform: translateY(1px); }

.rate-radio {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid #b9c8c0;
}

.rate-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rate-label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
}

.rate-value {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.rate-check {
  display: none;
  color: var(--brand);
}

.rate-item.active {
  border-color: var(--brand);
  background: #f2fbf6;
  box-shadow: 0 0 0 3px rgba(18, 148, 95, .09);
}

.rate-item.active .rate-radio {
  border-color: var(--brand);
  background: radial-gradient(circle at center, var(--brand) 0 42%, transparent 46%);
}

.rate-item.active .rate-check { display: inline-flex; }

.date-field {
  display: flex;
  gap: 9px;
}

.date-field .date-input:disabled {
  color: var(--soft);
  background: #edf2ef;
}

.longterm-btn {
  min-width: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}

.longterm-btn.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.wizard-progress {
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid rgba(211, 224, 218, .86);
  border-radius: var(--radius);
  background: rgba(255,255,255,.66);
}

.wizard-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #dce8e2;
}

.wizard-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-deep), var(--mint));
  transition: width .28s ease;
}

.wizard-step-text {
  margin-top: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid rgba(204, 218, 211, .85);
  background: rgba(250, 252, 251, .9);
  backdrop-filter: blur(18px);
}

.submit-bar.two .btn-ghost.block { flex: 0 0 34%; }
.submit-bar.two .btn-primary { flex: 1; }

.btn-primary,
.btn-ghost,
.btn-link {
  min-height: 46px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  text-decoration: none;
  font-weight: 750;
  transition: transform .16s, box-shadow .16s, background .16s;
}

.btn-primary {
  width: 100%;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  box-shadow: 0 10px 22px rgba(18, 148, 95, .22);
}

.btn-primary:active,
.btn-ghost:active,
.btn-link:active {
  transform: translateY(1px);
}

.btn-ghost {
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.btn-link {
  padding: 0 14px;
  color: #fff;
  background: var(--brand);
}

.btn-icon,
.tabbar-icon { display: inline-flex; }

.orders-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.order-head strong {
  font-size: 16px;
  line-height: 1.35;
}

.badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.badge.ok { background: var(--brand); }
.badge.err { background: var(--danger); }
.badge.pending { background: var(--warning); }

.order-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 12.5px;
}

.order-row b {
  min-width: 0;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
  font-weight: 650;
}

.order-desc {
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius);
  color: var(--muted);
  background: #f5f8f6;
  font-size: 12px;
  word-break: break-all;
}

.err-text { color: var(--danger); }

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.order-reject {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f2d4d4;
  border-radius: var(--radius);
  background: #fff5f5;
}

.reject-title {
  margin-bottom: 6px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.order-reject ul {
  margin: 0;
  padding-left: 18px;
}

.order-reject li {
  margin-bottom: 4px;
  color: #7d3c3c;
  font-size: 12px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  border-top: 1px solid rgba(204, 218, 211, .9);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
}

.tabbar-item {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
}

.tabbar-item.active {
  color: var(--brand-deep);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(112px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100% - 34px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(20, 33, 28, .9);
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 13px;
}

.toast.ok { background: rgba(18, 148, 95, .96); }
.toast.err { background: rgba(217, 77, 77, .96); }

.loading {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 248, 246, .58);
  backdrop-filter: blur(4px);
}

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 3px solid #d9e4df;
  border-top-color: var(--brand);
  animation: spin .78s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.qr-mask {
  position: absolute;
  inset: 0;
  background: rgba(20,33,28,.52);
}

.qr-box {
  position: relative;
  width: min(320px, 100%);
  padding: 22px;
  border-radius: 10px;
  background: #fff;
  text-align: center;
  box-shadow: 0 22px 58px rgba(20,33,28,.25);
}

.qr-box h3 {
  margin: 0 0 16px;
  font-size: 17px;
}

.qr-box img {
  width: 220px;
  height: 220px;
  display: block;
  margin: 0 auto 14px;
}

.qr-box p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.qr-box .btn-ghost {
  width: 100%;
}

@media (min-width: 420px) {
  .subject-pick { grid-template-columns: 1fr 1fr; }
  .view { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 360px) {
  .submit-bar.two .btn-ghost.block { flex-basis: 30%; }
  .btn-primary, .btn-ghost, .btn-link { font-size: 14px; }
  .prepare-hero h2 { font-size: 25px; }
}
