/* 国庆旅游热度榜 · 宋瓷水墨
   设计意图：托纸/册页两层纸面靠明度分层，界线用发丝墨线，
   天青作主色、朱砂只做印章级点睛，热度用「墨分五色」离散表达。 */

:root {
  /* 纸 */
  --paper: #edeae3;
  --leaf: #f7f5f0;
  --leaf-2: #f2efe9;
  /* 墨分五色 */
  --ink: #23262b;
  --ink-2: #3d4349;
  --ink-3: #4e5358;
  --ink-4: #6b7075;
  /* 界线 */
  --rule: #d8d3c9;
  --rule-2: #e5e1d9;
  /* 釉色 */
  --celadon: #7e9c99;
  --celadon-deep: #4f6e6b;
  --celadon-wash: #dbe3df;
  /* 语义 */
  --cinnabar: #a93226;
  --plum: #3f6b54;
  --ochre: #8a5a22;
  --up: #a93226;
  --down: #3f6b54;

  --song: "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC",
    "Songti SC", "STSong", "SimSun", "Han Serif", serif;
  --hei: "Source Han Sans SC", "Noto Sans CJK SC", -apple-system,
    BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    Roboto, Helvetica, Arial, sans-serif;

  --nav-h: 58px;
}

* { box-sizing: border-box; }

/* 显式 display 会盖过浏览器 [hidden] 的默认 display:none，
   必须强制隐藏，否则弹层会一直显示并挡住整页。 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--hei);
  font-size: 15px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 中文界面全局加粗会糊：字重收到 500，靠字号、字族与颜色分层 */
b, strong { font-weight: 500; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

/* 印：朱砂方章，替代彩色 emoji 图标 */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex: 0 0 24px;
  border-radius: 2px;
  background: var(--cinnabar); color: var(--leaf);
  font-family: var(--song); font-size: 14px; line-height: 1;
  font-weight: 400;
}
.seal-ink { background: transparent; color: var(--ink-3); border: 1px solid var(--rule); }

/* 细线图标：统一 1.4 描边，跟着文字颜色走 */
.ico { width: 15px; height: 15px; flex: 0 0 15px; stroke: currentColor; fill: none; stroke-width: 1.4; }

/* ---------- 顶部吸顶导航 ---------- */
.topnav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(237, 234, 227, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topnav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--song); font-size: 18px; letter-spacing: 2px; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: var(--ink-3); text-decoration: none;
  font-size: 14px; padding: 6px 12px;
  border-bottom: 1px solid transparent;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); border-bottom-color: var(--cinnabar); }
.nav-link.home-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--celadon-deep); margin-right: 6px;
}
.nav-link.home-link:hover { color: var(--ink); }

/* ---------- 卷首：天青釉，釉色向底部聚拢 ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(120% 82% at 16% 112%, rgba(96, 136, 127, .38), rgba(96, 136, 127, 0) 64%),
    radial-gradient(88% 72% at 90% -16%, rgba(255, 255, 255, .58), rgba(255, 255, 255, 0) 62%),
    linear-gradient(172deg, #e7ece7 0%, #d6e0db 56%, #c6d4ce 100%);
  border-bottom: 1px solid var(--rule);
  padding: 76px 0 66px;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; }
.hero-title {
  margin: 0 0 22px;
  font-family: var(--song);
  font-size: 54px; font-weight: 400; line-height: 1.24;
  letter-spacing: 4px;
  color: #1b1f22;
}
.hero-title em { font-style: normal; display: block; }
.hero-lede { margin: 0 0 34px; font-size: 15.5px; color: #2c3634; max-width: 38em; }

/* 卷首闲章：整页唯一的大面积朱砂 */
.hero-seal {
  position: absolute; right: max(28px, calc(50% - 542px)); top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 84px; height: 84px;
  border: 2.5px solid var(--cinnabar);
  border-radius: 3px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--song); color: var(--cinnabar);
  font-size: 30px; line-height: 1.05; letter-spacing: 0;
  opacity: .88;
  user-select: none; pointer-events: none;
}

/* ---------- 搜索：一条墨线，不用胶囊和投影 ---------- */
.search-box {
  position: relative;
  max-width: 480px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1.5px solid #5d6d69;
  padding: 4px 0 7px;
}
.search-box:focus-within { border-bottom-color: var(--ink); }
.search-box input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: transparent;
  color: var(--ink); font-family: var(--hei);
  padding: 4px 0; font-size: 15.5px;
}
.search-box input::placeholder { color: #55625e; }
.search-box .search-icon {
  color: #38443f; display: inline-flex; align-items: center;
  order: 2;
}
.search-box button {
  order: 2;
  border: 0; background: transparent; cursor: pointer;
  color: #38443f; padding: 2px 0; font-size: 18px; line-height: 1;
  display: none;
}
.search-box button:hover { color: var(--cinnabar); }
.search-box.has-value button { display: inline-flex; }
.search-box.has-value .search-icon { display: none; }

/* ---------- 四榜入口：条屏，不是卡片 ---------- */
.cat-wrap {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 auto;
  padding: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--leaf);
}
.cat-card {
  display: flex; align-items: flex-start; gap: 10px;
  border: 0; border-left: 1px solid var(--rule-2);
  border-top: 2px solid transparent;
  background: transparent;
  padding: 18px 16px 16px;
  cursor: pointer; text-align: left;
  font-family: var(--hei); color: var(--ink);
}
.cat-card:first-child { border-left: 0; padding-left: 28px; }
.cat-card:last-child { padding-right: 28px; }
.cat-card:hover { background: var(--leaf-2); }
.cat-card.active { background: var(--celadon-wash); border-top-color: var(--ink); }
.cat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: 0 0 26px; margin-top: 1px;
  border: 1px solid var(--rule); border-radius: 2px;
  font-family: var(--song); font-size: 14px; line-height: 1;
  color: var(--ink-3); background: var(--leaf);
}
.cat-card.active .cat-icon {
  background: var(--cinnabar); border-color: var(--cinnabar); color: var(--leaf);
}
.cat-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cat-text b { font-family: var(--song); font-size: 16px; letter-spacing: 1px; }
.cat-text small { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.cat-arrow { display: none; }

/* ---------- 榜单区标题 ---------- */
#rank-top { padding-top: 40px; padding-bottom: 8px; scroll-margin-top: calc(var(--nav-h) + 8px); }
.rank-head { margin-bottom: 18px; }
.rank-title {
  margin: 0 0 16px;
  font-family: var(--song); font-size: 24px; font-weight: 400;
  letter-spacing: 3px;
  display: flex; align-items: baseline; gap: 12px;
}
.rank-title small {
  font-family: var(--hei); font-size: 12px; letter-spacing: 0;
  color: var(--ink-4);
}
.hero-sub { margin: -6px 0 18px; font-size: 13px; color: var(--ink-4); }
.rank-trophy { display: none; }

/* ---------- Tabs：走细线，不用胶囊 ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--rule); }
.tab {
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--ink-3);
  padding: 8px 16px 9px; margin-bottom: -1px;
  cursor: pointer; font-family: var(--hei); font-size: 14px;
}
.tab:first-child { padding-left: 0; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--cinnabar); }

/* ---------- 册页：纸面靠明度分层，不用投影 ---------- */
main { min-height: 320px; }

.card {
  background: var(--leaf);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 22px 24px;
  margin-bottom: 22px;
  overflow: hidden;
  scroll-margin-top: calc(var(--nav-h) + 60px);
}
.card h3 {
  margin: 0 0 10px;
  font-family: var(--song); font-size: 19px; font-weight: 400;
  letter-spacing: 1.5px;
  display: flex; align-items: center; gap: 10px;
}
.card h3::before {
  content: "";
  width: 2px; height: 17px; flex: 0 0 2px;
  background: var(--cinnabar);
}
.board-desc { color: var(--ink-3); font-size: 13.5px; margin: 0 0 16px; max-width: 62em; }
.card .src {
  color: var(--ink-4); font-size: 12px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--rule-2);
}

/* 参考榜内子区块 */
.sub { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule-2); }
.sub:first-of-type { margin-top: 4px; padding-top: 0; border-top: 0; }
.sub h4 {
  margin: 0 0 10px;
  font-family: var(--song); font-size: 15.5px; font-weight: 400; letter-spacing: 1px;
  display: flex; align-items: baseline; gap: 10px;
}
.sub-src { font-family: var(--hei); font-size: 11.5px; letter-spacing: 0; color: var(--ink-4); }

/* 名录：条目，不是彩色胶囊 */
.chips { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 8px 0 4px; }
.chip {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 14px; padding: 3px 0;
  min-width: 128px;
}
.chip b { color: var(--ink-4); font-variant-numeric: tabular-nums; font-size: 12.5px; min-width: 18px; }
.chip .rk { color: var(--ink-4); font-size: 12px; }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; }
th {
  background: transparent;
  color: var(--ink-3);
  font-weight: 400; font-size: 12.5px;
  border-bottom: 1px solid var(--ink-4);
  cursor: pointer; user-select: none;
}
th:hover { color: var(--ink); }
th .arrow { font-size: 9px; color: var(--ink-4); margin-left: 2px; }
th.sorted { color: var(--ink); }
th.sorted .arrow { color: var(--cinnabar); }
td { border-bottom: 1px solid var(--rule-2); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--leaf-2); }
tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-4); }

/* 排名：第一名朱文实印，二三名白文空印，四名之后只写数字 */
th.rk-col { cursor: default; }
td.rk-cell { width: 46px; text-align: left; }
.medal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 2px;
  border: 1px solid var(--cinnabar);
  background: var(--cinnabar); color: var(--leaf);
  font-family: var(--song); font-size: 14px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.medal.m2, .medal.m3 { background: transparent; color: var(--cinnabar); }
.rknum {
  display: inline-block; width: 24px; text-align: center;
  color: var(--ink-4); font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* 同比：涨红跌绿（中国惯例） */
.pos { color: var(--up); }
.neg { color: var(--down); }

/* 热度：墨分五色，离散五级比渐变条更好比 */
.hbar { display: flex; width: max-content; gap: 3px; margin-top: 6px; }
.hbar i { width: 12px; height: 4px; border-radius: 1px; background: var(--rule); }
.hbar i.on:nth-child(1) { background: #bcc3c0; }
.hbar i.on:nth-child(2) { background: #9ba5a2; }
.hbar i.on:nth-child(3) { background: #7a8783; }
.hbar i.on:nth-child(4) { background: #566661; }
.hbar i.on:nth-child(5) { background: #2f3b37; }

/* ---------- 等级标记 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--leaf);
  font-size: 12.5px; color: var(--ink-2);
  line-height: 1.6;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 1px; background: var(--ink-4); }
.badge.sold_out { color: #8b2b21; border-color: #d9b8b2; background: #f7ece9; }
.badge.sold_out::before { background: var(--cinnabar); }
.badge.tight { color: #7d5220; border-color: #ddcdb0; background: #f7f1e4; }
.badge.tight::before { background: var(--ochre); }
.badge.normal { color: var(--celadon-deep); border-color: #bfcfcb; background: #eaf0ed; }
.badge.normal::before { background: var(--celadon); }
.badge.cheap { color: #35604b; border-color: #bdd0c4; background: #e9f0ea; }
.badge.cheap::before { background: var(--plum); }
.badge.dim { color: var(--ink-4); border-color: transparent; background: transparent; padding-left: 0; }
.badge.dim::before { display: none; }

.pill {
  display: inline-block;
  padding: 1px 8px; margin: 1px 2px;
  border: 1px solid var(--rule-2); border-radius: 2px;
  font-size: 12px; color: var(--ink-3); background: var(--leaf-2);
}

/* ---------- 详情弹层 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 14px 0 4px; }
.stat {
  border-left: 1px solid var(--rule-2);
  padding: 10px 0 10px 14px;
}
.stat:nth-child(odd) { border-left: 0; padding-left: 0; }
.stat .k { font-size: 12px; color: var(--ink-4); }
.stat .v {
  font-family: var(--song); font-size: 24px; line-height: 1.3;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.stat .v small { font-family: var(--hei); font-size: 12px; color: var(--ink-4); margin-left: 2px; }

.detail-section { margin-top: 22px; }
.detail-section h4 {
  margin: 0 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--song); font-size: 16px; font-weight: 400; letter-spacing: 1px;
}
.kv {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 7px 0; border-bottom: 1px solid var(--rule-2);
  font-size: 13.5px;
}
.kv .k { color: var(--ink-4); flex: 0 0 auto; }
.bar { height: 3px; background: var(--rule-2); overflow: hidden; margin: 2px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--celadon-deep); }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(35, 38, 43, .42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px; overflow-y: auto; z-index: 50;
}
.modal {
  background: var(--leaf);
  border: 1px solid var(--rule);
  border-radius: 3px;
  max-width: 640px; width: 100%;
  padding: 28px 30px; position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  border: 1px solid var(--rule); background: var(--leaf-2); border-radius: 2px;
  width: 30px; height: 30px; cursor: pointer;
  font-size: 14px; color: var(--ink-3); line-height: 1;
}
.modal-close:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.modal h2 {
  margin: 0 0 2px;
  font-family: var(--song); font-size: 27px; font-weight: 400; letter-spacing: 2px;
}
.modal .prov { color: var(--ink-3); font-size: 13px; margin-bottom: 4px; }

/* ---------- 本页榜单导航 ---------- */
.toc {
  position: sticky; top: var(--nav-h); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 20px;
  background: rgba(237, 234, 227, .96);
  border-bottom: 1px solid var(--rule);
  padding: 9px 28px; margin: 0 auto;
  max-width: 1140px;
}
.toc-label { font-size: 12px; color: var(--ink-4); }
.toc-item {
  border: 0; background: transparent; color: var(--ink-3);
  padding: 2px 0; cursor: pointer;
  font-family: var(--hei); font-size: 12.5px; white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.toc-item:hover { color: var(--ink); border-bottom-color: var(--ink-4); }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 40px;
  padding: 26px 0 56px;
  color: var(--ink-3); font-size: 12.5px;
  scroll-margin-top: calc(var(--nav-h) + 8px);
}
.site-footer p { margin: 6px 0; max-width: 74em; }
.empty { text-align: center; color: var(--ink-4); padding: 40px; }

/* ---------- 回到顶部 ---------- */
#toTop {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--cinnabar); border-radius: 2px;
  background: var(--cinnabar); color: var(--leaf);
  cursor: pointer; font-family: var(--song); font-size: 17px; line-height: 1;
}
#toTop span { display: none; }
#toTop.show { display: flex; }
#toTop:hover { background: #8f2a20; }

/* ---------- 键盘焦点 ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, th:focus-visible {
  outline: 2px solid var(--celadon-deep);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .hero { padding: 60px 0 56px; }
  .hero-title { font-size: 40px; letter-spacing: 3px; }
  .hero-seal { right: 24px; width: 68px; height: 68px; font-size: 24px; }
  .cat-wrap { grid-template-columns: repeat(2, 1fr); }
  .cat-card:nth-child(odd) { border-left: 0; padding-left: 28px; }
  .cat-card:nth-child(even) { padding-right: 28px; }
  .cat-card:nth-child(n+3) { border-top: 1px solid var(--rule-2); }
  .cat-card:nth-child(n+3).active { border-top-color: var(--ink); }
}
@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 18px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 15px; letter-spacing: 0; white-space: nowrap; }
  /* 窄屏只留「返回首页」和「榜单」：顶部有回顶按钮，数据说明在页脚 */
  .nav-link[href="#top"], .nav-link[href="#disclaimer"] { display: none; }
  .nav-link { padding: 6px 7px; font-size: 13px; }
  .nav-link.home-link { margin-right: 2px; }
  .hero { padding: 44px 0 44px; }
  .hero-title { font-size: 31px; letter-spacing: 2px; }
  .hero-seal { display: none; }
  .hero-lede { font-size: 14.5px; }
  .cat-wrap { grid-template-columns: 1fr; }
  .cat-card { border-left: 0; border-top: 1px solid var(--rule-2); padding: 14px 18px; }
  .cat-card:first-child { border-top: 2px solid transparent; padding-left: 18px; }
  .cat-card:last-child { padding-right: 18px; }
  .card { padding: 18px 16px; }
  .table-scroll { margin: 0 -16px; padding: 0 16px; }
  th, td { padding: 9px 10px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat, .stat:nth-child(odd) { border-left: 0; padding-left: 0; border-bottom: 1px solid var(--rule-2); }
  .modal { padding: 22px 18px; }
  .toc { padding: 9px 18px; gap: 0 14px; }
}
