/* =========================================================
   清逸博客 · 全局样式
   设计语言：卡片杂志风 · 暖纸白 / 深青主色 · 支持暗黑模式
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: oklch(96.8% 0.006 85);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(95% 0.008 85);
  --text: oklch(24% 0.02 85);
  --text-2: oklch(46% 0.015 85);
  --text-3: oklch(58% 0.012 85);
  --brand: oklch(56% 0.11 190);
  --brand-deep: oklch(46% 0.1 190);
  --brand-soft: oklch(92% 0.04 190);
  --border: oklch(89% 0.008 85);
  --header-bg: oklch(100% 0 0 / 0.72);
  --code-bg: oklch(94% 0.008 200);
  --shadow-card: 0 1px 2px oklch(0% 0 0 / 0.04), 0 8px 24px oklch(0% 0 0 / 0.06);
  --shadow-lift: 0 2px 4px oklch(0% 0 0 / 0.05), 0 18px 44px oklch(0% 0 0 / 0.1);
  --radius: 14px;
  --font-sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --header-h: 60px;
}

:root[data-theme="dark"] {
  --bg: oklch(16.5% 0.012 240);
  --surface: oklch(21% 0.014 240);
  --surface-2: oklch(25.5% 0.014 240);
  --text: oklch(92% 0.006 240);
  --text-2: oklch(74% 0.01 240);
  --text-3: oklch(58% 0.012 240);
  --brand: oklch(75% 0.09 190);
  --brand-deep: oklch(82% 0.08 190);
  --brand-soft: oklch(30% 0.05 190);
  --border: oklch(30% 0.012 240);
  --header-bg: oklch(18% 0.012 240 / 0.78);
  --code-bg: oklch(26% 0.012 240);
  --shadow-card: 0 1px 2px oklch(0% 0 0 / 0.3), 0 8px 24px oklch(0% 0 0 / 0.35);
  --shadow-lift: 0 2px 4px oklch(0% 0 0 / 0.35), 0 18px 44px oklch(0% 0 0 / 0.45);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

body::before {
  /* 背景点缀：顶部一抹品牌色的柔光 */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 38% at 18% -4%, var(--brand-soft), transparent 70%),
    radial-gradient(50% 30% at 95% -6%, oklch(92% 0.05 45 / 0.5), transparent 70%);
  pointer-events: none;
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(60% 38% at 18% -4%, oklch(28% 0.05 190 / 0.5), transparent 70%),
    radial-gradient(50% 30% at 95% -6%, oklch(26% 0.05 45 / 0.4), transparent 70%);
}

img { max-width: 100%; display: block; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.4; margin: 0 0 0.6em; }

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

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 8px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  height: 100%; display: flex; align-items: center; gap: 24px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif); font-size: 20px; font-weight: 700;
  color: var(--text); white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), oklch(60% 0.12 250));
  color: #fff; font-family: var(--font-serif); font-size: 17px; font-weight: 700;
  box-shadow: 0 4px 12px oklch(56% 0.11 190 / 0.35);
}

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav a {
  color: var(--text-2); font-size: 15px; padding: 6px 12px; border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
}
.main-nav a:hover { color: var(--brand-deep); background: var(--surface-2); text-decoration: none; }
.main-nav a.active { color: var(--brand-deep); background: var(--brand-soft); font-weight: 600; }

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

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; transition: all 0.2s;
}
.icon-btn:hover { color: var(--brand-deep); border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }

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

.hamburger { display: none; }

/* 移动端抽屉菜单 */
.mobile-nav {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(78vw, 320px);
  z-index: 150; background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(105%); transition: transform 0.3s ease;
  padding: 24px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: -12px 0 40px oklch(0% 0 0 / 0.15);
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav a {
  color: var(--text-2); font-size: 17px; padding: 12px 14px; border-radius: 10px;
}
.mobile-nav a.active { color: var(--brand-deep); background: var(--brand-soft); font-weight: 600; }
.mobile-nav .mobile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.nav-mask {
  position: fixed; inset: 0; z-index: 140; background: oklch(0% 0 0 / 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.nav-mask.open { opacity: 1; pointer-events: auto; }

/* ---------- 页面英雄区 ---------- */
.page-hero { padding: 46px 0 8px; }
.page-hero h1 {
  font-size: clamp(26px, 4vw, 34px); margin-bottom: 8px;
  display: flex; align-items: center; gap: 14px;
}
.page-hero h1::before {
  content: ""; width: 8px; height: 0.9em; border-radius: 4px;
  background: linear-gradient(180deg, var(--brand), oklch(60% 0.12 250));
}
.page-hero p { color: var(--text-2); margin: 0; max-width: 640px; }
.breadcrumb { color: var(--text-3); font-size: 14px; margin-bottom: 10px; }

/* ---------- 首页英雄区 ---------- */
.hero {
  position: relative;
  border-radius: 20px;
  padding: 40px 44px;
  margin: 26px 0 34px;
  overflow: hidden;
  background:
    linear-gradient(120deg, var(--brand-soft), var(--surface) 62%);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
}
.hero h1 {
  font-size: clamp(24px, 3.4vw, 32px); margin-bottom: 10px;
}
.hero p { color: var(--text-2); margin: 0 0 20px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); transform: translateY(-1px); text-decoration: none; box-shadow: 0 8px 20px oklch(56% 0.11 190 / 0.35); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); transform: translateY(-1px); text-decoration: none; }
.hero-deco { flex-shrink: 0; }
.hero-deco svg { width: 160px; height: 160px; opacity: 0.9; }
:root[data-theme="dark"] .hero-deco svg { opacity: 0.75; }

/* ---------- 布局：主栏 + 侧栏 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 30px; align-items: start; padding: 22px 0 60px; }
.main { min-width: 0; }
.sidebar { position: sticky; top: calc(var(--header-h) + 18px); display: flex; flex-direction: column; gap: 20px; }

/* ---------- 文章卡片 ---------- */
.section-title {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 19px; margin: 6px 0 18px; color: var(--text);
}
.section-title .count { color: var(--text-3); font-size: 14px; font-family: var(--font-sans); }

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

.article-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.article-card:hover .card-cover img { transform: scale(1.05); }

.card-cover { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); }
.article-card.featured .card-cover { aspect-ratio: 16 / 9; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 62%, oklch(0% 0 0 / 0.22));
}
.card-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 12.5px; font-weight: 600; color: #fff;
  padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 4px 12px oklch(0% 0 0 / 0.2);
}
.card-badge.plain { background: oklch(0% 0 0 / 0.45); backdrop-filter: blur(6px); }

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title {
  font-size: 19px; margin: 0 0 8px; line-height: 1.45;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--brand-deep); text-decoration: none; }
.card-excerpt {
  color: var(--text-2); font-size: 14.5px; margin: 0 0 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  margin-top: auto; display: flex; align-items: center; gap: 14px;
  color: var(--text-3); font-size: 13px; flex-wrap: wrap;
}
.card-meta .sep { opacity: 0.5; }
.tag-link { color: var(--text-3); }
.tag-link:hover { color: var(--brand-deep); }
.read-more { margin-left: auto; color: var(--brand-deep); font-size: 13.5px; font-weight: 600; }

/* 特色大卡 */
.card-featured { grid-column: 1 / -1; flex-direction: row; }
.card-featured .card-cover { width: 46%; aspect-ratio: 16 / 9; }
.card-featured .card-body { width: 54%; justify-content: center; }
.card-featured .card-title { font-size: 24px; }
.card-featured .card-excerpt { -webkit-line-clamp: 3; font-size: 15.5px; }

/* ---------- 侧栏组件 ---------- */
.widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-card);
}
.widget-title {
  font-size: 15.5px; margin: 0 0 14px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.widget-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* 作者卡 */
.author-card { text-align: center; }
.author-avatar {
  width: 78px; height: 78px; border-radius: 50%; margin: 4px auto 14px;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 34px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), oklch(60% 0.12 250));
  box-shadow: 0 10px 24px oklch(56% 0.11 190 / 0.35);
}
.author-card h3 { font-size: 20px; margin: 0 0 4px; }
.author-card .author-sub { color: var(--text-3); font-size: 13px; margin-bottom: 10px; }
.author-card p { color: var(--text-2); font-size: 13.5px; margin: 0 0 16px; }
.author-links { display: flex; justify-content: center; gap: 10px; }
.author-links a {
  font-size: 13px; color: var(--text-2); border: 1px solid var(--border);
  padding: 5px 14px; border-radius: 999px; transition: all 0.2s;
}
.author-links a:hover { color: var(--brand-deep); border-color: var(--brand); text-decoration: none; }

/* 分类列表 */
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cat-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-size: 14.5px;
  transition: background-color 0.2s, color 0.2s;
}
.cat-list a:hover { background: var(--surface-2); color: var(--brand-deep); text-decoration: none; }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.cat-count { margin-left: auto; font-size: 12.5px; color: var(--text-3); background: var(--surface-2); border-radius: 999px; padding: 1px 9px; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  font-size: 13px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px;
  transition: all 0.2s;
}
.tag-chip:hover { color: var(--brand-deep); border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }

/* 最新文章 */
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mini-list a { display: flex; gap: 12px; align-items: center; color: var(--text); }
.mini-list a:hover { text-decoration: none; }
.mini-list a:hover .mini-title { color: var(--brand-deep); }
.mini-thumb {
  width: 64px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
}
.mini-body { min-width: 0; }
.mini-title { font-size: 13.5px; line-height: 1.45; display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-date { font-size: 12px; color: var(--text-3); }

/* ---------- 归档时间线 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--brand), var(--border));
  border-radius: 2px;
}
.tl-year { position: relative; margin: 26px 0 12px; font-size: 22px; font-family: var(--font-serif); }
.tl-year:first-child { margin-top: 0; }
.tl-year::before {
  content: ""; position: absolute; left: -25px; top: 12px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand);
}
.tl-item {
  position: relative; margin: 0 0 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 18px; box-shadow: var(--shadow-card);
  display: flex; align-items: baseline; gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.tl-item:hover { transform: translateX(4px); box-shadow: var(--shadow-lift); }
.tl-item .tl-date { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.tl-item .tl-title { font-size: 15.5px; font-weight: 600; color: var(--text); }
.tl-item a:hover .tl-title { color: var(--brand-deep); }
.tl-item .tl-cat {
  margin-left: auto; font-size: 12px; color: #fff; padding: 2px 10px; border-radius: 999px; flex-shrink: 0;
}

/* ---------- 分类页 ---------- */
.cat-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-card);
  transition: transform 0.25s, box-shadow 0.25s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.cat-card h2 { display: flex; align-items: center; gap: 12px; font-size: 22px; margin: 0 0 6px; }
.cat-card h2 .cat-dot { width: 14px; height: 14px; }
.cat-card .cat-desc { color: var(--text-2); font-size: 14px; margin: 0 0 14px; }
.cat-posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cat-posts a {
  display: flex; gap: 10px; align-items: baseline; color: var(--text);
  font-size: 14.5px; padding: 6px 8px; border-radius: 8px; transition: background-color 0.2s;
}
.cat-posts a:hover { background: var(--surface-2); text-decoration: none; }
.cat-posts a:hover .cat-post-title { color: var(--brand-deep); }
.cat-post-title { font-weight: 500; }
.cat-posts .cat-post-date { margin-left: auto; font-size: 12.5px; color: var(--text-3); flex-shrink: 0; }

/* ---------- 标签页 ---------- */
.tags-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-card);
}
.tags-panel .tag-cloud { gap: 10px; }
.tags-panel .tag-chip { font-size: 14px; padding: 6px 16px; }
.tags-panel .tag-chip .tag-num { color: var(--text-3); margin-left: 4px; font-size: 12px; }
.tag-group { margin-top: 26px; border-top: 1px dashed var(--border); padding-top: 20px; }
.tag-group h3 {
  font-size: 17px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
}
.tag-group h3::before { content: "#"; color: var(--brand); font-weight: 700; }
.tag-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tag-group li a { display: flex; gap: 10px; align-items: baseline; color: var(--text); font-size: 14.5px; }
.tag-group li a:hover { text-decoration: none; }
.tag-group li a:hover .g-title { color: var(--brand-deep); }
.tag-group .g-date { margin-left: auto; color: var(--text-3); font-size: 12.5px; }

/* ---------- 搜索 ---------- */
.search-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 22px; box-shadow: var(--shadow-card);
}
.search-box { position: relative; }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--text-3); }
.search-box input {
  width: 100%; padding: 14px 18px 14px 46px; font-size: 16px;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--text); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-meta { color: var(--text-3); font-size: 13px; margin: 12px 0 0; }
.search-empty {
  text-align: center; padding: 60px 20px; color: var(--text-3);
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface);
}
.search-empty svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: 0.5; }

.search-results { display: flex; flex-direction: column; gap: 16px; }
.search-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; box-shadow: var(--shadow-card); transition: transform 0.2s, box-shadow 0.2s;
}
.search-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.search-item h3 { margin: 0 0 6px; font-size: 18px; }
.search-item h3 a { color: var(--text); }
.search-item h3 a:hover { color: var(--brand-deep); }
.search-item .si-meta { font-size: 13px; color: var(--text-3); display: flex; gap: 12px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.search-item .si-excerpt { color: var(--text-2); font-size: 14.5px; margin: 0; }
mark { background: oklch(85% 0.12 85); color: inherit; border-radius: 3px; padding: 0 2px; }
:root[data-theme="dark"] mark { background: oklch(45% 0.11 85); }

/* 全局搜索弹窗 */
.search-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: flex-start; justify-content: center; padding: 12vh 20px 20px;
}
.search-modal.open { display: flex; }
.search-modal .modal-mask {
  position: absolute; inset: 0; background: oklch(0% 0 0 / 0.5);
  backdrop-filter: blur(3px);
}
.search-modal .modal-panel {
  position: relative; width: min(620px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 80px oklch(0% 0 0 / 0.35); overflow: hidden;
}
.modal-panel .search-box { border-bottom: 1px solid var(--border); }
.modal-panel .search-box input { border: none; border-radius: 0; padding: 18px 18px 18px 48px; font-size: 17px; background: transparent; }
.modal-results { max-height: 46vh; overflow-y: auto; padding: 10px; }
.modal-results .search-item { border: none; box-shadow: none; padding: 12px 14px; }
.modal-results .search-item:hover { background: var(--surface-2); box-shadow: none; transform: none; }
.modal-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 14px; }
.modal-hint { padding: 10px 18px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12px; display: flex; gap: 16px; }
.modal-hint kbd {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-family: inherit; font-size: 11.5px;
}

/* ---------- 关于页 ---------- */
.about-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.about-head { padding: 44px 44px 30px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.about-avatar {
  width: 104px; height: 104px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-serif); font-size: 46px; font-weight: 700;
  background: linear-gradient(135deg, var(--brand), oklch(60% 0.12 250));
  box-shadow: 0 14px 34px oklch(56% 0.11 190 / 0.4);
}
.about-head h1 { font-size: 30px; margin: 0 0 4px; }
.about-head .about-sub { color: var(--text-3); margin: 0; }
.about-body { padding: 6px 44px 40px; }
.about-body h2 {
  font-size: 20px; margin: 30px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.skill-list { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag {
  font-size: 13.5px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px;
}
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.contact-list a { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-deep); }

/* ---------- 文章页 ---------- */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 36px; align-items: start; padding: 26px 0 60px; }
.post-article { min-width: 0; }

.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 300;
  background: linear-gradient(90deg, var(--brand), oklch(60% 0.12 250));
}

.post-head { margin-bottom: 26px; }
.post-head h1 { font-size: clamp(26px, 4vw, 34px); margin: 14px 0 12px; line-height: 1.35; }
.post-meta { display: flex; gap: 16px; align-items: center; color: var(--text-3); font-size: 13.5px; flex-wrap: wrap; }
.post-meta .sep { opacity: 0.5; }
.post-cover { border-radius: 16px; overflow: hidden; margin-bottom: 26px; box-shadow: var(--shadow-card); }
.post-cover img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }

/* 正文排版 */
.prose { font-size: 16.5px; line-height: 1.9; color: var(--text); }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 24px; margin: 2em 0 0.7em; padding-bottom: 10px; border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h3 { font-size: 19px; margin: 1.8em 0 0.6em; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h4 { font-size: 17px; margin: 1.6em 0 0.5em; }
.prose p { margin: 0 0 1.2em; }
.prose a { border-bottom: 1px solid oklch(56% 0.11 190 / 0.35); }
.prose a:hover { text-decoration: none; border-bottom-color: var(--brand); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.6em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--brand); }
.prose blockquote {
  margin: 1.6em 0; padding: 14px 22px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft); border-radius: 0 12px 12px 0;
  color: var(--text-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 0.88em; background: var(--code-bg); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 6px;
}
.prose pre {
  background: oklch(20% 0.02 240); color: oklch(88% 0.01 240);
  border-radius: 12px; padding: 18px 22px; overflow-x: auto;
  line-height: 1.7; margin: 1.5em 0; font-size: 14px;
  border: 1px solid oklch(28% 0.015 240);
}
.prose pre code { background: none; border: none; padding: 0; font-size: 14px; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose tr:nth-child(even) td { background: var(--surface-2); }
.prose img { border-radius: 12px; margin: 1.4em auto; }
.prose hr { border: none; border-top: 1px dashed var(--border); margin: 2.2em 0; }
.prose .note {
  border: 1px solid oklch(75% 0.1 45 / 0.4); background: oklch(93% 0.05 45 / 0.5);
  border-radius: 10px; padding: 12px 18px; margin: 1.4em 0; font-size: 14.5px; color: var(--text-2);
}
:root[data-theme="dark"] .prose .note { background: oklch(26% 0.03 45); border-color: oklch(42% 0.08 45); }

/* 文章目录 */
.post-toc {
  position: sticky; top: calc(var(--header-h) + 24px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; box-shadow: var(--shadow-card); font-size: 13.5px;
}
.post-toc .toc-title { font-weight: 700; margin-bottom: 10px; color: var(--text); font-family: var(--font-serif); }
.post-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow-y: auto; }
.post-toc ul ul { padding-left: 14px; }
.post-toc a { color: var(--text-2); display: block; padding: 3px 8px; border-radius: 6px; border-left: 2px solid transparent; }
.post-toc a:hover { color: var(--brand-deep); background: var(--surface-2); text-decoration: none; }
.post-toc a.toc-active { color: var(--brand-deep); border-left-color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* 文章标签与页脚 */
.post-tags { display: flex; gap: 10px; flex-wrap: wrap; margin: 34px 0 0; padding-top: 22px; border-top: 1px solid var(--border); }
.post-tags .tag-chip { padding: 5px 14px; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; }
.post-nav a {
  font-size: 14px; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px;
  max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: all 0.2s;
}
.post-nav a:hover { color: var(--brand-deep); border-color: var(--brand); text-decoration: none; }
.post-nav .next { margin-left: auto; text-align: right; }

/* ---------- 首页轮播 ---------- */
.carousel {
  position: relative; margin: 26px 0 6px; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  aspect-ratio: 21 / 9; background: var(--surface-2);
}
.carousel-track { position: absolute; inset: 0; }
.carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.7s ease; pointer-events: none; }
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide a { display: block; width: 100%; height: 100%; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, oklch(0% 0 0 / 0.45));
}
.carousel-caption {
  position: absolute; left: 24px; bottom: 20px; z-index: 2;
  color: #fff; font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(16px, 2.4vw, 22px);
  text-shadow: 0 2px 14px oklch(0% 0 0 / 0.5);
}
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid oklch(100% 0 0 / 0.35);
  background: oklch(0% 0 0 / 0.32); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0;
  opacity: 0; transition: opacity 0.3s, background 0.3s; backdrop-filter: blur(4px);
}
.carousel:hover .carousel-arrow { opacity: 1; }
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }
.carousel-arrow:hover { background: oklch(0% 0 0 / 0.55); }
.carousel-dots { position: absolute; right: 18px; bottom: 14px; z-index: 5; display: flex; gap: 8px; }
.carousel-dot { width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0; cursor: pointer; background: oklch(100% 0 0 / 0.55); transition: all 0.25s; }
.carousel-dot.active { background: var(--brand); transform: scale(1.3); }
@media (max-width: 820px) {
  .carousel { aspect-ratio: 16 / 9; }
  .carousel-arrow { width: 34px; height: 34px; font-size: 18px; }
  .carousel-caption { left: 16px; bottom: 14px; }
}

/* ---------- QQ 头像 ---------- */
.author-avatar-img, .about-avatar-img {
  object-fit: cover; border-radius: 50%; display: block;
  border: 3px solid var(--surface); box-shadow: 0 10px 24px oklch(0% 0 0 / 0.18);
}
.author-avatar-img { width: 78px; height: 78px; margin: 4px auto 14px; }
.about-avatar-img { width: 104px; height: 104px; flex-shrink: 0; }

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 90;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: all 0.3s; box-shadow: var(--shadow-card);
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:hover { color: var(--brand-deep); border-color: var(--brand); }
.back-top svg { width: 18px; height: 18px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0 34px; margin-top: 20px; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0; color: var(--text-3); font-size: 13.5px; }
.site-footer a { color: var(--text-3); }
.site-footer a:hover { color: var(--brand-deep); }
.footer-nav { display: flex; gap: 18px; }

/* ---------- 动画 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar .widget { flex: 1 1 280px; }
  .post-layout { grid-template-columns: 1fr; }
  .post-toc { display: none; }
}

@media (max-width: 820px) {
  .main-nav { display: none; }
  .hamburger { display: grid; }
  .hero { flex-direction: column; text-align: center; padding: 30px 24px; }
  .hero p { margin-inline: auto; }
  .hero-deco svg { width: 110px; height: 110px; }
  .card-featured { flex-direction: column; }
  .card-featured .card-cover, .card-featured .card-body { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .cat-cards { grid-template-columns: 1fr; }
  .timeline { padding-left: 20px; }
  .about-head { padding: 28px 24px 20px; }
  .about-body { padding: 4px 24px 30px; }
}

@media (max-width: 560px) {
  .page-hero { padding-top: 30px; }
  .tl-item { flex-wrap: wrap; gap: 8px; }
  .tl-item .tl-cat { margin-left: 0; }
  .footer-inner { flex-direction: column; text-align: center; }
}
