/* =====================================================================
   Cosmetic Insight — custom styles on top of Water.css
   Theme strategy: water.css provides variables; we re-declare them under
   html[data-theme="dark"] / html[data-theme="light"] so the manual toggle
   (persisted in localStorage) always wins over the OS preference.
   ===================================================================== */

/* ---- Manual light theme (same as water.css :root light) ---- */
html[data-theme="light"] {
  --background-body: #fff;
  --background: #efefef;
  --background-alt: #f7f7f7;
  --selection: #9e9e9e;
  --text-main: #363636;
  --text-bright: #000;
  --text-muted: #70777f;
  --links: #0076d1;
  --focus: #0096bfab;
  --border: #dbdbdb;
  --code: #000;
  --button-base: #d0cfcf;
  --button-hover: #9b9b9b;
  --scrollbar-thumb: rgb(170, 170, 170);
  --scrollbar-thumb-hover: var(--button-hover);
  --form-placeholder: #949494;
  --form-text: #1d1d1d;
  --variable: #39a33c;
  --highlight: #ff0;
  color-scheme: light;

  /* brand surfaces */
  --header-bg: linear-gradient(180deg, #ffffff 0%, #fdeef6 100%);
  --nav-bg: linear-gradient(180deg, #fdf2f8 0%, #fce7f0 100%);
  --footer-bg: linear-gradient(135deg, #fdf2f8 0%, #f4ecfb 100%);
  --hero-band-bg: linear-gradient(135deg, #e06091 0%, #9b59d0 55%, #6f5bd9 100%);
  --hero-text: #ffffff;
  --hero-sub-text: rgba(255, 255, 255, 0.88);
}

/* ---- Manual dark theme (water.css dark palette) ---- */
html[data-theme="dark"] {
  --background-body: #202b38;
  --background: #161f27;
  --background-alt: #1a242f;
  --selection: #1c76c5;
  --text-main: #dbdbdb;
  --text-bright: #fff;
  --text-muted: #a9b1ba;
  --links: #41adff;
  --focus: #0096bfab;
  --border: #526980;
  --code: #ffbe85;
  --button-base: #0c151c;
  --button-hover: #040a0f;
  --scrollbar-thumb: var(--button-hover);
  --scrollbar-thumb-hover: rgb(0, 0, 0);
  --form-placeholder: #a9a9a9;
  --form-text: #fff;
  --variable: #d941e2;
  --highlight: #efdb43;
  color-scheme: dark;

  /* brand surfaces */
  --header-bg: linear-gradient(180deg, #1c2734 0%, #232f3e 100%);
  --nav-bg: linear-gradient(180deg, #1a242f 0%, #202b38 100%);
  --footer-bg: linear-gradient(135deg, #1a242f 0%, #232f3e 100%);
  --hero-band-bg: linear-gradient(135deg, #7c345c 0%, #563a86 55%, #3c3f7d 100%);
  --hero-text: #ffffff;
  --hero-sub-text: rgba(255, 255, 255, 0.82);
}

html[data-theme="dark"] html { scrollbar-color: #040a0f #202b38; }

/* ---- Brand extras ---- */
:root {
  --accent: #e06091;
  --accent-soft: rgba(224, 96, 145, 0.12);
  --card-bg: var(--background-body);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(0, 0, 0, 0.06);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* undo water.css' 800px centered body — bands must be full-bleed and
     the content column is controlled by .container (max-width: 1360px) */
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Content column capped at 1360px; header/footer/hero bands stay full-bleed */
.container { max-width: 1360px; margin: 0 auto; padding: 0 1.25rem; }

/* =====================================================================
   Header (full-bleed, two rows: brand row + category nav row)
   ===================================================================== */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--background-body);
  padding: 0.5rem 1rem; z-index: 100; border: 1px solid var(--border);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.55rem 1.25rem;
}
.main-nav { background: var(--nav-bg); border-top: 1px solid rgba(224, 96, 145, 0.18); }
.main-nav-inner { display: flex; gap: 0.2rem; flex-wrap: wrap; padding: 0.25rem 1.25rem; }

.brand { display: flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.brand-mark { font-size: 1.4rem; }
.brand-name { font-weight: 700; font-size: 1.15rem; color: var(--text-bright); letter-spacing: 0.2px; white-space: nowrap; }
.brand-accent { color: var(--accent); }

.nav-link {
  text-decoration: none; color: var(--text-main);
  padding: 0.35rem 0.65rem; border-radius: 6px; font-size: 0.92rem; white-space: nowrap;
}
.nav-link:hover { background: var(--accent-soft); color: var(--links); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.search-form { display: flex; }
.search-form input[type="search"] {
  border-radius: 6px 0 0 6px; margin: 0; padding: 0.32rem 0.6rem; font-size: 0.9rem;
  width: 150px; background: var(--background-alt);
}
.search-form button {
  margin: 0; border-radius: 0 6px 6px 0; padding: 0.32rem 0.6rem; border: none;
  background: var(--accent); cursor: pointer; font-size: 0.9rem;
}
.search-form button:hover { filter: brightness(0.93); }

.theme-toggle {
  border: 1px solid var(--border); background: var(--background-body);
  border-radius: 6px; cursor: pointer; padding: 0.28rem 0.55rem; font-size: 1rem; line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-icon { display: none; }
html[data-theme="light"] .theme-icon-moon { display: inline; } /* show what you switch TO */
html[data-theme="dark"]  .theme-icon-sun  { display: inline; }

/* Hamburger: hidden on desktop */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  border: 1px solid var(--border); background: var(--background-body);
  border-radius: 6px; padding: 0.5rem 0.55rem; cursor: pointer;
}
.nav-toggle-bar { display: block; width: 18px; height: 2px; background: var(--text-main); border-radius: 2px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Small screens: category nav becomes a dropdown panel ---- */
@media (max-width: 920px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;                 /* closed by default */
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--background-body);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    z-index: 60;
  }
  .main-nav.open { display: block; }
  .main-nav-inner { flex-direction: column; gap: 0.1rem; padding: 0.6rem 1.25rem 0.8rem; }
  .nav-link { padding: 0.55rem 0.7rem; font-size: 1rem; border-radius: 8px; }
  /* keep the search compact; hero has a full-width one anyway */
  .search-form input[type="search"] { width: 110px; }
}
@media (max-width: 560px) {
  .search-form { display: none; } /* hero search covers it */
}

/* =====================================================================
   Hero (full-bleed brand color band, full-width search)
   ===================================================================== */
.hero-band {
  background: var(--hero-band-bg);
  color: var(--hero-text);
  padding: 3rem 0 2.6rem;
  margin-bottom: 1rem;
}
.hero { text-align: center; }
.hero h1 { font-size: 2.4rem; margin-bottom: 0.8rem; color: var(--hero-text); }
.hero-accent { color: #ffd6e8; }
.hero-sub { max-width: 720px; margin: 0 auto 1.4rem; color: var(--hero-sub-text); font-size: 1.05rem; }
.hero-search { display: flex; max-width: 860px; margin: 0 auto 0.9rem; }
.hero-search input[type="search"] {
  flex: 1; margin: 0; border-radius: 10px 0 0 10px; padding: 0.85rem 1.2rem; font-size: 1.05rem;
  background: var(--background-body); color: var(--text-main);
}
.hero-search button {
  margin: 0; border-radius: 0 10px 10px 0; border: none; padding: 0.85rem 1.6rem;
  background: var(--background-body); color: var(--accent); font-weight: 700; cursor: pointer;
  font-size: 1rem;
}
.hero-search button:hover { filter: brightness(0.96); }
.hero-stats { color: var(--hero-sub-text); font-size: 0.92rem; }

/* =====================================================================
   Sections & cards
   ===================================================================== */
.section { padding: 1.6rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-title { font-size: 1.45rem; color: var(--text-bright); margin-bottom: 1rem; }
.see-all { text-decoration: none; font-weight: 600; font-size: 0.95rem; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem;
}

/* Browse by category: fixed one-row-three-column (3-col) layout */
.category-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .category-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
a.card { text-decoration: none; color: inherit; display: block; padding: 1.1rem; }
a.card:hover { transform: translateY(-2px); border-color: var(--accent); }

.category-card { text-align: center; }
.category-icon { font-size: 2rem; display: block; margin-bottom: 0.4rem; }
.category-card h3 { margin: 0 0 0.3rem; color: var(--text-bright); }
.category-card p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }

.review-card { display: flex; flex-direction: column; overflow: hidden; }
.review-cover {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--background-alt));
  min-height: 110px; text-decoration: none;
  /* 真实图铺在 emoji 占位之上；overflow:hidden 让圆角裁到图上，
     同时把 hover 放大（scale）裁在封面框内，外框位置/大小保持不变 */
  position: relative; overflow: hidden;
}
.review-emoji { font-size: 2.6rem; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15)); }
/* articles.sample_image —— 绝对定位铺满封面块，等比例裁切不变形。
   没有这张图时元素不存在，露出的就是上面的渐变底 + emoji。 */
.review-cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; background: var(--background-alt);
  /* 平滑过渡，hover 时放大形成动态效果 */
  transition: transform 0.4s ease;
}
/* 鼠标移到卡片上：封面真实图在原框内放大（1.08x），框的位置/尺寸不变 */
.review-card:hover .review-cover-img { transform: scale(1.08); }
.review-card:hover { box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,0.12)); }

/* ---- 首页底部 "Most read"（最近30天，两列，最多12条） ---- */
.most-read-list { list-style: none; margin: 0; padding: 0; column-count: 2; column-gap: 2.5rem; }
.most-read-item {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.8rem 0; border-bottom: 1px solid var(--border);
  break-inside: avoid; -webkit-column-break-inside: avoid;
}
.most-read-item:last-child { border-bottom: none; }
.mr-rank {
  flex: 0 0 auto; width: 1.9rem; height: 1.9rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; color: #fff;
  background: var(--accent); border-radius: 8px;
}
.mr-body { min-width: 0; flex: 1; }
.mr-title { margin: 0; font-size: 1.02rem; line-height: 1.4; }
.mr-title a { text-decoration: none; color: var(--text-bright); }
.mr-title a:hover { color: var(--links); }
.mr-meta { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
/* 每行右侧示例图：固定 64×64 方块，emoji 占位在底层，有 sample_image 时叠图 */
.mr-thumb {
  flex: 0 0 auto; width: 64px; height: 64px;
  border-radius: 8px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--background-alt));
  text-decoration: none;
}
.mr-thumb .review-emoji { font-size: 1.7rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)); }
.mr-thumb-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: block;
  background: var(--background-alt);
  transition: transform 0.4s ease;
}
.most-read-item:hover .mr-thumb-img { transform: scale(1.08); }
@media (max-width: 640px) {
  .most-read-list { column-count: 1; column-gap: 0; }
}
.review-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.review-title { font-size: 1.05rem; margin: 0; line-height: 1.35; }
.review-title a { text-decoration: none; color: var(--text-bright); }
.review-title a:hover { color: var(--links); }
.review-excerpt { margin: 0; color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.review-meta { margin: 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-muted); }
.review-footer { margin: 0.2rem 0 0; display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; font-size: 0.85rem; }
.rating { color: #e2a63d; font-weight: 600; white-space: nowrap; }
.badge {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  font-size: 0.78rem; font-weight: 600; padding: 0.1rem 0.55rem;
  border-radius: 99px; text-decoration: none; white-space: nowrap;
}
.badge:hover { filter: brightness(1.05); text-decoration: underline; }
.muted { color: var(--text-muted); }

/* =====================================================================
   List page
   ===================================================================== */
.breadcrumb { font-size: 0.88rem; color: var(--text-muted); padding: 0.9rem 0 0.4rem; }
.breadcrumb a { color: var(--links); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span[aria-hidden] { margin: 0 0.35rem; }

.list-head h1 { color: var(--text-bright); margin-bottom: 0.2rem; }
.list-head { margin-bottom: 0.8rem; }

.filter-bar { display: flex; align-items: center; gap: 0.5rem; margin: 0.6rem 0 0.9rem; font-size: 0.92rem; }
.filter-bar select { width: auto; padding: 0.3rem 0.6rem; }

.category-chips { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--border); border-radius: 99px;
  padding: 0.28rem 0.85rem; text-decoration: none; color: var(--text-main);
  font-size: 0.88rem; background: var(--background-body);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-active:hover { color: #fff; }
.chip-count {
  display: inline-block; min-width: 1.4rem; text-align: center;
  font-size: 0.75rem; font-weight: 700; line-height: 1.5;
  background: var(--background-alt); color: var(--text-muted);
  border-radius: 99px; padding: 0 0.4rem;
}
.chip-active .chip-count { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* chips row: subcategory chips left, sort control right */
.chips-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: 0.4rem 0 1.4rem;
}
.chips-row .category-chips { flex: 1; }
.chips-row .filter-bar { margin: 0; flex-shrink: 0; }

.article-list { display: flex; flex-direction: column; gap: 1rem; }
.list-item {
  display: flex; gap: 1.1rem; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  padding: 1.1rem; transition: border-color 0.15s ease;
}
.list-item:hover { border-color: var(--accent); }
.list-item-cover {
  flex: 0 0 96px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--background-alt));
  border-radius: 10px; text-decoration: none;
  /* 固定成 96×96 方块并垂直居中：不写死高度时 flex 默认 stretch，
     标题一多行高变大，封面就被拉成竖长条，商品图裁切得很怪 */
  height: 96px; align-self: center;
  /* 示例图盖在 emoji 占位之上；overflow:hidden 让圆角裁到图上 */
  position: relative; overflow: hidden;
}
/* articles.sample_image —— 绝对定位铺满封面块，等比例裁切不变形。
   没有这张图时元素不存在，露出的就是上面的渐变底 + emoji。 */
.list-cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  border-radius: 10px; display: block;
  background: var(--background-alt);
}
.list-item .review-title { font-size: 1.18rem; }
.list-item-body { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }

/* ---- 列表页两栏：左侧主列表（大），右侧榜单与最新（小） ---- */
.list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;   /* 左列可压缩，右列固定 */
  gap: 2rem;
  align-items: start;
}
.list-main { min-width: 0; }        /* 不加这行，长标题会把左列撑破栅格 */

.list-aside { display: flex; flex-direction: column; gap: 1.3rem; }
.aside-block {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.aside-title { margin: 0; font-size: 1rem; color: var(--text-bright); }
.aside-sub { margin: 0.1rem 0 0.75rem; font-size: 0.76rem; color: var(--text-muted); }
.aside-empty { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.aside-link {
  color: var(--text-bright); text-decoration: none;
  /* 最多两行，超出省略 —— 否则长商品标题会把侧栏拉得很长 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.aside-link:hover { color: var(--links); }

/* 阅读榜：序号跨两行，标题在上、阅读数在下 */
.aside-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.aside-rank li {
  display: grid; grid-template-columns: 1.35rem minmax(0, 1fr); column-gap: 0.5rem;
  font-size: 0.88rem; line-height: 1.35;
}
.aside-num {
  grid-row: 1 / span 2; font-size: 0.82rem; font-weight: 700; line-height: 1.45;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
/* 前三名用强调色，其余退成灰 —— 榜单的视觉层级 */
.aside-rank li:nth-child(n+4) .aside-num { color: var(--text-muted); font-weight: 600; }
.aside-rank .aside-link { grid-column: 2; }
.aside-views { grid-column: 2; font-size: 0.74rem; color: var(--text-muted); }

.aside-latest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.aside-latest li { display: flex; flex-direction: column; gap: 0.12rem; font-size: 0.88rem; line-height: 1.35; }
.aside-latest time {
  font-size: 0.74rem; color: var(--text-muted);
  /* water.css 给所有 <time> 加了灰底 + padding，在侧栏卡片里会变成难看的色块 */
  background: none; padding: 0; border-radius: 0;
}

/* 窄屏折成单列：主列表在上，侧栏在下 */
@media (max-width: 980px) {
  .list-layout { grid-template-columns: 1fr; gap: 1.6rem; }
}

.pagination { display: flex; gap: 0.4rem; justify-content: center; margin: 1.8rem 0; flex-wrap: wrap; }
.page-btn {
  border: 1px solid var(--border); border-radius: 8px; padding: 0.35rem 0.8rem;
  text-decoration: none; color: var(--text-main); background: var(--background-body); font-size: 0.92rem;
}
.page-btn:hover { border-color: var(--accent); }
.page-current { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty-state { text-align: center; padding: 3rem 0; }
.empty-emoji { font-size: 3rem; margin: 0; }

/* =====================================================================
   Article page + TOC
   ===================================================================== */
.article-layout { padding-bottom: 2rem; }

.article-header { padding-top: 0.6rem; margin-bottom: 1.2rem; }
.article-title { font-size: 2rem; line-height: 1.25; color: var(--text-bright); margin: 0.4rem 0 0.5rem; }
.article-standfirst { font-size: 1.08rem; color: var(--text-muted); margin: 0 0 0.8rem; }
.article-byline { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.article-rating { color: #e2a63d; }

/* TOC: sticky sidebar on wide screens, collapsible box on narrow ones */
@media (min-width: 1000px) {
  .article-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 0 2.2rem;
    align-items: start;
  }
  .article-header  { grid-column: 1; grid-row: 1; }
  .toc             { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 76px; margin-top: 0.6rem; }
  .article-content { grid-column: 1; grid-row: 2; }
  .article-foot    { grid-column: 1; grid-row: 3; }
}
.toc {
  background: var(--background-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.8rem 1rem; font-size: 0.88rem;
}
.toc summary { cursor: pointer; font-weight: 700; color: var(--text-bright); }
.toc-list { list-style: none; margin: 0.5rem 0 0; padding-left: .3rem; }
.toc-list li { margin: 0.28rem 0; line-height: 1.45; }
/* hierarchical indent: level-2 flush, level-3 nested under its parent */
.toc-list li.toc-l2 > a { font-weight: 600; color: var(--text-bright); }
.toc-list li + li.toc-l2 { margin-top: 0.6rem; }
.toc-list li.toc-l3 {
  margin-left: 0;
  padding-left: 1.55rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  position: relative;
}
.toc-list li.toc-l3::before {
  content: "";
  position: absolute; left: 0.55rem; top: 0.5em;
  width: 0.6rem; height: 1px; background: var(--text-muted); opacity: .55;
}
.toc a { text-decoration: none; color: var(--text-main); }
.toc a:hover, .toc a.toc-active { color: var(--accent); }
.toc a.toc-active { font-weight: 700; }
/* 当前阅读小节：左侧竖条 + 高亮，长目录时更容易定位 */
.toc-list li.toc-l2:has(> a.toc-active) { border-left: 2px solid var(--accent); margin-left: -0.45rem; padding-left: 0.3rem; }
.toc-list li.toc-l2:has(> a.toc-active) > a { color: var(--accent); }

/* Markdown article content */
.article-content { line-height: 1.75; }
.article-content h2 { margin-top: 2.2rem; padding-top: 0.4rem; color: var(--text-bright); }
.article-content h3 { color: var(--text-bright); }
/* 正文为 HTML 源时（content_format=html），滚动定位需给固定顶栏留余量 */
.article-content h1, .article-content h2, .article-content h3,
.article-content h4 { scroll-margin-top: 88px; }
.article-content section + section { margin-top: 1.2rem; }
.article-content figure { margin: 1.6rem 0; }
.article-content figcaption {
  margin-top: 0.5rem; text-align: center;
  font-size: 0.86rem; color: var(--text-muted);
}
.article-content figure img { margin: 0; }
/* 可选排版组件：作者在 HTML 正文里用 class 调用 */
.article-content .callout {
  margin: 1.4rem 0; padding: 0.85rem 1rem;
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0; background: var(--accent-soft);
}
.article-content .callout > :first-child { margin-top: 0; }
.article-content .callout > :last-child { margin-bottom: 0; }
.article-content .note { font-size: 0.9rem; color: var(--text-muted); }
.article-content .lead { font-size: 1.06rem; color: var(--text-main); }
.article-content th, .article-content td {
  border: 1px solid var(--border); padding: 0.45rem 0.6rem; text-align: left;
}
.article-content thead th { background: var(--background-alt); }
.article-content details { margin: 1.2rem 0; }
.article-content summary { cursor: pointer; font-weight: 700; }
.article-content dl dt { font-weight: 700; margin-top: 0.6rem; }
.article-content dl dd { margin: 0.2rem 0 0 1.2rem; color: var(--text-muted); }
.article-content .anchor {
  opacity: 0; margin-right: 0.35rem; text-decoration: none; color: var(--accent); font-weight: 400;
}
.article-content .hnum {
  color: var(--accent); font-weight: 700; margin-right: 0.3rem;
}
.article-content h2:hover .anchor,
.article-content h3:hover .anchor { opacity: 1; }
/* 表格：宽屏铺满正文列；窄屏才切成可横向滚动的块（display:block 会让
   内部表格按内容收缩，必须只在需要滚动时启用） */
.article-content table {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
  table-layout: auto;
}
@media (max-width: 720px) {
  .article-content table { display: block; overflow-x: auto; white-space: nowrap; }
}
.article-content blockquote {
  border-left: 4px solid var(--accent); margin-left: 0; padding: 0.2rem 1rem;
  background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--text-main);
}
.article-content img { max-width: 100%; border-radius: 8px; }
.article-content code { background: var(--background-alt); padding: 0.1rem 0.35rem; border-radius: 4px; }

/* Editorial images: full column width, rounded, framed; the italic paragraph
   right after an image paragraph acts as its caption. */
.article-content p:has(> img) {
  margin: 1.6rem 0 0.4rem;
}
.article-content img {
  display: block; width: 100%; border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.article-content p:has(> img) + p > em:first-child {
  display: block; text-align: center;
  color: var(--text-muted); font-size: 0.86rem;
}

.article-foot { margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.article-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }

.related-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  margin-top: 3rem; border-top: 1px solid var(--border);
  background: var(--footer-bg); padding: 1.8rem 0 1rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 1.6rem;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h3 { font-size: 0.95rem; margin: 0 0 0.5rem; color: var(--text-bright); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0.3rem 0; font-size: 0.9rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-about p { font-size: 0.88rem; color: var(--text-muted); }
.footer-note p { font-size: 0.84rem; color: var(--text-muted); }

/* 页脚品牌名：两个单词两种颜色（Cosmetic 用正文色，Insight 用强调色）。
   上面的 .footer-about p 特异性更高，会把品牌名压成 0.88rem 灰字，这里提权还原。 */
.footer-about .brand-name {
  font-size: 1.15rem; font-weight: 700; color: var(--text-bright);
  letter-spacing: 0.2px; margin: 0 0 0.55rem;
}

/* Editorial Policy 要点列表：accent 色勾号，比整段文字更好扫读 */
.footer-note .policy-list { list-style: none; margin: 0.45rem 0 0; padding: 0; }
.footer-note .policy-list li {
  position: relative; padding-left: 1.05rem; margin: 0.35rem 0;
  font-size: 0.84rem; line-height: 1.45; color: var(--text-muted);
}
.footer-note .policy-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 700;
}
.footer-bottom { border-top: 1px solid var(--border); margin-top: 1.4rem; padding-top: 0.9rem; }
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

/* Print: reading-friendly */
@media print {
  .site-header, .site-footer, .no-print, .anchor { display: none !important; }
  body { background: #fff; color: #000; }
}
