:root {
  --brand-brown: #805040;
  --brand-green: #588840;
  --brand-green-2: #6b9b54;
  --ink: #171717;
  --muted: #6f756f;
  --line: #e3e5df;
  --paper: #ffffff;
  --page: #f6f7f4;
  --soft-green: #eef6ea;
  --soft-brown: #f5efec;
  --soft-blue: #f1f6ff;
  --shadow: 0 18px 50px rgba(34, 38, 33, 0.12);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family: "STHeiti", "Heiti SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 14px;
}

.phone {
  width: min(100%, 430px);
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex-shrink: 0;
  padding: 22px 22px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: block;
  width: 132px;
  height: auto;
  margin-bottom: 18px;
}

.screen-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 700;
}

.screen-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 22px;
}

.home-hero {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f3f0ed;
  aspect-ratio: 16 / 9;
}

.home-hero img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.home-route {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: left;
  color: inherit;
}

.home-route:active,
.primary-button:active,
.ghost-button:active,
.nav-button:active,
.directory-button:active {
  transform: translateY(1px);
}

.route-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--brand-green);
  background: var(--soft-green);
  font-weight: 700;
  font-size: 17px;
}

.route-icon.brown {
  color: var(--brand-brown);
  background: var(--soft-brown);
}

.route-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.route-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.route-arrow {
  color: var(--brand-brown);
  font-size: 24px;
}

.summary-card,
.notice-card,
.section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.summary-card {
  padding: 16px;
  background: var(--soft-green);
  border-color: #d7e8ce;
}

.summary-title {
  margin: 0 0 10px;
  color: var(--brand-green);
  font-size: 17px;
  font-weight: 700;
}

.summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.42;
}

.section-card {
  margin-top: 12px;
  padding: 14px 16px;
}

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

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

.primary-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--brand-green);
  font-weight: 700;
  margin-top: 18px;
}

.ghost-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--brand-brown);
  background: var(--paper);
  font-weight: 700;
  margin-top: 10px;
}

.progress-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.progress-count {
  color: var(--brand-brown);
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: #ebece8;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand-green);
}

.directory-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f8f9f6;
  padding: 5px 8px;
  font-size: 12px;
}

.photo-frame {
  margin-top: 18px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #dce1da;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.photo-frame.photo-focus-entrance {
  aspect-ratio: 838 / 1356;
}

.photo-frame.photo-focus-entrance img {
  object-fit: cover;
  object-position: center center;
}

.photo-frame.photo-landscape {
  aspect-ratio: 1470 / 1070;
}

.photo-frame.photo-landscape img {
  object-fit: cover;
  object-position: center center;
}

.photo-frame.photo-wayfinding {
  aspect-ratio: 2350 / 1564;
}

.photo-frame.photo-wayfinding img {
  object-fit: cover;
  object-position: center center;
}

.photo-frame.photo-square {
  aspect-ratio: 1782 / 1778;
}

.photo-frame.photo-square img {
  object-fit: cover;
  object-position: center center;
}

.photo-frame.photo-portrait {
  aspect-ratio: 4 / 5;
}

.photo-frame.photo-portrait img {
  object-fit: cover;
  object-position: center center;
}

.photo-frame.placeholder {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.placeholder-label {
  color: var(--brand-brown);
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.step-heading {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-brown);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.step-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.step-action {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.confirm-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  color: var(--brand-green);
  background: var(--soft-green);
  border: 1px solid #d7e8ce;
  font-size: 13px;
  line-height: 1.48;
}

.confirm-box strong {
  color: var(--brand-green);
}

.bottom-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.nav-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f4f5f1;
  color: var(--muted);
  font-weight: 700;
}

.nav-button.next {
  border-color: var(--brand-green);
  background: var(--brand-green);
  color: #fff;
}

.nav-button:disabled {
  opacity: 0.42;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  background: rgba(17, 24, 39, 0.28);
  padding: 16px;
}

.directory-modal {
  width: min(100%, 430px);
  max-height: 76dvh;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.modal-title {
  margin: 0;
  font-size: 19px;
}

.close-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f9f6;
  color: var(--muted);
  padding: 6px 10px;
}

.section-label {
  margin: 16px 0 8px;
  color: var(--brand-brown);
  font-size: 13px;
  font-weight: 700;
}

.directory-item {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  text-align: left;
  color: var(--ink);
}

.directory-item.active {
  border-color: #d7e8ce;
  background: var(--soft-green);
}

.completion-photo {
  margin-top: 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 5;
  background: linear-gradient(180deg, #e9efe5, #ffffff);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
}

.completion-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.completion-card {
  margin-top: 16px;
  border-radius: var(--radius);
  border: 1px solid #d7e8ce;
  background: var(--soft-green);
  padding: 16px;
}

.completion-card h2 {
  margin: 0 0 10px;
  color: var(--brand-green);
  font-size: 20px;
}

.completion-card p {
  margin: 0;
  line-height: 1.6;
  font-size: 14px;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 36px;
  }
}
