/* ============================================================
   main.css — 北美情报站前台样式
   深色 + 青绿主题（与 K 线图表颜色统一）
   ============================================================ */

:root {
  --green:        #26a69a;
  --green-dark:   #1d8a80;
  --green-light:  rgba(38,166,154,.08);
  --green-mid:    rgba(38,166,154,.18);
  --bg-body:      #0d1117;   /* 与 K 线图表页面背景一致 */
  --bg-surface:   #161b22;   /* 与 K 线图表 panel 背景一致 */
  --bg-card:      #1c2128;
  --bg-hover:     #21262d;
  --border:       #30363d;
  --border-light: #21262d;
  --text-primary: #e6edf3;
  --text-secondary:#e6edf3;
  --text-muted:   #ffffff;
  --red:          #ef5350;   /* K 线阴线色，用于危险提示 */
  --shadow-sm:    0 1px 4px rgba(0,0,0,.4);
  --shadow-md:    0 4px 20px rgba(0,0,0,.5);
  --shadow-hover: 0 6px 24px rgba(38,166,154,.2);
  --radius:       8px;
  --radius-sm:    6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
}
.site-body {
  display: flex; flex-direction: column; min-height: 100vh;
}
.site-main { flex: 1; padding: 20px 0 48px; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
img { max-width: 100%; }

/* site-main padding 由下面统一定义 */

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; gap: 20px; height: 56px;
}

.site-logo {
  display: flex; align-items: center; gap: 9px;
  color: var(--text-primary); font-size: 20px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0; text-decoration: none;
}
.site-logo:hover { color: var(--green); text-decoration: none; }
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--green); color: #fff;
  border-radius: 6px; font-size: 17px;
}
.logo-icon.small { width: 22px; height: 22px; font-size: 11px; border-radius: 4px; }

.header-search {
  flex: 1; max-width: 440px;
  display: flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 0 4px 0 12px;
  transition: border-color .2s;
}
.header-search:focus-within { border-color: var(--green); }
.search-icon { color: var(--text-muted); font-size: 16px; flex-shrink: 0; margin-right: 6px; }
.header-search input {
  flex: 1; border: none; background: transparent;
  font-size: 15.5px; color: var(--text-primary); outline: none; padding: 7px 0;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search button {
  padding: 5px 14px; background: var(--green); color: #fff;
  border: none; border-radius: 4px; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.header-search button:hover { background: var(--green-dark); }

.header-actions {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; margin-left: auto;
}
.user-name { font-size: 15px; color: var(--text-secondary); }
.btn-header-primary {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; background: var(--green); color: #fff;
  border-radius: 6px; font-size: 15px; font-weight: 500;
  text-decoration: none; transition: background .15s;
}
.btn-header-primary:hover { background: var(--green-dark); color: #fff; text-decoration: none; }
.btn-header-outline {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  border-radius: 6px; font-size: 15px;
  text-decoration: none; transition: border-color .15s, color .15s;
}
.btn-header-outline:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.btn-header-text { font-size: 15px; color: var(--text-muted); }
.btn-header-text:hover { color: var(--green); }

.mobile-menu-btn {
  display: none; background: none; border: none;
  font-size: 24px; color: var(--text-primary); cursor: pointer;
  margin-left: auto; padding: 4px;
}
.mobile-search { display: flex; gap: 8px; padding: 10px 0; }
.mobile-search input {
  flex: 1; padding: 7px 12px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-primary);
  border-radius: var(--radius-sm); font-size: 16px; outline: none;
}
.mobile-search input:focus { border-color: var(--green); }
.mobile-search button {
  padding: 7px 14px; background: var(--green); color: #fff;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
}

/* ============================================================
   Nav Tabs
   ============================================================ */
.site-nav-tabs {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.nav-tabs-inner { display: flex; }
.nav-tab {
  display: inline-flex; align-items: center;
  padding: 9px 18px; font-size: 17px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color .15s; text-decoration: none;
}
.nav-tab:hover { color: var(--text-primary); text-decoration: none; }
.nav-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 500; }

/* ============================================================
   Main Layout
   ============================================================ */
/* site-main padding 由上面统一定义 */

/* ---- 移动端分类 Tab 条（桌面隐藏）---- */
.mobile-cat-tabs {
  display: none;
}
.home-layout {
  display: grid;
  grid-template-columns: 190px 1fr 240px;
  gap: 16px; align-items: start;
}

/* ---- Sidebar Card ---- */
.sidebar-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sidebar-card-header {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 13px; font-weight: 700;
  color: var(--text-muted); border-bottom: 1px solid var(--border-light);
  text-transform: uppercase; letter-spacing: .07em;
}
.sidebar-card-header i { color: var(--green); }

.cat-list { list-style: none; padding: 6px 0; }

/* 一级分类 */
.cat-list-item > a {
  display: flex; align-items: center;
  padding: 8px 14px; font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  transition: background .12s, color .12s; text-decoration: none;
  gap: 6px;
}
.cat-list-item > a:hover { background: var(--green-light); color: var(--green); }
.cat-list-item > a.active {
  background: var(--green-light); color: var(--green);
  border-left: 3px solid var(--green);
}
.cat-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: 12px; background: var(--bg-card); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 1px 6px;
}

/* 二级分类容器：左侧竖线 + 缩进 */
.cat-sub-list {
  list-style: none;
  margin: 0 0 4px 20px;
  border-left: 2px solid var(--border);
  padding-left: 0;
}
.cat-sub-list li { position: relative; }
.cat-sub-list a {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px 5px 12px;
  font-size: 14px; font-weight: 400; color: var(--text-muted);
  transition: background .12s, color .12s; text-decoration: none;
}
.cat-sub-list a::before {
  content: ''; position: absolute; left: -2px; top: 50%;
  width: 8px; height: 2px; background: var(--border);
}
.cat-sub-list a:hover { color: var(--green); background: var(--green-light); }
.cat-sub-list a.active {
  color: var(--green); font-weight: 600;
  background: var(--green-light);
}
.cat-sub-list a.active::before { background: var(--green); }

.featured-list { list-style: none; padding: 4px 0; }
.featured-list li { border-bottom: 1px solid var(--border-light); }
.featured-list li:last-child { border-bottom: none; }
.featured-list a {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 14px; font-size: 14px; color: var(--text-secondary);
  line-height: 1.5; transition: background .12s, color .12s; text-decoration: none;
}
.featured-list a:hover { background: var(--green-light); color: var(--green); }
.featured-rank {
  flex-shrink: 0; width: 19px; height: 19px; font-size: 12px; font-weight: 700;
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  margin-top: 1px; background: var(--bg-hover); color: var(--text-muted);
}
.featured-rank.top { background: var(--green); color: #fff; }

/* ---- Category Banner (二级分类简介) ---- */
.cat-banner {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(38,166,154,.06) 100%);
  border: 1px solid rgba(38,166,154,.35);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.cat-banner::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}
.cat-banner-avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(38,166,154,.4); flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(38,166,154,.1);
}
.cat-banner-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(38,166,154,.15), rgba(38,166,154,.05));
  border: 2px solid rgba(38,166,154,.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 24px; color: var(--green);
  box-shadow: 0 0 0 4px rgba(38,166,154,.08);
}
.cat-banner-info { flex: 1; min-width: 0; }
.cat-banner-name {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 5px; letter-spacing: .01em;
}
.cat-banner-desc {
  font-size: 15px; color: var(--text-muted); line-height: 1.65;
}

/* ---- Category Overview Card ---- */
.cat-overview-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  margin-bottom: 14px; gap: 12px;
}
.cat-overview-sorts {
  display: flex; gap: 6px;
}
.cat-sort-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500; text-decoration: none;
  border: 1px solid var(--border); color: var(--text-secondary);
  background: var(--bg-hover); transition: all .15s;
}
.cat-sort-btn:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.cat-sort-btn.active {
  background: var(--green); color: #fff;
  border-color: var(--green);
}
.cat-sort-btn.active:hover { background: var(--green-dark); color: #fff; }
.cat-overview-stat {
  display: flex; align-items: baseline; gap: 4px; flex-shrink: 0;
}
.cat-overview-stat-num {
  font-size: 22px; font-weight: 800; color: var(--green); line-height: 1;
}
.cat-overview-stat-label {
  font-size: 14px; color: var(--text-muted);
}


/* ---- Featured Grid (1+N 大图主推布局) ---- */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 260px);
  gap: 8px;
  margin-bottom: 16px;
  height: auto;
}
/* 左：大图主推 */
.featured-main {
  position: relative; display: block; text-decoration: none;
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg-surface);
}
.featured-main-blur {
  position: absolute; inset: -12px;
  background-size: cover; background-position: center;
  filter: blur(20px) brightness(.6) saturate(1.1);
  transform: scale(1.05);
}
.featured-main > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .3s ease;
}
.featured-main:hover > img { transform: scale(1.03); }
.featured-main-nocover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--text-muted); opacity: .3;
}
.featured-main-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 36px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 100%);
}
.featured-main-title {
  font-size: 16px; font-weight: 700; color: #fff;
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.featured-main-summary {
  font-size: 12px; color: rgba(255,255,255,.9);
  margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden;
}
/* 右：小卡片列表 */
.featured-side {
  display: flex; flex-direction: column; gap: 8px;
}
.featured-side-item {
  flex: 1; display: flex; gap: 10px;
  text-decoration: none;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.featured-side-item:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-hover);
}
.featured-side-img {
  flex-shrink: 0; width: 80px;
  position: relative; overflow: hidden;
  background: var(--bg-hover);
}
.featured-side-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.featured-side-nocover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-muted); opacity: .3;
}
.featured-side-badge {
  position: absolute; bottom: 5px; left: 5px;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 5px; background: rgba(240,192,112,.5);
  color: #f0c070; border: 1px solid rgba(240,192,112,.35);
  border-radius: 4px; font-size: 10px; font-weight: 600;
  backdrop-filter: blur(4px);
}
.featured-side-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 8px 10px 8px 0; gap: 3px;
}
.featured-side-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.featured-side-meta {
  font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px;
}
/* carousel-badge 复用 */
.carousel-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; background: rgba(240,192,112,.5);
  color: #f0c070; border: 1px solid rgba(240,192,112,.3);
  border-radius: 4px; font-size: 12px; font-weight: 600;
  margin-bottom: 5px;
}



/* ---- Article Cards (三列网格) ---- */
.article-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  /* margin-top: 45px; */
}
.article-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  display: flex; flex-direction: column;
}
.article-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.article-card .article-footer { margin-top: auto; }
.article-meta {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 9px; flex-wrap: wrap;
}
.article-meta-spacer { flex: 1; }
.article-tag-parent {
  background: transparent; color: var(--text-muted);
  border-color: var(--border);
}
.article-tag-parent:hover { background: var(--green-light); color: var(--green); border-color: rgba(38,166,154,.2); }
.article-tag-sep {
  font-size: 10px; color: var(--text-muted); padding: 0 1px;
  display: inline-flex; align-items: center;
}
.article-tag {
  display: inline-block; padding: 2px 8px;
  background: var(--green-light); color: var(--green);
  border: 1px solid rgba(38,166,154,.2);
  border-radius: 4px; font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.article-tag:hover { background: var(--green-mid); color: var(--green-dark); }
.badge-featured {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 7px; background: rgba(240,192,112,.1);
  color: #f0c070; border-radius: 4px; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(240,192,112,.2);
}
.meta-time, .meta-views { font-size: 14px; color: var(--text-muted); }
.article-title {
  font-size: 17px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 7px;
  line-height: 1.5;         /* 设置行高 */
  min-height: 3em;          /* 最小高度 = 行高(1.5) * 2 */
  display: block;           /* 确保是块级元素 */
}
.article-title a { color: inherit; text-decoration: none; }
.article-title a:hover { color: var(--green); }
.article-summary {
  font-size: 15px; color: var(--text-secondary); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px;
}
.article-cover {
  margin-bottom: 10px; border-radius: 6px; overflow: hidden;
  position: relative; aspect-ratio: 16/9; background: var(--bg-hover);
}
.article-cover-blur {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(16px); transform: scale(1.1);
  opacity: 0.85;
}
.article-cover img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: contain;
  display: block;
  filter: blur(1px);
}
.article-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border-light);
}
.article-footer-meta {
  display: flex; align-items: center; gap: 10px;
}
.article-author { font-size: 14px; color: var(--text-muted); }
.read-more {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; background: var(--green); color: #fff;
  border-radius: 4px; font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background .15s;
}
.read-more:hover { background: var(--green-dark); color: #fff; text-decoration: none; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty-state i { font-size: 40px; display: block; margin-bottom: 12px; color: var(--text-muted); }

/* ---- Pagination ---- */
.pagination-wrap {
  display: flex; justify-content: center; margin-top: 20px; gap: 5px;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px;
  border: 1px solid var(--border); background: var(--bg-surface);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  font-size: 15px; text-decoration: none; transition: all .15s;
}
.page-btn:hover { border-color: var(--green); color: var(--green); background: var(--green-light); }
.page-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.page-btn.disabled { opacity: .35; pointer-events: none; }
.page-info { font-size: 14.5px; color: var(--text-muted); align-self: center; }

.search-heading {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
  margin-bottom: 14px; font-size: 15.5px; color: var(--text-secondary);
}
.search-heading strong { color: var(--green); }

/* ============================================================
   Post Detail
   ============================================================ */
.post-header { margin-bottom: 20px; }
.post-tags-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; flex-wrap: wrap; gap: 6px;
}
.post-tags-left { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.post-title {
  font-size: 24px; font-weight: 700; color: var(--text-primary);
  line-height: 1.4; margin: 10px 0;
}
.post-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 14.5px; color: var(--text-muted); flex-wrap: wrap;
}
.post-meta i { margin-right: 3px; }
.post-body {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  font-size: 17px; line-height: 1.9; color: var(--text-primary);
}
.post-body h1, .post-body h2, .post-body h3,
.post-body h4, .post-body h5, .post-body h6 {
  color: var(--text-primary); font-weight: 700; margin: 24px 0 12px;
}
.post-body h2 {
  font-size: 19px; border-left: 3px solid var(--green);
  padding-left: 10px; margin-left: -13px;
}
.post-body p { margin: 12px 0; }
.post-body a { color: var(--green); }
.post-body code {
  background: var(--bg-card); border-radius: 4px; padding: 2px 6px;
  font-size: .875em; color: #3fb950;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.post-body pre {
  background: #0d1117; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; margin: 16px 0;
}
.post-body pre code { background: none; color: var(--text-primary); padding: 0; }
.post-body blockquote {
  border-left: 3px solid var(--green); margin: 16px 0;
  padding: 8px 16px; background: var(--green-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-secondary);
}
.post-body img { max-width: 100%; border-radius: var(--radius-sm); }
.post-body ul, .post-body ol { padding-left: 22px; margin: 12px 0; }
.post-body li { margin: 7px 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 8px 12px; font-size: 16px; }
.post-body th { background: var(--bg-card); color: var(--text-secondary); font-weight: 600; }

/* ============================================================
   404
   ============================================================ */
.not-found {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 50vh; text-align: center; gap: 14px;
}
.not-found .code {
  font-size: 96px; font-weight: 900; color: var(--green);
  text-shadow: 0 0 40px rgba(38,166,154,.4); line-height: 1;
}
.not-found p { font-size: 19px; color: var(--text-secondary); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--bg-surface); border-top: 1px solid var(--border); padding: 20px 0;
}
.footer-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 15.5px; color: var(--text-primary); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 14.5px; color: var(--text-muted); }
.footer-links a:hover { color: var(--green); }
.footer-copy { font-size: 14px; color: var(--text-muted); margin-left: auto; }

/* ============================================================
   Back to Top
   ============================================================ */
.back-to-top {
  position: fixed; right: 24px; bottom: 28px;
  width: 38px; height: 38px; background: var(--green);
  color: #fff; border: none; border-radius: 6px;
  font-size: 16px; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(38,166,154,.4); z-index: 200;
}
.back-to-top:hover { transform: translateY(-2px); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .home-layout { grid-template-columns: 170px 1fr; }
  .home-layout > aside:last-child { display: none; }
  .article-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  /* 布局 */
  .home-layout { grid-template-columns: 1fr; }
  .home-layout > aside { display: none; }
  .article-list { grid-template-columns: 1fr; }

  /* 移动端分类 Tab 条 */
  .mobile-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
    width: 100%;
    gap: 8px;
    padding: 8px 0 10px;
    margin-bottom: 12px;
  }
  .mobile-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: background .12s, color .12s, border-color .12s;
  }
  .mobile-cat-tab img {
    width: 16px; height: 16px;
    border-radius: 50%; object-fit: cover;
  }
  .mobile-cat-tab.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
  }
  .mobile-cat-sub {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 11px;
    opacity: 0.85;
  }

  /* Header — 手机端两行布局：第一行 logo+汉堡，第二行搜索框 */
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 4px;
    gap: 6px;
  }
  .site-logo { font-size: 16px; gap: 6px; flex-shrink: 0; flex: 1; }
  .logo-text { max-width: none; overflow: visible; white-space: nowrap; }
  .header-search { display: flex; order: 3; flex: 0 0 100%; margin: 0; max-width: none; }
  .header-actions { display: none; }
  .mobile-menu-btn { display: none; }
  #mobileNav, #mobileNavKline { display: none !important; }

  /* 精选展示手机端：左大图 + 右两张小卡片 */
  .featured-grid { grid-template-columns: 1fr 110px; height: auto; gap: 6px; }
  .featured-side { gap: 6px; }
  .featured-side-item:nth-child(n+3) { display: none; }
  .featured-side-item { flex-direction: column; gap: 0; }
  .featured-side-img { width: 100%; height: 90px; flex-shrink: 0; }
  .featured-side-info { padding: 5px 6px; justify-content: flex-start; }
  .featured-side-title { font-size: 11px; -webkit-line-clamp: 2; }
  .featured-side-meta { display: none; }

  /* 文章卡片 */
  .article-title { font-size: 15px; }
  .article-summary { font-size: 14px; }
  .article-cover img { object-fit: contain; }

  /* 详情页 */
  .post-title { font-size: 20px; }
  .post-body { padding: 14px; font-size: 15px; }
  .post-body h2 { margin-left: 0; font-size: 17px; }
  .post-body h3 { font-size: 15px; }
  .post-body pre { padding: 10px; font-size: 13px; }
  .post-body table { font-size: 13px; }
  .post-body th, .post-body td { padding: 6px 8px; }

  /* 分类 banner */
  .cat-banner { padding: 14px 16px; gap: 12px; }
  .cat-banner-avatar, .cat-banner-icon { width: 42px; height: 42px; }

  /* Footer */
  .footer-copy { margin-left: 0; width: 100%; }
  .footer-inner { gap: 10px; }

  /* 导航 tab 字体缩小 */
  .nav-tab { padding: 8px 12px; font-size: 15px; }

  /* 翻页按钮更容易点击 */
  .page-btn { min-width: 38px; height: 38px; font-size: 15px; }

  /* site-main 上下间距收紧 */
  .site-main { padding: 12px 0 32px; }
}

@media (max-width: 480px) {
  .article-list { grid-template-columns: 1fr; gap: 10px; }
  .post-body { padding: 12px; }
  /* 标题在手机端始终显示，不隐藏 */
  .nav-tab { padding: 8px 9px; font-size: 14px; }
  .cat-sort-btn { padding: 5px 10px; font-size: 14px; }

  /* 分类简介 banner：防止内容溢出 */
  .cat-banner { overflow: hidden; }
  .cat-banner-desc { word-break: break-word; white-space: normal; }

  /* 暂无文章：确保撑满整列 */
  .empty-state { width: 100%; box-sizing: border-box; }
}

@media (min-width: 1400px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
    max-width: 1520px;
  }
  .article-list { 
    margin-top: 10px !important;
  }
}
