/* ============================================================
   AI 资讯门户 · 高级浅色杂志风（Editorial Premium）
   云白底 + 衬线大标题 + 柔和层叠阴影 + 靛蓝/琥珀点缀
   ============================================================ */
:root {
  --primary: #4f46e5;
  --primary-deep: #3730a3;
  --primary-soft: #eef2ff;
  --accent: #b45309;      /* 精选 · 琥珀 */
  --gold: #d97706;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #a1a1aa;
  --line: #e8e6e3;
  --line-soft: #f1efec;
  --bg: #faf9f8;
  --card: #ffffff;
  --hot: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .04), 0 1px 3px rgba(24, 24, 27, .05);
  --shadow-md: 0 1px 2px rgba(24, 24, 27, .04), 0 10px 28px -8px rgba(24, 24, 27, .1);
  --shadow-lg: 0 2px 4px rgba(24, 24, 27, .04), 0 20px 48px -12px rgba(24, 24, 27, .14);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", SimSun, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1100px 420px at 50% -160px, #edeffc 0%, rgba(250, 249, 248, 0) 70%),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
button { font-family: inherit; cursor: pointer; }
::selection { background: color-mix(in srgb, var(--primary) 15%, #fff); color: var(--primary-deep); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
mark { background: #fdeebc; color: inherit; border-radius: 3px; padding: 0 2px; }

/* ================= Header ================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--primary) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.brand-name em { font-style: normal; color: var(--primary); }
.brand-sub { font-size: 11px; color: var(--ink-3); margin-top: -3px; letter-spacing: .3px; }

/* 导航铺满顶栏剩余宽度，不出现滚动条：窄屏由下方断点分级收窄，≤780px 整体隐藏 */
.main-nav { display: flex; align-items: center; flex: 1; min-width: 0; justify-content: space-between; }
.main-nav a {
  padding: 8px 12px; border-radius: 8px;
  font-size: 14px; color: var(--ink-2); white-space: nowrap;
  transition: color .18s, background-color .18s;
}
.main-nav a:hover { background: #f4f3f8; color: var(--primary); }
.main-nav a.active { color: var(--primary); font-weight: 700; background: var(--primary-soft); }

/* 搜索框：位于副导航条右侧（热词条左、搜索右），不占顶栏宽度 */
.header-search { position: relative; flex-shrink: 0; }
.header-search input {
  width: 210px; height: 34px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0 14px 0 34px; font-size: 13px; outline: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.5' y2='16.5'/%3E%3C/svg%3E") 12px center no-repeat;
  box-shadow: var(--shadow-sm);
  transition: width .25s, border-color .2s, box-shadow .2s;
}
.header-search input::placeholder { color: var(--ink-3); }
.header-search input:focus {
  width: 260px; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent);
}
.gh-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  height: 37px; padding: 0 17px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  transition: background-color .18s, transform .18s, box-shadow .18s;
}
.gh-btn:hover { background: var(--primary); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--primary) 50%, transparent); }

/* ================= 热词条 + 搜索 ================= */
.subnav {
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.subnav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  height: 46px;
}
/* 热词条占满剩余宽度，超宽时自身横向滑动且不显示滚动条；搜索框固定在右 */
.subnav-tags {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.subnav-tags::-webkit-scrollbar { display: none; }
.subnav .tag-link {
  font-size: 12.5px; color: var(--ink-3); padding: 3px 10px;
  border-radius: 999px; border: 1px dashed transparent; white-space: nowrap;
}
.subnav .tag-link:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* ================= 顶栏「专题」入口（悬停下拉） ================= */
/* 专题栏目（算法题解 / 后端技术 / 一叶一世界等）不再平铺顶栏，收进这个入口；
   菜单内容随渲染生成（专题可经 MCP 运行期新增），悬停与键盘聚焦都会展开 */
.nav-topic { position: relative; }
.nav-topic-link { display: inline-flex; align-items: center; gap: 5px; }
.ntm-caret {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4.5px solid currentColor; opacity: .5; transition: transform .18s;
}
.nav-topic:hover .ntm-caret, .nav-topic:focus-within .ntm-caret { transform: rotate(180deg); }
/* 鼠标从链接移到菜单之间有一小段间隙，用透明块把 hover 桥接起来（高度与菜单偏移一致） */
.nav-topic::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }
.nav-topic-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; z-index: 140;
  min-width: 232px; padding: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(-5px);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.nav-topic:hover .nav-topic-menu, .nav-topic:focus-within .nav-topic-menu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.nav-topic-menu .ntm-head { padding: 4px 10px 6px; font-size: 10.5px; letter-spacing: .18em; color: var(--ink-3); }
.nav-topic-menu .ntm-item {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 8px 10px; border-radius: 9px; font-size: 13.5px; color: var(--ink);
}
.nav-topic-menu .ntm-item:hover { background: var(--primary-soft); color: var(--primary); }
.nav-topic-menu .ntm-item .ntm-t { font-weight: 600; }
.nav-topic-menu .ntm-item .ntm-c { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.nav-topic-menu .ntm-empty { padding: 8px 10px; font-size: 12.5px; color: var(--ink-3); }
.nav-topic-menu .ntm-all {
  display: block; margin-top: 4px; padding: 9px 10px 7px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-3); text-align: center;
}
.nav-topic-menu .ntm-all:hover { color: var(--primary); }

/* ================= 主题色入口（右上角，悬停展开色板） ================= */
/* 选择只绑定在浏览器本地（localStorage），服务端不存任何偏好；
   无 JS 访客保持默认靛蓝。浮层用 :hover / :focus-within 展开，与「专题」下拉同款交互 */
.theme-ctl { position: relative; flex-shrink: 0; }
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 37px; height: 37px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2);
  transition: color .18s, border-color .18s, transform .18s;
}
.theme-btn:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); transform: translateY(-1px); }
.theme-ctl::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.theme-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 140;
  width: 212px; padding: 12px 12px 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(-5px);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.theme-ctl:hover .theme-pop, .theme-ctl:focus-within .theme-pop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.tp-head { padding: 0 2px 9px; font-size: 10.5px; letter-spacing: .18em; color: var(--ink-3); }
.tp-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.tp-swatch {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px;
  background: var(--sw); border: 0; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.tp-swatch:hover { transform: translateY(-2px); box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--sw) 55%, transparent); }
.tp-swatch.on { outline: 2px solid var(--sw); outline-offset: 2px; }
.tp-swatch.on::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.tp-custom {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 11px; padding: 9px 2px 0; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.tp-custom input {
  width: 34px; height: 26px; padding: 0; border: 1px solid var(--line);
  border-radius: 7px; background: none; cursor: pointer;
}
.tp-reset {
  display: block; width: 100%; margin-top: 9px; padding: 8px 0 1px;
  border: 0; border-top: 1px solid var(--line-soft); background: none;
  font-size: 12px; color: var(--ink-3); cursor: pointer;
}
.tp-reset:hover { color: var(--primary); }
@media (max-width: 780px) { .theme-pop { right: -60px; } }

/* ================= 页面骨架 ================= */
.page { padding: 24px 0 64px; min-height: 60vh; }
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 324px;
  gap: 24px; align-items: start;
}
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

/* ================= 编辑推荐横排（日期块卡片） ================= */
.featured-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px; overflow: hidden;
}
@media (max-width: 1000px) { .featured-strip { grid-template-columns: repeat(2, 1fr); } }
.featured-cell {
  display: flex; gap: 13px; padding: 18px 18px;
  border-right: 1px solid var(--line-soft); cursor: pointer;
  transition: background-color .18s;
  min-width: 0; /* 防止 nowrap 内容把 1fr 轨道撑爆 */
}
.featured-cell:last-child { border-right: 0; }
.featured-cell:hover { background: #fbfaff; }
.date-block {
  flex-shrink: 0; width: 52px; text-align: center;
  border-right: 1px solid var(--line-soft); padding-right: 12px;
}
.date-block .d {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.2;
}
.date-block .m { font-size: 11px; color: var(--ink-3); letter-spacing: .4px; }
.featured-cell .t {
  font-size: 13.5px; font-weight: 650; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.featured-cell .s {
  margin-top: 5px; font-size: 12px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ================= 焦点 Banner ================= */
.hero-banner {
  display: block;
  position: relative; border-radius: 18px; overflow: hidden;
  background:
    radial-gradient(900px 380px at 92% -60%, color-mix(in srgb, var(--primary) 55%, transparent), transparent 62%),
    radial-gradient(720px 320px at -6% 140%, color-mix(in srgb, var(--primary) 30%, transparent), transparent 60%),
    linear-gradient(115deg,
      color-mix(in srgb, var(--primary) 25%, #0d1024) 0%,
      color-mix(in srgb, var(--primary) 50%, #0d1024) 32%,
      color-mix(in srgb, var(--primary) 85%, #0d1024) 66%,
      color-mix(in srgb, var(--primary) 78%, #9333ea) 100%);
  color: #fff; padding: 38px 40px 40px; cursor: pointer;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.hero-banner .hb-chip {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .5px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .32);
  backdrop-filter: blur(4px);
  padding: 3px 14px; border-radius: 999px; margin-bottom: 16px;
}
.hero-banner h2 {
  font-family: var(--serif);
  font-size: 28px; line-height: 1.42; letter-spacing: .3px; font-weight: 700;
  max-width: 780px;
}
.hero-banner .hb-summary {
  margin-top: 12px; max-width: 720px; color: rgba(255, 255, 255, .86);
  font-size: 13.5px; line-height: 1.8;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-banner .hb-meta { margin-top: 18px; font-size: 12.5px; color: rgba(255, 255, 255, .72); display: flex; gap: 18px; }
.hero-banner .hb-go {
  position: absolute; right: 34px; bottom: 32px;
  background: #fff; color: var(--primary-deep);
  font-size: 13px; font-weight: 700; padding: 9px 20px; border-radius: 999px;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .35);
  transition: transform .18s;
}
.hero-banner:hover .hb-go { transform: translateX(2px); }

/* ================= 专题栏目横幅（一叶一世界等，颜色随 --topic 注入） ================= */
.topic-hero {
  --topic: #00897b;
  position: relative; border-radius: 18px; overflow: hidden;
  background:
    radial-gradient(880px 360px at 94% -70%, color-mix(in srgb, var(--topic) 52%, transparent), transparent 62%),
    radial-gradient(700px 320px at -8% 150%, color-mix(in srgb, var(--topic) 30%, transparent), transparent 60%),
    linear-gradient(115deg, #10261f 0%, #143d33 45%, color-mix(in srgb, var(--topic) 82%, #06281f) 100%);
  color: #fff; padding: 34px 40px 36px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.topic-hero .th-chip {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .5px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .32);
  padding: 3px 14px; border-radius: 999px; margin-bottom: 14px;
}
.topic-hero h2 {
  font-family: var(--serif);
  font-size: 30px; letter-spacing: 1px; font-weight: 700;
}
.topic-hero .th-tagline {
  margin-top: 8px; font-size: 15px; font-weight: 600; letter-spacing: .3px;
  color: color-mix(in srgb, #fff 88%, var(--topic));
}
.topic-hero .th-desc {
  margin-top: 10px; max-width: 720px; font-size: 13px; line-height: 1.85;
  color: rgba(255, 255, 255, .84);
}
.topic-hero .th-meta { margin-top: 16px; font-size: 12px; color: rgba(255, 255, 255, .62); letter-spacing: .3px; }
@media (max-width: 1000px) { .topic-hero { padding: 26px 24px 28px; } .topic-hero h2 { font-size: 24px; } }

/* ================= 专题总览页（/topics 卡片网格） ================= */
.topic-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-top: 4px;
}
@media (max-width: 1000px) { .topic-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .topic-cards { grid-template-columns: 1fr; } }
.topic-card {
  --topic: var(--primary);
  display: flex; flex-direction: column; gap: 7px;
  padding: 20px 22px 16px;
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--topic);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.topic-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--topic) 38%, var(--line));
}
.tc-head { display: flex; align-items: center; justify-content: space-between; }
.tc-chip {
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  color: var(--topic); background: color-mix(in srgb, var(--topic) 9%, transparent);
  padding: 3px 10px; border-radius: 999px;
}
.tc-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.topic-card h3 { font-family: var(--serif); font-size: 21px; letter-spacing: .5px; }
.tc-tagline { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--topic) 80%, var(--ink)); }
.tc-desc {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.8;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-latest { display: flex; flex-direction: column; gap: 5px; margin-top: 3px; }
.tc-latest li {
  position: relative; padding-left: 13px; font-size: 12.5px; color: var(--ink-2);
  list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-latest li::before {
  content: ''; position: absolute; left: 2px; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--topic); opacity: .55;
}
.tc-empty { font-size: 12.5px; color: var(--ink-3); }
.tc-foot {
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-3);
}
.topic-card:hover .tc-foot { color: var(--primary); }
.topics-others { margin-top: 20px; font-size: 13px; color: var(--ink-3); }
.topics-others a { margin-left: 10px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.topics-others a:hover { color: var(--primary); border-color: var(--primary); }

/* ================= 区块 ================= */
.section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
}
.section-head .bar {
  width: 4px; height: 17px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #fff));
}
.section-head h3 { font-size: 16.5px; font-weight: 750; letter-spacing: .2px; }
.section-head .en {
  font-size: 10.5px; color: var(--ink-3); font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; transform: translateY(1px);
}
.section-head .more { margin-left: auto; font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.section-head .more:hover { color: var(--primary); }

/* ================= 文章列表行 ================= */
.article-rows { padding: 6px 14px; }
.article-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 14px; margin: 0 -14px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 12px; cursor: pointer;
  transition: background-color .18s;
}
.article-row:hover { background: #f8f8fd; }
.article-row:last-child { border-bottom: 0; }
.article-row:hover .ar-title { color: var(--primary); }
.ar-body { min-width: 0; flex: 1; }
.ar-title { font-size: 16px; font-weight: 650; line-height: 1.55; letter-spacing: .1px; transition: color .15s; }
.ar-summary {
  margin-top: 6px; font-size: 13px; color: var(--ink-3); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ar-meta { margin-top: 8px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.cat-chip {
  font-size: 11.5px; font-weight: 650;
  padding: 1.5px 10px; border-radius: 999px; letter-spacing: .3px;
}

/* ================= 右侧栏 ================= */
.side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 86px; }
@media (max-width: 1000px) { .side { position: static; } }

.rank-list { padding: 8px 20px 14px; }
.rank-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f6f5f2; cursor: pointer; }
.rank-item:last-child { border-bottom: 0; }
.rank-no {
  flex-shrink: 0; width: 21px; height: 21px; margin-top: 3px;
  border-radius: 6px; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f4f3f1; color: var(--ink-3);
}
.rank-no.top1 { background: #fdf1d8; color: #b45309; }          /* 金 */
.rank-no.top2 { background: #eceef2; color: #5b6472; }          /* 银 */
.rank-no.top3 { background: #fae7d8; color: #9a3412; }          /* 铜 */
.rank-item .rt {
  font-size: 13.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rank-item:hover .rt { color: var(--primary); }

.flash-list { padding: 8px 20px 14px; }
.flash-item { display: flex; gap: 11px; padding: 9px 0; cursor: pointer; }
.flash-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; margin-top: 8px; }
.flash-item .ft {
  font-size: 13.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.flash-item:hover .ft { color: var(--primary); }
.flash-item .fm { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

.hot-tabs { display: flex; gap: 2px; margin-left: auto; background: #f2f1ef; border-radius: 999px; padding: 2px; }
.hot-tabs a, .hot-tabs span { font-size: 12px; padding: 2px 12px; border-radius: 999px; color: var(--ink-3); cursor: pointer; transition: color .15s; }
.hot-tabs a.active, .hot-tabs span.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }

/* 侧栏「专题」板块：顶栏窄屏隐藏后这里仍是专题入口 */
.side-topics { display: flex; flex-direction: column; padding: 8px 20px 14px; }
.st-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f6f5f2; }
.st-item:last-child { border-bottom: 0; }
.st-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.st-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13.5px; font-weight: 600;
}
.st-title em { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.st-tagline { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-item:hover .st-title { color: var(--primary); }

.gh-card {
  border-radius: var(--radius); padding: 22px;
  background: linear-gradient(140deg, #1c1c21 0%, #26243f 70%, #373081 160%);
  color: #fff; box-shadow: var(--shadow-md);
}
.gh-card h4 { font-size: 15.5px; margin-bottom: 7px; letter-spacing: .3px; }
.gh-card p { font-size: 12.5px; color: rgba(255, 255, 255, .72); margin-bottom: 15px; line-height: 1.75; }
.gh-card a {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; font-size: 12.5px; padding: 6px 15px; border-radius: 999px;
  transition: background-color .18s, color .18s;
}
.gh-card a:hover { background: #fff; color: var(--ink); }

/* ================= 文章详情页 ================= */
.article-page {
  max-width: 820px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 42px 48px 44px;
}
.crumbs { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; letter-spacing: .2px; }
.crumbs a:hover { color: var(--primary); }
.article-page h1 {
  font-family: var(--serif);
  font-size: 30px; line-height: 1.42; letter-spacing: .2px; font-weight: 700;
  margin-bottom: 16px;
}
.article-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3);
  padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); margin-bottom: 24px;
}
.article-content p { font-size: 15.5px; line-height: 1.95; color: #27272a; margin: 15px 0; text-align: justify; }
.article-tags { margin-top: 26px; display: flex; gap: 8px; flex-wrap: wrap; }
.article-tags a, .article-tags span {
  font-size: 12px; color: var(--ink-2); background: #f4f3f1;
  border: 1px solid var(--line-soft);
  padding: 3px 13px; border-radius: 999px;
}
.article-tags a:hover { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.article-source {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 24px; padding: 10px 24px;
  background: var(--primary); color: #fff; border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--primary) 45%, transparent);
  transition: background-color .18s, transform .18s, box-shadow .18s;
}
.article-source:hover { background: var(--primary-deep); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px -6px color-mix(in srgb, var(--primary-deep) 50%, transparent); }
.back-blog { margin-left: 14px; font-size: 13px; color: var(--ink-3); }
.back-blog:hover { color: var(--primary); }
.related { margin-top: 32px; border-top: 1px solid var(--line-soft); padding-top: 20px; }
.related h4 { font-size: 15px; margin-bottom: 10px; font-weight: 700; }
.related .rk { display: block; padding: 7px 0; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.related .rk:hover { color: var(--primary); }
.related .rk::before { content: "· "; color: var(--primary); font-weight: 800; }

/* ================= 搜索结果页 ================= */
.page-title {
  font-family: var(--serif);
  font-size: 24px; margin-bottom: 14px; letter-spacing: .2px;
}
.page-title em { font-style: normal; color: var(--primary); }
.result-count { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }

.empty { text-align: center; padding: 80px 0; color: var(--ink-3); }
.empty .icon { font-size: 40px; margin-bottom: 12px; }

/* ================= Footer（深色收尾） ================= */
.site-footer {
  background: #17171a;
  padding: 38px 0 46px; margin-top: 40px;
  color: #8e8e99; font-size: 13px; text-align: center; line-height: 2;
}
.site-footer .flinks {
  display: flex; justify-content: center; gap: 26px; margin-bottom: 12px; flex-wrap: wrap;
}
.site-footer .flinks a { color: #d4d4d8; font-size: 13.5px; letter-spacing: .3px; }
.site-footer .flinks a:hover { color: #fff; }
.site-footer a { color: #a1a1aa; }
.site-footer a:hover { color: #e4e4e7; }

/* ================= 响应式 ================= */
/* 顶栏宽度预算：栏目必须完整放下且不出滚动条，按断点分级收窄链接与间隙 */
@media (max-width: 1140px) {
  .header-inner { gap: 18px; }
  .main-nav a { padding: 8px 10px; font-size: 13.5px; }
}
@media (max-width: 1000px) {
  .gh-btn { display: none; }
  .main-nav a { padding: 8px 8px; font-size: 13px; }
}
@media (max-width: 780px) {
  .header-inner { gap: 12px; padding: 0 16px; }
  .main-nav { display: none; }
  .subnav-inner { gap: 10px; padding: 0 16px; }
  .header-search input { width: 150px; }
  .header-search input:focus { width: 190px; }
  .wrap { padding: 0 16px; }
  .featured-strip { grid-template-columns: 1fr; }
  .featured-cell { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .featured-cell:last-child { border-bottom: 0; }
  .hero-banner { padding: 26px 24px 28px; }
  .hero-banner h2 { font-size: 21px; }
  .hero-banner .hb-go { position: static; display: inline-block; margin-top: 16px; }
  .article-page { padding: 28px 22px 30px; border-radius: var(--radius); }
  .article-page h1 { font-size: 24px; }
  .section { border-radius: 12px; }
}

/* ================= SSR：卡片级链接（<a> 代替 <div>，避免 hover 变色波及整卡） ================= */
a.hero-banner, a.hero-banner:hover { color: #fff; }
a.featured-cell, a.article-row, a.rank-item, a.flash-item { color: inherit; }
a.featured-cell:hover, a.article-row:hover, a.rank-item:hover, a.flash-item:hover { color: inherit; }

/* ================= 分页条 ================= */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 16px 20px 20px; border-top: 1px solid var(--line-soft);
}
.pager .pg {
  font-size: 13.5px; color: var(--ink-2);
  padding: 8px 20px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  box-shadow: var(--shadow-sm);
  transition: color .18s, border-color .18s, transform .18s;
}
.pager .pg:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.pager .pg-info { font-size: 12.5px; color: var(--ink-3); letter-spacing: .3px; }

/* ================= 正文 Markdown 排版 ================= */
.article-content.md h1, .article-content.md h2, .article-content.md h3,
.article-content.md h4, .article-content.md h5, .article-content.md h6 {
  color: var(--ink); line-height: 1.5; margin: 28px 0 12px; font-weight: 700;
}
.article-content.md h1 { font-family: var(--serif); font-size: 23px; }
.article-content.md h2 {
  font-family: var(--serif); font-size: 20px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.article-content.md h3 { font-size: 17.5px; }
.article-content.md h4, .article-content.md h5, .article-content.md h6 { font-size: 15.5px; }
.article-content.md a { color: var(--primary); }
.article-content.md a:hover { text-decoration: underline; text-underline-offset: 3px; }
.article-content.md strong { font-weight: 700; color: var(--ink); }
.article-content.md ul, .article-content.md ol { margin: 14px 0; padding-left: 26px; }
.article-content.md ul { list-style: disc; }
.article-content.md ol { list-style: decimal; }
.article-content.md li { font-size: 15px; line-height: 1.9; color: #27272a; margin: 6px 0; }
.article-content.md li::marker { color: var(--primary); }
.article-content.md blockquote {
  margin: 18px 0; padding: 12px 20px;
  border-left: 3px solid var(--primary); background: var(--primary-soft);
  color: var(--ink-2); border-radius: 0 10px 10px 0;
}
.article-content.md blockquote p { margin: 4px 0; font-size: 14.5px; }
.article-content.md code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px; background: #f4f3f1; color: #b3376a;
  padding: 2px 6px; border-radius: 5px;
}
.article-content.md pre {
  margin: 18px 0; padding: 18px 20px; overflow-x: auto;
  background: #16161a; border-radius: 12px; line-height: 1.75;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.article-content.md pre code { background: none; color: #dcd6f7; padding: 0; font-size: 13px; }

/* 代码高亮（highlight.js）：token 配色贴合深底 #16161a，正文/源码仍是默认淡紫 */
.article-content.md .hljs-comment, .article-content.md .hljs-quote { color: #7f848e; font-style: italic; }
.article-content.md .hljs-keyword, .article-content.md .hljs-selector-tag, .article-content.md .hljs-literal,
.article-content.md .hljs-section, .article-content.md .hljs-doctag, .article-content.md .hljs-type,
.article-content.md .hljs-name, .article-content.md .hljs-strong { color: #c678dd; }
.article-content.md .hljs-string, .article-content.md .hljs-regexp, .article-content.md .hljs-addition,
.article-content.md .hljs-attribute, .article-content.md .hljs-meta .hljs-string { color: #98c379; }
.article-content.md .hljs-number, .article-content.md .hljs-symbol, .article-content.md .hljs-bullet,
.article-content.md .hljs-link, .article-content.md .hljs-deletion { color: #d19a66; }
.article-content.md .hljs-title, .article-content.md .hljs-title.function_, .article-content.md .hljs-built_in,
.article-content.md .hljs-builtin-name { color: #61afef; }
.article-content.md .hljs-title.class_, .article-content.md .hljs-attr, .article-content.md .hljs-variable,
.article-content.md .hljs-template-variable, .article-content.md .hljs-params,
.article-content.md .hljs-selector-class, .article-content.md .hljs-selector-id { color: #e5c07b; }
.article-content.md .hljs-meta, .article-content.md .hljs-tag { color: #56b6c2; }
.article-content.md .hljs-emphasis { font-style: italic; }
.article-content.md table {
  width: 100%; margin: 18px 0; border-collapse: collapse; font-size: 13.5px;
}
.article-content.md th, .article-content.md td {
  border: 1px solid var(--line); padding: 9px 13px; text-align: left;
}
.article-content.md th { background: #f7f6f4; font-weight: 650; }
.article-content.md img { max-width: 100%; border-radius: 10px; margin: 10px 0; }
.article-content.md hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

/* ================= 正文图表（mermaid / SVG） ================= */
/* SVG 以 <img> 内嵌（见 server/markdown.ts）：居中、不撑破正文，宽度由自身尺寸或 viewBox 决定 */
.article-content.md img.svg-embed { display: block; margin: 16px auto; max-width: 100%; height: auto; }
/* mermaid 画出来的图表：居中，宽图横向滚动而不是撑破布局。
   mermaid 已被要求输出自然尺寸（见 public/mermaid.js 的 useMaxWidth），这里放开宽度上限
   按自然尺寸渲染 —— 否则 2900px 的树会被压进正文栏、字号只剩 3px 看不清；手机上仍整幅缩放 */
.article-content.md .mermaid-figure { margin: 18px 0; text-align: center; overflow: auto; }
.article-content.md .mermaid-figure > svg { width: auto; max-width: none; height: auto; }
@media (max-width: 780px) {
  .article-content.md .mermaid-figure > svg { width: 100%; max-width: 100%; }
}
/* 语法有误或脚本不可用：保留源码（pre 沿用代码块样式），上方加一行说明 */
.article-content.md pre.mermaid-error::before {
  content: '图表无法渲染，以下为 mermaid 源码';
  display: block; margin-bottom: 8px;
  color: #ffb86b; font-size: 12px; font-family: var(--sans);
}

/* ================= 访问量统计（侧栏板块 + 数据统计页） ================= */
.visit-stats { padding: 14px 20px 16px; }
.vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vs-cell {
  background: #f8f8fd; border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 9px 11px;
}
.vs-num { font-size: 19px; font-weight: 800; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.vs-label { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.vs-hot { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 9px; }
.vs-hot-title { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.vs-hot-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.vs-hot-item .vh-no {
  flex-shrink: 0; width: 16px; height: 16px; border-radius: 4px; background: #f4f3f1;
  color: var(--ink-3); font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.vs-hot-item .vh-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-hot-item:hover .vh-t { color: var(--primary); }
.vs-hot-item .vh-p { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.vs-more { display: inline-block; margin-top: 10px; font-size: 12.5px; color: var(--primary); }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px 20px;
}
.stat-card .n { font-size: 30px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-card .l { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 760px) { .stat-cards { grid-template-columns: 1fr 1fr; } }

.trend { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 18px 20px 0; }
.trend-col {
  flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.trend-bar {
  width: 100%; max-width: 34px; min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #6366f1, #a5b4fc);
}
.trend-x { font-size: 10.5px; color: var(--ink-3); margin-top: 6px; white-space: nowrap; }
.trend-legend { padding: 0 20px 16px; font-size: 12px; color: var(--ink-3); }

.stat-table { width: 100%; border-collapse: collapse; }
.stat-table th, .stat-table td {
  text-align: left; padding: 10px 20px;
  border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.stat-table th {
  font-size: 11.5px; color: var(--ink-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.stat-table tbody tr:last-child td { border-bottom: 0; }
.stat-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.stat-table td a:hover { color: var(--primary); }
.stat-note { font-size: 12.5px; color: var(--ink-3); padding: 16px 20px 4px; line-height: 1.8; }

/* ================= 原创角标 ================= */
.origin-chip {
  display: inline-block; vertical-align: 1px;
  margin-right: 7px; padding: 1px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px; white-space: nowrap;
  color: #b45309; background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa; border-radius: 999px;
}
.featured-cell .t .origin-chip, .rank-item .rt .origin-chip {
  font-size: 10px; padding: 0 6px; margin-right: 5px;
}
.ar-comments { font-variant-numeric: tabular-nums; }

/* 浏览数据（每篇文章的浏览量 PV + 独立访客 UV）：列表卡片、焦点 Banner、详情页 meta 行共用 */
.visit-chip { font-variant-numeric: tabular-nums; white-space: nowrap; }
.article-meta .visit-chip { color: var(--primary); }
.featured-cell .fc-stat { margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.hero-banner .hb-meta .visit-chip { color: rgba(255, 255, 255, .86); }

/* ================= 匿名留言（仅本站原创文章） ================= */
.comments { margin-top: 34px; border-top: 1px solid var(--line-soft); padding-top: 24px; }
.comments .section-head { padding: 0 0 14px; border-bottom: 1px solid var(--line-soft); }
.comment-notice {
  margin-top: 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); border: 1px solid #dbe2fe;
  color: var(--primary-deep); font-size: 13px;
}
.comment-form { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.comment-form .cf-nick, .comment-form .cf-text {
  width: 100%; max-width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: #fbfbfa; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 13px; transition: border-color .15s, background-color .15s;
}
.comment-form .cf-nick { max-width: 260px; }
.comment-form .cf-text { resize: vertical; min-height: 78px; line-height: 1.75; }
.comment-form .cf-nick:focus, .comment-form .cf-text:focus { outline: none; border-color: var(--primary); background: #fff; }
.cf-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cf-tip { font-size: 12px; color: var(--ink-3); }
.cf-submit {
  margin-left: auto; padding: 9px 24px; border: 0; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 650;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--primary) 45%, transparent);
  transition: background-color .18s, transform .18s;
}
.cf-submit:hover { background: var(--primary-deep); transform: translateY(-1px); }
.comment-list { margin-top: 22px; }
.comment-item { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.comment-item:first-child { border-top: 0; }
.ci-head { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.ci-nick { font-weight: 700; color: var(--ink-2); }
.ci-time { color: var(--ink-3); }
.ci-body {
  margin-top: 5px; font-size: 14px; line-height: 1.8; color: #27272a;
  white-space: pre-wrap; word-break: break-word;
}
@media (max-width: 640px) { .cf-submit { margin-left: 0; width: 100%; } }
