/* ============================================================
 * 北京CityWalk · 全站样式
 * 设计 token：朱砂红 #C0392B / 金 #D4A017 / 米白 #FAF6EF /
 *            墨 #2F2A24 / 次文字 #8A7A6A / 卡片白 #FFFFFF
 * 基准 375px，内容 max-width:480px 居中；正文 ≥14px；点击区 ≥44px
 * ============================================================ */

:root {
  --red: #C0392B;          /* 主色·朱砂红 */
  --red-dark: #A33024;     /* 主色按压态 */
  --red-soft: #F7E9E6;     /* 主色浅底 */
  --gold: #D4A017;         /* 辅助金 */
  --gold-soft: #FAF1DA;    /* 金色浅底 */
  --bg: #FAF6EF;           /* 页面米白 */
  --ink: #2F2A24;          /* 正文墨色 */
  --sub: #8A7A6A;          /* 次要文字 */
  --card: #FFFFFF;         /* 卡片白 */
  --line: #ECE4D8;         /* 分隔线（米色系） */
  --green: #3F8F5B;        /* 起点绿 */
  --shadow: 0 1px 4px rgba(47, 42, 36, .08);
  --shadow-lg: 0 4px 18px rgba(47, 42, 36, .14);
  --radius: 12px;
  --tabbar-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { 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", sans-serif;
  color: var(--ink);
  background: #EFE9DE;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
ul, ol { list-style: none; }

/* ---------- 布局容器：375 基准，480 居中 ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  position: relative;
  box-shadow: 0 0 24px rgba(47, 42, 36, .08);
}
.app.detail-mode { padding-bottom: calc(68px + var(--safe-bottom)); }

.view { padding: 0 14px; }

/* 无彩色头图的页面（专辑总览/我的收藏）：
   用容器自身 padding-top 承接首标题间距，避免子元素 margin 穿透到 body 露出灰底，
   同时覆盖刘海屏顶部安全区；首个标题不再重复外边距，视觉位置保持 18px */
.view-plain { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
.view-plain > .section-title:first-child { margin-top: 0; }

/* 通用区块标题 */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 10px;
}
.section-title .hint { font-size: 12px; font-weight: 400; color: var(--sub); }

/* ---------- 顶部品牌头 ---------- */
.app-header {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: linear-gradient(135deg, var(--red) 0%, #D1543F 100%);
  color: #fff;
}
.app-header h1 { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.app-header p { font-size: 12px; opacity: .9; margin-top: 2px; }

/* 详情页返回头 */
.detail-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px;
  background: rgba(250, 246, 239, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 0 8px 0 4px;
  font-size: 14px;
  color: var(--ink);
}
.back-btn svg { flex: none; }
.detail-header .htitle {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* 专辑分类列表页的返回头同样式，标题可更长 */
.cat-header h2 { font-size: 16px; }

/* ---------- 精选轮播 ---------- */
.hero { margin: 14px 0 4px; }
.hero-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-card {
  position: relative;
  flex: 0 0 82%;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  min-height: 168px;
}
.hero-img { width: 100%; height: 128px; object-fit: cover; background: #E6DED2; }
.hero-fallback {
  width: 100%; height: 128px;
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); font-size: 13px;
  background: repeating-linear-gradient(45deg, #EFE8DC, #EFE8DC 10px, #E7DFD0 10px, #E7DFD0 20px);
  padding: 12px; text-align: center;
}
.hero-body { padding: 8px 12px 10px; }
.hero-body .nm { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-body .th { font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.hero-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--gold); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* ---------- 搜索框 ---------- */
.searchbar {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 4px;
  height: 44px;
  padding: 0 12px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.searchbar svg { flex: none; color: var(--sub); }
.searchbar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--ink); min-width: 0;
}
.searchbar input::placeholder { color: #B6A997; }
.search-clear { color: var(--sub); display: none; padding: 6px; }
.searchbar.has-text .search-clear { display: inline-flex; }

/* ---------- 筛选区 ---------- */
.filters { margin-top: 10px; }
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.filter-label {
  flex: 0 0 38px;
  font-size: 12px;
  color: var(--sub);
  font-weight: 600;
}
.chip-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding: 4px 0;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  white-space: nowrap;
}
.chip.on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}

/* 排序分段控件 */
.sortbar {
  display: flex;
  gap: 0;
  margin: 10px 0 6px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sort-item {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--sub);
  position: relative;
}
.sort-item + .sort-item::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 1px;
  background: var(--line);
}
.sort-item.on { color: var(--red); font-weight: 700; }

/* 已选条件汇总条 */
.filter-summary {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--gold-soft);
  border-radius: 10px;
  font-size: 12px;
  color: #7A5E1F;
}
.filter-summary.show { display: flex; }
.filter-summary .conds { flex: 1; line-height: 1.5; }
.filter-summary .clear-all {
  flex: none;
  color: var(--red);
  font-weight: 700;
  min-height: 32px;
  padding: 0 6px;
}

.result-count { font-size: 12px; color: var(--sub); margin: 8px 2px 4px; }

/* ---------- 线路卡片 ---------- */
.route-list { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.route-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 10px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  text-align: left;
}
.route-card:active { background: #FBF8F2; }
.route-cover {
  flex: 0 0 96px;
  width: 96px; height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: #E6DED2;
}
.cover-fallback {
  flex: 0 0 96px;
  width: 96px; height: 96px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 6px;
  font-size: 11px; color: var(--sub);
  background: repeating-linear-gradient(45deg, #EFE8DC, #EFE8DC 8px, #E7DFD0 8px, #E7DFD0 16px);
}
.route-info { flex: 1; min-width: 0; }
.route-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  background: #F3ECE2;
  color: #86653F;
  white-space: nowrap;
}
.tag.region { background: #EFEBEF; color: #6E5578; }
.tag.gap { background: var(--red-soft); color: var(--red); font-weight: 600; }
.tag.season { background: var(--gold-soft); color: #8A6A14; font-weight: 600; }
.tag.visited { background: #E5F1E9; color: var(--green); font-weight: 600; }
.route-meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--sub);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.route-meta .heat { color: var(--red); }
.route-meta .heat.pending { color: var(--sub); font-weight: 400; }
.fav-remove {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 6px 8px 0 0;
  color: #B9AB97;
}
.fav-remove:active { color: var(--red); }

/* ---------- 空态 ---------- */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--sub);
}
.empty svg { color: #CDBFA9; margin-bottom: 10px; }
.empty .et { font-size: 15px; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.empty .ed { font-size: 13px; margin-bottom: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:active { background: var(--red-dark); }
.btn-ghost { background: var(--card); color: var(--red); border: 1px solid var(--red); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; }

/* ---------- FAB 今天走哪条 ---------- */
.fab-surprise {
  position: fixed;
  right: calc(50% - 240px + 14px);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 23px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}
/* 屏宽 ≤508 时按视口右侧定位（容器贴边） */
@media (max-width: 508px) {
  .fab-surprise { right: 14px; }
}
.fab-surprise:active { transform: scale(.96); }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tabbar.hidden { display: none; }
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--sub);
}
.tab.on { color: var(--red); font-weight: 700; }

/* ---------- 详情页 ---------- */
.detail-body { padding: 14px 14px 0; }
/* 详情头图：与列表封面同源，增强代入感；标题紧接其下 */
.detail-cover {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 12px;
  background: #E6DED2;
  margin-bottom: 12px;
}
.detail-fallback {
  width: 100%;
  height: 190px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 12px;
  font-size: 13px; color: var(--sub);
  background: repeating-linear-gradient(45deg, #EFE8DC, #EFE8DC 10px, #E7DFD0 10px, #E7DFD0 20px);
}
.detail-title { font-size: 20px; font-weight: 800; line-height: 1.35; }
.detail-subtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.detail-subtags .heat-text { background: var(--red-soft); color: var(--red); font-weight: 600; }

/* 四条标准徽章 */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge svg { flex: none; }
.badge.b-value { background: #FBEFE3; color: #B26A24; border-color: #F0D9BD; }
.badge.b-gap   { background: var(--red-soft); color: var(--red); border-color: #EBCFC9; }
.badge.b-cheap { background: #E5F1E9; color: var(--green); border-color: #CDE3D5; }
.badge.b-beauty{ background: var(--gold-soft); color: #8A6A14; border-color: #EEDFAE; }
.badge .arrow { transition: transform .2s ease; }
.badge.expanded .arrow { transform: rotate(180deg); }
.criteria-panel {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--card);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  font-size: 13px;
  color: #5C5348;
  box-shadow: var(--shadow);
}
.criteria-panel.show { display: block; }
/* 徽章切换时的轻量淡入（JS 切换文案后重挂 .fade 触发） */
.criteria-panel.fade { animation: criteriaFade .22s ease; }
@keyframes criteriaFade {
  from { opacity: .25; }
  to   { opacity: 1; }
}

/* 内容卡片通用（卖点/信息/站点/出片/来源） */
.panel {
  margin-top: 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-hd {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 14px 8px;
  font-size: 15px;
  font-weight: 700;
}
.panel-hd .count { font-size: 12px; color: var(--sub); font-weight: 400; }
.panel-bd { padding: 0 14px 12px; font-size: 14px; }
.theme-text { color: #5C5348; }

/* 信息行 */
.info-list .info-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.info-list .info-row:last-child { border-bottom: none; }
.info-row .ik {
  flex: 0 0 62px;
  color: var(--sub);
}
.info-row .iv { flex: 1; min-width: 0; }

/* 秋日限定观赏窗口 */
.season-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--gold-soft);
  border-radius: 10px;
  font-size: 13px;
  color: #7A5E1F;
  font-weight: 600;
}
.season-note svg { flex: none; }

/* 打卡按钮 */
.visited-toggle {
  margin-top: 14px;
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--sub);
}
.visited-toggle.done { background: #E5F1E9; border-color: #CDE3D5; color: var(--green); }

/* 方案 B 地图示意卡 */
.map-illus {
  margin: 0 14px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 22% 30%, rgba(212,160,23,.10), transparent 42%),
    radial-gradient(circle at 78% 72%, rgba(192,57,43,.08), transparent 46%),
    repeating-linear-gradient(0deg, #F3EBDD, #F3EBDD 22px, #EEE4D3 22px, #EEE4D3 23px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.35) 22px, transparent 22px, transparent 46px),
    #F3EBDD;
  border: 1px solid #E7DCC8;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-point { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.map-point .mp-label { min-width: 44px; font-weight: 700; }
.map-point.start .mp-label { color: var(--green); }
.map-point.end .mp-label { color: var(--red); }
.map-point .mp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-dash {
  margin-left: 21px;
  border-left: 2px dashed #C9B48C;
  height: 22px;
}
.map-stat {
  margin-top: 8px;
  font-size: 12px;
  color: #8A7A5E;
  text-align: center;
}
.nav-buttons { display: flex; gap: 10px; padding: 10px 14px 0; }
.nav-btn {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}
.nav-btn.amap { background: var(--red); color: #fff; }
.nav-btn.amap:active { background: var(--red-dark); }
.nav-btn.baidu { background: #2E6FB5; color: #fff; }
.nav-btn.baidu:active { background: #275E99; }
.map-tip {
  padding: 8px 14px 12px;
  font-size: 11px;
  color: var(--sub);
  display: flex; gap: 5px; align-items: flex-start;
}

/* 站点分段 / 出片点 */
.seg-list .seg {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.seg-list .seg:last-child { border-bottom: none; }
.seg-no {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.seg-no.photo { background: var(--gold-soft); color: #8A6A14; }
.seg-tx b { display: block; font-size: 14px; font-weight: 600; }
.seg-tx span { font-size: 12.5px; color: var(--sub); }

/* 起终点摘要条 */
.endpoints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.endpoints .ep { display: flex; gap: 8px; }
.endpoints .ep b { flex: 0 0 36px; }
.endpoints .ep.start b { color: var(--green); }
.endpoints .ep.end b { color: var(--red); }

/* 来源：整行一个锚点，点击高度 ≥44px，虚线行间分隔 */
.src-list .src {
  padding: 0;
  border-bottom: 1px dashed var(--line);
}
.src-list .src:last-child { border-bottom: none; }
.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 6px 2px;
  color: inherit;
  border-radius: 8px;
}
.src-row:active { background: var(--bg); }
.src-platform {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #F3ECE2;
  color: #86653F;
}
.src-heat { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-go { flex: none; color: var(--red); display: inline-flex; }
.src-note { font-size: 11px; color: var(--sub); padding: 6px 0 2px; }

/* 详情吸底操作条 */
.actionbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px 14px calc(8px + var(--safe-bottom));
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  z-index: 25;
}
.actionbar.hidden { display: none; }
.act-icon {
  flex: 0 0 62px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--sub);
  border-radius: 10px;
}
.act-icon.on { color: var(--red); }
.act-icon svg { flex: none; }
.act-nav {
  flex: 1;
  min-height: 48px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.act-nav:active { background: var(--red-dark); }

/* ---------- 专辑页 ---------- */
.album-grid { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.album-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  min-height: 72px;
}
.album-card:active { background: #FBF8F2; }
.album-ico {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
}
.album-card .a-body { flex: 1; min-width: 0; }
.album-card .a-name { font-size: 15px; font-weight: 700; }
.album-card .a-desc { font-size: 12.5px; color: var(--sub); margin-top: 1px; }
.album-card .a-count {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-soft);
  padding: 4px 9px;
  border-radius: 12px;
}
.album-card .a-arrow { flex: none; color: #C4B7A2; }

/* ---------- 收藏页 ---------- */
.progress-card {
  margin-top: 14px;
  background: linear-gradient(135deg, var(--red), #D1543F);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
/* 18/18 全部走完：朱砂红变金色，提供完成感 */
.progress-card.all-done {
  background: linear-gradient(135deg, var(--gold), #B08615);
}
.progress-card .pc-top { display: flex; align-items: baseline; justify-content: space-between; }
.progress-card .pc-num { font-size: 22px; font-weight: 800; }
.progress-card .pc-num small { font-size: 13px; font-weight: 400; opacity: .85; }
.progress-card .pc-tip { font-size: 12px; opacity: .88; }
.progress-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,.28);
  overflow: hidden;
  margin-top: 12px;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  transition: width .3s ease;
}
.share-all { margin-top: 12px; }

/* ---------- 底部弹层 / Toast ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(47, 42, 36, .42);
  z-index: 40;
}
.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  z-index: 41;
  box-shadow: 0 -4px 20px rgba(0,0,0,.18);
}
.sheet-grip {
  width: 38px; height: 4px;
  border-radius: 2px;
  background: #E0D6C4;
  margin: 0 auto 12px;
}
.sheet-title { font-size: 16px; font-weight: 700; text-align: center; }
.sheet-sub { font-size: 12.5px; color: var(--sub); text-align: center; margin: 4px 0 14px; line-height: 1.6; }
.sheet-body { font-size: 14px; color: var(--ink); }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.sheet-actions .row2 { display: flex; gap: 10px; }
.sheet-actions .row2 .btn { flex: 1; }

.surprise-card {
  text-align: center;
  padding: 4px 0 2px;
}
.surprise-card .sp-name { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.surprise-card .sp-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.surprise-card .sp-theme {
  font-size: 13.5px;
  color: #5C5348;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  line-height: 1.65;
}
.surprise-card .sp-meta { font-size: 12.5px; color: var(--sub); margin-top: 10px; }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + var(--safe-bottom));
  max-width: 80%;
  background: rgba(47, 42, 36, .92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 60;
  text-align: center;
}
.toast.show { opacity: 1; }

/* 桌面端：页面外留白，480 居中 */
@media (min-width: 520px) {
  body { padding: 0; }
}

/* ============================================================
 * 响应式适配（默认样式=手机；以下两档为平板/桌面增强）
 * 手机  <720 ：底部 Tab + 单列（即上方全部默认样式）
 * 平板  ≥720 ：容器放宽 720，卡片双列竖版，chips 换行
 * 桌面  ≥1024：左侧固定导航栏，内容 ≤1120，详情双栏，专辑三列
 * ============================================================ */

/* ---------- PC 左侧导航栏：手机/平板默认隐藏 ---------- */
.sidebar { display: none; }

/* 桌面静态操作组默认（手机/平板）隐藏，≥1024 媒体块内再开启。
   注意：此规则必须位于媒体查询之前，否则会同特异性覆盖桌面的 display:flex */
.actions-desktop { display: none; }

/* ---------------- 平板档 ≥720 ---------------- */
@media (min-width: 720px) {
  .app { max-width: 720px; }

  /* 精选卡定宽，不再按屏宽百分比 */
  .hero-card { flex-basis: 270px; }
  .hero-img { height: 140px; }

  /* 筛选 chips 由横滚改为自然换行 */
  .chip-scroll { flex-wrap: wrap; overflow: visible; }

  /* 搜索与排序不必拉满 720 */
  .searchbar, .sortbar { max-width: 520px; }

  /* 线路列表双列；卡片改竖版（封面在上） */
  .route-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .route-card { flex-direction: column; gap: 10px; }
  .route-cover,
  .cover-fallback {
    flex: none;
    width: 100%;
    height: 140px;
  }

  /* 专辑双列 */
  .album-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  /* 详情/分类列表正文放宽到 720（与容器一致） */
  .detail-body { max-width: 720; margin: 0 auto; }
}

/* ---------------- 桌面档 ≥1024 ---------------- */
@media (min-width: 1024px) {
  body { background: #EFE9DE; }

  /* 左侧导航栏 */
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 224px;
    background: var(--ink);
    color: var(--bg);
    z-index: 30;
    padding: 20px 14px 16px;
  }
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 18px;
    border-bottom: 1px solid rgba(250, 246, 239, .12);
    margin-bottom: 14px;
  }
  .sb-txt { display: flex; flex-direction: column; line-height: 1.35; }
  .sb-txt b { font-size: 17px; color: #fff; letter-spacing: .5px; }
  .sb-txt small { font-size: 11.5px; color: rgba(250, 246, 239, .6); margin-top: 2px; }
  .sidebar-nav { display: flex; flex-direction: column; gap: 6px; }
  .side-tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 15px;
    color: rgba(250, 246, 239, .72);
    transition: background .15s ease, color .15s ease;
  }
  .side-tab.on { background: var(--red); color: #fff; font-weight: 700; }
  .sidebar-foot {
    margin-top: auto;
    padding: 14px 12px 0;
    border-top: 1px solid rgba(250, 246, 239, .12);
    font-size: 11px;
    line-height: 1.7;
    color: rgba(250, 246, 239, .45);
  }

  /* 主区域让位侧栏，取消手机壳限宽与阴影 */
  .app {
    max-width: none;
    margin-left: 224px;
    min-height: 100vh;
    box-shadow: none;
    padding-bottom: 28px;
  }
  .app.detail-mode { padding-bottom: 28px; }

  /* 底部 Tab 与吸底操作条在桌面隐藏（由侧栏 / 静态操作组替代） */
  .tabbar { display: none; }
  .actionbar { display: none; }

  /* 内容统一 ≤1120 居中 */
  .view { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

  /* 无彩色头图的页面顶部留白与首页横幅 26px 顶距对齐 */
  .view-plain { padding-top: 26px; }

  /* 品牌头变圆角横幅卡 */
  .app-header {
    max-width: 1120px;
    margin: 26px auto 0;
    border-radius: 16px;
    padding: 26px 32px;
    box-shadow: var(--shadow);
  }
  .app-header h1 { font-size: 26px; }
  .app-header p { font-size: 13.5px; margin-top: 4px; }

  /* 精选更大定宽卡 */
  .hero-card { flex-basis: 310px; min-height: 0; }
  .hero-img, .hero-fallback { height: 160px; }

  /* 搜索/排序限宽，避免 1120 下输入框过长 */
  .searchbar, .sortbar { max-width: 560px; }

  /* 线路双列竖版大卡 */
  .route-list { gap: 16px; }
  .route-cover,
  .cover-fallback { height: 168px; }

  /* FAB 固定到视口右下（侧栏占左，不再按手机壳居中计算） */
  .fab-surprise { right: 30px; bottom: 30px; }

  /* 通用弹层在桌面改为屏幕居中模态框（手机端底部抽屉样式被覆盖） */
  .sheet {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: calc(100% - 64px);
    max-width: 440px;
    border-radius: 16px;
    padding: 22px;
  }
  /* 桌面模态不需要手机抽屉的顶部抓手条 */
  .sheet-grip { display: none; }

  /* ---------- 详情双栏 ---------- */
  .detail-header {
    max-width: 1120px;
    margin: 0 auto;
    background: transparent;
    border-bottom: none;
    padding: 18px 28px 0;
  }
  .detail-body { max-width: 1120px; padding: 8px 28px 0; }
  .detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 22px;
    align-items: start;
  }
  /* DOM 顺序信息列在前（手机自然堆叠），桌面把站点列放左、信息列放右 */
  .detail-main { grid-column: 1; grid-row: 1; min-width: 0; }
  .detail-side {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    position: sticky;
    top: 14px;
    /* 信息列内容可能高于视口：限高并内部滚动，保证标题与底部操作始终可达 */
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
  }
  .detail-side::-webkit-scrollbar { width: 5px; }
  .detail-side::-webkit-scrollbar-thumb { background: #DCCFB9; border-radius: 3px; }
  .detail-side .panel,
  .detail-side .map-panel { margin-top: 14px; }
  .detail-side > .detail-title-block,
  .detail-side > .visited-toggle { margin-top: 14px; }

  /* 桌面静态操作组（手机端由 CSS 隐藏，沿用吸底条） */
  .actions-desktop { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
  .actions-desktop .ad-row { display: flex; gap: 10px; }
  .ad-btn {
    min-height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--sub);
  }
  .ad-btn.half { flex: 1; }
  .ad-btn.fav.on { color: var(--red); border-color: #EBCFC9; background: var(--red-soft); }
  .ad-nav {
    min-height: 50px;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .ad-nav:active { background: var(--red-dark); }

  /* 地图卡两侧内边距对齐 panel（手机端自带 14px 横边距） */
  .map-panel { margin-left: 0; margin-right: 0; }

  /* 专辑三列；分类过滤列表仍是双列大卡 */
  .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .cat-header { max-width: 1120px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }

  /* 收藏：进度卡宽版 */
  .progress-card { padding: 22px 26px; }
  .progress-card .pc-num { font-size: 26px; }
}
