/* ==========================================================================
   拾光 · theme-shiguang — Halo 主题样式表
   布局规格对齐个人主页类站点范式：浅灰页面底 + 居中白色圆角卡片容器
   文件顺序：令牌 → 基础 → 布局 → 组件 → 页面 → 响应式
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌 — 颜色
   -------------------------------------------------------------------------- */
:root {
  /* 页面底与卡片底刻意区分：页面浅灰，容器纯白 */
  --bg-page: #eeeeee;
  --bg-surface: #ffffff;
  --bg-subtle: #fafafa;
  --bg-inset: #f5f5f5;
  --bg-hover: #f5f5f5;
  --bg-active: #ebedef;

  --text-primary: #333333;
  --text-strong: #454545;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-inverse: #ffffff;

  --border: #f5f5f5;
  --border-color: #f5f5f5;
  --divider: #f0f0f0;
  --border-strong: #d8d8d8;

  --like: #ff3333;
  --danger: #f4212e;
  --success: #2f9e63;

  --shadow-xs: 0 1px 2px rgb(16 24 40 / 0.04);
  --shadow-sm: 0 1px 3px rgb(16 24 40 / 0.06);
  --shadow-md: 0 4px 14px rgb(16 24 40 / 0.08);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.25);
  --shadow-focus: 0 0 0 3px rgb(29 155 240 / 0.28);

  --scrim: rgb(16 24 40 / 0.45);

  /* 强调色：由 html 上的内联样式覆盖 --accent-light / --accent-dark */
  --accent: var(--accent-light, #333333);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-contrast: var(--text-inverse);
  --accent-hover: #272727;

  /* 右下角悬浮工具组的悬浮底色（与参考站取值一致） */
  --go-top-hover: #272727;
}

[data-theme="dark"] {
  --bg-page: #1b1b1b;
  --bg-surface: #1b1b1b;
  --bg-subtle: #292929;
  --bg-inset: #292929;
  --bg-hover: #333333;
  --bg-active: #3a3a3a;

  --text-primary: #cccccc;
  --text-strong: #e0e0e0;
  --text-secondary: #a4abb3;
  --text-muted: #868d95;
  --text-inverse: #0d1117;

  --border: #2b2b2b;
  --border-color: #2b2b2b;
  --divider: #2b2b2b;
  --border-strong: #5f5f5f;

  --like: #ff3333;
  --danger: #f4212e;
  --success: #5ec98d;

  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 14px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.6);

  --scrim: rgb(0 0 0 / 0.62);

  --accent: var(--accent-dark, #1d9bf0);
  --accent-hover: #1a8cd8;
  --accent-contrast: #0b1620;

  /* 深色下悬浮工具组用略亮的灰，避免和 #1b1b1b 页面底色糊在一起 */
  --go-top-hover: #4a4a4a;
}

:root {
  --accent-light: #333333;
  --accent-dark: #1d9bf0;
}

.radius-small {
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 12px;
}

.radius-medium {
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

.radius-large {
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
}

/* --------------------------------------------------------------------------
   2. 设计令牌 — 字体 / 间距 / 尺寸
   -------------------------------------------------------------------------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, Helvetica,
    Arial, sans-serif;
  --font-serif: Georgia, "Songti SC", "Noto Serif SC", "Source Han Serif SC",
    "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Fira Code",
    Menlo, Consolas, monospace;

  /* 基准 16px，与参考站点一致 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;

  --lh-tight: 1.35;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;
  --lh-loose: 1.75;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* 布局关键尺寸（对齐参考站点） */
  --sidebar-w: 200px;
  --content-w: 750px;
  --cover-h: clamp(240px, 30vw, 340px);
  --gutter: 45px;      /* 资料区左右内边距 */
  --feed-pad: 60px;    /* 动态流左右内边距 */
  --topbar-h: 56px;
}

.font-serif {
  font-family: var(--font-serif);
}

.font-sans {
  font-family: var(--font-sans);
}

/* --------------------------------------------------------------------------
   3. 基础重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + var(--sp-4));
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-size: 1rem;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

a:hover {
  color: var(--accent);
}

img,
svg,
video {
  max-width: 100%;
  vertical-align: middle;
}

img {
  height: auto;
  border-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: var(--sp-6) 0;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

::selection {
  background-color: var(--accent-soft);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (pointer: fine) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background-color: var(--border-strong);
    border: 3px solid var(--bg-page);
    border-radius: 9999px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
  }
}

/* 图标：20×20 线性，与参考站点一致 */
/* 图标：fill 风格（Reicon），path 自带 fill="currentColor"
   注意：不要在这里设 fill:none / stroke —— CSS 优先级高于 path 上的
   presentation attribute，会把图标「抹空」成不可见。
   图标来源与许可见 assets/icons/sprite.svg 头部注释。 */
.svg-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  vertical-align: middle;
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 200;
  padding: var(--sp-2) var(--sp-4);
  background-color: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-md);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   4. 布局骨架
   -------------------------------------------------------------------------- */
.app-layout {
  display: flex;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: 100vh;
  padding: 40px 0 0;
}

/* 主容器：整块白色圆角卡片，承载资料头 / 导航 / 动态流 */
.main-container {
  flex: 1 1 0%;
  min-width: 0;
  max-width: var(--content-w);
  padding: 0 0 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.content-area {
  display: block;
}

/* --------------------------------------------------------------------------
   5. 侧边导航
   -------------------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 24px 20px 24px 24px;
  background: transparent;
  overflow: hidden;
}

/* LOGO：图标 + 站点名，透明底无边框 */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  max-width: 100%;
  margin: 0 0 36px;
  padding: 5px 15px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.5;
  color: var(--text-primary);
  background: transparent;
  border-radius: 0;
}

.sidebar-logo:hover {
  color: var(--text-primary);
}

.sidebar-logo-img {
  display: block;
  flex-shrink: 1;
  width: 60px;
  max-width: 60px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.sidebar-logo-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}

/*
  侧栏图标加粗：叠加 1px 描边
  参考站 .nav-item svg 同时设了 stroke:currentColor，而我们的图标是
  evenodd 空心轮廓（fill 自带 fill="currentColor"），继承下来的 1px 描边
  正好把轮廓压粗一档。实测着墨率由 22.8% → 38.1%，与参考站 38.15% 一致。
  只给侧栏叠加，其它位置保持原样，避免整体变重。
*/
.nav-item .svg-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1;
}

.nav-item .nav-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
}

.sidebar-extra {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-mini-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.15s;
}

.sidebar-mini-btn:hover {
  background: var(--bg-hover);
}

.sidebar-mini-btn .svg-icon {
  width: 18px;
  height: 18px;
}

/* 主题切换：日/月图标互斥显示 */
.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* --------------------------------------------------------------------------
   6. 移动端顶栏与抽屉
   -------------------------------------------------------------------------- */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 60;
  align-items: center;
  gap: var(--sp-3);
  height: var(--topbar-h);
  padding: 0 var(--sp-4);
  background-color: color-mix(in srgb, var(--bg-page) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-color);
}

.topbar-brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 1rem;
  font-weight: 700;
}

.topbar-brand img {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.topbar-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  color: var(--text-primary);
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--bg-hover);
}

.icon-btn .svg-icon {
  width: 20px;
  height: 20px;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background-color: var(--scrim);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.drawer-mask.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(78vw, 300px);
  padding: 24px 20px 24px 24px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.drawer-title {
  font-size: 1.125rem;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   7. 个人资料头部
   -------------------------------------------------------------------------- */
.profile-header {
  position: relative;
  background-color: var(--bg-surface);
}

/* 封面：高 340px，直角（由父容器圆角裁切） */
.profile-cover {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  height: var(--cover-h);
  overflow: clip;
  background-color: var(--bg-subtle);
  z-index: 0;
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.profile-cover.is-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      120% 120% at 12% 0%,
      var(--accent-soft) 0%,
      transparent 62%
    ),
    radial-gradient(90% 90% at 92% 100%, var(--accent-soft) 0%, transparent 58%);
}

/* 头部主体：头像 / 资料 / 社交 横向排列，与封面底部对齐 */
.profile-header-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 var(--gutter) 16px;
}

.profile-avatar-wrap {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 150px;
  height: 150px;
  margin-top: -70px;
}

/* 头像：150px 正圆，4px 描边与卡片底同色，形成"挖空"效果 */
.profile-avatar {
  display: block;
  width: 150px;
  max-width: 100%;
  height: 150px;
  border-radius: 9999px;
  border: 4px solid var(--bg-surface);
  background-color: var(--bg-subtle);
  object-fit: cover;
}

/* 未设置头像时的占位圆 */
.profile-avatar-fallback {
  background-color: var(--bg-subtle);
}

.profile-avatar-fallback::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background-image: radial-gradient(
    circle at 50% 38%,
    var(--border-strong) 0 18%,
    transparent 19%
  ),
  radial-gradient(
    ellipse 42% 30% at 50% 92%,
    var(--border-strong) 0 100%,
    transparent 101%
  );
}

.profile-info {
  flex: 1 1 0%;
  min-width: 0;
  padding-bottom: 10px;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 2px;
  color: var(--text-primary);
}

.profile-bio {
  font-size: 0.875rem;
  line-height: 1.4;
  margin: 0;
  color: var(--text-primary);
}

/* 社交：60×60 圆形填充底 */
.profile-social {
  flex: 0 0 auto;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 15px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.social-link:hover {
  background: var(--bg-hover);
  color: var(--accent);
  transform: translateY(-2px);
}

.social-link .svg-icon {
  width: 22px;
  height: 22px;
}

/* 统计：与封面下沿的内容区同左缩进 */
.profile-stats {
  display: flex;
  gap: 20px;
  padding: 0 var(--gutter) 18px;
  border-bottom: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: var(--radius-md);
}

.stat-count {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   8. 顶部导航 Tabs
   -------------------------------------------------------------------------- */
.profile-nav {
  display: flex;
  gap: 4px;
  padding: 30px 50px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.profile-nav::-webkit-scrollbar {
  display: none;
}

.profile-nav-item {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px 18px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.profile-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.profile-nav-item.active {
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   9. 动态流与卡片
   -------------------------------------------------------------------------- */
.feed-container {
  padding: 0 var(--feed-pad);
}

.feed {
  display: block;
}

/* 卡片：列表项形态 —— 透明底、无圆角，靠底部分隔线划分 */
.post-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  border-radius: 0;
  transition: background 0.15s;
}

/* 分批展示（加载更多）
   仅在有脚本时隐藏后续批次，无脚本时全部内容可见；
   同时 hidden 需显式声明，否则被自定义 display 覆盖 */
html.js .post-card.is-deferred,
html.js .album-cell.is-deferred {
  display: none;
}

.post-card[hidden],
.album-cell[hidden],
.moment-image-cell[hidden] {
  display: none;
}

/* 参考站保留每条卡片的底部分隔线，不做 last-child 特殊处理 */

/* layout-plain：去掉分隔线，纯留白分隔 */
.feed.layout-plain .post-card {
  border-bottom: 0;
}

.post-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 10px;
}

.post-avatar-col {
  flex: 0 0 auto;
}

.post-avatar {
  display: block;
  width: 40px;
  max-width: 100%;
  height: 40px;
  border-radius: 9999px;
  background-color: var(--bg-inset);
  object-fit: cover;
}

.post-body-col {
  flex: 1 1 0%;
  min-width: 0;
}

/* 作者行：基线与时间对齐 */
.post-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.post-header .profile-name {
  display: block;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.post-header .profile-name:hover {
  opacity: 0.7;
}

.post-header .profile-name .post-username {
  font-weight: 400;
}

.post-username {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.post-time {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* 头部内的作者行与时间共用 1.25 行高（参考站如此） */
.post-header .profile-name,
.post-header .post-time {
  line-height: 1.25;
  vertical-align: baseline;
}

.post-time-sep {
  margin-right: 4px;
}

.badge-pinned {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background-color: var(--accent-soft);
  border-radius: 9999px;
}

/* 正文：0.98rem / 1.75 */
.post-content {
  font-size: 0.98rem;
  line-height: var(--lh-loose);
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

/* 摘要态：去掉 pre-wrap，限制行数 */
.post-content.post-content-summary {
  display: block;
  margin-bottom: 0;
  white-space: normal;
  overflow: visible;
}

.post-title-link {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.post-title-link:hover {
  color: var(--accent);
}

/* 媒体：正方形小图，非通栏 */
.media-wrapper {
  margin-top: 8px;
}

.media-single {
  position: relative;
  display: block;
  width: clamp(200px, 60%, 280px);
  max-width: 100%;
  max-height: 420px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin: 0;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.media-single img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-single:hover img {
  transform: scale(1.015);
}

/* 图片比例适配：由 main.js 读取 naturalWidth/Height 后追加对应类，
   让竖图 / 横图保留原始比例，而不是被统一裁成正方形 */
.media-single.is-portrait,
.media-single.is-square,
.media-single.is-landscape {
  aspect-ratio: auto;
}

.media-single.is-square {
  width: clamp(200px, 30vw, 300px);
}

.media-single.is-landscape {
  width: clamp(220px, 40vw, 350px);
}

.media-single.is-portrait img,
.media-single.is-square img,
.media-single.is-landscape img {
  height: auto;
}

.media-grid {
  display: grid;
  gap: 2px;
  width: clamp(200px, 60%, 280px);
  grid-template-columns: repeat(2, 1fr);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-inset);
}

.media-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.media-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.media-grid .media-more {
  position: relative;
}

.media-grid .media-more::after {
  content: "+" attr(data-rest);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  background-color: rgb(0 0 0 / 0.42);
}

/* 操作栏：纵向排列，与正文左对齐 */
.post-meta-actions {
  display: block;
  padding-top: 8px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 9999px;
  background-color: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

a.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

.post-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 15px 8px 0;
  border-radius: 9999px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s, background 0.15s;
}

.action-btn .svg-icon {
  width: 18px;
  height: 18px;
}

.action-count {
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.action-btn:hover {
  color: var(--text-primary);
}

.action-btn.liked {
  color: var(--like);
}

.action-btn.is-active {
  color: var(--accent);
}

/* 分享卡片：音乐 / 视频 / 网址 */
.share-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  overflow: hidden;
}

.share-card:hover {
  border-color: var(--border-strong);
}

.share-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--accent);
  border: 1px solid var(--border-color);
}

.share-card-body {
  min-width: 0;
  flex: 1 1 auto;
}

.share-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.share-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.share-card-embed {
  margin-top: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.share-card-embed iframe {
  display: block;
  width: 100%;
  border: 0;
}

/* 分享按钮的「已复制」气泡 */
.action-btn,
.btn {
  position: relative;
}

.share-tip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--text-primary);
  color: var(--bg-surface);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   10. 分页
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 30px 0 10px;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  color: var(--accent-contrast);
  opacity: 0.88;
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-soft);
}

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn .svg-icon {
  width: 17px;
  height: 17px;
}

/* --------------------------------------------------------------------------
   11. 页面通用头部

   .page-header 用于归档 / 分类 / 标签三个列表页，尺寸逐项量自参考站：
     padding 20px 50px 12px；底边 1px 分隔线；标题 1.5rem / 800 / letter-spacing -0.5px
   左右 50px 与列表内容的 50px 一致（见 .list-page），保证标题和列表左对齐。
   -------------------------------------------------------------------------- */
.page-head {
  margin-bottom: var(--sp-6);
}

.page-header {
  padding: 20px 50px 12px;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.5px;
}

/* 列表页（归档 / 分类 / 标签）：内容与页头同为 50px 内边距 */
.list-page {
  padding: 0 50px;
}

/* 归档分组：页头之下留 15px 呼吸（参考站 .archive-group{padding:15px 50px}） */
.archive-group {
  padding: 15px 0;
}

.archive-group:first-of-type {
  padding-top: 0;
}

.page-desc {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.page-meta {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: var(--sp-8) 0 var(--sp-4);
  font-size: 1.0625rem;
  font-weight: 700;
}

.section-label::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 9999px;
  background-color: var(--accent);
}

.empty-state {
  padding: var(--sp-16) var(--sp-6);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background-color: var(--bg-subtle);
}

.empty-state .empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--sp-4);
  color: var(--text-muted);
}

.empty-state .empty-icon .svg-icon {
  width: 100%;
  height: 100%;
}

.empty-title {
  font-size: 1.0625rem;
  font-weight: 700;
}

.empty-desc {
  margin-top: 6px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   12. 文章详情
   -------------------------------------------------------------------------- */
.article {
  padding: var(--sp-8) var(--feed-pad) var(--sp-10);
}

.article.is-plain {
  padding: var(--sp-2) 0;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}

.article-byline-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  flex: none;
  background-color: var(--bg-inset);
}

.article-byline-main {
  min-width: 0;
}

.article-byline-name {
  font-size: 0.9375rem;
  font-weight: 600;
}

.article-byline-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.article-byline-meta .svg-icon {
  width: 14px;
  height: 14px;
}

.meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 正文排版 */
.prose {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text-primary);
  word-break: break-word;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 1.9em;
  margin-bottom: 0.7em;
  line-height: 1.35;
  scroll-margin-top: 90px;
}

.prose h2 {
  font-size: 1.42em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--divider);
}

.prose h3 {
  font-size: 1.2em;
}

.prose h4 {
  font-size: 1.06em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose strong {
  font-weight: 600;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
  list-style: revert;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose li::marker {
  color: var(--text-muted);
}

.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 0.6em 1.1em;
  border-left: 3px solid var(--accent);
  background-color: var(--bg-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.prose blockquote > * + * {
  margin-top: 0.6em;
}

.prose img {
  border-radius: var(--radius-md);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.prose figure {
  margin: 1.4em 0;
}

.prose figcaption {
  margin-top: 0.6em;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.prose hr {
  margin: 2em 0;
  border-top: 1px solid var(--divider);
}

.prose code {
  padding: 0.16em 0.42em;
  font-size: 0.86em;
  background-color: var(--bg-inset);
  border-radius: var(--radius-sm);
  word-break: break-word;
}

.prose pre {
  margin: 1.4em 0;
  padding: var(--sp-4);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  background-color: var(--bg-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.code-block {
  position: relative;
}

.code-copy {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.code-block:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}

.code-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.code-copy .svg-icon {
  width: 14px;
  height: 14px;
}

.code-copy.done {
  color: var(--success);
  border-color: var(--success);
  opacity: 1;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-color);
  text-align: left;
}

.prose th {
  background-color: var(--bg-subtle);
  font-weight: 600;
}

.prose video,
.prose iframe {
  max-width: 100%;
  border-radius: var(--radius-md);
}

.prose kbd {
  padding: 0.16em 0.4em;
  font-size: 0.82em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
}

.article-footer {
  margin-top: var(--sp-10);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-color);
}

.article-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.article-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}

.copyright-box {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.copyright-box .copyright-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.prev-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: var(--sp-6);
}

.prev-next-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  min-width: 0;
  transition: border-color 0.25s, background 0.25s;
}

.prev-next-item:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

.prev-next-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.prev-next-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prev-next-item.is-next {
  text-align: right;
  align-items: flex-end;
}

.prev-next-item.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* 目录 */
/* 文章详情的目录：内联块（参考站为单栏版式，不放侧栏） */
.toc-inline {
  position: static;
  margin: 14px 0 0;
  padding: 14px 16px;
  font-size: 0.875rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.toc-inline:empty,
.toc-inline:has(> .toc-title:only-child) {
  display: none;
}

.toc-inline .toc-title {
  margin-bottom: 0;
}

.toc-inline .toc-list:not(:empty) {
  margin-top: 10px;
}

.toc {
  position: sticky;
  top: var(--sp-6);
  max-height: calc(100vh - var(--sp-12));
  overflow-y: auto;
  font-size: 0.875rem;
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.toc-title .svg-icon {
  width: 15px;
  height: 15px;
}

.toc-list {
  border-left: 1px solid var(--border-color);
}

.toc-list ul {
  padding-left: 0;
}

.toc-link {
  display: block;
  padding: 5px 0 5px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.level-3 {
  padding-left: var(--sp-6);
}

.toc-link.level-4 {
  padding-left: var(--sp-8);
}

.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   13. 归档 / 分类 / 标签 / 作者
   -------------------------------------------------------------------------- */
/* .archive-group 的间距见第 11 节；.archive-year-label 是年份标题 */
.archive-year-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.archive-year-label small {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
}

.archive-month-label {
  margin: var(--sp-4) 0 var(--sp-1);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.archive-list {
  border-left: 1px solid var(--divider);
  margin-left: 5px;
}

.archive-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-5);
  min-height: 36px;
}

.archive-item::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 9999px;
  background-color: var(--border-strong);
  transition: background-color 0.15s, transform 0.15s;
}

.archive-item:hover::before {
  background-color: var(--accent);
  transform: scale(1.35);
}

.archive-item-date {
  flex: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.archive-item-title {
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-item:hover .archive-item-title {
  color: var(--accent);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: all 0.15s;
}

.tag-cloud-item .tag-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.tag-cloud-item:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
}

.tag-cloud-item:hover .tag-count {
  color: var(--accent);
}

.taxonomy-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.taxonomy-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface);
  transition: all 0.25s;
}

.taxonomy-card:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  transform: translateY(-2px);
}

.taxonomy-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.taxonomy-card-head .svg-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.taxonomy-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.taxonomy-card-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.child-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--sp-5);
}

/* 作者归档头部 */
.author-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--sp-6);
}

.author-avatar {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 9999px;
  object-fit: cover;
  background-color: var(--bg-inset);
}

.author-head-info {
  min-width: 0;
}

.author-head-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   14. 友链（对齐参考站）
   -------------------------------------------------------------------------- */
.page-article.link-page {
  padding: 0 16px;
}

/* 独立页面的正文区（富文本介绍文字） */
.page-content {
  padding: 16px 0 24px;
}

.link-page .page-content {
  padding: 35px 50px 0;
  margin-bottom: 8px;
}

.page-content.post-content {
  font-size: 1rem;
  line-height: 1.7;
  white-space: normal;
}

/* 页面没写正文时，友链区块自己留出顶部间距 */
.page-article.link-page > .link-groups:first-child {
  padding-top: 30px;
}

.link-groups {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 8px;
  padding: 5px 35px 30px;
}

.link-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.link-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
}

.link-group-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-primary);
}

.link-group-icon .svg-icon {
  width: 100%;
  height: 100%;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: var(--text-primary);
  text-decoration: none;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgb(0 0 0 / 0.08);
  border-color: var(--text-primary);
  outline: none;
}

.link-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background-color: var(--bg-hover);
  overflow: hidden;
}

.link-card-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card-logo .svg-icon {
  width: 100%;
  height: 100%;
  color: var(--text-secondary);
}

.link-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.link-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-desc {
  max-width: 16em;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   分类归档 · 文章列表（对齐参考站）
   ========================================================================== */
.article-list {
  padding: 0 50px 20px;
}

.article-card {
  display: flex;
  gap: 14px;
  padding: 30px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.article-card-cover {
  flex: 0 0 auto;
  width: clamp(92px, 9vw, 132px);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-subtle);
}

.article-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 无封面时的占位，保持「左图右文」的栅格不塌陷 */
.article-card-cover.is-empty {
  background-image: linear-gradient(135deg, var(--bg-inset), var(--bg-subtle));
}

.article-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.article-card-title {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card:hover .article-card-title {
  color: var(--accent);
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.article-card-author {
  font-weight: 600;
}

.article-card-date {
  font-variant-numeric: tabular-nums;
}

.article-card-excerpt {
  margin: 0 0 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.article-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-stat .svg-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ==========================================================================
   分类归档 / 独立页面 · 相册（图片网格 + 灯箱）
   ========================================================================== */
.page-article {
  padding: 0 16px;
}

/* 页面主体淡入（参考站行为） */
.main-container > .page-article {
  animation: pageFadeIn 0.4s ease both;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.album-section {
  padding: 16px 35px 28px;
}

.album-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.album-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-bottom: 50px;
  border-bottom: 1px solid var(--border);
}

.album-cell {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-subtle);
}

.album-cell img,
.album-cell video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.album-cell:hover img,
.album-cell:hover video {
  transform: scale(1.06);
}

.album-cell .cell-overlay {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.18);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.album-cell:hover .cell-overlay {
  opacity: 1;
}

.album-cell .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.album-cell .play-icon::after {
  content: "";
  display: block;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}

.album-loading {
  color: var(--text-primary);
  padding: 24px 0;
  font-size: 0.9rem;
}

.album-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  background: rgb(0 0 0 / 0.88);
}

.album-lightbox.open {
  display: flex;
}

.album-lightbox .lb-media {
  max-width: 90vw;
  max-height: 74vh;
  border-style: solid;
  border-color: #fff;
  border-width: 20px 20px 70px 20px;
  border-radius: 10px;
  object-fit: contain;
  background: #000;
}

.album-lightbox .lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.album-lightbox .lb-close:hover {
  background: rgb(255 255 255 / 0.22);
}

.album-lightbox .lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.album-lightbox .lb-nav:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.28);
}

.album-lightbox .lb-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.album-lightbox .lb-prev {
  left: 18px;
}

.album-lightbox .lb-next {
  right: 18px;
}

.album-lightbox .lb-link {
  margin-top: 36px;
  color: #fff;
  font-size: 0.9rem;
  text-decoration: underline;
}

/* 加载更多
   容器默认不显示：没有脚本时点按钮不会有任何反应，露出来只会误导访客。
   只有脚本可用（html.js）时才显示；具体是否真的出现，
   由 JS 按「还有没有下一页」决定（末页时置为 display:none）。 */
.load-more-wrap {
  display: none;
  justify-content: center;
  padding: 35px;
}

html.js .load-more-wrap {
  display: flex;
}

/* 「加载更多」模式下隐藏传统分页（首页 / 归档 / 作者 / 分类 / 标签 都是）。
   分页导航仍然渲染在 HTML 里 —— 无脚本时它可见，作为纯链接的可访问回退，
   爬虫也能顺着 rel="next" 抓到后续页。
   不加 body.home 限定：这几页现在共用 modules/load-more.html 这一套组件。 */
html.js [data-pagination] {
  display: none;
}

.load-more-btn,
.moments-load-more-btn {
  padding: 10px 28px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.load-more-btn:hover,
.moments-load-more-btn:hover {
  border-color: var(--border-strong);
}

.load-more-btn:disabled,
.moments-load-more-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ==========================================================================
   详情页 · 说说（moment）
   ========================================================================== */
.post-card.post-detail.post-moment {
  padding: 30px 60px;
}

.moment-text {
  margin-bottom: 10px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
}

.moment-text:empty {
  display: none;
}

.moment-text a[href] {
  color: var(--accent);
  text-decoration: none;
}

.moment-text a[href]:hover {
  text-decoration: underline;
}

.moment-image-grid {
  display: grid;
  gap: 4px;
  margin: 4px 0 8px;
}

.moment-image-grid.cols-1 {
  display: block;
  width: 80%;
}

.moment-image-grid.cols-2 {
  width: 90%;
  grid-template-columns: repeat(2, 1fr);
}

.moment-image-grid.cols-3 {
  width: 90%;
  grid-template-columns: repeat(3, 1fr);
}

.moment-image-grid.cols-4 {
  width: 90%;
  grid-template-columns: repeat(2, 1fr);
}

.moment-image-grid.cols-many {
  width: 90%;
  grid-template-columns: repeat(3, 1fr);
}

.moment-image-cell {
  position: relative;
  display: block;
  padding-top: 100%;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-subtle);
}

.moment-image-cell img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.moment-image-cell:hover img {
  transform: scale(1.03);
}

.moment-image-grid.cols-1 .moment-image-cell {
  height: auto;
  padding-top: 0;
  background: transparent;
}

.moment-image-grid.cols-1 .moment-image-cell img {
  position: static;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: initial;
}

.moment-video {
  margin-top: 6px;
}

.moment-video:empty {
  display: none;
}

.moment-video video,
.moment-video iframe {
  display: block;
  max-width: 100%;
  max-height: 600px;
  width: auto;
  height: auto;
  border-radius: 8px;
}

/* 正文元素级样式：文章详情以 .post-content 承载富文本（与参考站一致） */
.post-content h1 {
  margin: 12px 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
}

.post-content h2 {
  margin: 10px 0 4px;
  font-size: 1.4rem;
  font-weight: 700;
}

.post-content h3 {
  margin: 8px 0 4px;
  font-size: 1.25rem;
  font-weight: 600;
}

.post-content h4 {
  margin: 8px 0 4px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.post-content p {
  margin: 15px 0;
  min-height: 1.45em;
}

.post-content ul,
.post-content ol {
  padding-left: 20px;
  margin-bottom: 6px;
}

.post-content li {
  margin-bottom: 2px;
}

.post-content li::marker {
  color: var(--text-secondary);
}

.post-content blockquote {
  margin: 8px 0;
  padding-left: 12px;
  color: var(--text-primary);
  border-left: 3px solid var(--border-strong);
}

.post-content code {
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-inset);
  border-radius: 4px;
}

.post-content pre {
  margin: 8px 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #d4d4d4;
  background: #1e1e1e;
  border-radius: var(--radius-md);
}

.post-content pre code {
  padding: 0;
  font-size: inherit;
  color: inherit;
  background: none;
}

.post-content a {
  color: #1d9bf0;
  text-decoration: none;
}

.post-content a:hover {
  opacity: 0.7;
}

.post-content strong {
  font-weight: 700;
}

.post-content hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.post-content table {
  width: 100%;
  margin: 8px 0;
  border-collapse: collapse;
}

.post-content th,
.post-content td {
  padding: 8px 12px;
  font-size: 0.875rem;
  text-align: left;
  border: 1px solid var(--border);
}

.post-content th {
  background: var(--bg-inset);
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 6px 0;
  cursor: zoom-in;
  border-radius: var(--radius-md);
}

.post-content figure {
  margin: 20px 0;
}

.post-content figure img,
.post-content figure video {
  max-width: 820px;
  height: auto;
  margin: 0;
}

.post-content figcaption {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
}

.post-content video {
  max-width: 100%;
  margin: 6px 0;
  border-radius: var(--radius-md);
}

.post-content iframe {
  display: block;
  width: 100%;
  max-width: 600px;
  min-height: 200px;
  margin: 14px auto;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
}

.post-content > *:first-child {
  margin-top: 0;
}

/* ==========================================================================
   详情页 · 文章（article）
   ========================================================================== */
.post-article-wrap {
  padding: 0 50px;
}

.entity-field-title {
  margin: 6px 0 14px;
  padding-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.post-article .post-header {
  margin-bottom: 0;
}

.post-article .post-time {
  display: block;
  margin: 2px 0 10px;
}

.post-article .post-content {
  margin-top: 14px;
}

.post-actions-center {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border-color);
}

.post-actions-center .post-actions {
  padding: 15px 0;
}

/* 评论区（依赖评论组件插件，未安装时由模板给出占位） */
.post-comments {
  padding: 20px 60px 28px;
}

/* 独立页面正文：与文章正文同款排版，但不保留 HTML 源码缩进（参考站如此） */
.page-content.post-content {
  font-size: 1rem;
  line-height: 1.7;
  white-space: normal;
}

/* 独立页面封面 */
.page-cover {
  display: block;
  margin: 0 0 16px;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.page-cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* 评论组件（halo-comment-widget）跟随主题强调色。
   组件通过 CSS 变量暴露配色，这里映射到本主题令牌，
   使得深浅色模式下评论区的按钮/高亮都自动跟随。 */
.post-comments,
.post-comments comment-widget,
comment-widget {
  --halo-cw-primary-1-color: var(--accent) !important;
  --halo-cw-primary-2-color: var(--accent) !important;
  --halo-cw-primary-3-color: var(--accent-contrast) !important;
  --halo-cw-muted-1-color: var(--border-strong) !important;
}

.comments-title {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
}

/* 图片灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  background-color: var(--scrim);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: var(--sp-5);
  right: var(--sp-5);
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background-color: rgb(255 255 255 / 0.14);
  color: #fff;
}

.lightbox-close:hover {
  background-color: rgb(255 255 255 / 0.26);
  color: #fff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background-color: rgb(255 255 255 / 0.14);
  color: #fff;
}

.lightbox-nav:hover {
  background-color: rgb(255 255 255 / 0.26);
  color: #fff;
}

.lightbox-nav.prev {
  left: var(--sp-4);
}

.lightbox-nav.next {
  right: var(--sp-4);
}

/* --------------------------------------------------------------------------
   15. 页脚
   -------------------------------------------------------------------------- */
.site-footer {
  padding: var(--sp-6) var(--feed-pad) var(--sp-4);
  border-top: 1px solid var(--border-color);
  margin-top: var(--sp-6);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.9;
  text-align: center;
}

/* 页脚各行居中（.footer-links 是 flex，光靠 text-align 管不到 flex item） */
.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-sep {
  color: var(--border-strong);
}

.footer-line + .footer-line {
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   16. 二维码弹窗
   -------------------------------------------------------------------------- */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}

.qr-modal[hidden] {
  display: none;
}

.qr-mask {
  position: absolute;
  inset: 0;
  background-color: var(--scrim);
  backdrop-filter: blur(4px);
}

.qr-box {
  position: relative;
  width: min(320px, 86vw);
  padding: 50px 24px 25px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: qr-pop 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.qr-img {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background-color: #fff;
}

.qr-title {
  margin-top: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.qr-close {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  width: 34px;
  height: 34px;
}

@keyframes qr-pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --------------------------------------------------------------------------
   17. 右下角悬浮工具组（二维码 / 配色切换 / 回到顶部）& 阅读进度

   间距体系与参考站逐像素对齐：三个按钮同为 25×25、圆角 4px、底色 #535353，
   竖向 pitch 固定 33px（25 高 + 8 间隔），bottom 依次 216 / 183 / 150。
   二维码与配色常驻可见；回到顶部默认在 bottom:22px 并淡出，滚动后上移到 150px。
   水平位置由 main.js 的 initFloatTools() 动态计算（贴着主卡片右边缘 + 20px）。
   -------------------------------------------------------------------------- */
.footer-qr,
.theme-toggle,
.go-top {
  position: fixed;
  right: 20px;
  z-index: 999;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 4px;
  background-color: #535353;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  -webkit-tap-highlight-color: transparent;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.footer-qr:hover,
.theme-toggle:hover,
.go-top:hover {
  background-color: var(--go-top-hover, var(--accent-hover));
  transform: translateY(-2px) scale(1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.footer-qr:active,
.theme-toggle:active,
.go-top:active {
  transform: translateY(0) scale(0.94);
}

.footer-qr:focus-visible,
.theme-toggle:focus-visible,
.go-top:focus-visible {
  outline: 2px solid var(--like-color, #ff3333);
  outline-offset: 2px;
}

.footer-qr {
  bottom: 216px;
}

.footer-qr .svg-icon {
  width: 15px;
  height: 15px;
}

.theme-toggle {
  bottom: 183px;
}

.theme-toggle .svg-icon {
  width: 14px;
  height: 14px;
}

.go-top {
  bottom: 22px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.96);
}

.go-top .svg-icon {
  width: 14px;
  height: 14px;
}

.go-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  bottom: 150px;
}

@media (prefers-reduced-motion: reduce) {
  .footer-qr,
  .theme-toggle {
    transition: background 0.15s ease;
  }
  .go-top {
    transition: opacity 0.2s ease;
    transform: none;
  }
  .footer-qr:hover,
  .theme-toggle:hover,
  .go-top:hover,
  .go-top.is-visible {
    transform: none;
  }
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  height: 2px;
  width: 0;
  background-color: var(--accent);
  transition: width 80ms linear;
}

/* --------------------------------------------------------------------------
   18. 响应式
   -------------------------------------------------------------------------- */

/* 文章页三栏（正文 + 目录） */
@media (min-width: 1240px) {
  .article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: var(--sp-8);
    align-items: start;
  }

  .article-layout .article-aside {
    position: sticky;
    top: var(--sp-6);
  }
}

@media (max-width: 1239px) {
  .article-aside {
    display: none;
  }
}

/* 中等屏：侧栏收窄为图标条 */
@media (max-width: 1100px) {
  .sidebar {
    width: 100px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .sidebar-logo {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 24px;
  }

  .sidebar-logo-text {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
  }

  .nav-item .nav-label {
    display: none;
  }

  .sidebar-mini-btn {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
  }

  .sidebar-mini-btn span {
    display: none;
  }

  /* 友链：两列（窄屏时不再压缩单卡宽度） */
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 平板/手机：纵向堆叠，隐藏侧栏，容器去边框 */
@media (max-width: 768px) {
  .topbar {
    display: flex;
  }

  .app-layout {
    flex-direction: column;
    padding-top: 0;
  }

  .app-layout > .sidebar {
    display: none;
  }

  .main-container {
    max-width: 100%;
    border: none;
    border-radius: 0;
  }

  .feed-container {
    padding: 0 30px;
  }

  .profile-nav {
    padding: 30px;
  }

  .article {
    padding: var(--sp-6) 30px var(--sp-8);
  }

  .site-footer {
    padding-left: 30px;
    padding-right: 30px;
  }

  /* 窄屏：悬浮工具组退回视口右下角（不再贴卡片外沿） */
  .footer-qr,
  .theme-toggle,
  .go-top {
    right: 20px;
  }

  /* 友链：收紧间距 */
  .link-grid {
    gap: 12px;
  }

  .link-groups {
    gap: 24px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
    --fs-3xl: 26px;
  }

  .profile-header-body {
    gap: 12px;
    padding: 0 var(--gutter) 12px;
  }

  .profile-avatar-wrap,
  .profile-avatar {
    width: 110px;
    height: 110px;
  }

  .profile-avatar-wrap {
    margin-top: -55px;
  }

  .profile-stats {
    padding: 0 var(--gutter) 14px;
  }

  .feed-container {
    padding: 0 30px;
  }

  .profile-nav {
    padding: 15px;
  }

  .profile-nav-item {
    padding: 6px 14px;
    font-size: 0.875rem;
  }

  .article {
    padding: var(--sp-5) 20px var(--sp-8);
  }

  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .article-title {
    font-size: 1.4rem;
  }

  .prose {
    font-size: 1rem;
    line-height: 1.8;
  }

  .prose pre {
    margin-left: -20px;
    margin-right: -20px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .prev-next {
    grid-template-columns: minmax(0, 1fr);
  }

  .prev-next-item.is-next {
    text-align: left;
    align-items: flex-start;
  }

  .link-grid,
  .taxonomy-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-card-title {
    font-size: 1rem;
  }

  .album-section {
    padding: 14px 16px 24px;
  }

  .album-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .album-cell {
    border-radius: 6px;
  }

  .album-lightbox .lb-media {
    max-height: 66vh;
    border-width: 5px 5px 35px 5px;
  }

  .post-content,
  .moment-text {
    font-size: 1rem;
    line-height: 1.55;
  }
}

@media (max-width: 500px) {
  .feed-container {
    padding: 0 10px;
  }

  .post-card {
    padding: 20px 12px 12px;
  }

  .article-list {
    padding: 0 10px 20px;
  }

  .entity-field-title {
    font-size: 1.2rem;
  }

  .post-article-wrap {
    padding: 0 10px;
  }

  .post-comments {
    padding: 20px 20px 28px;
  }

  .post-card.post-detail.post-moment {
    padding: 20px 10px;
  }

  .media-single,
  .media-grid {
    width: 100%;
  }

  .action-btn {
    padding: 8px 12px 8px 0;
  }

  .pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .pagination .btn {
    justify-content: center;
  }

  .pagination-info {
    text-align: center;
    order: -1;
  }

  /* 友链：单列 */
  .link-groups {
    padding: 18px 16px;
  }

  .link-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .link-card {
    gap: 12px;
    padding: 12px;
  }

  .link-card-logo {
    width: 44px;
    height: 44px;
  }

  .link-card-title {
    font-size: 0.875rem;
  }

  .link-card-desc {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 列表页页头 / 内容区：窄屏收紧内边距（放在末尾以确保覆盖上面的同名规则） */
@media (max-width: 1100px) {
  .page-header {
    padding: 20px 30px 12px;
  }

  .list-page {
    padding: 0 30px;
  }
}

@media (max-width: 500px) {
  .page-header {
    padding: 16px 10px 10px;
  }

  .list-page {
    padding: 0 10px;
  }
}

@media print {
  .sidebar,
  .topbar,
  .site-footer,
  .footer-qr,
  .theme-toggle,
  .go-top,
  .drawer,
  .drawer-mask,
  .article-aside {
    display: none !important;
  }

  .app-layout {
    display: block;
    padding: 0;
  }

  .main-container {
    max-width: 100%;
    border: none;
    border-radius: 0;
  }

  .article {
    padding: 0;
  }

  .feed-container {
    padding: 0;
  }
}
