/* ==========================================================================
   个人站点 · 前台样式
   ========================================================================== */

/* ----------------------------- 设计变量 ----------------------------- */
:root {
  --bg: #fbfbfd;
  --bg-soft: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --text: #16181d;
  --text-soft: #58606e;
  --text-mute: #8b93a1;
  --border: #e6e8ee;
  --border-soft: #eef0f5;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #ffffff;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .07);
  --shadow-lg: 0 14px 36px rgba(16, 24, 40, .12);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --code-bg: #f6f7f9;
  --code-text: #24292f;
  --code-keyword: #a626a4;
  --code-string: #50a14f;
  --code-number: #986801;
  --code-comment: #a0a1a7;
  --code-func: #4078f2;
  --code-attr: #e45649;
  --code-type: #c18401;
}

html[data-theme="dark"] {
  --bg: #0e1014;
  --bg-soft: #14171d;
  --surface: #171a21;
  --surface-2: #1c2028;
  --text: #e7e9ee;
  --text-soft: #a3abb8;
  --text-mute: #7b8391;
  --border: #262b35;
  --border-soft: #20242c;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1d2130;
  --accent-text: #0e1014;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
  --code-bg: #12151b;
  --code-text: #cbd3e1;
  --code-keyword: #c678dd;
  --code-string: #98c379;
  --code-number: #d19a66;
  --code-comment: #5c6370;
  --code-func: #61afef;
  --code-attr: #e06c75;
  --code-type: #e5c07b;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0e1014;
    --bg-soft: #14171d;
    --surface: #171a21;
    --surface-2: #1c2028;
    --text: #e7e9ee;
    --text-soft: #a3abb8;
    --text-mute: #7b8391;
    --border: #262b35;
    --border-soft: #20242c;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: #1d2130;
    --accent-text: #0e1014;
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
    --code-bg: #12151b;
    --code-text: #cbd3e1;
    --code-keyword: #c678dd;
    --code-string: #98c379;
    --code-number: #d19a66;
    --code-comment: #5c6370;
    --code-func: #61afef;
    --code-attr: #e06c75;
    --code-type: #e5c07b;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 620px; }
.section { padding: 34px 0; }
.muted { color: var(--text-mute); }
.center-block { text-align: center; padding: 80px 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-text); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ----------------------------- 顶栏 ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.site-nav { display: flex; gap: 4px; margin-left: 8px; }
.site-nav a {
  padding: 7px 11px; border-radius: 8px; font-size: 14.5px; color: var(--text-soft);
  transition: background-color .15s, color .15s;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--text-soft); cursor: pointer; transition: all .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.i-moon { display: none; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .i-sun { display: none; }
  html:not([data-theme="light"]) .i-moon { display: block; }
}
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 38px; height: 38px; padding: 0 9px; margin-left: auto;
    background: transparent; border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--text-soft); border-radius: 2px; }
  .header-actions { margin-left: 0; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 62px; flex-direction: column; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px; margin: 0; display: none; box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 12px; }
}

/* ----------------------------- 首页 Hero ----------------------------- */
.hero { padding: 56px 20px 28px; }
.hero-inner { display: flex; gap: 26px; align-items: center; }
.hero-avatar {
  flex: 0 0 92px; width: 92px; height: 92px; border-radius: 26px; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: grid; place-items: center; color: #fff; font-size: 38px; font-weight: 700;
  box-shadow: var(--shadow);
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-text h1 { font-size: 30px; margin-bottom: 6px; }
.hero-bio { color: var(--text-soft); margin: 0 0 16px; max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats { margin: 16px 0 0; font-size: 13.5px; color: var(--text-mute); }
@media (max-width: 640px) {
  .hero { padding: 34px 20px 16px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-avatar { flex-basis: 68px; width: 68px; height: 68px; border-radius: 20px; font-size: 28px; }
  .hero-text h1 { font-size: 24px; }
}

/* ----------------------------- 按钮 ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14.5px; font-weight: 500;
  cursor: pointer; transition: all .16s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn-xs { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-ok { color: var(--ok); }
.btn-ok:hover { border-color: var(--ok); color: var(--ok); }
.btn-block { width: 100%; }

/* ----------------------------- 区块标题 ----------------------------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 20px; margin: 0; }
.section-head .more { font-size: 14px; color: var(--text-mute); }
.section-head .more:hover { color: var(--accent); }

.page-head { padding: 40px 20px 8px; }
.page-head h1 { font-size: 28px; margin-bottom: 6px; }
.page-sub { color: var(--text-mute); margin: 0; font-size: 15px; }
.crumb { font-size: 13.5px; color: var(--text-mute); margin: 0 0 8px; }
.big-code { font-size: 64px; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }

/* ----------------------------- 卡片 ----------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.card-link { display: block; height: 100%; }
.card-cover { height: 152px; background-size: cover; background-position: center; }
.card-cover--empty { background-image: linear-gradient(135deg, #6366f1, #8b5cf6); }
.card-cover--empty[data-seed="0"] { background-image: linear-gradient(135deg, #6366f1, #8b5cf6); }
.card-cover--empty[data-seed="1"] { background-image: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.card-cover--empty[data-seed="2"] { background-image: linear-gradient(135deg, #f97316, #f43f5e); }
.card-cover--empty[data-seed="3"] { background-image: linear-gradient(135deg, #10b981, #84cc16); }
.card-cover--empty[data-seed="4"] { background-image: linear-gradient(135deg, #8b5cf6, #ec4899); }
.card-cover--empty[data-seed="5"] { background-image: linear-gradient(135deg, #f59e0b, #eab308); }
.card-body { padding: 16px 18px 18px; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-mute); margin-bottom: 8px; }
.card-title { font-size: 17px; margin: 0 0 8px; }
.card-summary { color: var(--text-soft); font-size: 14.5px; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; gap: 7px; font-size: 12.5px; color: var(--text-mute); }
.badge { background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 6px; font-size: 12px; }
.badge-lock { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.mini-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; transition: all .18s;
}
.mini-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.mini-card h3 { font-size: 16px; margin-bottom: 6px; }
.mini-card p { color: var(--text-soft); font-size: 14px; margin: 0; }
.mini-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mini-tags span { font-size: 12px; color: var(--text-mute); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }

.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.project-card h3 { font-size: 18px; margin-bottom: 8px; }
.project-card p { color: var(--text-soft); font-size: 14.5px; margin: 0 0 12px; }
.project-cover { height: 140px; border-radius: var(--radius-sm); background-size: cover; background-position: center; margin-bottom: 14px; }
.project-actions { display: flex; gap: 8px; margin-top: 14px; }

.link-card {
  display: flex; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; transition: all .18s;
}
.link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.link-avatar {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px; overflow: hidden;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700;
}
.link-avatar img { width: 100%; height: 100%; object-fit: cover; }
.link-card h3 { font-size: 15px; margin: 0 0 2px; }
.link-card p { margin: 0; font-size: 13px; color: var(--text-mute); }
.links-block { margin-bottom: 30px; }
.links-title { font-size: 16px; color: var(--text-soft); font-weight: 600; margin-bottom: 14px; }

.album-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .18s; }
.album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.album-cover { height: 168px; background: linear-gradient(135deg, var(--accent), #a855f7); background-size: cover; background-position: center; }
.album-info { padding: 14px 16px 16px; }
.album-info h3 { font-size: 16px; margin-bottom: 4px; }
.album-info p { margin: 0 0 6px; font-size: 13.5px; color: var(--text-soft); }
.album-info span { font-size: 12.5px; color: var(--text-mute); }

/* 行列表（归档 / 搜索结果） */
.rows { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px;
  border-radius: 10px; border-bottom: 1px solid var(--border-soft); transition: background-color .15s;
}
.row-item:hover { background: var(--surface-2); }
.row-date { flex: 0 0 96px; font-size: 13px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.row-title { flex: 1; font-size: 15px; }
.row-arrow { color: var(--text-mute); opacity: 0; transition: opacity .15s; }
.row-item:hover .row-arrow { opacity: 1; }
.archive-group { margin-bottom: 26px; }
.archive-year { font-size: 19px; display: flex; align-items: center; gap: 10px; }
.archive-year span { font-size: 12.5px; color: var(--text-mute); background: var(--surface-2); padding: 1px 9px; border-radius: 20px; font-weight: 500; }

/* 标签 */
.pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.pill { font-size: 13px; color: var(--text-soft); background: var(--surface-2); padding: 3px 10px; border-radius: 20px; transition: all .15s; }
.pill:hover { background: var(--accent-soft); color: var(--accent); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); padding: 7px 14px; border-radius: 20px; font-size: 14px; transition: all .15s;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip span { font-size: 12px; color: var(--text-mute); }

/* ----------------------------- 文章页 ----------------------------- */
.article-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding-top: 40px; padding-bottom: 60px; }
.article-layout:not(:has(.toc)) { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
.article-main { min-width: 0; }
.article-head { margin-bottom: 26px; }
.article-head h1 { font-size: 32px; margin-bottom: 12px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--text-mute); }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: 26px; }

.toc { position: sticky; top: 84px; align-self: start; font-size: 13.5px; max-height: calc(100vh - 120px); overflow: auto; }
.toc-title { font-weight: 600; color: var(--text-mute); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a { display: block; padding: 4px 0 4px 12px; color: var(--text-soft); border-left: 2px solid transparent; margin-left: -1px; }
.toc li a:hover { color: var(--accent); border-left-color: var(--accent); }
.toc-l3 a { padding-left: 24px; font-size: 13px; }
.toc-l4 a { padding-left: 34px; font-size: 12.5px; }
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}

/* 正文排版 */
.prose { font-size: 16.5px; line-height: 1.85; color: var(--text); overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 23px; margin: 2em 0 .7em; padding-bottom: .3em; border-bottom: 1px solid var(--border-soft); }
.prose h3 { font-size: 19px; margin: 1.7em 0 .6em; }
.prose h4 { font-size: 17px; margin: 1.5em 0 .5em; }
.prose p { margin: 0 0 1.1em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose blockquote {
  margin: 1.3em 0; padding: 2px 18px; border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-soft);
}
.prose code {
  font-family: var(--mono); font-size: .88em; background: var(--code-bg); color: var(--code-attr);
  padding: .15em .42em; border-radius: 5px;
}
.prose pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px 17px; overflow-x: auto; margin: 1.3em 0; line-height: 1.62;
}
.prose pre code { background: none; padding: 0; color: var(--code-text); font-size: 13.5px; }
.prose img, .md-img { border-radius: var(--radius-sm); margin: 1.3em auto; cursor: zoom-in; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.3em 0; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.2em 0; }
.prose input[type="checkbox"] { margin-right: 6px; }

/* 代码高亮（自绘配色，跟随主题） */
.hljs { color: var(--code-text); }
.hljs-comment, .hljs-quote { color: var(--code-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag, .hljs-formula { color: var(--code-keyword); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta .hljs-string { color: var(--code-string); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link, .hljs-variable, .hljs-template-variable { color: var(--code-number); }
.hljs-title, .hljs-title.function_, .hljs-section, .hljs-name { color: var(--code-func); }
.hljs-attr, .hljs-property, .hljs-selector-class, .hljs-selector-id, .hljs-tag { color: var(--code-attr); }
.hljs-built_in, .hljs-type, .hljs-class .hljs-title, .hljs-params { color: var(--code-type); }
.hljs-deletion { color: var(--danger); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* 上一篇/下一篇 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 46px 0 0; }
.post-nav-item {
  display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); transition: all .18s;
}
.post-nav-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-nav-item span { font-size: 12.5px; color: var(--text-mute); }
.post-nav-item strong { font-size: 14.5px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav-item--next { text-align: right; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }

/* 评论 */
.comments { margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--border); }
.comments-title { font-size: 18px; margin-bottom: 18px; }
.comments-title span { color: var(--text-mute); font-weight: 400; font-size: 15px; }
.comment-list { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 12px; }
.comment-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-weight: 700;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; }
.comment-head strong { font-size: 14.5px; }
.comment-head time { font-size: 12.5px; color: var(--text-mute); }
.comment-text { font-size: 15px; color: var(--text-soft); }
.comment-empty { color: var(--text-mute); font-size: 14.5px; }
.comment-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.cf-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); outline: none; transition: border-color .15s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form textarea { resize: vertical; margin-bottom: 10px; }
.cf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cf-tip { font-size: 12.5px; color: var(--text-mute); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
@media (max-width: 640px) { .cf-row { grid-template-columns: 1fr; } }

/* ----------------------------- 加密文章 ----------------------------- */
.lock-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 42px 30px; text-align: center; margin: 60px 0; box-shadow: var(--shadow-sm);
}
.lock-icon { font-size: 40px; margin-bottom: 10px; }
.lock-card h1 { font-size: 24px; margin-bottom: 8px; }
.lock-tip { color: var(--text-mute); margin-bottom: 22px; }
.lock-form { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.lock-form input {
  flex: 1; max-width: 260px; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); outline: none;
}
.lock-form input:focus { border-color: var(--accent); }
.lock-meta { font-size: 13px; color: var(--text-mute); margin: 0; }
.form-error { color: var(--danger); font-size: 14px; margin: 0 0 14px; }

/* ----------------------------- 相册 ----------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gallery-item { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.gallery-item img { width: 100%; height: 230px; object-fit: cover; cursor: zoom-in; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item figcaption { padding: 9px 12px; font-size: 13px; color: var(--text-mute); }
.photo-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.photo-strip-item { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; }
.photo-strip-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo-strip-item:hover img { transform: scale(1.06); }
@media (max-width: 760px) { .photo-strip { grid-template-columns: repeat(3, 1fr); } }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(8, 10, 14, .92);
  display: none; align-items: center; justify-content: center; padding: 32px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox-close { position: fixed; top: 18px; right: 22px; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; }

/* ----------------------------- 搜索 ----------------------------- */
.search-form { display: flex; gap: 10px; margin-top: 16px; max-width: 520px; }
.search-form input {
  flex: 1; padding: 11px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); outline: none;
}
.search-form input:focus { border-color: var(--accent); }
.search-count, .search-hint { color: var(--text-mute); font-size: 14px; margin-bottom: 14px; }

/* ----------------------------- 分页 / 空状态 ----------------------------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 34px; }
.page-btn { padding: 8px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 14px; }
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-info { font-size: 13.5px; color: var(--text-mute); }

.empty {
  text-align: center; padding: 60px 20px; color: var(--text-mute);
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface);
}

/* ----------------------------- 页脚 ----------------------------- */
.site-footer { margin-top: 60px; border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { padding: 34px 20px; display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: flex-end; }
.footer-title { font-weight: 700; margin: 0 0 4px; }
.footer-sub { color: var(--text-mute); font-size: 14px; margin: 0 0 12px; }
.footer-social { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; color: var(--text-soft); }
.footer-social a:hover { color: var(--accent); }
.footer-copy { font-size: 13px; color: var(--text-mute); margin: 0; }

/* ----------------------------- 表单通用 ----------------------------- */
input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="number"], input[type="search"], select, textarea {
  font-family: inherit;
}
::selection { background: var(--accent); color: var(--accent-text); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }
