:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --ink: #1d2522;
  --muted: #64716b;
  --line: #d8d0c3;
  --panel: #fffdf8;
  --accent: #0f766e;
  --accent-2: #a43f2f;
  --gold: #c08a2b;
  --shadow: 0 14px 34px rgba(35, 42, 38, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 16px;
  padding: 18px 16px 14px;
  background: rgba(247, 244, 238, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 7vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stats span {
  display: grid;
  gap: 3px;
  min-height: 58px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  border-right: 1px solid var(--line);
}

.stats span:last-child {
  border-right: 0;
}

.stats strong {
  color: var(--ink);
  font-size: 20px;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 12px 44px;
}

.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.view-tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.view-tab.active {
  background: var(--ink);
  color: white;
}

.toolbar {
  position: sticky;
  top: 150px;
  z-index: 4;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(247, 244, 238, 0));
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tab,
.icon-btn,
.card button,
.dialog-close {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.tab {
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.tab.active {
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--accent-2);
  font-size: 24px;
}

.notice {
  display: none;
  margin: 4px 0 12px;
  padding: 12px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fff8e7;
  color: #63420d;
  font-size: 14px;
  line-height: 1.45;
}

.notice button {
  min-height: 44px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid rgba(191, 126, 31, 0.34);
  border-radius: 8px;
  background: #fffdf8;
  color: #8a3b23;
  font: inherit;
  font-weight: 800;
}

.notice.show {
  display: block;
}

.timeline {
  display: grid;
  align-items: stretch;
  gap: 14px;
}

.timeline[hidden] {
  display: none;
}

.map-panel {
  display: none;
  gap: 10px;
}

.map-panel.active {
  display: grid;
}

.map-controls {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  gap: 8px;
}

.map-controls button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.map-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.map-hint {
  margin: -2px 0 0;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.route-map {
  width: 100%;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.route-map:active {
  cursor: grabbing;
}

.route-svg {
  width: 100%;
  height: auto;
  min-height: 520px;
  display: block;
}

.map-marker {
  cursor: pointer;
}

.segment-drive {
  pointer-events: none;
}

.segment-drive rect {
  fill: rgba(255, 253, 248, 0.9);
  stroke-width: 1;
}

.segment-drive.outbound rect {
  stroke: rgba(15, 118, 110, 0.42);
}

.segment-drive.inbound rect {
  stroke: rgba(164, 63, 47, 0.42);
}

.segment-drive text {
  stroke: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.segment-drive.outbound text {
  fill: #0f766e;
}

.segment-drive.inbound text {
  fill: #a43f2f;
}

.map-marker .hit-area {
  pointer-events: all;
}

.map-marker .marker-hit-box {
  pointer-events: all;
}

.map-marker:hover .map-icon,
.map-marker.selected .map-icon {
  opacity: 0.86;
}

.map-marker.selected .hit-area {
  opacity: 0.16;
  stroke: var(--accent-2);
  stroke-width: 3;
}

.map-marker text {
  paint-order: stroke;
  stroke: rgba(255, 253, 248, 0.94);
  stroke-width: 3px;
  fill: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
}

.map-marker.selected text {
  fill: var(--accent-2);
}

.map-details {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  line-height: 1.45;
  box-shadow: var(--shadow);
}

.map-details strong {
  color: var(--ink);
  font-size: 16px;
}

.map-detail-head {
  display: flex;
  gap: 8px;
  align-items: start;
  justify-content: space-between;
}

.map-detail-head em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e8f7f4;
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.map-detail-brief,
.map-detail-more > div {
  display: grid;
  gap: 5px;
}

.map-detail-more summary {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.map-detail-more summary::-webkit-details-marker {
  display: none;
}

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

.map-detail-nav button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.map-detail-nav button:disabled {
  color: #9a9287;
  background: #eee8df;
  cursor: not-allowed;
}

.map-details span {
  font-size: 13px;
}

.map-details b {
  display: inline-block;
  min-width: 42px;
  margin-right: 6px;
  color: var(--accent-2);
}

.map-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.map-legend span {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.scenic {
  background: #7c3aed;
}

.dot.outbound {
  background: var(--accent);
}

.dot.inbound {
  background: var(--accent-2);
}

.dot.tennis {
  background: #84cc16;
}

.dot.rest {
  background: #eab308;
}

.map-fallback {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  line-height: 1.6;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card.skipped {
  opacity: 0.58;
}

.card-detail-trigger {
  cursor: pointer;
}

.card-detail-trigger:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.42);
  outline-offset: -3px;
}

.hero {
  position: relative;
  min-height: 190px;
  background: #d7dfdc;
}

.hero img {
  width: 100%;
  height: 220px;
  display: block;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.58));
}

.badge-row {
  position: absolute;
  z-index: 1;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: end;
}

.badge {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.badge.tennis {
  background: #dff7ed;
  color: #075c4e;
}

.content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.day-title {
  display: grid;
  gap: 5px;
}

.day-title h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.route {
  color: var(--muted);
  font-size: 13px;
}

.intro {
  margin: 0;
  color: #34413c;
  font-size: 15px;
  line-height: 1.6;
}

.meta-grid {
  display: grid;
  gap: 8px;
}

.meta {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
  font-size: 13px;
  line-height: 1.45;
}

.meta strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-2);
}

.meta.pitfall {
  border-color: #d8c4e8;
  background: #fbf7ff;
}

.meta.pitfall strong {
  color: #7c3aed;
}

.mobile-extra-grid,
.card-more {
  display: none;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.actions button {
  min-height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.actions button.secondary {
  background: #e8e1d6;
  color: var(--ink);
}

.actions button.warn {
  background: var(--accent-2);
}

.actions button:disabled {
  cursor: not-allowed;
  background: #d8d0c3;
  color: #877c6d;
}

.xhs-links {
  display: grid;
  gap: 7px;
}

.xhs-links a {
  display: block;
  padding: 10px;
  border-radius: 8px;
  background: #fff1f3;
  color: #9f1239;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.verify-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #f4fbf8;
}

.verify-block h4 {
  margin: 0;
  color: #0f766e;
  font-size: 16px;
}

.verify-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.verify-block li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.verify-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #d9f4ec;
  color: #0f766e;
  font-weight: 800;
}

.fold-block summary {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
}

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

.fold-block summary h4 {
  margin: 0;
}

.fold-block summary > span {
  min-width: 58px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.fold-block summary::after {
  content: "⌄";
  width: 24px;
  height: 24px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: currentColor;
  font-weight: 900;
  transition: transform 0.18s ease;
}

.fold-block[open] summary::after {
  transform: rotate(180deg);
}

.fold-block[open] summary {
  margin: -2px -2px 2px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.fold-block:not([open]) {
  gap: 0;
}

.source-links {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 8px;
  background: #fbf7ff;
}

.source-links h4 {
  margin: 0;
  color: #7c3aed;
  font-size: 16px;
}

.source-links > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.source-links a {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  text-decoration: none;
}

.source-links span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #efe5ff;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 800;
}

.source-links strong {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.source-priority {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(67, 56, 202, 0.18);
  border-radius: 8px;
  background: #f8fbff;
}

.source-priority h4 {
  margin: 0;
  color: #4338ca;
  font-size: 16px;
}

.source-priority ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-priority li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: start;
}

.source-priority li > span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 900;
}

.source-priority strong,
.source-priority p {
  margin: 0;
}

.source-priority strong {
  color: var(--ink);
  font-size: 13px;
}

.source-priority p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.prep-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(55, 93, 82, 0.2);
  border-radius: 8px;
  background: #f6faf7;
}

.prep-block h4 {
  margin: 0;
  color: #27584d;
  font-size: 16px;
}

.prep-grid {
  display: grid;
  gap: 10px;
}

.prep-grid > div {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(55, 93, 82, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.prep-grid strong {
  color: #27584d;
  font-size: 13px;
}

.prep-grid ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.time-gates {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: 8px;
  background: #f6f9ff;
}

.time-gates h4 {
  margin: 0;
  color: #1d4ed8;
  font-size: 16px;
}

.time-gates ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.time-gates li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: start;
}

.time-gates span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.time-gates p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.question-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(11, 95, 115, 0.2);
  border-radius: 8px;
  background: #f3fbfd;
}

.question-block h4 {
  margin: 0;
  color: #0b5f73;
  font-size: 16px;
}

.question-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.question-block li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: start;
}

.question-block span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #dff4f8;
  color: #0b5f73;
  font-size: 12px;
  font-weight: 800;
}

.question-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.warning-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(164, 63, 47, 0.22);
  border-radius: 8px;
  background: #fff7ed;
}

.warning-block h4 {
  margin: 0;
  color: #a43f2f;
  font-size: 16px;
}

.warning-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.warning-block li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: start;
}

.warning-block span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fee2e2;
  color: #a43f2f;
  font-size: 12px;
  font-weight: 800;
}

.warning-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #f4fbf8;
}

.field-block h4 {
  margin: 0;
  color: #0f766e;
  font-size: 16px;
}

.field-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.field-block li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: start;
}

.field-block span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #dcfce7;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
}

.field-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.decision-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(164, 63, 47, 0.18);
  border-radius: 8px;
  background: #fffaf4;
}

.decision-block h4 {
  margin: 0;
  color: #a43f2f;
  font-size: 16px;
}

.decision-grid {
  display: grid;
  gap: 10px;
}

.decision-grid > div {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.decision-grid > div:first-child {
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.decision-grid > div:last-child {
  border: 1px solid rgba(164, 63, 47, 0.22);
}

.decision-grid strong {
  font-size: 13px;
}

.decision-grid > div:first-child strong {
  color: #0f766e;
}

.decision-grid > div:last-child strong {
  color: #a43f2f;
}

.decision-grid ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rule-notes {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(194, 120, 24, 0.24);
  border-radius: 8px;
  background: #fff8eb;
}

.rule-notes h4,
.rule-notes p {
  margin: 0;
}

.rule-notes h4 {
  color: #b45309;
  font-size: 16px;
}

.rule-notes ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #3d3528;
  font-size: 13px;
  line-height: 1.55;
}

.rule-notes p {
  color: #8a5a12;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.detail-basics,
.xhs-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(100, 113, 107, 0.22);
  border-radius: 8px;
  background: #fbf7ef;
}

.detail-basics h4,
.xhs-block h4 {
  color: var(--ink);
  font-size: 16px;
}

dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

dialog::backdrop {
  background: rgba(22, 28, 25, 0.55);
}

.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 26px;
}

.dialog-content {
  display: grid;
  width: 100%;
  gap: 14px;
  padding: 16px;
}

.dialog-content h3 {
  margin: 0;
  font-size: 25px;
}

.detail-jump {
  display: none;
}

.gallery {
  display: grid;
  gap: 10px;
}

.gallery-stage {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #111815;
  aspect-ratio: 4 / 3;
}

.gallery-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-main-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.68));
  color: #fff;
  font-size: 13px;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 52px;
  transform: translateY(-50%);
  border: 0;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.gallery-nav.prev {
  left: 8px;
}

.gallery-nav.next {
  right: 8px;
}

.gallery-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 104px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}

.gallery-thumbs button {
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f0ebe2;
  color: var(--muted);
  font: inherit;
  text-align: left;
  scroll-snap-align: start;
}

.gallery-thumbs button.active {
  border-color: var(--accent);
  color: var(--ink);
}

.gallery-thumbs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

.thumb-placeholder {
  display: grid;
  min-height: 74px;
  place-items: center;
  padding: 8px;
  background: linear-gradient(135deg, #eef7f5, #f5eefb);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.gallery-thumbs small {
  display: -webkit-box;
  min-height: 42px;
  padding: 6px 6px 0;
  overflow: hidden;
  color: #52615d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gallery-thumbs span {
  display: block;
  min-height: 42px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.guide-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8c4e8;
  border-radius: 8px;
  background: #fbf7ff;
}

.guide-block h4,
.guide-block p {
  margin: 0;
}

.guide-block h4 {
  color: #7c3aed;
  font-size: 16px;
}

.guide-block p {
  color: #33413d;
  font-size: 14px;
  line-height: 1.65;
}

.guide-cards {
  display: grid;
  gap: 9px;
}

.guide-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.guide-card summary {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
}

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

.guide-card summary::after {
  content: "⌄";
  width: 24px;
  height: 24px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #f5f0ff;
  color: #6d28d9;
  font-weight: 900;
  transition: transform 0.18s ease;
}

.guide-card[open] summary::after {
  transform: rotate(180deg);
}

.guide-card[open] summary {
  margin: -2px -2px 2px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(237, 233, 254, 0.72);
}

.guide-card summary span {
  margin-left: auto;
  color: #8b7aa8;
  font-size: 12px;
  font-weight: 700;
}

.guide-card strong {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 12px;
}

.guide-card > div {
  display: grid;
  gap: 7px;
}

.extra-tips {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #f8fbff;
}

.extra-tips h4 {
  margin: 0;
  color: #4338ca;
  font-size: 16px;
}

.extra-tips ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: #33413d;
  line-height: 1.65;
  list-style: none;
}

.extra-tips li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.extra-tips .tip-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.extra-tips li > span:last-child {
  display: block;
  min-width: 0;
}

.guide-card p {
  margin: 0;
  color: #33413d;
  line-height: 1.62;
}

.dialog-content ul {
  margin: 0;
  padding-left: 20px;
  color: #33413d;
  line-height: 1.7;
}

@media (max-width: 520px) {
  .app-header {
    position: static;
    gap: 8px;
    padding: 10px 12px 8px;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 11px;
  }

  h1 {
    font-size: 23px;
    line-height: 1.12;
  }

  .summary {
    display: none;
  }

  .stats span {
    min-height: 38px;
    gap: 1px;
    font-size: 11px;
  }

  .stats strong {
    font-size: 17px;
  }

  .toolbar {
    top: 52px;
    padding: 8px 0;
  }

  .view-switch {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 4px 0 6px;
    background: var(--bg);
  }

  main {
    width: min(100%, 100vw);
    padding: 10px 10px 20px;
  }

  .hero {
    min-height: 160px;
  }

  .hero img {
    height: 170px;
  }

  .content {
    gap: 10px;
    padding: 12px;
  }

  .day-title h2 {
    font-size: 19px;
    line-height: 1.25;
  }

  .intro {
    font-size: 14px;
    line-height: 1.5;
  }

  .meta-grid {
    gap: 7px;
  }

  .meta {
    padding: 9px;
  }

  .meta-grid > .mobile-extra {
    display: none;
  }

  .meta-grid > .pitfall {
    display: none;
  }

  .card > .content > .xhs-links {
    display: none;
  }

  .card-more .xhs-links {
    display: none;
  }

  .card-more {
    display: block;
    padding: 0;
    border: 0;
  }

  .card-more summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    list-style: none;
  }

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

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

  .card-more:not([open]) .mobile-extra-grid,
  .card-more:not([open]) .xhs-links {
    display: none;
  }

  .card-more[open] .mobile-extra-grid {
    margin-top: 8px;
  }

  .actions {
    gap: 7px;
  }

  .actions button {
    min-height: 46px;
    font-size: 14px;
  }

  .tab {
    min-height: 44px;
  }

  .card-more summary,
  .xhs-links a,
  .source-links a {
    min-height: 44px;
  }

  dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .dialog-close {
    position: fixed;
    top: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
    margin: 0;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: 0 4px 14px rgba(22, 28, 25, 0.12);
  }

  .dialog-content {
    gap: 12px;
    padding: 14px 10px 24px;
  }

  .dialog-content h3 {
    max-width: calc(100% - 48px);
    font-size: 22px;
    line-height: 1.25;
  }

  .detail-jump {
    position: sticky;
    top: 52px;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: -4px;
    padding: 2px 0;
    background: var(--panel);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 14px rgba(22, 28, 25, 0.06);
  }

  .detail-jump button {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
  }

  .gallery-stage {
    aspect-ratio: 16 / 10;
    border-radius: 6px;
  }

  .gallery,
  .guide-block {
    scroll-margin-top: 104px;
  }

  .gallery-thumbs {
    grid-auto-columns: 58px;
    gap: 6px;
    padding-bottom: 2px;
  }

  .gallery-thumbs button {
    border-radius: 7px;
  }

  .gallery-thumbs img {
    aspect-ratio: 1 / 1;
  }

  .gallery-thumbs span,
  .gallery-thumbs small {
    display: none;
  }

  .thumb-placeholder {
    min-height: 58px;
    aspect-ratio: 1 / 1;
    padding: 4px;
    font-size: 10px;
  }

  .gallery-caption {
    padding: 10px;
    font-size: 12px;
  }

  .gallery-nav {
    width: 44px;
    height: 48px;
  }

  .guide-block,
  .extra-tips,
  .field-block,
  .warning-block,
  .time-gates,
  .question-block,
  .decision-block,
  .prep-block,
  .verify-block,
  .source-priority,
  .source-links {
    padding: 10px;
  }

  .fold-block summary,
  .guide-card summary {
    min-height: 44px;
    gap: 7px;
  }

  .guide-card {
    gap: 6px;
    padding: 8px;
  }

  .guide-card summary span,
  .fold-block summary > span {
    min-width: 50px;
    font-size: 11px;
  }

  .guide-card summary::after,
  .fold-block summary::after {
    width: 24px;
    height: 24px;
  }

  .guide-card strong {
    min-height: 22px;
    padding: 0 7px;
  }

  .source-priority li {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
  }

  .source-priority li > span {
    width: fit-content;
    height: 24px;
    min-width: 28px;
    border-radius: 999px;
  }

  .source-priority p {
    margin-top: 1px;
    font-size: 14px;
    line-height: 1.58;
  }

  .decision-grid > div {
    gap: 8px;
    padding: 9px;
  }

  .decision-grid strong {
    display: inline-flex;
    width: fit-content;
    min-height: 24px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 12px;
  }

  .decision-grid ul {
    gap: 7px;
    padding: 0;
    list-style: none;
  }

  .decision-grid li {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 1.48;
  }

  .field-block li,
  .warning-block li,
  .time-gates li,
  .question-block li {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
  }

  .guide-card,
  .extra-tips li,
  .field-block li,
  .warning-block li,
  .time-gates li,
  .question-block li {
    line-height: 1.55;
  }

  .field-block span,
  .warning-block span,
  .time-gates span,
  .question-block span {
    width: fit-content;
    min-height: 22px;
    padding: 0 7px;
    border-radius: 999px;
  }

  .field-block p,
  .warning-block p,
  .time-gates p,
  .question-block p {
    font-size: 14px;
    line-height: 1.62;
  }

  .extra-tips ul {
    gap: 7px;
  }

  .extra-tips li {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 7px;
    padding: 8px 7px;
  }

  .extra-tips .tip-tag {
    min-width: 0;
    padding: 1px 5px;
    font-size: 11px;
  }

  .guide-card p {
    font-size: 14px;
    line-height: 1.58;
  }

  .route-map,
  .route-svg {
    min-height: 390px;
  }

  .map-panel.active {
    padding-bottom: 520px;
  }

  .map-controls {
    grid-template-columns: 56px 1fr 56px;
  }

  .map-controls button {
    min-height: 48px;
  }

  .map-details {
    gap: 8px;
    padding: 10px;
    scroll-margin-top: 96px;
  }

  .map-detail-nav button {
    min-height: 44px;
    font-size: 14px;
  }

  .map-detail-head strong {
    font-size: 15px;
    line-height: 1.35;
  }

  .map-legend {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .map-legend::-webkit-scrollbar {
    display: none;
  }

  .map-legend span {
    min-width: max-content;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
  }

  .source-links > div {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .app-header {
    grid-template-columns: 1fr 360px;
    align-items: end;
    padding: 24px 32px 18px;
  }

  .toolbar {
    top: 120px;
  }

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

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

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

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

@media (max-width: 370px) {
  .dialog-content {
    padding-inline: 8px;
  }

  .guide-block,
  .extra-tips,
  .field-block,
  .warning-block,
  .time-gates,
  .question-block,
  .decision-block,
  .prep-block,
  .verify-block,
  .source-priority,
  .source-links,
  .detail-basics,
  .xhs-block {
    padding-inline: 8px;
  }

  .field-block li,
  .warning-block li,
  .time-gates li,
  .question-block li,
  .decision-grid li,
  .extra-tips li,
  .source-priority li {
    padding-inline: 7px;
  }
}

@media (max-width: 520px) and (max-height: 760px) {
  .app-header {
    gap: 6px;
    padding: 8px 10px 6px;
  }

  .eyebrow {
    font-size: 10px;
  }

  h1 {
    font-size: 21px;
  }

  .stats span {
    min-height: 32px;
  }

  .view-tab,
  .tab,
  .icon-btn {
    min-height: 44px;
  }

  main {
    padding-top: 8px;
  }

  .toolbar {
    padding: 6px 0;
  }

  .hero {
    min-height: 124px;
  }

  .hero img {
    height: 132px;
  }

  .content {
    gap: 8px;
    padding: 10px;
  }

  .intro {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .meta {
    padding: 8px;
  }

  .card-more summary,
  .actions button {
    min-height: 44px;
  }

  .actions button {
    font-size: 13px;
  }

  .gallery-stage {
    max-height: 190px;
    aspect-ratio: 16 / 8;
  }

  .gallery-nav {
    width: 44px;
    height: 44px;
  }

  .gallery-thumbs {
    grid-auto-columns: 54px;
    gap: 6px;
  }
}

@media (max-width: 520px) and (max-height: 680px) {
  .hero {
    min-height: 106px;
  }

  .hero img {
    height: 112px;
  }

  .content {
    gap: 6px;
    padding: 9px;
  }

  .intro {
    -webkit-line-clamp: 1;
  }

  .card-more summary,
  .actions button {
    min-height: 44px;
  }

  .gallery-stage {
    max-height: 172px;
    aspect-ratio: 16 / 7.4;
  }

  .gallery-thumbs {
    grid-auto-columns: 50px;
  }
}

@media (max-width: 760px) and (max-height: 480px) {
  .app-header {
    gap: 6px;
    padding: 6px 10px;
  }

  .eyebrow,
  .summary {
    display: none;
  }

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

  .stats span {
    min-height: 30px;
    font-size: 10px;
  }

  .stats strong {
    font-size: 15px;
  }

  main {
    padding: 6px 10px 18px;
  }

  .view-tab,
  .tab,
  .icon-btn {
    min-height: 44px;
  }

  .toolbar {
    top: 44px;
    padding: 5px 0;
  }

  .view-switch {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 3px 0 5px;
    background: var(--bg);
  }

  dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .dialog-close {
    position: fixed;
    top: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
    margin: 0;
    background: rgba(255, 253, 248, 0.92);
  }

  .dialog-content {
    gap: 8px;
    padding: 10px;
  }

  .dialog-content h3 {
    max-width: calc(100% - 48px);
    font-size: 20px;
    line-height: 1.2;
  }

  .detail-jump {
    gap: 7px;
  }

  .detail-jump button {
    min-height: 44px;
  }

  .gallery {
    gap: 6px;
  }

  .gallery-stage {
    max-height: 190px;
    aspect-ratio: 16 / 7;
  }

  .gallery-thumbs {
    grid-auto-columns: 52px;
    gap: 6px;
  }

  .gallery-thumbs img {
    aspect-ratio: 1 / 1;
  }

  .gallery-thumbs span,
  .gallery-thumbs small {
    display: none;
  }

  .route-map,
  .route-svg {
    min-height: 280px;
  }

  .route-svg {
    height: 280px;
  }

  .map-controls button {
    min-height: 44px;
  }
}

@media (max-width: 900px) and (max-height: 480px) {
  .app-header {
    position: static;
    grid-template-columns: 1fr 220px;
    gap: 8px;
    padding: 6px 10px;
  }

  .eyebrow,
  .summary {
    display: none;
  }

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

  .stats span {
    min-height: 30px;
    font-size: 10px;
  }

  .stats strong {
    font-size: 15px;
  }

  main {
    padding: 6px 10px 18px;
  }

  .view-tab,
  .tab,
  .icon-btn {
    min-height: 44px;
  }

  .toolbar {
    top: 44px;
    padding: 5px 0;
  }

  .view-switch {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 3px 0 5px;
    background: var(--bg);
  }

  .hero {
    min-height: 120px;
  }

  .hero img {
    height: 128px;
  }

  .content {
    gap: 7px;
    padding: 9px;
  }

  .intro {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .meta-grid > .mobile-extra,
  .meta-grid > .pitfall {
    display: none;
  }

  .card > .content > .xhs-links {
    display: none;
  }

  .card-more .xhs-links {
    display: none;
  }

  .card-more {
    display: block;
    padding: 0;
    border: 0;
  }

  .card-more summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbf7ef;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    list-style: none;
  }

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

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

  .card-more:not([open]) .mobile-extra-grid,
  .card-more:not([open]) .xhs-links {
    display: none;
  }

  .actions {
    gap: 6px;
  }

  .actions button {
    min-height: 44px;
    font-size: 12px;
  }
}
