/*
Theme Name: Trilight
Theme URI: https://www.trilightlab.com
Author: Trilightlab
Author URI: https://www.trilightlab.com
Description: 一个为长文阅读与作品展示打造的极简宽屏 WordPress 主题。固定深色模式、响应式卡片网格、优雅的中文排版与代码高亮，适合 AI、技术与创作类博客。
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trilight
Tags: blog, minimal, responsive, full-width, dark-mode, two-columns, custom-menu, featured-images, translation-ready
*/

/* =========================================================
   1. 设计变量（Design Tokens）
   ========================================================= */
:root {
  /* 颜色 —— 固定深色模式 */
  --bg: #0c0c0e;
  --bg-soft: #16161a;
  --bg-elevated: #161619;
  --text: #f4f4f5;
  --text-soft: #b4b4bd;
  --text-muted: #76767f;
  --border: #232328;
  --border-strong: #303036;
  --accent: #8b8bf5;
  --accent-hover: #a3a3ff;
  --accent-soft: rgba(139, 139, 245, 0.14);
  --code-bg: #16161a;
  --code-text: #c9c9f0;
  --selection: rgba(139, 139, 245, 0.26);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);

  /* 排版 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC",
    Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Georgia", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", "Menlo",
    "Consolas", "Liberation Mono", monospace;

  /* 尺寸 */
  --wide: 1280px;       /* 宽屏容器 */
  --content: 1140px;    /* 内容容器 */
  --reading: 720px;     /* 文章阅读宽度 */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --header-h: 68px;
  --gutter: clamp(20px, 5vw, 48px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  overflow-x: hidden;
}

::selection { background: var(--selection); }

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 0.6em;
}

p { margin: 0 0 1.25em; }

button { font-family: inherit; cursor: pointer; }

/* =========================================================
   3. 布局容器
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--wide); }
.container--reading { max-width: var(--reading); }

.site-main { padding-block: clamp(40px, 6vw, 72px); min-height: 60vh; }

/* 跳过链接（无障碍） */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: 12px; top: 12px; color: #fff; }

/* =========================================================
   4. 顶部导航
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.site-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.site-brand a { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #b07be0);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name {
  font-weight: 750;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* 主菜单 */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.main-nav a:hover { color: var(--text); background: var(--bg-soft); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: var(--text);
  background: var(--accent-soft);
}
.main-nav .sub-menu {
  position: absolute;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 180px;
  padding: 6px;
  margin-top: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.18s var(--ease);
}
.main-nav li { position: relative; }
.main-nav li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* 图标按钮（搜索、菜单） */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  transition: all 0.18s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-soft); }
.icon-btn svg { width: 19px; height: 19px; }

.menu-toggle { display: none; }

/* 移动端抽屉菜单 */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 99;
  background: var(--bg);
  padding: 24px var(--gutter) 48px;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s var(--ease);
  overflow-y: auto;
}
.mobile-nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav a {
  display: block;
  padding: 14px 6px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.mobile-nav .sub-menu a { font-size: 1rem; font-weight: 500; padding-left: 22px; color: var(--text-soft); }

/* =========================================================
   5. 页面头部 / Hero（首页宽屏图片）
   ========================================================= */
.page-hero--image {
	padding: 0;
	border-bottom: none;
	/* 突破容器，全宽显示 */
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.page-hero__image-wrap {
	width: 100%;
	aspect-ratio: 21 / 9;
	overflow: hidden;
	background: var(--bg-soft);
}

.page-hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* 预留：若将来恢复文字 Hero，保留原样式（不会被上方覆盖） */
.page-hero--text {
	padding-block: clamp(48px, 8vw, 96px) clamp(28px, 4vw, 48px);
	border-bottom: 1px solid var(--border);
}
.page-hero--text .page-hero__eyebrow {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 14px;
}
.page-hero--text .page-hero__title {
	font-size: clamp(2rem, 5vw, 3.2rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	margin: 0 0 0.4em;
}
.page-hero--text .page-hero__desc {
	font-size: clamp(1.05rem, 2vw, 1.25rem);
	color: var(--text-soft);
	max-width: 60ch;
	margin: 0;
}

/* =========================================================
   6. 文章卡片网格
   ========================================================= */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: clamp(24px, 3vw, 40px);
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.post-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
  display: block;
}
.post-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.post-card:hover .post-card__thumb img { transform: scale(1.045); }
.post-card__thumb--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
}
.post-card__thumb--placeholder span {
  font-size: 2.4rem; font-weight: 800; color: var(--accent); opacity: 0.5;
}

.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }

.post-card__cat {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 11px;
}
.post-card__title {
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px;
}
.post-card__title a { color: var(--text); }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.65;
  margin: 0 0 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.post-card__meta time { white-space: nowrap; }
.post-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }

/* 置顶 / 第一篇大卡 (可选 feature) */
.posts-grid .post-card--feature {
  grid-column: 1 / -1;
}
@media (min-width: 820px) {
  .posts-grid .post-card--feature {
    flex-direction: row;
    align-items: stretch;
  }
  .posts-grid .post-card--feature .post-card__thumb {
    width: 52%;
    aspect-ratio: auto;
  }
  .posts-grid .post-card--feature .post-card__body {
    justify-content: center;
    padding: clamp(28px, 4vw, 52px);
  }
  .posts-grid .post-card--feature .post-card__title { font-size: clamp(1.5rem, 2.5vw, 2.1rem); }
  .posts-grid .post-card--feature .post-card__excerpt { font-size: 1.02rem; -webkit-line-clamp: 4; }
}

/* =========================================================
   6b. 文章列表（新闻媒体风格，封面图可选）
   ========================================================= */
.posts-list {
  max-width: 860px;
  margin-inline: auto;
}

/* 首页内容区：适度加宽，同时控制单行长度以保证可读性 */
.blog .posts-list { max-width: 1040px; }

/* =========================================================
   6c. 首页开源项目展示（hero 下方三栏）
   ========================================================= */
.oss-projects {
  padding-block: clamp(36px, 5vw, 64px);
  border-bottom: 1px solid var(--border);
}
.oss-projects__head {
  max-width: 640px;
  margin: 0 auto clamp(26px, 3.5vw, 42px);
  text-align: center;
}
.oss-projects__eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.oss-projects__heading {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.oss-projects__sub {
  color: var(--text-soft);
  font-size: 1rem;
  margin: 0;
}

.oss-projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 32px);
  align-items: start;
}

.oss-card { min-width: 0; }

.oss-card__visual {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  margin-bottom: 18px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.oss-card:hover .oss-card__visual {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.oss-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}
.oss-card:hover .oss-card__img { transform: scale(1.04); }

/* 无封面时的占位 */
.oss-card__ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  background:
    radial-gradient(130% 100% at 50% -10%, var(--accent-soft), transparent 56%),
    var(--bg-soft);
}

/* 卡片文字 */
.oss-card__title {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.oss-card__title a { color: var(--text); transition: color 0.18s var(--ease); }
.oss-card__title a:hover { color: var(--accent); }
.oss-card__desc {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 14px;
}
.oss-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.86rem;
  font-weight: 600;
}
.oss-card__links a { color: var(--accent); }
.oss-card__links a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .oss-projects__grid { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }
}

.post-row {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  align-items: flex-start;
  padding-block: clamp(26px, 3.5vw, 40px);
  border-bottom: 1px solid var(--border);
}
.post-row:first-child { padding-top: 0; }

.post-row__body { flex: 1; min-width: 0; }

.post-row__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 1em;
}
.post-row__cat {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.post-row__title {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.post-row__title a { color: var(--text); transition: color 0.18s var(--ease); }
.post-row__title a:hover { color: var(--accent); }

.post-row__excerpt {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-row__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.post-row__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }

/* 右侧缩略图（仅有封面时出现） */
.post-row__thumb {
  flex-shrink: 0;
  width: clamp(116px, 22vw, 208px);
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
}
.post-row__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.post-row:hover .post-row__thumb img { transform: scale(1.05); }

/* 头条（首页首篇） */
.post-row--lead {
  display: block;
  padding-top: 0;
  padding-bottom: clamp(34px, 4.5vw, 52px);
}
.post-row--lead .post-row__cover {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: clamp(20px, 3vw, 30px);
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
}
.post-row--lead .post-row__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.post-row--lead:hover .post-row__cover img { transform: scale(1.03); }
.post-row--lead .post-row__title { font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.2; margin-bottom: 16px; }
.post-row--lead .post-row__excerpt { font-size: 1.1rem; -webkit-line-clamp: 3; max-width: 64ch; }

/* =========================================================
   7. 分页
   ========================================================= */
.pagination {
  margin-top: clamp(40px, 6vw, 72px);
  display: flex;
  justify-content: center;
}
.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  font-weight: 500;
  transition: all 0.18s var(--ease);
}
.pagination .page-numbers:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-soft); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .dots { border: none; }

/* =========================================================
   8. 单篇文章 / 页面
   ========================================================= */
.entry-header { padding-block: clamp(40px, 6vw, 72px) 0; }
.entry-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.entry-header__cat {
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}
.entry-title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin: 0 0 0.5em;
}
.entry-subhead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-soft);
  margin: 0 0 8px;
}
.entry-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding-block: 22px;
}
.entry-avatar { width: 40px; height: 40px; border-radius: 50%; }
.entry-byline strong { color: var(--text); font-weight: 600; }

.featured-media {
  margin-block: clamp(28px, 4vw, 44px);
}
.featured-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* 正文排版（prose） */
.entry-content {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text);
}
.entry-content > * { margin-bottom: 1.5em; }
.entry-content h2 {
  font-size: 1.6rem;
  margin-top: 2em;
  padding-top: 0.2em;
  letter-spacing: -0.02em;
}
.entry-content h3 { font-size: 1.32rem; margin-top: 1.8em; }
.entry-content h4 { font-size: 1.12rem; margin-top: 1.5em; }
.entry-content a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.entry-content a:hover { text-decoration-color: var(--accent); }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content li::marker { color: var(--accent); }

.entry-content img { border-radius: var(--radius-sm); margin-inline: auto; }
.entry-content figure { margin: 2em 0; }
.entry-content figcaption {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.entry-content blockquote {
  margin: 2em 0;
  padding: 6px 0 6px 24px;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
  font-size: 1.12rem;
  font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

/* 行内代码 + 代码块 */
.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.entry-content pre {
  font-family: var(--font-mono);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.7;
}
.entry-content pre code { background: none; border: none; padding: 0; color: var(--text); font-size: inherit; }

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.entry-content th, .entry-content td {
  padding: 11px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.entry-content th { background: var(--bg-soft); font-weight: 600; }

.entry-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

/* 标签 */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-block: clamp(36px, 5vw, 56px) 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.entry-tags a {
  font-size: 0.85rem;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 99px;
  transition: all 0.18s var(--ease);
}
.entry-tags a:hover { color: var(--accent); border-color: var(--accent); }

/* 上一篇 / 下一篇 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-block: clamp(40px, 6vw, 64px);
}
.post-nav a {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: all 0.25s var(--ease);
}
.post-nav a:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.post-nav .label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.post-nav .title { display: block; margin-top: 6px; font-weight: 600; color: var(--text); }
.post-nav .next { text-align: right; }

/* 作者卡 */
.author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 28px;
  margin-block: clamp(36px, 5vw, 56px);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.author-box img { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; }
.author-box__name { font-weight: 700; font-size: 1.1rem; margin: 0 0 6px; }
.author-box__bio { color: var(--text-soft); font-size: 0.95rem; margin: 0; }

/* =========================================================
   9. 影集 / 图集（gallery）
   ========================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.gallery-grid img { border-radius: var(--radius-sm); aspect-ratio: 1; object-fit: cover; width: 100%; }

/* =========================================================
   10. 评论
   ========================================================= */
.comments-area { margin-top: clamp(40px, 6vw, 64px); }
.comments-title { font-size: 1.5rem; margin-bottom: 28px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin-bottom: 26px; }
.comment-body {
  padding: 20px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.comment-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.comment-author { font-weight: 600; }
.comment-metadata, .comment-metadata a { font-size: 0.82rem; color: var(--text-muted); }
.comment-list .children { list-style: none; margin: 22px 0 0; padding-left: clamp(16px, 4vw, 40px); }

.comment-respond {
  margin-top: 40px;
  padding: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.comment-form label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
}
.comment-form textarea:focus,
.comment-form input:focus,
.search-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* =========================================================
   11. 按钮
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.96rem;
  transition: all 0.2s var(--ease);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--text); border-color: var(--text-muted); }

/* 提交按钮统一 */
.comment-form input[type="submit"],
.wp-block-button__link,
.search-submit {
  display: inline-flex;
  align-items: center;
  padding: 12px 26px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.96rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.comment-form input[type="submit"]:hover,
.search-submit:hover { background: var(--accent-hover); }

/* =========================================================
   12. 搜索
   ========================================================= */
.search-form { display: flex; gap: 8px; }
.search-field {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

/* 搜索弹层 */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  background: color-mix(in srgb, var(--bg) 70%, rgba(0,0,0,0.4));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease);
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay__inner {
  width: min(640px, 90vw);
  transform: translateY(-10px);
  transition: transform 0.25s var(--ease);
}
.search-overlay.is-open .search-overlay__inner { transform: translateY(0); }
.search-overlay .search-field {
  font-size: 1.4rem;
  padding: 20px 24px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}
.search-overlay__hint { text-align: center; margin-top: 16px; color: var(--text-muted); font-size: 0.85rem; }

/* =========================================================
   13. 页脚
   ========================================================= */
.site-footer {
  margin-top: clamp(60px, 8vw, 110px);
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding-block: clamp(48px, 6vw, 72px) 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(32px, 5vw, 64px);
}
.footer-about__name { font-weight: 750; font-size: 1.2rem; margin: 0 0 10px; }
.footer-about p { color: var(--text-soft); font-size: 0.95rem; max-width: 38ch; margin: 0; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--text-soft); font-size: 0.95rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: clamp(40px, 5vw, 60px);
  padding-block: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: 9px;
  color: var(--text-soft);
}
.footer-social a:hover { color: var(--accent); border-color: var(--accent); }
.footer-social svg { width: 17px; height: 17px; }

/* =========================================================
   14. 工具类 & 杂项
   ========================================================= */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.sticky-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; color: var(--accent);
}

/* WP 对齐 */
.alignleft { float: left; margin: 0.4em 1.6em 1em 0; }
.alignright { float: right; margin: 0.4em 0 1em 1.6em; }
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.86rem; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* 全宽 / 宽对齐块 */
.alignwide { width: min(var(--wide), 100%); margin-inline: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }

/* 进度条（阅读进度） */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 90;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all 0.25s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* 入场动画 */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* =========================================================
   15. 响应式
   ========================================================= */
@media (max-width: 900px) {
  .main-nav, .search-toggle-desktop { display: none; }
  .menu-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .brand-tagline { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .post-row { gap: 16px; }
  .post-row__thumb { width: 104px; aspect-ratio: 1; }
  .post-row__excerpt { -webkit-line-clamp: 2; }
}

@media (max-width: 420px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   16. 图集 / 影集（瀑布流 + 灯箱）
   ========================================================= */
.gallery-hero { border-bottom: none; padding-bottom: clamp(16px, 3vw, 32px); }
.gallery-intro { max-width: 64ch; }
.gallery-intro p:last-child { margin-bottom: 0; }

/* 瀑布流：按列宽自动分列，天然响应式 */
.tl-gallery {
  columns: 320px 3;
  column-gap: clamp(12px, 1.4vw, 20px);
}
.tl-gallery__item {
  break-inside: avoid;
  margin: 0 0 clamp(12px, 1.4vw, 20px);
  display: block;
}
.tl-gallery__link {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
}
.tl-gallery__link img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
  will-change: transform;
}
.tl-gallery__link:hover img { transform: scale(1.05); }

/* 悬停浮层：底部渐变 + 图注 + 放大图标 */
.tl-gallery__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.08) 45%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.tl-gallery__link:hover .tl-gallery__overlay,
.tl-gallery__link:focus-visible .tl-gallery__overlay { opacity: 1; }
.tl-gallery__cap {
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  transform: translateY(6px);
  transition: transform 0.35s var(--ease);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.tl-gallery__link:hover .tl-gallery__cap { transform: translateY(0); }
.tl-gallery__icon {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  transform: scale(0.85);
  transition: transform 0.35s var(--ease);
}
.tl-gallery__link:hover .tl-gallery__icon { transform: scale(1); }
.tl-gallery__icon svg { width: 16px; height: 16px; }

/* 灯箱 */
.tl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 11, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.tl-lightbox.is-open { opacity: 1; visibility: visible; }

.tl-lb__stage {
  margin: 0;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.tl-lb__img {
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.tl-lightbox.is-open .tl-lb__img { transform: scale(1); opacity: 1; }
.tl-lb__img.is-switching { opacity: 0; transform: scale(0.985); }
.tl-lb__caption {
  color: rgba(255,255,255,0.82);
  font-size: 0.95rem;
  text-align: center;
  max-width: 70ch;
  line-height: 1.5;
}
.tl-lb__caption:empty { display: none; }

/* 灯箱控件 */
.tl-lb__close,
.tl-lb__nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255,255,255,0.10);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.tl-lb__close:hover,
.tl-lb__nav:hover { background: rgba(255,255,255,0.22); }
.tl-lb__close { top: 20px; right: 22px; width: 46px; height: 46px; }
.tl-lb__close svg { width: 22px; height: 22px; }
.tl-lb__nav { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; }
.tl-lb__nav:hover { transform: translateY(-50%) scale(1.06); }
.tl-lb__prev { left: 22px; }
.tl-lb__next { right: 22px; }
.tl-lb__nav svg { width: 26px; height: 26px; }
.tl-lb__counter {
  position: absolute;
  top: 26px; left: 26px;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .tl-lb__nav { width: 44px; height: 44px; }
  .tl-lb__prev { left: 10px; }
  .tl-lb__next { right: 10px; }
  .tl-lb__close { top: 12px; right: 12px; }
  .tl-lb__counter { top: 16px; left: 16px; }
}
