:root {
  --bg: #f6f1ea;
  --text: #2e241e;
  --muted: #6f5f53;
  --line: rgba(93, 74, 58, 0.16);
  --card: rgba(255, 255, 255, 0.9);
  --accent: #9a5d35;
  --accent-soft: rgba(154, 93, 53, 0.12);
  --shadow: 0 16px 40px rgba(40, 30, 22, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f2e8dc 0%, #f9f6f1 32%, #f6f1ea 100%);
  color: var(--text);
}

.wrap {
  width: min(1160px, calc(100% - 24px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.hero,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.hero {
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255, 248, 240, 0.98), rgba(247, 238, 228, 0.95));
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.hero-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

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

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
}

.hero-route-title {
  margin: 12px 0 0;
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 700;
  line-height: 1.35;
}

.hero-route-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 720px;
}

.weather-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(154, 93, 53, 0.3);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(72, 46, 28, 0.08);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.weather-link:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: rgba(154, 93, 53, 0.42);
}

.weather-link:focus-visible {
  outline: 2px solid rgba(154, 93, 53, 0.35);
  outline-offset: 2px;
}

.weather-link svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.weather-link svg path:first-child {
  fill: rgba(154, 93, 53, 0.1);
}

.weather-link span {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.panel {
  margin-top: 18px;
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.panel-tools {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 34px);
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.tabs {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-stack {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.tab-block {
  display: grid;
  gap: 8px;
}

.tab-caption {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tab-btn {
  border: 1px solid rgba(154, 93, 53, 0.24);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn-direction {
  background: rgba(154, 93, 53, 0.06);
}

.tab-btn-plan {
  background: #fff;
}

.tab-btn.is-active {
  background: linear-gradient(135deg, #a96940, #8a512c);
  color: #fff;
  border-color: transparent;
}

.route-content {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

summary.section-head {
  padding: 14px 16px;
  background: rgba(249, 244, 236, 0.7);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-card[open] > summary.section-head {
  border-bottom: 1px solid var(--line);
}

summary.section-head::-webkit-details-marker {
  display: none;
}

summary.section-head::after {
  content: "展开";
  flex-shrink: 0;
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
}

.section-card[open] > summary.section-head::after {
  content: "收起";
}

.section-body {
  padding: 14px 16px;
}

.day-card > summary.section-head {
  background: rgba(154, 93, 53, 0.12);
}

.markdown p {
  margin: 10px 0;
  color: var(--text);
}

.markdown ul {
  margin: 8px 0 8px 18px;
  padding: 0;
}

.markdown li {
  margin: 6px 0;
  color: var(--muted);
}

.markdown a {
  color: var(--accent);
  text-decoration: none;
}

.markdown a:hover {
  text-decoration: underline;
}

.route-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.route-image-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.section-image-wrap {
  margin-top: 14px;
}

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

.section-nav {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-query-grid {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.info-query-btn {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(154, 93, 53, 0.22);
  background: rgba(154, 93, 53, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.info-query-btn:hover {
  background: rgba(154, 93, 53, 0.14);
}

.info-query-btn:focus-visible {
  outline: 2px solid rgba(154, 93, 53, 0.3);
  outline-offset: 2px;
}

.quick-nav-card .section-body {
  padding-top: 12px;
  padding-bottom: 12px;
}

.quick-nav-card .section-nav {
  margin-top: 0;
}

.quick-nav-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(154, 93, 53, 0.22);
  background: rgba(154, 93, 53, 0.08);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}

.nav-chip:hover {
  background: rgba(154, 93, 53, 0.14);
}

.mini-details {
  border: 1px dashed rgba(154, 93, 53, 0.28);
  border-radius: 14px;
  background: rgba(249, 244, 236, 0.48);
  overflow: hidden;
}

.mini-summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 13px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.mini-summary::-webkit-details-marker {
  display: none;
}

.mini-summary::after {
  content: "展开细节";
  float: right;
  color: var(--accent);
  font-weight: 700;
}

.mini-details[open] > .mini-summary::after {
  content: "收起细节";
}

.mini-body {
  padding: 0 13px 12px;
}

.mini-body p,
.mini-body li {
  font-size: 13px;
}

.mini-body .section-image-wrap {
  margin-top: 8px;
}

.route-image-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.route-image-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
  background: #f8f4ee;
}

.route-image-grid.is-single .route-image-card img {
  height: min(42vw, 360px);
}

.route-image-card p {
  margin: 0;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.route-image-empty {
  padding: 12px;
  border: 1px dashed rgba(154, 93, 53, 0.35);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
}

body.has-info-modal {
  overflow: hidden;
}

.info-modal[hidden] {
  display: none;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 22, 17, 0.46);
}

.info-modal-dialog {
  position: relative;
  width: min(680px, calc(100% - 24px));
  max-height: min(78vh, 720px);
  overflow: auto;
  margin: 6vh auto 0;
  padding: 18px 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fffdf9;
  box-shadow: 0 20px 50px rgba(32, 22, 16, 0.22);
}

.info-modal-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.info-modal-title {
  margin: 0 42px 12px 0;
  font-size: clamp(22px, 3vw, 28px);
}

.info-modal-body {
  color: var(--text);
}

.info-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(154, 93, 53, 0.22);
  background: rgba(154, 93, 53, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 820px) {
  .wrap {
    width: min(100% - 14px, 1000px);
    padding-top: 10px;
  }

  .hero,
  .panel {
    border-radius: 18px;
    padding: 16px;
  }

  .panel-head {
    flex-direction: column;
    align-items: start;
  }

  .panel-tools {
    width: 100%;
    align-items: start;
  }

  .hero-top {
    align-items: flex-start;
    gap: 12px;
  }

  .weather-link {
    min-height: 40px;
    padding: 0 12px;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .section-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .tab-btn {
    min-height: 40px;
    flex: 0 0 auto;
  }

  .route-image-grid {
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .route-image-grid.is-single {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .route-image-card {
    scroll-snap-align: start;
  }

  .info-query-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-modal-dialog {
    width: min(100% - 12px, 680px);
    margin-top: 2vh;
    max-height: 88vh;
    padding: 16px;
    border-radius: 16px;
  }

  .info-modal-title {
    margin-right: 0;
    padding-right: 70px;
  }
}
