/* ==========================================================================
   H5 资讯门户模板样式表(css/style.css)
   --------------------------------------------------------------------------
   设计令牌集中在 :root —— 更换主题色只需修改 --primary 及其派生值。
   移动端优先(设计基准 375px);>=768px 时内容在页面居中呈现。
   无任何外部资源依赖(字体/图标均为内联 SVG 或 Unicode)。
   ========================================================================== */

/* ----------------------------- Design Tokens ---------------------------- */
:root {
  /* 品牌/主题色 */
  --primary: #024ac2;
  --primary-dark: #01378f;
  --primary-deeper: #012a68;
  --primary-light: #3b74db;
  --primary-tint-10: rgba(2, 74, 194, 0.06);
  --primary-tint-100: #eaf1fc;
  --primary-gradient: linear-gradient(135deg, #024ac2 0%, #2f6fe0 55%, #56a0ee 100%);

  /* 中性灰阶 */
  --text-1: #18222f;
  --text-2: #57636f;
  --text-3: #97a0ab;
  --border: #e9ecf1;
  --bg-app: #f4f6fa;
  --bg-card: #ffffff;

  /* 点缀色 */
  --hot-red: #f43f24;
  --hot-orange: #ff7a29;
  --ad-gold: #fff7e8;
  --ad-gold-border: #f7e2b6;
  --like-pink: #fd5a63;
  --collect-gold: #ffb703;

  /* 尺寸/圆角/阴影/层级 */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-card: 0 2px 10px rgba(30, 47, 80, 0.07);
  --shadow-float: 0 6px 20px rgba(14, 33, 81, 0.16);
  --header-h: 48px;
  --nav-h: 40px;
  --z-header: 60;
  --z-overlay: 70;
  --z-fab: 50;
  --z-bar: 55;
  --z-toast: 90;
}

/* -------------------------------- Reset -------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-1);
  background: var(--bg-app);
  overflow-x: hidden;
}

ul,
ol {
  list-style: none;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: transparent;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* SEO 专用:仅对爬屏/读屏可见,不影响视觉布局 */
.seo-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 增强脚本注入的 meta 小图标(对齐静态 <svg> 尺寸) */
.meta-ico {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex: none;
}

/* 内容列:手机全宽 → 桌面居中“手机壳”宽度 */
.container {
  margin: 0 auto;
  max-width: 100%;
}

/* ============================== 顶栏与搜索 ============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: var(--header-h);
  padding: 0 12px;
  max-width: 720px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
  white-space: nowrap;
}

.logo-mark {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark svg {
  width: 16px;
  height: 16px;
}

.logo-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 3px;
}

.logo-text {
  margin-right: -2px;
}

.search-btn {
  width: 40px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -8px;
  color: var(--text-1);
}

.header-side {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 34px;
}

.back-btn {
  width: 40px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  margin-left: -8px;
}

.back-btn .icon,
.search-btn .icon {
  width: 22px;
  height: 22px;
}

.back-btn svg,
.search-btn svg {
  fill: currentColor;
}

.header-search-placeholder {
  flex: 1;
}

/* 搜索覆盖层 */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(24, 34, 47, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.search-overlay.open {
  opacity: 1;
  visibility: visible;
}

.search-panel {
  background: var(--bg-card);
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 18px;
  transform: translateY(-16px);
  transition: transform 0.25s ease;
  box-shadow: 0 8px 24px rgba(20, 35, 65, 0.18);
}

.search-overlay.open .search-panel {
  transform: translateY(0);
}

.search-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
  padding: 0 12px 12px;
}

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f4f9;
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 38px;
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-tint-100);
}

.search-form .icon {
  width: 18px;
  height: 18px;
  fill: var(--text-3);
  flex: none;
}

.search-input {
  flex: 1;
  font-size: 15px;
  color: var(--text-1);
}

.search-input::placeholder {
  color: var(--text-3);
}

.btn-cancel {
  color: var(--primary);
  font-size: 15px;
  padding: 6px 4px;
}

.search-hint {
  padding: 6px 14px 10px;
  font-size: 13px;
  color: var(--text-3);
}

.hot-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px;
}

.hot-chip {
  padding: 5px 13px;
  font-size: 13px;
  color: var(--text-2);
  background: #f2f5fa;
  border-radius: 999px;
  transition: background 0.18s, color 0.18s;
}

.hot-chip:hover {
  background: var(--primary-tint-100);
  color: var(--primary);
}

/* ============================ 分类导航横滑条 ============================ */
.cat-nav-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: calc(var(--z-header) - 1);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(28, 44, 77, 0.04);
}

.cat-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  max-width: 720px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox 隐藏滚动条 */
}

.cat-nav::-webkit-scrollbar {
  display: none; /* Webkit 隐藏滚动条 */
}

.cat-item {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14.5px;
  color: var(--text-2);
  white-space: nowrap;
  position: relative;
  transition: color 0.18s;
}

.cat-item.active {
  color: var(--primary);
  font-weight: 700;
}

.cat-item.active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 4px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

/* =============================== 轮播图 ================================== */
.carousel-area {
  position: relative;
  background: #000;
}

.carousel-track,
.carousel-track-mobile {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .carousel-track {
    cursor: grab;
    user-select: none;
  }

  .carousel-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
  }
}

.c-slide {
  scroll-snap-align: center; /* 居中停靠效果更佳 */
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 10 / 6.6; /* 图片填充高度由容器决定 */
  overflow: hidden;
}

.c-cover {
  position: absolute;
  inset: 0;
  transition: transform 0.12s ease-out;
}

.c-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(5, 12, 28, 0.82),
    rgba(5, 12, 28, 0.32) 45%,
    rgba(5, 12, 28, 0.05)
  );
}

/* 轮播文案与角标 */
.c-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px 18px;
  color: #fff;
}

.c-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.slide-meta {
  font-size: 11px;
  opacity: 0.85;
}

.badge-top {
  background: linear-gradient(90deg, var(--hot-red), #ff8a00);
  font-weight: 700;
}

/* 轮播指示点 */
.carousel-dots {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.carousel-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: width 0.25s, background 0.25s;
}

.carousel-dots .dot.active {
  width: 18px;
  border-radius: 4px;
  background: #fff;
}

/* 占位封面(无真实图片,纯 CSS 渐变 + 大字) */
.cover-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.92);
}

.cover-ph .ph-word {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 8px;
  text-indent: 8px; /* 抵消末字符字距 */
}

.cover-ph .ph-en {
  position: relative;
  z-index: 1;
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.75;
  text-transform: uppercase;
}

/* —— 占位封面包配方案(与 mock-data 的 cover.bg 对应)—— */
.bg-blue   { background: linear-gradient(135deg, #0b63d8 0%, #4796f0 100%); }
.bg-indigo { background: linear-gradient(135deg, #3a44c9 0%, #7d89ff 100%); }
.bg-cyan   { background: linear-gradient(135deg, #0787a8 0%, #35c2df 100%); }
.bg-steel  { background: linear-gradient(135deg, #45607e 0%, #7e9cc0 100%); }
.bg-gold   { background: linear-gradient(135deg, #b7791f 0%, #eebb55 100%); }
.bg-coral  { background: linear-gradient(135deg, #d84a3a 0%, #ff8a70 100%); }
.bg-sand   { background: linear-gradient(135deg, #a9825a 0%, #dcb586 100%); }
.bg-green  { background: linear-gradient(135deg, #178a46 0%, #48c477 100%); }
.bg-red    { background: linear-gradient(135deg, #c62f31 0%, #f4645f 100%); }
.bg-lime   { background: linear-gradient(135deg, #4d8f1f 0%, #96cf53 100%); }
.bg-magenta{ background: linear-gradient(135deg, #b12a87 0%, #ea67bf 100%); }
.bg-violet { background: linear-gradient(135deg, #6d28c9 0%, #a678ec 100%); }
.bg-plum   { background: linear-gradient(135deg, #802868 0%, #c25ba3 100%); }
.bg-navy   { background: linear-gradient(135deg, #14306e 0%, #3a60b8 100%); }
.bg-slate  { background: linear-gradient(135deg, #39434e 0%, #75859a 100%); }
.bg-forest { background: linear-gradient(135deg, #14532d 0%, #3b8a5c 100%); }
.bg-mint   { background: linear-gradient(135deg, #0f8a72 0%, #52c7ab 100%); }
.bg-peach  { background: linear-gradient(135deg, #d97c3f 0%, #ffb377 100%); }
.bg-teal   { background: linear-gradient(135deg, #0d7d74 0%, #43bfb3 100%); }
.bg-orange { background: linear-gradient(135deg, #c2560c 0%, #ff9954 100%); }
.bg-purple { background: linear-gradient(135deg, #86198f 0%, #c95bd1 100%); }

/* ============================ 区块通用标题 ============================= */
.section {
  margin-top: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
}

.section-more {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  color: var(--text-3);
}

.section-more svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ============================== 文章卡片 ================================ */
.section-body {
  padding: 0 12px;
  max-width: 720px;
  margin: 0 auto;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-grid-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* —— 列表式卡片(横排小图)—— */
.card.list-mode {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  padding: 11px 0;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

.card.list-mode:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.list-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0;
}

.card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.42;
  color: var(--text-1);
}

.card:active .card-title {
  color: var(--primary);
}

.card-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  max-width: 100%;
}

.meta-row > span,
.meta-row > a {
  white-space: nowrap;
  flex: none; /* 防止“x小时前”等短文案被逐字折行 */
}
.meta-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* 小图标统一尺寸:覆盖列表/详情 meta、推广位等所有出现场景
   (SVG 无固有尺寸,漏约束会被撑满容器) */
.meta-item svg,
.hot-ico,
.meta-ico,
.article-meta svg,
.meta-row svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex: none;
}

.article-meta .meta-viewers {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.promo-chip {
  color: #c8891b;
  background: var(--ad-gold);
  border: 1px solid var(--ad-gold-border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10.5px;
  line-height: 1.35;
}

.thumb-wrap {
  position: relative;
  border-radius: var(--radius-s);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.thumb-wrap .cover-ph {
  inset: 0;
  position: absolute;
}

.thumb-wrap .cover-ph .ph-word {
  font-size: 17px;
  letter-spacing: 4px;
}

/* —— 网格小卡(热门推荐)—— */
.grid-card {
  overflow: hidden;
}

.grid-cover {
  aspect-ratio: 5 / 3;
  position: relative;
}

/* —— Hero 大卡(头条) —— */
.hero-card {
  position: relative;
}

.hero-cover {
  aspect-ratio: 21 / 9;
  position: relative;
}

.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 14px 12px;
  background: linear-gradient(to top, rgba(6, 14, 32, 0.78), transparent);
  color: #fff;
}

.hero-title {
  font-size: 17px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.4;
}

.hero-card .badge-top {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

/* ============================== 推广文章位 =============================== */
.promo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(160deg, #f0f6ff 0%, var(--primary-tint-100) 100%);
  border-radius: var(--radius-m);
  padding: 12px;
}

.promo-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  border: 1px dashed var(--ad-gold-border);
  border-radius: var(--radius-m);
  padding: 10px;
  transition: box-shadow 0.18s;
}

.promo-item:hover {
  box-shadow: var(--shadow-card);
}

.promo-cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-s);
  position: relative;
  overflow: hidden;
}

.promo-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ad-flag {
  align-self: flex-start;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #a06b12;
  padding: 1px 5px;
  background: linear-gradient(90deg, #ffe9c4, #fcd48e);
  border-radius: 3px;
}

/* 热榜序号 chip:前三名红-橙渐变,其余灰 */
.rank-chip {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: #c3cad6;
}

.rank-1 { background: linear-gradient(135deg, var(--hot-red), #ff7043); }
.rank-2 { background: linear-gradient(135deg, #fb8c24, var(--hot-orange)); }
.rank-3 { background: linear-gradient(135deg, #ffc23d, var(--hot-orange)); }

/* 热榜单行条目(热门推荐列表形态) */
.hot-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 2px;
}

.hot-line:not(:last-child) {
  border-bottom: 1px dashed var(--border);
}

.hl-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.hot-line .hl-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 15px;
}

.hl-views {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--text-3);
}

/* ======================== 列表页工具条(分类页) ========================= */
.list-toolbar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px 4px;
}

.list-title {
  font-size: 19px;
  font-weight: 800;
}

.list-title .kw {
  font-style: normal;
  color: var(--primary);
}

.list-count {
  font-size: 12px;
  color: var(--text-3);
}

.sort-tabs {
  margin-left: auto;
  display: inline-flex;
  background: #eef1f6;
  border-radius: 999px;
  padding: 3px;
}

.sort-tab {
  height: 26px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-2);
  transition: all 0.18s;
}

.sort-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(2, 74, 194, 0.28);
}

/* ================================ 加载更多 ============================== */
.load-more {
  margin-top: 14px;
  padding-bottom: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.btn-more {
  width: 180px;
  height: 40px;
  background: var(--bg-card);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-more:not(:disabled):hover {
  color: var(--primary);
  border-color: var(--primary-light);
}

.btn-more:disabled {
  cursor: default;
  opacity: 0.75;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(2, 74, 194, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.end-tip,
.empty-tip {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: 26px 0;
}

/* 骨架屏 */
.skeleton {
  border-radius: var(--radius-m);
  background: var(--bg-card);
  overflow: hidden;
  position: relative;
}

.sk-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 12px;
}

.sk-thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-s);
}

.sk-lines {
  display: flex;
  flex-direction: column;
  gap: 9px;
  justify-content: center;
}

.sk-line {
  height: 13px;
  border-radius: 4px;
}

.sk-line.w60 { width: 60%; }
.sk-line.w90 { width: 92%; }
.sk-line.w40 { width: 38%; }

.skeleton .sk-thumb,
.skeleton .sk-line {
  background: linear-gradient(90deg, #eef1f6 25%, #f8fafc 45%, #eef1f6 65%);
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from { background-position: 210% 0; }
  to   { background-position: -10% 0; }
}

.fade-in-up {
  animation: fadeUp 0.35s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ============================== 详情页 ================================== */
.article-page {
  /* 底部预留空间,避免正文被固定操作栏遮挡 */
  padding-bottom: 78px;
}

.detail-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 30px;
}

.article-head {
  padding-bottom: 14px;
}

.article-title {
  font-size: 21px;
  line-height: 1.42;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 13px;
  font-size: 12.5px;
  color: var(--text-3);
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}

.author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.follow-btn {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-tint-100);
  border: 1px solid var(--primary-light);
  padding: 1px 9px;
  border-radius: 999px;
}

.meta-viewers {
  margin-left: auto;
}

/* 正文排版 */
.article-body {
  font-size: 16px;
  line-height: 1.85;
  color: #232f3e;
}

.article-body p {
  margin: 15px 0;
  text-align: justify;
}

.article-body strong.keyword {
  color: var(--primary);
  background: var(--primary-tint-10);
  border-radius: 3px;
  padding: 0 3px;
}

blockquote.quote-block {
  margin: 18px 0;
  padding: 13px 15px;
  background: var(--primary-tint-100);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: #27437c;
  font-size: 14.5px;
  line-height: 1.7;
}

.quote-source {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-3);
}

.disclaimer {
  margin-top: 22px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
}

.tag-row {
  margin-top: 16px;
}

.tag-pill {
  display: inline-block;
  font-size: 12.5px;
  color: var(--primary);
  background: var(--primary-tint-100);
  padding: 5px 12px;
  margin-right: 8px;
  margin-bottom: 7px;
  border-radius: 999px;
}

/* 相关阅读 */
.related-section {
  margin-top: 24px;
}

.related-li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 11px 0;
  align-items: flex-start;
}

.related-li:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.related-cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-s);
  position: relative;
  overflow: hidden;
}

.related-main {
  min-width: 0;
}

/* 底部互动条(fixed bottom)与占位 */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-bar);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -3px 14px rgba(22, 36, 66, 0.06);
}

.bar-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px
  calc(9px + env(safe-area-inset-bottom, 0));
}

/* 窄屏防御:互动栏内容压缩,杜绝横向溢出(min-width:0 允许收缩) */
.comment-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f1f4f9;
  border-radius: 999px;
  height: 37px;
  padding: 0 13px;
  gap: 6px;
  min-width: 0;
}

.comment-input-wrap svg {
  width: 16px;
  height: 16px;
  fill: var(--text-3);
  flex: none;
}

#commentInput {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  min-width: 0;
}

.btn-send {
  width: 62px;
  height: 37px;
  flex: none;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  background: var(--primary);
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.1s, background 0.2s;
}

/* 窄屏(≤360px)时进一步压缩互动栏 */
@media (max-width: 360px) {
  .bar-inner { gap: 7px; padding-left: 8px; padding-right: 8px; }
  .btn-send { width: 52px; font-size: 13px; }
  .comment-input-wrap { padding: 0 10px; }
  #commentInput::placeholder { color: transparent; } /* 小屏隐藏占位文案防溢出 */
}

.btn-send.ready {
  opacity: 1;
}

.btn-send.ready:active {
  transform: scale(0.94);
}

.bar-action {
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 10.5px;
  color: var(--text-2);
  position: relative;
}

.bar-action svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
  transition: fill 0.18s, transform 0.18s;
}

.bar-action.like.active svg {
  fill: var(--like-pink);
  animation: pop 0.35s ease;
}

.bar-action.collect.active svg {
  fill: var(--collect-gold);
  animation: pop 0.35s ease;
}

.bar-action.share:active svg {
  fill: var(--primary);
}

/* 计数随 action 排列;非 bubble 形态时保持文档流 */
.bar-action .count-num {
  position: static;
  display: block;
  min-width: 0;
  height: auto;
  line-height: 1.2;
  font-size: 10.5px;
  color: inherit;
}

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.32); }
  70% { transform: scale(0.91); }
  100% { transform: scale(1); }
}

.count-num.badge-bubble {
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  background: transparent;
  border-radius: 999px;
  position: absolute;
  top: -3px;
  left: 21px;
  font-size: 10px;
  color: var(--text-3);
  line-height: 15px;
  display: none;
}

.count-num.bump {
  animation: bump 0.3s ease;
}

@keyframes bump {
  0%   { transform: translateY(6px) scale(0.85); opacity: 0.3; }
  100% { transform: none; opacity: 1; }
}

/* ============================ 回到顶部 FAB ============================== */
.back-top {
  position: fixed;
  right: 14px;
  bottom: 76px;
  z-index: var(--z-fab);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: var(--shadow-float);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.28s ease;
}

.back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-top svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.back-top:hover {
  color: var(--primary);
}

/* ================================ Toast ================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) translateY(12px);
  z-index: var(--z-toast);
  max-width: 82%;
  padding: 10px 18px;
  background: rgba(17, 26, 41, 0.88);
  color: #fff;
  font-size: 14px;
  border-radius: var(--radius-m);
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s ease;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

/* ================================ 页脚 ================================== */
.site-footer {
  margin-top: 26px;
  padding: 20px 16px calc(22px + env(safe-area-inset-bottom, 0));
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 8px;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-beian a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-beian a:hover {
  color: var(--primary);
}

/* =========================== 桌面端适度增强 ============================= */
@media (min-width: 768px) {
  body {
    font-size: 15.5px;
  }

  /* 内容列居中呈现 */
  .container,
  .section-body {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }

  /* 桌面视口更大时给页面铺 brand 渐变背景边缘 */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--primary-gradient);
    opacity: 0.05;
  }

  .site-header-inner { max-width: 720px; }
  .cat-nav           { max-width: 720px; }
  .search-panel      { max-width: 720px; }
  .bar-inner         { max-width: 720px; }
  .detail-wrap       { max-width: 720px; }

  .article-title { font-size: 23px; }
}

