:root {
  --bg: #f5f7f8;
  --text: #172126;
  --muted: #68757d;
  --line: #dde5e8;
  --card: #ffffff;
  --teal: #087d78;
  --teal-dark: #075d5a;
  --orange: #f19635;
  --red: #d94545;
  --blue: #246bfe;
  --shadow: 0 8px 24px rgba(19, 37, 45, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button {
  border: 0;
}

.app {
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  padding: env(safe-area-inset-top) 14px 24px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px 12px;
}

.city {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

h1 {
  font-size: 24px;
  line-height: 1.2;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--text);
  display: grid;
  place-items: center;
}

.plus-icon,
.plus-icon::after {
  display: block;
  width: 18px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  content: "";
}

.plus-icon::after {
  transform: rotate(90deg);
}

.hero {
  min-height: 156px;
  background: #e9f5f2;
  border: 1px solid #cde7e1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.hero-copy {
  min-width: 0;
}

.hero-track {
  display: flex;
  width: 100%;
  transition: transform 0.32s ease;
}

.hero-slide {
  min-width: 100%;
  min-height: 156px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 96px;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero h2 {
  font-size: 26px;
  line-height: 1.18;
  margin-bottom: 8px;
}

.hero p:last-child {
  color: #425159;
  font-size: 14px;
  line-height: 1.5;
}

.hero-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.hero-dots {
  position: absolute;
  left: 16px;
  bottom: 10px;
  display: flex;
  gap: 5px;
}

.hero-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #a8c8c3;
}

.hero-dots span.active {
  width: 18px;
  background: var(--teal);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.tab {
  min-width: 0;
  height: 42px;
  background: #e8eef0;
  color: #445158;
  border-radius: 8px;
  font-weight: 700;
}

.tab.active {
  background: var(--text);
  color: #fff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}

.section-head h3 {
  font-size: 18px;
}

.section-head span,
.section-head button {
  color: var(--muted);
  font-size: 13px;
}

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

.scan-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin: 14px 0 16px;
  background: #fff7ea;
  border: 1px solid #f2d4a8;
  border-radius: 8px;
}

.scan-copy {
  min-width: 0;
}

.scan-label {
  display: inline-block;
  margin-bottom: 6px;
  color: #a15c0b;
  font-size: 13px;
  font-weight: 800;
}

.scan-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.25;
}

.scan-card p {
  color: #5e4a2b;
  font-size: 13px;
  line-height: 1.45;
}

.scan-card input {
  display: none;
}

.scan-action {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border-radius: 8px;
  background: #111820;
  color: #fff;
}

.scan-action:active {
  background: #064e4b;
}

.scan-action b {
  font-size: 17px;
}

.scan-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fff;
  position: relative;
}

.scan-icon::before {
  position: absolute;
  content: "";
  inset: 9px;
  border: 3px solid var(--teal);
  border-radius: 4px;
}

.scan-icon::after {
  position: absolute;
  content: "";
  left: 11px;
  right: 11px;
  top: 18px;
  height: 3px;
  background: var(--orange);
  border-radius: 2px;
}

.scan-result {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #f0d3a5;
}

.scan-result img {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f4f5;
}

.scan-result strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
}

.scan-result small {
  color: #684315;
  font-size: 12px;
  line-height: 1.45;
}

.home-block {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.home-block h3 {
  font-size: 18px;
}

.home-service-list {
  display: grid;
  gap: 8px;
}

.home-service-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.home-service-item:active {
  background: #e9f5f2;
  border-color: var(--teal);
}

.home-service-item b {
  font-size: 15px;
}

.home-service-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.home-order-btn {
  margin-top: 2px;
}

.back-btn {
  height: 38px;
  padding: 0 12px;
  margin: 6px 0 12px;
  border-radius: 8px;
  background: #e7edf0;
  color: #253238;
  font-weight: 800;
}

.detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-card h3 {
  font-size: 22px;
  margin: 0;
}

.detail-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
  color: #344349;
  font-size: 14px;
  line-height: 1.45;
}

.detail-list div::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.service-card {
  min-width: 0;
  min-height: 102px;
  padding: 10px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(18, 34, 42, 0.04);
}

.service-card.active {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  color: #fff;
  box-shadow: 0 8px 18px rgba(7, 93, 90, 0.22);
}

.service-card:active {
  transform: scale(0.98);
  background: #064e4b;
  color: #fff;
}

.service-card.active small,
.service-card:active small {
  color: #d7f2ec;
}

.service-card.active .service-icon,
.service-card:active .service-icon {
  background: #e9fffb;
}

.service-card strong {
  font-size: 15px;
}

.service-card small {
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.service-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  position: relative;
  background: #d9eeea;
}

.tool-icon::before,
.clean-icon::before,
.install-icon::before,
.move-icon::before,
.recycle-icon::before,
.heater-icon::before {
  position: absolute;
  content: "";
  inset: 9px;
  border: 3px solid var(--teal);
}

.tool-icon::before {
  border-left: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.clean-icon::before {
  border-radius: 50%;
}

.install-icon::before {
  border-top: 0;
}

.move-icon::before {
  border-left: 0;
  border-right: 0;
}

.heater-icon::before {
  inset: 8px 10px;
  border-radius: 6px;
}

.heater-icon::after {
  position: absolute;
  content: "";
  left: 13px;
  right: 13px;
  bottom: 9px;
  height: 3px;
  border-radius: 2px;
  background: var(--orange);
}

.recycle-icon::before {
  border-radius: 50%;
  border-left-color: transparent;
}

.recycle-icon::after {
  position: absolute;
  content: "";
  right: 7px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-top: 3px solid var(--teal);
  border-right: 3px solid var(--teal);
  transform: rotate(45deg);
}

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

label {
  display: grid;
  gap: 6px;
}

label span {
  color: #344349;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  outline: none;
  padding: 12px 12px;
}

textarea {
  resize: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 125, 120, 0.12);
}

.image-upload {
  display: grid;
  gap: 8px;
}

.image-upload input {
  display: none;
}

.upload-box {
  min-height: 76px;
  padding: 14px;
  border: 1px dashed #8abdb6;
  border-radius: 8px;
  background: #f0faf7;
  display: grid;
  align-content: center;
}

.upload-box span {
  color: var(--teal);
  font-size: 15px;
}

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

.photo-preview {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.photo-preview img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: #edf2f4;
}

.photo-preview b {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.photo-preview small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.promise-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0;
}

.promise-row div,
.worker-summary div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.promise-row b,
.worker-summary b {
  display: block;
  font-size: 14px;
}

.promise-row small,
.worker-summary small {
  color: var(--muted);
  font-size: 11px;
}

.price-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.price-table-head {
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: #fff7ea;
  color: #684315;
  font-size: 13px;
  font-weight: 800;
}

.price-table div:not(.price-table-head) {
  display: grid;
  gap: 3px;
  min-height: 58px;
  place-items: center;
  background: var(--card);
  padding: 8px 4px;
}

.price-table span {
  color: var(--muted);
  font-size: 12px;
}

.price-table b {
  color: var(--orange);
  font-size: 15px;
}

.primary {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.primary:active {
  background: var(--teal-dark);
}

.text-btn {
  background: transparent;
  padding: 4px 0;
}

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

.empty {
  padding: 28px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.order-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 12px rgba(18, 34, 42, 0.05);
}

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

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

.status {
  height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #fff;
  background: var(--orange);
  font-size: 12px;
  white-space: nowrap;
}

.status.accepted {
  background: var(--blue);
}

.status.done {
  background: var(--teal);
}

.order-meta {
  display: grid;
  gap: 5px;
  color: #4a5960;
  font-size: 13px;
  line-height: 1.45;
}

.order-photo {
  display: block;
  width: 100%;
  max-height: 180px;
  margin-top: 10px;
  border-radius: 8px;
  object-fit: cover;
  background: #edf2f4;
}

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

.mini-btn {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  background: var(--text);
  font-weight: 700;
}

.mini-btn.secondary {
  background: #e7edf0;
  color: #253238;
}

.mini-btn.danger {
  background: var(--red);
}

.worker-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  width: min(88%, 360px);
  padding: 12px 14px;
  background: rgba(20, 29, 34, 0.94);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

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

@media (max-width: 420px) {
  .app {
    padding-left: 10px;
    padding-right: 10px;
  }

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

  .hero h2 {
    font-size: 23px;
  }

  .hero-img {
    width: 92px;
    height: 92px;
  }

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