/* 中秋 · 秦皇岛 行程站 —— 样式表 */

:root {
  --navy: #0d2b45;
  --sea: #1b6ca8;
  --sea-mid: #3d8fc4;
  --sea-light: #e9f3fa;
  --sun: #e2843c;
  --sun-light: #fdf1e6;
  --bg: #f4f7fa;
  --card: #ffffff;
  --text: #1e2d3d;
  --muted: #6b7c8f;
  --line: #e3eaf1;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(13, 43, 69, .06);
  --shadow-lg: 0 6px 24px rgba(13, 43, 69, .1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部 ---------- */
.topbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--sea) 100%);
  color: #fff;
  padding: 26px 20px 22px;
}
.topbar .wrap { max-width: 900px; margin: 0 auto; }
.topbar .kicker {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .72;
  margin-bottom: 6px;
}
.topbar h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.35;
}
.topbar .sub {
  margin-top: 8px;
  font-size: 14px;
  opacity: .88;
}

/* ---------- 导航 ---------- */
.nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }
.nav .wrap {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 12px;
  white-space: nowrap;
}
.nav a {
  display: block;
  padding: 13px 14px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover { color: var(--sea); text-decoration: none; }
.nav a.active {
  color: var(--navy);
  border-bottom-color: var(--sea);
  font-weight: 600;
}

/* ---------- 布局 ---------- */
main { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }

section { margin-bottom: 34px; }

h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  padding-left: 11px;
  border-left: 4px solid var(--sea);
  line-height: 1.4;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin: 22px 0 10px;
}
h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--sea);
  margin: 16px 0 8px;
}

p { margin-bottom: 10px; }

.lead { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card.tight { padding: 14px 16px; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- 总览卡 ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fact {
  background: #fff;
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow);
}
.fact .label { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.fact .value { font-size: 16px; font-weight: 700; color: var(--navy); line-height: 1.45; }
.fact .note { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- 日程时间线 ---------- */
.day {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
}
.day-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 15px 20px;
  background: var(--sea-light);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.day-head .d {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}
.day-head .w {
  font-size: 13px;
  color: var(--sea);
  font-weight: 600;
}
.day-head .tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border-radius: 20px;
  padding: 2px 11px;
  border: 1px solid var(--line);
}
.day-body { padding: 16px 20px 18px; }

.steps { list-style: none; }
.steps li {
  position: relative;
  padding-left: 24px;
  padding-bottom: 12px;
  font-size: 14.5px;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sea-mid);
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7.5px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.steps li strong { color: var(--navy); }
.steps .t {
  display: inline-block;
  min-width: 52px;
  font-weight: 600;
  color: var(--sun);
  font-size: 13px;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 6px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  min-width: 460px;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--sea-light);
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 标签 ---------- */
.pill {
  display: inline-block;
  font-size: 12px;
  padding: 1px 9px;
  border-radius: 20px;
  background: var(--sea-light);
  color: var(--sea);
  font-weight: 600;
  white-space: nowrap;
}
.pill.free { background: #e8f6ee; color: #2f8a55; }
.pill.paid { background: var(--sun-light); color: #c96a1d; }
.pill.must { background: #fdeaea; color: #c0392b; }
.pill.off { background: #eef1f4; color: #93a1af; text-decoration: line-through; }

/* ---------- 提示块 ---------- */
.note {
  background: var(--sun-light);
  border-left: 3px solid var(--sun);
  border-radius: 0 8px 8px 0;
  padding: 11px 14px;
  font-size: 13.5px;
  margin: 12px 0;
}
.note.info { background: var(--sea-light); border-left-color: var(--sea); }
.note b { color: var(--navy); }

/* ---------- 链接卡 ---------- */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.linkcard {
  display: block;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.linkcard:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sea-mid);
}
.linkcard .t { font-weight: 700; color: var(--navy); font-size: 15px; margin-bottom: 3px; }
.linkcard .d { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---------- 页内锚点导航 ---------- */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}
.subnav a {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
}
.subnav a:hover {
  text-decoration: none;
  border-color: var(--sea-mid);
  color: var(--sea);
}

/* ---------- 折叠 ---------- */
details {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}
details > summary {
  cursor: pointer;
  padding: 13px 18px;
  font-weight: 600;
  color: var(--navy);
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "▸";
  color: var(--sea);
  font-size: 12px;
  transition: transform .15s ease;
}
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { background: var(--sea-light); }
details .body { padding: 2px 18px 16px; font-size: 14px; }
details .body > *:first-child { margin-top: 0; }
details .body ul { padding-left: 20px; }
details .body li { margin-bottom: 5px; }

/* ---------- 提示条 ---------- */
.mini {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}

ul.plain { padding-left: 20px; margin-bottom: 10px; }
ul.plain li { margin-bottom: 5px; }

ol.numlist { padding-left: 22px; margin-bottom: 10px; }
ol.numlist li { margin-bottom: 6px; }

.route {
  background: var(--sea-light);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 14px;
  margin: 10px 0;
  line-height: 1.9;
}
.route .arrow { color: var(--sea-mid); font-weight: 700; padding: 0 3px; }

/* ---------- 页脚 ---------- */
footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 46px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 560px) {
  .topbar h1 { font-size: 21px; }
  main { padding: 18px 14px 48px; }
  .card { padding: 15px 16px; }
  .day-head { padding: 13px 16px; }
  .day-body { padding: 14px 16px 16px; }
  .day-head .tag { margin-left: 0; }
  body { font-size: 14.5px; }
}

/* ---------- 窄屏：表格转为卡片，避免横向截断 ---------- */
@media (max-width: 640px) {

  .table-wrap {
    overflow-x: visible;
    margin-bottom: 12px;
  }

  table {
    min-width: 0;
    width: 100%;
    display: block;
    background: transparent;
  }

  table thead { display: none; }

  table tbody { display: block; }

  table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: var(--shadow);
    padding: 9px 0;
    margin-bottom: 10px;
  }

  table tbody tr:last-child { margin-bottom: 0; }

  /* 空单元格不占位 */
  table tbody td:empty { display: none; }

  table td,
  table th {
    display: block;
    width: auto;
    border: none;
    padding: 4px 15px;
    text-align: left;
  }

  /* 有表头的表：每格显示「标签 + 值」 */
  table td[data-label] {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  table td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 62px;
    font-size: 12px;
    font-weight: 700;
    color: var(--sea);
    line-height: 1.7;
  }

  /* 第一列当作卡片标题 */
  table tbody tr > td[data-label]:first-child {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--navy);
    padding-bottom: 5px;
  }

  table tbody tr > td[data-label]:first-child::before { display: none; }

  /* 键值表（无 thead）：th 作小标签，td 作内容 */
  table tbody tr > th {
    font-size: 12px;
    font-weight: 700;
    color: var(--sea);
    background: transparent;
    white-space: normal;
    padding-bottom: 0;
  }

  table tbody tr > th + td { padding-top: 2px; }

  /* 跨列单元格（如「合计」） */
  table tbody tr > td[colspan] {
    font-weight: 600;
    color: var(--navy);
    padding-bottom: 2px;
  }

  table tbody tr > td[colspan] + td[data-label] {
    font-weight: 700;
    color: var(--navy);
  }

  .pill { font-size: 12px; }
}
