:root {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --surface: #ffffff;
  --field: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --blue: #3b82f6;
  --orange: #f97316;
  --orange-soft: #fff7ed;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --soft-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -8%, rgba(59, 130, 246, .16), transparent 34%),
    radial-gradient(circle at 100% 6%, rgba(249, 115, 22, .08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 16px;
  overflow-x: hidden;
}

.page {
  width: min(100%, 430px);
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 8px 14px 150px;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: -8px -14px 10px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid rgba(226, 232, 240, .85);
  background: rgba(248, 250, 252, .88);
  backdrop-filter: blur(20px);
}

.topbar > div {
  min-width: 0;
}

.topbar .ghost {
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

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

h2 {
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  font-size: 17px;
}

.panel,
.form-card,
.form-stepper-card,
.feature-card,
.wide-card,
.brand-card,
.panel-title-card,
.mobile-filters,
.empty-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.panel,
.form-card,
.form-stepper-card,
.brand-card,
.panel-title-card,
.mobile-filters,
.empty-card {
  padding: 16px;
  margin-bottom: 12px;
}

.login-panel {
  margin-top: 22px;
}

.brand-card {
  padding: 24px 18px 20px;
  text-align: center;
}

.brand-card p:last-child,
.panel-title-card span,
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.logo-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fff7ed, #fed7aa);
  color: var(--orange);
  font-size: 28px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.account-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(59, 130, 246, .14);
  border-radius: 999px;
  background: rgba(239, 246, 255, .88);
}

.account-panel span,
.account-panel strong {
  font-size: 12px;
}

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

.account-panel strong {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.feature-card,
.wide-card {
  display: flex;
  color: var(--text);
  text-align: left;
}

.feature-card {
  min-height: 148px;
  padding: 16px 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wide-card {
  width: 100%;
  margin-bottom: 12px;
  padding: 14px;
  align-items: center;
  gap: 12px;
}

.feature-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.wide-card .feature-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  margin-bottom: 0;
}

.check {
  background: #eff6ff;
  color: var(--primary);
}

.list {
  background: #fff7ed;
  color: var(--blue);
}

.save {
  background: #ecfdf5;
  color: var(--success);
}

.info {
  background: #f1f5f9;
  color: #475569;
}

.feature-card strong,
.wide-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.28;
}

.feature-card em,
.wide-card em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
}

.intro-card {
  padding: 16px;
  background: linear-gradient(135deg, rgba(239, 246, 255, .98), rgba(255, 247, 237, .78));
  border-color: rgba(59, 130, 246, .18);
}

.intro-card p {
  margin: 4px 0 0;
}

.card-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.card-heading > div,
.card-heading h2,
.card-heading h3 {
  min-width: 0;
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .14);
}

.highlight-card .card-icon,
.cleared-hint .card-icon {
  background: var(--orange-soft);
  color: var(--orange);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .14);
}

.form-stepper-card {
  padding: 10px;
  background: rgba(255, 255, 255, .78);
}

.step-status {
  margin: 0 2px 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.form-stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.form-stepper button {
  min-width: 0;
  margin: 0;
  padding: 7px 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.form-stepper b,
.form-stepper span {
  display: block;
}

.form-stepper b {
  width: 22px;
  height: 22px;
  margin: 0 auto 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ececf0;
  color: var(--muted);
  font-size: 11px;
}

.form-stepper button.active {
  background: rgba(59, 130, 246, .1);
  color: var(--primary);
}

.form-stepper button.active b,
.form-stepper button.done b {
  background: var(--primary);
  color: #fff;
}

label {
  display: block;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

input,
select,
textarea,
button {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  background: var(--field);
  color: var(--text);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
  padding: 0;
  accent-color: var(--primary);
}

textarea {
  resize: vertical;
}

button {
  width: auto;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease, opacity .15s ease;
}

button:active:not(:disabled) {
  transform: scale(.985);
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

button.is-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  vertical-align: -2px;
  animation: spin .72s linear infinite;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(59, 130, 246, .5);
  outline: 4px solid rgba(59, 130, 246, .14);
  background: #fff;
}

.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.secondary {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 800;
}

.ghost {
  background: rgba(255, 255, 255, .82);
  color: var(--text);
}

.mini-button,
.compact-button {
  width: auto;
  margin: 0;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 800;
}

.location-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

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

.location-card strong {
  margin-bottom: 4px;
}

.location-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.location-card.success {
  background: #ecfdf5;
}

.location-card.failed {
  background: #fef2f2;
}

.segmented,
.status-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.segmented label,
.status-tabs label {
  margin: 0;
  border-radius: 16px;
  padding: 12px;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--line);
}

.status-tabs {
  grid-template-columns: repeat(3, 1fr);
  margin: 10px 0;
}

.segmented label:has(input:checked),
.status-tabs label:has(input:checked) {
  background: rgba(59, 130, 246, .1);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .24);
}

.segmented input,
.status-tabs input,
.check-list input {
  width: auto;
  margin: 0 7px 0 0;
}

.segmented span {
  font-weight: 800;
}

.segmented em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
}

.highlight-card {
  background: rgba(255, 247, 237, .72);
  border-color: rgba(249, 115, 22, .18);
}

.cleared-hint {
  background: rgba(255, 255, 255, .94);
}

.cleared-hint p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.gas-source-card h3 {
  color: var(--text);
}

.check-list label,
.hazard-item {
  border-radius: 16px;
  padding: 12px;
  background: var(--field);
  border: 1px solid var(--line);
}

.check-list label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: start;
  margin: 8px 0;
  color: var(--text);
}

.hazard-category {
  margin-bottom: 12px;
}

.hazard-item {
  margin-top: 10px;
}

.hazard-item > label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: start;
  margin: 0;
  color: var(--text);
}

.hazard-item.selected {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, .22);
}

.photo-grid,
.date-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-tile {
  min-height: 104px;
  margin: 10px 0 0;
  border: 1px dashed rgba(59, 130, 246, .34);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  text-align: center;
  padding: 14px;
}

.photo-tile input {
  display: none;
}

.photo-tile span,
.photo-tile em {
  display: block;
}

.photo-tile span {
  color: var(--text);
  font-weight: 800;
}

.photo-tile em {
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.photo-tile.processing {
  background: #eff6ff;
}

.photo-tile.processing::after {
  content: "正在生成水印...";
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.photo-preview {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.photo-card {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  padding: 8px;
  background: #f8f8fa;
}

.photo-card img {
  width: 82px;
  height: 82px;
  border-radius: 14px;
  object-fit: cover;
  background: #e5e5ea;
}

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

.photo-card strong {
  color: var(--primary);
  font-size: 14px;
}

.photo-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.photo-card button {
  margin: 0;
  padding: 7px 9px;
  color: var(--danger);
  font-size: 12px;
}

.hazard-photo {
  margin-left: 24px;
}

.panel-title-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.mobile-filters {
  padding: 14px;
}

.search-field {
  margin-top: 0;
}

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

.record-card {
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.record-card button {
  width: 100%;
  margin: 0;
  padding: 14px;
  text-align: left;
  background: transparent;
}

.record-card strong,
.record-card em,
.record-card .record-address {
  display: block;
}

.record-card strong {
  margin: 8px 0 4px;
  font-size: 17px;
}

.record-card em,
.record-address {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.4;
}

.record-status,
.status {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.record-status.pending,
.status.pending {
  background: var(--orange-soft);
  color: var(--orange);
}

.empty-card {
  color: var(--muted);
  text-align: center;
}

.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .22);
}

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  max-height: min(86dvh, 760px);
  margin: auto;
  overflow: auto;
  border-radius: 26px 26px 0 0;
  padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .2);
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 2px auto 12px;
  border-radius: 999px;
  background: #d1d1d6;
}

.sheet-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

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

.mobile-detail-grid div,
.rectify-card {
  border-radius: 18px;
  padding: 12px;
  background: #f8f8fa;
}

.mobile-detail-grid span,
.mobile-detail-grid strong {
  display: block;
}

.mobile-detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-detail-grid strong {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.mobile-detail-section {
  margin-top: 16px;
}

.mobile-detail-section h3,
.rectify-card h3 {
  margin-bottom: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
}

.tag-list span,
.tag-list p {
  margin: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.mobile-photo-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-photo-list a {
  overflow: hidden;
  border-radius: 10px;
  padding: 0;
  background: #eef6ff;
  color: var(--blue);
  font-size: 13px;
  text-decoration: none;
}

.mobile-photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e5e5ea;
}

.mobile-photo-thumb span {
  display: block;
  padding: 8px;
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
}

.rectify-card {
  margin-top: 16px;
}

.bottom-actions,
.app-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 58px;
  z-index: 12;
  display: grid;
  grid-template-columns: .75fr 1.55fr;
  gap: 7px;
  max-width: 480px;
  margin: 0 auto;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(60, 60, 67, .1);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(22px);
}

.bottom-actions button {
  margin: 0;
}

.quick-actions,
.step-actions {
  display: grid;
  gap: 8px;
}

.quick-actions {
  grid-template-columns: 1fr;
}

.step-actions {
  grid-template-columns: 1fr;
}

.quick-actions button,
.step-actions button {
  width: 100%;
}

.review-card {
  background: rgba(255, 255, 255, .94);
}

.review-summary {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.review-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.review-row:last-child {
  border-bottom: 0;
}

.review-row span {
  color: var(--muted);
  font-size: 13px;
}

.review-row strong {
  font-size: 14px;
  line-height: 1.45;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 14;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 480px;
  margin: 0 auto;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(60, 60, 67, .1);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(22px);
}

.bottom-nav button {
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.bottom-nav button.active {
  color: var(--primary);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 82px;
  z-index: 40;
  max-width: 430px;
  margin: auto;
  padding: 12px;
  border-radius: 16px;
  background: rgba(28, 28, 30, .92);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(16px);
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.step-hidden {
  display: none !important;
}

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

  .topbar {
    margin-left: -10px;
    margin-right: -10px;
  }

  .topbar .ghost {
    padding-left: 8px;
    padding-right: 8px;
  }

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

  .segmented,
  .photo-grid,
  .date-pair {
    grid-template-columns: 1fr;
  }

  .mobile-detail-grid {
    grid-template-columns: 1fr;
  }

  .photo-card {
    grid-template-columns: 76px 1fr;
  }

  .photo-card img {
    width: 76px;
    height: 76px;
  }

  .photo-card button {
    grid-column: 1 / -1;
  }
}

@media (max-height: 560px) {
  .topbar {
    position: static;
  }

  .bottom-actions,
  .app-action-bar,
  .bottom-nav {
    position: static;
    margin-top: 12px;
  }

  .page {
    padding-bottom: 24px;
  }
}
