/* ───────────────────────────────────────────────────────────────
   埃及 11 天 · 2026
   底色取自日出前的天光；强调色用古埃及蓝颜料。
   等宽字体承载所有时刻、票价与航班号——这趟行程是挂在钟表上的。
   ─────────────────────────────────────────────────────────────── */

:root {
  /* dark-first：裸 :root 即深色调色板 */
  --ground:      #0D1317;
  --surface:     #131C21;
  --raised:      #1A252B;
  --line:        #28353C;
  --line-soft:   #1E2A31;
  --text:        #E9E6DD;
  --text-dim:    #96A5AD;
  --text-faint:  #66757E;
  --accent:      #5A96D2;
  --accent-deep: #17303F;
  --dawn:        #E2A455;
  --med:         #7E9BD8;
  --reef:        #22A79C;
  --sand:        #C4996B;
  --shadow:      0 18px 40px -24px rgb(0 0 0 / 0.9);
  --hero-scrim:  linear-gradient(180deg, rgb(13 19 23 / 0.28) 0%, rgb(13 19 23 / 0.62) 48%, var(--ground) 100%);

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans:  "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

  --xs: 0.75rem;
  --sm: 0.8125rem;
  --md: 0.9375rem;
  --lg: 1.125rem;
  --xl: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem);
  --xxl: clamp(2.2rem, 1.4rem + 3.6vw, 4rem);

  --gutter: clamp(1rem, 3.5vw, 3rem);
  --maxw: 1280px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground:      #EDEEEA;
    --surface:     #F7F7F3;
    --raised:      #FFFFFF;
    --line:        #D2D6CF;
    --line-soft:   #E3E5DE;
    --text:        #12181C;
    --text-dim:    #56646C;
    --text-faint:  #7E8A91;
    --accent:      #1A5896;
    --accent-deep: #DCE7F2;
    --dawn:        #A96A18;
    --med:         #3D5B9E;
    --reef:        #0C7469;
    --sand:        #7A5320;
    --shadow:      0 16px 34px -26px rgb(18 24 28 / 0.5);
    --hero-scrim:  linear-gradient(180deg, rgb(13 19 23 / 0.30) 0%, rgb(13 19 23 / 0.56) 48%, rgb(13 19 23 / 0.82) 100%);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --ground:      #EDEEEA;
  --surface:     #F7F7F3;
  --raised:      #FFFFFF;
  --line:        #D2D6CF;
  --line-soft:   #E3E5DE;
  --text:        #12181C;
  --text-dim:    #56646C;
  --text-faint:  #7E8A91;
  --accent:      #1A5896;
  --accent-deep: #DCE7F2;
  --dawn:        #A96A18;
  --med:         #3D5B9E;
  --reef:        #0C7469;
  --sand:        #7A5320;
  --shadow:      0 16px 34px -26px rgb(18 24 28 / 0.5);
  --hero-scrim:  linear-gradient(180deg, rgb(13 19 23 / 0.30) 0%, rgb(13 19 23 / 0.56) 48%, rgb(13 19 23 / 0.82) 100%);
  color-scheme: light;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--md);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
:where(a) { color: var(--accent); text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { width: min(100% - var(--gutter) * 2, var(--maxw)); margin-inline: auto; }

.label {
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint);
}

.btn {
  font: inherit; font-size: var(--sm); cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.22rem 0.85rem;
  transition: border-color 140ms ease, color 140ms ease;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.badge {
  display: inline-block; margin-left: 0.4rem; vertical-align: 0.06em;
  font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.06em;
  border: 1px solid currentColor; border-radius: 2px; padding: 0 0.3rem;
  white-space: nowrap;
}

.badge--dawn { color: var(--dawn); }
.badge--med  { color: var(--med); }
.badge--reef { color: var(--reef); }
.badge--sand { color: var(--sand); }
.badge--only { color: var(--text-faint); }

.dash { color: var(--text-faint); font-family: var(--mono); }

/* ── 页头 ───────────────────────────────────────────────── */

.hero { position: relative; isolation: isolate; overflow: hidden; }

.hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
  transform: scaleX(-1);   /* 气球移到右侧，给左边的标题让位 */
  z-index: -2;
}

.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(13 19 23 / 0.62) 0%, rgb(13 19 23 / 0.18) 54%, rgb(13 19 23 / 0) 78%),
    var(--hero-scrim);
}

.hero__inner {
  display: flex; flex-direction: column; gap: 1.1rem;
  padding-block: clamp(2.5rem, 9vw, 5.5rem) clamp(1.5rem, 4vw, 2.5rem);
}

.hero__eyebrow { color: rgb(233 230 221 / 0.7); }

.hero h1 {
  margin: 0;
  font-family: var(--serif); font-weight: 700;
  font-size: var(--xxl); line-height: 1.02; letter-spacing: -0.01em;
  color: #F3F1EA; text-wrap: balance;
  text-shadow: 0 2px 30px rgb(0 0 0 / 0.45);
}

.hero h1 em {
  display: block; font-style: normal;
  font-family: var(--sans); font-weight: 400;
  font-size: clamp(0.9rem, 0.55rem + 1.2vw, 1.2rem);
  letter-spacing: 0.05em; line-height: 1.5; margin-top: 0.6rem;
  color: rgb(243 241 234 / 0.8);
}

.hero__meta {
  display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem;
  font-family: var(--mono); font-size: var(--sm);
  font-variant-numeric: tabular-nums; color: rgb(243 241 234 / 0.8);
}

.hero__meta b { font-weight: 500; color: #F3F1EA; }

/* ── 小节 ───────────────────────────────────────────────── */

.sec { padding-block: clamp(1.6rem, 3.5vw, 2.6rem); }
.sec + .sec { border-top: 1px solid var(--line-soft); }

.sec__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.9rem;
  margin-bottom: 0.9rem;
}

.sec__head h2 {
  margin: 0; font-family: var(--serif); font-weight: 700;
  font-size: var(--xl); line-height: 1.2;
}

.sec__hint { font-size: var(--sm); color: var(--text-faint); }

.cols { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }

.scroll { overflow-x: auto; }

/* ── 地图 ───────────────────────────────────────────────── */

.atlas { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: start; }

.atlas__map { position: relative; }

#map {
  height: clamp(320px, 46vh, 480px);
  border: 1px solid var(--line); border-radius: 3px;
  background: var(--surface);
}

.atlas__warn {
  position: absolute; inset: auto 10px 52px 10px; margin: 0;
  background: var(--surface); border: 1px solid var(--dawn); border-radius: 3px;
  padding: 0.5rem 0.7rem; font-size: var(--sm); color: var(--text-dim);
}

.atlas__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem;
  margin-top: 0.6rem;
}

.atlas__legend {
  display: inline-flex; flex-wrap: wrap; gap: 0.4rem 1.1rem;
  font-family: var(--mono); font-size: var(--xs); color: var(--text-faint);
}

.lg { display: inline-flex; align-items: center; gap: 0.4rem; }
.lg svg { display: block; overflow: visible; }

/* Leaflet 主题适配 */

.leaflet-container {
  font-family: var(--sans); background: var(--surface);
}

/* 底图是 OSM 亮色瓦片；深色主题下整层反色 */
.leaflet-tile-pane { filter: saturate(0.72) contrast(0.95); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.86) contrast(0.92) saturate(0.55);
  }
}

:root[data-theme="dark"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.86) contrast(0.92) saturate(0.55);
}

.map-tip, .leaflet-tooltip {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 2px;
  box-shadow: none;
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  padding: 0.12rem 0.4rem;
}

.leaflet-tooltip-right::before { border-right-color: var(--line); }
.leaflet-tooltip-left::before { border-left-color: var(--line); }
.leaflet-tooltip-top::before { border-top-color: var(--line); }

.pin b {
  display: grid; place-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 1.6px solid var(--accent);
  color: var(--text);
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.pin:hover b, .pin.is-hi b {
  background: var(--dawn); border-color: var(--dawn); color: var(--ground);
  transform: scale(1.18);
}

/* 转场标签：挂在每条腿的中点 */
.leg-tag { width: 0 !important; height: 0 !important; }

.leg-tag .tagbox {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  white-space: nowrap; padding: 0.08rem 0.45rem;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 10px; line-height: 1.6;
  color: var(--text);
}

.leg-tag i { font-style: normal; color: var(--text-faint); }

.leaflet-container.is-city .leg-tag { opacity: 0; transition: opacity 200ms ease; }

.leaflet-bar a {
  background: var(--surface); color: var(--text); border-bottom-color: var(--line);
}

.leaflet-bar a:hover { background: var(--raised); color: var(--accent); }

.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 86%, transparent) !important;
  color: var(--text-faint); font-size: 10px;
}

.leaflet-control-attribution a { color: var(--text-dim); }

/* ── 地图侧栏 ───────────────────────────────────────────── */

.atlas__panel {
  display: flex; flex-direction: column; gap: 0.7rem;
  padding: 0.9rem 1rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
}

.pan__head { display: flex; flex-direction: column; gap: 0.15rem; }

.pan__head h3 {
  margin: 0; font-family: var(--serif); font-weight: 700;
  font-size: var(--lg); line-height: 1.25;
}

.pan__meta { font-family: var(--mono); font-size: var(--xs); color: var(--text-dim); }
.pan__meta b { color: var(--dawn); font-weight: 500; }
.pan__note { margin: 0; font-size: var(--xs); line-height: 1.6; color: var(--text-faint); }

.pan__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.pan__item {
  width: 100%; display: grid; align-items: center;
  grid-template-columns: 1.5rem 40px minmax(0, 1fr) auto;
  gap: 0 0.7rem;
  font: inherit; text-align: left; cursor: pointer;
  background: transparent; color: var(--text);
  border: 0; border-top: 1px solid var(--line-soft);
  padding: 0.42rem 0.1rem;
  transition: background-color 120ms ease;
}

.pan__item--stop { grid-template-columns: 1.5rem minmax(0, 1fr) auto; }
.pan__list li:first-child .pan__item { border-top: 0; }
.pan__item:hover, .pan__item.is-hi { background: var(--raised); }

.pan__item img { width: 40px; height: 30px; object-fit: cover; border-radius: 2px; border: 1px solid var(--line); }

.pan__num {
  font-family: var(--mono); font-size: var(--xs); font-weight: 500;
  color: var(--text-faint); font-variant-numeric: tabular-nums;
}

.pan__item.is-hi .pan__num, .pan__item:hover .pan__num { color: var(--dawn); }
.pan__name { font-size: var(--sm); font-weight: 500; }
.pan__sub { font-family: var(--mono); font-size: 0.625rem; color: var(--text-faint); white-space: nowrap; }

/* ── 表格通用 ───────────────────────────────────────────── */

.tbl {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.tbl thead th {
  text-align: left; vertical-align: bottom;
  font-family: var(--mono); font-weight: 500; font-size: var(--xs);
  letter-spacing: 0.08em; color: var(--text-faint);
  border-bottom: 1px solid var(--line);
  padding: 0 0.7rem 0.45rem;
  white-space: nowrap;
}

.tbl tbody th, .tbl tbody td {
  text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
  padding: 0.6rem 0.7rem;
  font-size: var(--sm);
}

.tbl tbody th { font-weight: 500; }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 0; }

/* 行程表 */

.tbl--itin { min-width: 960px; }
.tbl--itin thead th:nth-child(1) { width: 5.5rem; }
.tbl--itin thead th:nth-child(2) { width: 11rem; }
.tbl--itin thead th:nth-child(6) { width: 6rem; }

.tbl--itin tbody tr:hover { background: var(--surface); }

.itin__date { white-space: nowrap; }
.itin__d { font-family: var(--mono); font-size: var(--md); font-weight: 500; display: block; }
.itin__wd { font-size: 0.6875rem; color: var(--text-faint); margin-right: 0.4rem; }
.itin__n { font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.1em; color: var(--text-faint); }

.itin__cname { font-weight: 500; }
.itin__flag {
  margin: 0.3rem 0 0; font-size: var(--xs); line-height: 1.5; color: var(--text-dim);
  padding-left: 0.75rem; border-left: 2px solid var(--dawn);
}

.itin__stay { font-family: var(--mono); font-size: var(--xs); color: var(--text-dim); }

.ent { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0 0.6rem; }
.ent + .ent { margin-top: 0.55rem; padding-top: 0.55rem; border-top: 1px dotted var(--line-soft); }

.ent__t {
  font-family: var(--mono); font-size: var(--xs); font-weight: 500;
  color: var(--text); padding-top: 0.12rem; white-space: nowrap;
}

.ent--move .ent__t { color: var(--text-faint); }
.ent__b { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ent__x { margin: 0; font-size: var(--xs); line-height: 1.55; color: var(--text-dim); }
.ent--move .ent__x { color: var(--text-faint); font-style: italic; }

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.chip {
  font: inherit; font-size: var(--xs); line-height: 1.4; cursor: pointer;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.14rem 0.6rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
  transition: border-color 140ms ease, color 140ms ease;
}

.chip::after { content: "＋"; font-size: 0.6rem; color: var(--text-faint); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:hover::after { color: var(--accent); }

/* 预订清单 */

.tbl--book { min-width: 760px; }
.tbl--book thead th:nth-child(1) { width: 2rem; }
.tbl--book .book__tick { text-align: center; padding-inline: 0.3rem; }
.tbl--book .book__when { font-family: var(--mono); font-size: var(--xs); color: var(--text-faint); white-space: nowrap; }
.tbl--book .book__what { white-space: nowrap; }
.tbl--book .book__detail { color: var(--text-dim); line-height: 1.55; }
.tbl--book .book__cost { font-family: var(--mono); font-size: var(--xs); color: var(--text-dim); white-space: nowrap; }
.tbl--book tr.is-done .book__what { text-decoration: line-through; color: var(--text-faint); }
.tbl--book tr.is-done .book__detail { color: var(--text-faint); }

.book__tick input {
  appearance: none; -webkit-appearance: none;
  width: 1rem; height: 1rem; margin: 0.15rem 0 0;
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--ground); cursor: pointer;
  display: grid; place-content: center;
}

.book__tick input::before {
  content: "✓"; font-size: 0.7rem; color: var(--ground);
  transform: scale(0); transition: transform 120ms ease;
}

.book__tick input:checked { background: var(--accent); border-color: var(--accent); }
.book__tick input:checked::before { transform: scale(1); }

/* 机票 */

.tbl--fly { min-width: 420px; }
.fly__date { font-family: var(--mono); font-size: var(--xs); color: var(--text-faint); white-space: nowrap; }
.fly__route i { font-style: normal; color: var(--text-faint); }
.fly__note { margin: 0.15rem 0 0; font-size: var(--xs); color: var(--text-dim); }
.fly__code { font-family: var(--mono); font-size: var(--xs); color: var(--text-dim); }
.fly__time { font-family: var(--mono); font-size: var(--xs); white-space: nowrap; }
.tbl--fly tr[data-leg="回程"] { background: var(--surface); }

.notes { list-style: none; margin: 0.9rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.notes li {
  font-size: var(--xs); line-height: 1.6; color: var(--text-dim);
  padding-left: 1.4rem; position: relative;
}

.notes li::before {
  content: "!"; position: absolute; left: 0; top: 0.1rem;
  width: 0.95rem; height: 0.95rem; border-radius: 50%;
  border: 1px solid var(--dawn); color: var(--dawn);
  font-family: var(--mono); font-size: 0.58rem; line-height: 0.9rem; text-align: center;
}

/* 实用信息 */

.tbl--facts tbody th {
  white-space: nowrap; font-family: var(--serif); font-weight: 700;
  font-size: var(--sm); width: 4.5rem;
}

.tbl--facts tbody td { color: var(--text-dim); line-height: 1.6; }

/* ── 景点弹层 ───────────────────────────────────────────── */

.sheet {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: var(--gutter);
  background: rgb(6 10 12 / 0.72); backdrop-filter: blur(3px);
}

.sheet[hidden] { display: none; }

.sheet__card {
  width: min(100%, 560px); max-height: min(88vh, 720px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: var(--shadow);
}

.sheet__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.sheet__body { padding: 1.1rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; }
.sheet__meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.sheet__body h3 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: var(--xl); line-height: 1.25; }
.sheet__body p { margin: 0; font-size: var(--md); line-height: 1.7; }
.sheet__tip { border-left: 2px solid var(--dawn); padding-left: 0.85rem; color: var(--text-dim); font-size: var(--sm); }
.sheet__body .btn { align-self: flex-start; margin-top: 0.2rem; }

/* ── 页脚 ───────────────────────────────────────────────── */

.foot {
  padding-block: 1.5rem 2.5rem; border-top: 1px solid var(--line-soft);
  color: var(--text-faint); font-size: var(--xs);
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; justify-content: space-between;
}

/* ── 响应 ───────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .atlas { grid-template-columns: minmax(0, 1fr); }
  #map { height: clamp(300px, 42vh, 400px); }
  .cols { grid-template-columns: minmax(0, 1fr); }
}

/* 窄屏：表格改成卡片，每格加行头 */
@media (max-width: 860px) {
  .tbl--itin, .tbl--book { min-width: 0; }
  .tbl--itin thead, .tbl--book thead { display: none; }

  .tbl--itin, .tbl--itin tbody, .tbl--itin tr, .tbl--itin th, .tbl--itin td,
  .tbl--book, .tbl--book tbody, .tbl--book tr, .tbl--book th, .tbl--book td {
    display: block; width: auto;
  }

  .tbl--itin tr, .tbl--book tr {
    border: 1px solid var(--line); border-radius: 3px;
    padding: 0.6rem 0.8rem 0.7rem; margin-bottom: 0.7rem;
    background: var(--surface);
  }

  .tbl--itin th, .tbl--itin td,
  .tbl--book th, .tbl--book td { border-bottom: 0; padding: 0.3rem 0; }

  .tbl--itin td[data-h]::before,
  .tbl--book td[data-h]::before {
    content: attr(data-h);
    display: block; margin-bottom: 0.2rem;
    font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.12em;
    color: var(--text-faint);
  }

  .tbl--itin .itin__date { display: flex; align-items: baseline; gap: 0.5rem; }
  .tbl--itin .itin__d { display: inline; }
  .tbl--itin .itin__n { margin-left: auto; }
  .tbl--itin td[data-h="城市"]::before { display: none; }
  .tbl--itin .itin__city { padding-bottom: 0.5rem; border-bottom: 1px solid var(--line-soft); }

  .tbl--book .book__tick { display: inline-block; margin-right: 0.5rem; }
  .tbl--book .book__tick::before { display: none; }
  .tbl--book .book__what { display: inline-block; }
  .tbl--book .book__when { display: block; }

  .tbl--fly { min-width: 0; }
  .tbl--facts tbody th { width: auto; }
}

@media (max-width: 620px) {
  .ent { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .pan__item { grid-template-columns: 1.3rem 34px minmax(0, 1fr); row-gap: 0.1rem; }
  .pan__item img { width: 34px; height: 26px; }
  .pan__sub { grid-column: 3; }
  .pan__item--stop { grid-template-columns: 1.3rem minmax(0, 1fr); }
  .pan__item--stop .pan__sub { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
