:root {
  --bg: #fdf9f5;
  --surface: #ffffff;
  --surface-2: #fff8f3;
  --ink: #2e241f;
  --ink-2: #7a6a5f;
  --ink-3: #a8968a;
  --line: #efe4da;
  --primary: #f04b27;
  --primary-600: #da3918;
  --primary-100: #ffdfd4;
  --primary-50: #fff1ec;
  --accent: #f09a0c;
  --new: #7c5cff;
  --steady: #a8968a;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(46, 36, 31, 0.04), 0 8px 24px rgba(46, 36, 31, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

h1, h2, h3 { line-height: 1.35; margin: 0 0 12px; font-weight: 700; }
h1 { font-size: 30px; letter-spacing: -0.5px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin: 0 0 14px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-2); font-size: 13px; }
.warn { color: var(--primary-600); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff; padding: 8px 14px; z-index: 99;
}
.skip:focus { left: 8px; top: 8px; }

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(253, 249, 245, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.logo-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px; overflow: hidden;
}
.logo-mark svg { display: block; width: 100%; height: 100%; }
.nav { display: flex; gap: 22px; font-size: 14px; color: var(--ink-2); }
.nav a:hover { color: var(--primary); }
.topbar-meta { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* Hero */
.hero { padding: 48px 0 28px; }
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 40px; align-items: center;
}
.hero h1 { font-size: 34px; margin-bottom: 12px; }
.lede { font-size: 15px; color: var(--ink-2); }
.stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  list-style: none; padding: 0; margin: 0;
}
.stats li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.stats strong { display: block; font-size: 22px; color: var(--primary); line-height: 1.2; }
.stats span { font-size: 12px; color: var(--ink-3); }
.updated { font-size: 13px; color: var(--ink-3); margin-top: 16px; }

/* 区块 */
.section { padding: 28px 24px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.section-head h2 { margin: 0; }
.section-lead { color: var(--ink-2); font-size: 14px; max-width: 840px; }
.more { font-size: 13px; color: var(--primary); white-space: nowrap; }

/* 卡片网格 */
.topgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
/* 首页综合热搜：三列自适应，避免宽屏面板过宽 */
.grid-hot { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
/* 防止长标题撑破轨道把内容挤出屏幕 */
.topgrid > *, .grid2 > *, .grid3 > *, .grid-hot > * { min-width: 0; max-width: 100%; }

.topcard, .panel, .catcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.topcard { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.topcard-head { display: flex; align-items: center; justify-content: space-between; }
.srcline { font-size: 12px; color: var(--ink-3); }
.topcard-title { font-size: 14px; margin: 0; line-height: 1.45; overflow-wrap: anywhere; }

.catcard { padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: transform 0.15s, border-color 0.15s; }
.catcard:hover { transform: translateY(-2px); border-color: var(--primary-100); }
.catcard h3 { margin: 0; }
.catcard p { margin: 0; font-size: 13px; color: var(--ink-2); }

/* 榜单列表 */
.panel { padding: 16px 18px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h3 { margin: 0; font-size: 15px; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.row { display: flex; gap: 10px; align-items: flex-start; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.row-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.rows-lg .row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rows-lg .row:last-child { border-bottom: 0; }
.rows-lg .row-title { font-size: 16px; }

.rank {
  flex: 0 0 auto; width: 24px; height: 24px; margin-top: 2px;
  display: grid; place-items: center;
  border-radius: 7px; background: var(--surface-2); color: var(--ink-3);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rank.top1 { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.rank.top2 { background: #ff7a45; color: #fff; }
.rank.top3 { background: #ffa940; color: #fff; }

.bar { display: block; width: 72px; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; flex: 0 0 auto; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; }
.hot { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.trend { padding: 1px 6px; border-radius: 5px; font-size: 11px; background: var(--surface-2); color: var(--steady); }
.trend.hot { background: var(--primary-50); color: var(--primary); }
.trend.up { background: var(--primary-50); color: var(--primary-600); }
.trend.new { background: #f1eefe; color: var(--new); }
.trend.boom { background: #fdecec; color: #d4380d; }

.chip { padding: 1px 7px; border-radius: 6px; background: var(--primary-50); font-size: 11px; }
.chip a { color: var(--primary-600); }

/* 正文 */
.prose { max-width: 900px; }
.prose h2 { margin-top: 28px; font-size: 20px; }
.prose ul { padding-left: 20px; color: var(--ink-2); }
.prose li { margin-bottom: 6px; }
.prose p { color: var(--ink-2); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--primary); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }

/* 页头与面包屑 */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-3); padding-top: 20px; }
.breadcrumb strong { color: var(--ink-2); font-weight: 500; }
.page-head { padding-top: 24px; padding-bottom: 8px; }

/* 404 */
.notfound { padding: 80px 24px; text-align: center; }
.nf-code { font-size: 96px; font-weight: 800; color: var(--primary-100); margin: 0; line-height: 1; }
.notfound h1 { margin-top: 8px; }
.notfound .lede { margin: 0 auto 24px; }
.nf-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 40px; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 14px;
}
.btn:hover { background: var(--primary-600); color: #fff; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary-100); }
.notfound .topgrid { text-align: left; grid-template-columns: repeat(4, 1fr); }

/* 页脚 */
.footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface-2); }
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr;
  gap: 26px; padding-top: 40px; padding-bottom: 28px;
}
.footer-brand { font-weight: 700; margin-bottom: 8px; }
.footer-desc { font-size: 13px; color: var(--ink-2); max-width: 340px; }
.footer-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--ink-2); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 24px;
  font-size: 12px; color: var(--ink-3);
}

@media (max-width: 1024px) {
  .topgrid { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-desc { max-width: none; }
  .notfound .topgrid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .wrap { padding: 0 16px; }
  .topbar-inner { gap: 12px; height: 56px; }
  .nav { display: none; }
  .topbar-meta { font-size: 11px; }
  .hero { padding: 28px 0 16px; }
  .hero h1 { font-size: 25px; }
  .lede { font-size: 14px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .section { padding: 24px 16px; }
  .topgrid { grid-template-columns: 1fr 1fr; }
  .notfound .topgrid { grid-template-columns: 1fr; }
  .nf-code { font-size: 72px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .bar { width: 60px; }
}

/* ---------- 搜索过滤 ---------- */
.filterbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search {
  flex: 1 1 260px; max-width: 420px;
  padding: 10px 14px; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.search::placeholder { color: var(--ink-3); }
.search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.row.hide { display: none; }
.hot.plain { font-size: 11px; color: var(--ink-3); }

/* ---------- 三列分类 ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------- 文章 ---------- */
.article { max-width: 860px; }
.article-meta { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.article-lead {
  font-size: 16px; color: var(--ink); background: var(--primary-50);
  border-left: 3px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px; margin-bottom: 8px;
}
.article h2 { margin-top: 34px; font-size: 21px; }
.article p, .article li { color: var(--ink-2); }
.article ul { padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article-nav { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- 表格 ---------- */
.tablewrap { overflow-x: auto; margin: 18px 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; font-size: 13px; color: var(--ink); white-space: nowrap; }
td { color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }

/* ---------- 站点地图 ---------- */
.sitemap-group { margin-bottom: 30px; }
.sitemap-group h2 { font-size: 17px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.plainlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.plainlist li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; color: var(--ink-2); }
.plainlist li .muted { text-align: right; flex: 0 0 auto; }

/* ---------- 404 搜索 ---------- */
.nf-search { display: flex; gap: 8px; justify-content: center; max-width: 440px; margin: 0 auto 18px; }
.nf-search .search { flex: 1; max-width: none; }
.nf-search .btn { border: 0; cursor: pointer; font-family: inherit; white-space: nowrap; }
.notfound .section-head { margin-top: 44px; text-align: left; }
.notfound .rows { text-align: left; max-width: 760px; margin: 0 auto; }
.nf-grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid3 { grid-template-columns: repeat(2, 1fr); }
  .nf-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .grid3 { grid-template-columns: 1fr; }
  .nf-grid { grid-template-columns: 1fr 1fr; }
  .nf-search { flex-direction: column; }
  .plainlist li { flex-direction: column; gap: 2px; }
  .plainlist li .muted { text-align: left; }
  th, td { padding: 9px 10px; font-size: 13px; }
}

/* ---------- 移动端导航 ---------- */
.nav-toggle { display: none; }
@media (max-width: 720px) {
  .nav-toggle {
    display: inline-block; margin-left: auto; padding: 6px 12px;
    font-size: 13px; font-family: inherit; color: var(--ink-2);
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  }
  .nav.open {
    display: flex; flex-wrap: wrap; gap: 14px;
    position: absolute; left: 0; right: 0; top: 56px;
    padding: 14px 16px; background: var(--surface);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .topbar-meta { display: none; }
}

/* ---------- 垂类榜单紧凑卡 ---------- */
.panel-mini { padding: 16px; display: flex; flex-direction: column; }
.panel-mini .panel-head { margin-bottom: 10px; }
.panel-mini .more { margin-top: auto; padding-top: 10px; }
.mini { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.mini li { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; line-height: 1.45; min-width: 0; }
.mini a { flex: 1 1 auto; min-width: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini a:hover { color: var(--primary); }
.mini-rank {
  flex: 0 0 auto; width: 16px; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.mini-rank.hot { color: var(--primary); }

/* ---------- 榜单大全分组 ---------- */
.group-block { margin: 26px 0 6px; }
.group-title {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 16px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.group-title .muted { font-size: 12px; font-weight: 400; }

/* ---------- 友情链接 ---------- */
.friendlinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.friendlinks a {
  padding: 9px 10px; text-align: center; font-size: 13.5px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.friendlinks a:hover { color: var(--primary); border-color: var(--primary-100); background: var(--primary-50); }

@media (max-width: 720px) {
  .friendlinks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .friendlinks a { font-size: 13px; padding: 8px; }
}

/* ---------- 页脚底栏 ---------- */
.footer-nav a { color: var(--ink-3); }
.footer-nav a:hover { color: var(--primary); }

@media (max-width: 1024px) {
  .grid3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .mini a { white-space: normal; }
}
