:root {
  --primary: #173f35;
  --primary-2: #23604e;
  --primary-soft: #e4f0ea;
  --accent: #e79a45;
  --accent-soft: #fff2df;
  --ink: #15231f;
  --muted: #6f7e78;
  --line: #dfe7e3;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --danger: #b84b42;
  --danger-soft: #fae9e7;
  --success: #2f7c5c;
  --shadow: 0 8px 30px rgba(21, 48, 39, .08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #e8eeeb;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: linear-gradient(135deg, #e7eeea, #f3f5f1); }
button, input, select, textarea { font: inherit; }
button, [role="button"] { min-height: 44px; }
button { color: inherit; }
img { display: block; max-width: 100%; }
.btn--reset {
  width: 100%;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hero__project.btn--reset { background: rgba(255,255,255,.07); }
.card.btn--reset { background: var(--surface); }

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--canvas);
  box-shadow: 0 0 60px rgba(20, 48, 39, .14);
}

#app { min-height: 100svh; padding-bottom: calc(88px + var(--safe-bottom)); }
.page { animation: page-in .28s cubic-bezier(.2, 0, 0, 1); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 18px;
  background: rgba(244, 247, 245, .92);
  backdrop-filter: blur(16px);
}
.topbar--dark { color: #fff; background: var(--primary); }
.topbar__title { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.topbar__eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 11px; }
.topbar--dark .topbar__eyebrow { color: #b8cdc4; }
.icon-btn {
  display: grid;
  width: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(23, 63, 53, .08); }
.icon-btn:active, .btn:active, .action-card:active, .list-card:active { transform: scale(.98); }
.icon-btn:focus-visible, .btn:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(231, 154, 69, .45);
  outline-offset: 2px;
}

.content { padding: 0 18px 26px; }
.hero {
  position: relative;
  overflow: hidden;
  padding: 16px 18px 26px;
  color: #fff;
  background: var(--primary);
  border-radius: 0 0 30px 30px;
}
.hero::after {
  content: "";
  position: absolute;
  right: -48px;
  top: -34px;
  width: 180px;
  height: 180px;
  border: 34px solid rgba(255, 255, 255, .055);
  border-radius: 50%;
}
.hero__meta { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: #e9b16f; color: var(--primary); font-weight: 800; }
.hero h1 { position: relative; z-index: 1; margin: 22px 0 4px; font-size: 29px; letter-spacing: -.045em; }
.hero p { position: relative; z-index: 1; margin: 0; color: #bed1c9; font-size: 13px; }
.hero__project { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.07); }
.hero__project strong { display: block; margin-bottom: 5px; font-size: 14px; }
.hero__project span { color: #bed1c9; font-size: 12px; }
.progress-ring { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) 0 76%, rgba(255,255,255,.13) 76%); }
.progress-ring::after { content: "76%"; display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--primary); font-size: 11px; font-weight: 700; }

.section { margin-top: 24px; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section__head h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.section__head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.text-btn { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--primary-2); font-size: 13px; font-weight: 700; cursor: pointer; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: -12px; position: relative; z-index: 2; }
.metric { padding: 15px 12px; border: 1px solid rgba(23,63,53,.06); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow); }
.metric strong { display: block; font-size: 22px; letter-spacing: -.04em; }
.metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.metric i { color: var(--accent); font-size: 11px; font-style: normal; }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.action-card { min-width: 0; min-height: 84px; padding: 10px 4px; border: 0; border-radius: 15px; background: #fff; cursor: pointer; transition: transform .16s, box-shadow .16s; }
.action-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.action-card__icon { display: grid; width: 38px; height: 38px; margin: 0 auto 7px; place-items: center; border-radius: 13px; background: var(--primary-soft); color: var(--primary); font-size: 18px; }
.action-card span:last-child { display: block; overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

.card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.card + .card { margin-top: 12px; }
.card--shadow { box-shadow: var(--shadow); border-color: transparent; }
.card--tint { border-color: transparent; background: var(--primary-soft); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__head h3 { margin: 0; font-size: 15px; }
.card__head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.chevron { color: #8b9994; font-size: 18px; }
.status { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--success); font-size: 11px; font-weight: 700; white-space: nowrap; }
.status--warn { background: var(--accent-soft); color: #9a5c18; }
.status--danger { background: var(--danger-soft); color: var(--danger); }
.status::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }

.route-mini { display: grid; grid-template-columns: 1fr 42px 1fr; align-items: center; margin-top: 16px; }
.route-mini__place strong { display: block; font-size: 14px; }
.route-mini__place span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.route-mini__arrow { color: var(--accent); text-align: center; }
.route-mini__arrow::before { content: ""; display: block; height: 1px; background: currentColor; }
.route-mini__arrow span { display: inline-block; margin-top: -14px; padding-left: 2px; background: #fff; }

.search-wrap { padding: 4px 18px 14px; }
.search { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.search span { margin-right: 9px; color: var(--muted); }
.search input { min-width: 0; width: 100%; height: 44px; border: 0; outline: 0; background: transparent; }
.chips { display: flex; gap: 8px; padding: 0 18px 14px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); cursor: pointer; }
.chip.is-active { border-color: var(--primary); background: var(--primary); color: #fff; }

.list { padding: 0 18px; }
.list-card { display: grid; grid-template-columns: 82px minmax(0, 1fr) 20px; gap: 13px; align-items: center; width: 100%; min-height: 112px; margin-bottom: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; text-align: left; cursor: pointer; }
.list-card:hover { border-color: #bdcec7; box-shadow: var(--shadow); }
.thumb { width: 82px; height: 82px; object-fit: cover; border-radius: 14px; background: #eef2ef; }
.list-card__body { min-width: 0; }
.list-card__body h3 { margin: 0 0 5px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.list-card__body p { margin: 0 0 9px; color: var(--muted); font-size: 11px; }
.list-card__meta { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--muted); font-size: 11px; }
.list-card__meta b { color: var(--primary); }

.empty-note { padding: 14px; border-radius: 14px; background: #eef3f0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.project-card { position: relative; overflow: hidden; }
.project-card::after { content: attr(data-index); position: absolute; right: 12px; top: -14px; color: rgba(23,63,53,.06); font-size: 84px; font-weight: 800; }
.project-card__title { position: relative; z-index: 1; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.project-card h3 { margin: 0 0 6px; font-size: 17px; }
.project-card p { margin: 0; color: var(--muted); font-size: 12px; }
.project-card__stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.project-card__stats span { color: var(--muted); font-size: 11px; }
.project-card__stats b { display: block; margin-top: 4px; color: var(--ink); font-size: 14px; }

.profile-card { display: flex; align-items: center; gap: 14px; padding: 20px; color: #fff; border-radius: 22px; background: var(--primary); }
.profile-card .avatar { width: 54px; height: 54px; }
.profile-card h2 { margin: 0 0 5px; font-size: 19px; }
.profile-card p { margin: 0; color: #bcd0c7; font-size: 12px; }
.menu { margin-top: 16px; border-radius: 20px; overflow: hidden; background: #fff; }
.menu button { display: flex; align-items: center; width: 100%; min-height: 56px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.menu button:last-child { border-bottom: 0; }
.menu__icon { display: grid; width: 34px; height: 34px; margin-right: 12px; place-items: center; border-radius: 11px; background: var(--primary-soft); }
.menu button span:nth-child(2) { flex: 1; font-size: 14px; font-weight: 600; }

.detail-hero { padding: 0 18px 20px; }
.detail-visual { position: relative; overflow: hidden; min-height: 230px; border-radius: 24px; background: #dfe9e4; }
.detail-visual img { width: 100%; height: 230px; object-fit: cover; }
.detail-visual__badge { position: absolute; left: 14px; top: 14px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--primary); font-size: 11px; font-weight: 700; backdrop-filter: blur(10px); }
.detail-title { padding: 0 18px; }
.detail-title h1 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.detail-title p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.spec { padding: 13px; border-radius: 14px; background: #f5f8f6; }
.spec span { display: block; color: var(--muted); font-size: 11px; }
.spec b { display: block; margin-top: 5px; font-size: 14px; }
.location-card { position: relative; overflow: hidden; padding: 16px 16px 18px 60px; border-radius: 18px; background: var(--primary-soft); }
.location-card::before { content: "⌖"; position: absolute; left: 18px; top: 18px; color: var(--primary); font-size: 24px; }
.location-card strong { display: block; font-size: 14px; }
.location-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.decision-banner { padding: 18px; color: #fff; border-radius: 20px; background: var(--primary); }
.decision-banner small { color: #bdd1c8; }
.decision-banner h2 { margin: 7px 0 10px; font-size: 22px; }
.decision-banner p { margin: 0; color: #d6e2dd; font-size: 12px; line-height: 1.65; }
.need-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.need-row:last-child { border-bottom: 0; }
.need-row strong { display: block; font-size: 14px; }
.need-row span { color: var(--muted); font-size: 11px; }
.need-row b { color: var(--primary); font-size: 13px; }
.need-row .gap { color: var(--danger); }

.recommend-card { position: relative; padding: 16px; border: 1.5px solid var(--line); border-radius: 20px; background: #fff; }
.recommend-card + .recommend-card { margin-top: 11px; }
.recommend-card.is-best { border-color: var(--primary-2); box-shadow: 0 10px 26px rgba(23,63,53,.1); }
.recommend-card__rank { position: absolute; right: 14px; top: -1px; padding: 7px 10px; border-radius: 0 0 10px 10px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; }
.recommend-card h3 { margin: 0 0 5px; padding-right: 70px; font-size: 15px; }
.recommend-card > p { margin: 0; color: var(--muted); font-size: 11px; }
.decision-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 14px; }
.decision-cell { padding: 10px; border-radius: 12px; background: #f5f8f6; }
.decision-cell span { display: block; color: var(--muted); font-size: 10px; }
.decision-cell b { display: block; margin-top: 4px; font-size: 12px; }
.decision-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; }
.risk { color: var(--success); font-size: 11px; }
.risk--warn { color: #a36620; }
.risk--bad { color: var(--danger); }

.route-map { position: relative; min-height: 190px; overflow: hidden; padding: 22px; color: #fff; border-radius: 24px; background: #193e35; }
.route-map::before, .route-map::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.route-map::before { width: 170px; height: 170px; right: -55px; top: -58px; }
.route-map::after { width: 90px; height: 90px; right: -15px; top: -18px; }
.route-line { position: relative; z-index: 1; display: grid; grid-template-columns: 18px 1fr; gap: 13px; }
.route-line__rail { display: flex; flex-direction: column; align-items: center; }
.route-line__dot { width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); }
.route-line__bar { width: 2px; height: 58px; background: rgba(255,255,255,.26); }
.route-line__place { padding-bottom: 22px; }
.route-line__place strong { display: block; font-size: 15px; }
.route-line__place span { display: block; margin-top: 4px; color: #bcd0c7; font-size: 11px; }
.route-map__distance { position: absolute; right: 18px; bottom: 18px; z-index: 2; padding: 8px 10px; border-radius: 11px; background: rgba(255,255,255,.1); font-size: 11px; }
.timeline { padding-left: 7px; }
.timeline__item { position: relative; padding: 0 0 20px 28px; }
.timeline__item::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -2px; width: 1px; background: var(--line); }
.timeline__item:last-child::before { display: none; }
.timeline__item::after { content: ""; position: absolute; left: 0; top: 5px; width: 11px; height: 11px; border: 3px solid var(--canvas); border-radius: 50%; background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.timeline__item.is-pending::after { background: #fff; box-shadow: 0 0 0 1px #9eaaa5; }
.timeline__item strong { display: block; font-size: 13px; }
.timeline__item span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.compare { display: grid; grid-template-columns: 1fr 30px 1fr; gap: 7px; align-items: stretch; }
.compare__side { padding: 13px; border-radius: 15px; background: #f4f7f5; }
.compare__side small { color: var(--muted); }
.compare__side strong { display: block; margin-top: 7px; font-size: 14px; }
.compare__side span { display: block; margin-top: 4px; color: var(--success); font-size: 11px; }
.compare__arrow { display: grid; place-items: center; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photo-slot { display: grid; min-height: 112px; padding: 12px; place-items: center; border: 1px dashed #b9c7c1; border-radius: 15px; background: #fafcfb; color: var(--muted); text-align: center; cursor: pointer; }
.photo-slot span { display: block; font-size: 22px; }
.photo-slot small { display: block; margin-top: 4px; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option label { display: flex; min-height: 52px; padding: 10px 12px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-size: 12px; font-weight: 650; text-align: center; cursor: pointer; }
.option input:checked + label { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.form-group { margin-bottom: 16px; }
.form-group > label, .form-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.field { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; outline: 0; }
textarea.field { min-height: 92px; padding-top: 12px; resize: vertical; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: #e9efec; }
.segmented button { border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.is-active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(23,63,53,.08); font-weight: 700; }
.helper { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.sticky-actions { position: sticky; z-index: 5; bottom: calc(78px + var(--safe-bottom)); display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin: 20px -2px 0; padding: 10px 2px; background: linear-gradient(transparent, var(--canvas) 24%); }
.detail-page .sticky-actions { bottom: 0; }
.btn { min-height: 48px; padding: 0 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; cursor: pointer; transition: transform .15s, filter .15s; }
.btn--primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn--tonal { border-color: transparent; background: var(--primary-soft); color: var(--primary); }
.btn--danger { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.btn--block { width: 100%; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 430px);
  min-height: calc(70px + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  transform: translateX(-50%);
  border-top: 1px solid rgba(223,231,227,.9);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
}
.bottom-nav.is-hidden { display: none; }
.nav-btn { display: flex; min-width: 0; min-height: 58px; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 14px; background: transparent; color: #84918c; cursor: pointer; }
.nav-btn__icon { font-size: 19px; line-height: 1; }
.nav-btn__label { margin-top: 5px; font-size: 10px; }
.nav-btn.is-active { background: #edf4f0; color: var(--primary); font-weight: 700; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 102px; max-width: 340px; padding: 11px 16px; border-radius: 13px; background: rgba(21,35,31,.92); color: #fff; font-size: 12px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .22s ease; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.screen-reader { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (min-width: 431px) {
  .app-shell { min-height: calc(100svh - 32px); margin-block: 16px; border-radius: 30px; }
  #app { min-height: calc(100svh - 32px); }
  .bottom-nav { bottom: 16px; border-radius: 0 0 30px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
