:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --ink: #172226;
  --muted: #667782;
  --line: #d7e0e2;
  --panel: #ffffff;
  --accent: #246b62;
  --accent-2: #b06a28;
  --good: #2e6f56;
  --bad: #a84636;
  --soft: #eaf3f1;
  --warm: #fff2df;
  --shadow: 0 14px 32px rgba(28, 52, 58, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(36, 107, 98, 0.12), transparent 260px),
    linear-gradient(180deg, #edf4f5 0%, transparent 300px),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 14px 32px;
}

.topbar,
.result-head,
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  min-height: 58px;
}

.header-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: 32px;
  line-height: 1.15;
}

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

h3 {
  font-size: 15px;
  line-height: 1.4;
}

.panel,
.result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.route-dock {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.route-dock .field-head {
  margin-top: 0;
}

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

.dock-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.dock-chip {
  width: 100%;
  max-width: none !important;
  min-height: 54px !important;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: left;
}

.dock-chip strong,
.dock-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-chip strong {
  font-size: 14px;
}

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

.place-panel {
  display: grid;
  gap: 10px;
  position: relative;
}

.place-panel::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 144px;
  width: 2px;
  height: 92px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.35;
  border-radius: 99px;
}

.field-head {
  margin-top: 2px;
  font-weight: 800;
}

.field-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.compact-head {
  margin-top: 12px;
}

.field-label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 95, 114, 0.14);
}

.meta,
.status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.suggestions {
  display: grid;
  gap: 6px;
  margin-top: -2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 12px 26px rgba(43, 56, 61, 0.1);
}

.suggestion {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.suggestion:active,
.suggestion:hover {
  background: #f1f5f4;
}

.suggestion strong,
.suggestion small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion strong {
  font-size: 14px;
}

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

.status {
  min-height: 20px;
  margin-top: 12px;
  text-align: center;
}

.icon-button,
.mini-button,
.text-button,
.feedback-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 22px;
}

.mini-button {
  min-height: 46px;
  color: var(--accent);
  font-weight: 800;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.segmented button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-top: 8px;
  color: var(--ink);
}

.check-row input {
  width: 20px;
  min-height: 20px;
}

.primary-button {
  width: 100%;
  min-height: 64px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  gap: 2px;
  box-shadow: var(--shadow);
  cursor: pointer;
  position: sticky;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 8;
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

#askLabel {
  font-size: 18px;
  font-weight: 900;
}

.button-sub {
  font-size: 12px;
  opacity: 0.86;
}

.hidden {
  display: none !important;
}

.reason {
  margin: 14px 0 0;
  font-size: 17px;
  line-height: 1.65;
}

.pref-panel {
  padding: 0;
  overflow: hidden;
}

.pref-panel summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.pref-panel summary::-webkit-details-marker,
.detail-block summary::-webkit-details-marker {
  display: none;
}

.pref-panel summary::after {
  content: "展开";
  color: var(--accent);
  font-size: 13px;
}

.pref-panel[open] summary::after {
  content: "收起";
}

.pref-panel summary small {
  color: var(--muted);
  font-weight: 700;
}

.pref-panel > :not(summary) {
  margin-left: 14px;
  margin-right: 14px;
}

.pref-panel > :last-child {
  margin-bottom: 14px;
}

.agent-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.agent-strip span {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

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

.summary-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.summary-grid strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.pill-button.nav-pill {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.section-block {
  margin-top: 18px;
}

.map-view {
  height: 260px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2ee;
  overflow: hidden;
  position: relative;
}

.map-view p {
  margin: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.routes-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.route-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.route-item.is-active {
  background: #f8fbfa;
}

.route-item.is-primary {
  border-color: rgba(49, 95, 114, 0.55);
  box-shadow: inset 4px 0 0 var(--accent);
}

.route-item strong {
  display: block;
  margin-bottom: 4px;
}

.route-item span,
.route-item small {
  color: var(--muted);
}

.score {
  color: var(--accent);
  font-weight: 900;
}

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

.route-actions a,
.route-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.route-actions button.is-map-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.route-steps {
  display: none;
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.route-item.expanded .route-steps {
  display: block;
}

.route-steps li {
  margin: 6px 0;
}

.feedback {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.detail-block {
  border-top: 1px solid #e8eef0;
  padding-top: 12px;
}

.detail-block summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  list-style: none;
}

.detail-block summary::after {
  content: "查看";
  float: right;
  color: var(--accent);
  font-size: 13px;
}

.detail-block[open] summary::after {
  content: "收起";
}

.feedback-btn {
  min-height: 42px;
  font-weight: 800;
}

.quick-routes {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-action {
  min-width: 0;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.quick-action span,
.quick-action small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-action span {
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

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

.quick-action:active,
.quick-action:hover {
  border-color: rgba(36, 107, 98, 0.45);
  background: var(--soft);
}

.chip-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.route-chip {
  flex: 0 0 auto;
  max-width: 260px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.route-chip strong,
.route-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pick-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  background: rgba(16, 26, 30, 0.42);
  padding: 12px;
}

.pick-dialog {
  width: min(720px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(10, 20, 24, 0.25);
}

.pick-head,
.pick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pick-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  margin-top: 12px;
}

.pick-map {
  height: min(56vh, 440px);
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2ee;
  overflow: hidden;
  position: relative;
}

.pick-map p {
  margin: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.pick-actions {
  margin-top: 12px;
}

.primary-inline {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.primary-inline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (min-width: 680px) {
  .shell {
    padding-top: 28px;
  }

  .panel,
  .result {
    padding: 18px;
  }

  .pref-panel {
    padding: 0;
  }

  .map-view {
    height: 320px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 28px;
  }

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

  .field-head {
    align-items: flex-start;
  }

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