/* ==========================================================================
   style.css —— 全站共享设计系统
   --------------------------------------------------------------------------
   目录：
     01. 变量与主题（浅色 / 深色）
     02. 基础重置与排版
     03. 布局（容器 / 头部 / 页脚）
     04. 通用组件（按钮 / 标签 / 卡片 / 分区标题）
     05. 首页
     06. 小作文页
     07. 项目页
     08. 图片页
     09. 弹层（文章阅读 / 灯箱）
     10. 关于页
     11. 辅助工具与响应式
   ========================================================================== */

/* ========== 01. 变量与主题 ========== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono",
    Menlo, "Courier New", monospace;

  /* 颜色（浅色主题） */
  --bg: #faf9f6;
  --bg-soft: #f1efe9;
  --surface: #ffffff;
  --surface-2: #f6f4ee;
  --text: #29292f;
  --text-soft: #5d5d68;
  --text-faint: #94949e;
  --accent: #6c5ce7;
  --accent-strong: #5648c9;
  --accent-soft: rgba(108, 92, 231, 0.12);
  --border: #e6e3da;
  --ok: #1fa855;
  --ok-soft: rgba(31, 168, 85, 0.12);
  --warn: #e0961c;
  --warn-soft: rgba(224, 150, 28, 0.14);
  --plan: #3a7bd5;
  --plan-soft: rgba(58, 123, 213, 0.13);
  --danger: #d64545;

  --shadow-sm: 0 1px 2px rgba(30, 28, 20, 0.05);
  --shadow-md: 0 6px 20px -6px rgba(30, 28, 20, 0.14);
  --shadow-lg: 0 18px 48px -18px rgba(20, 18, 10, 0.3);

  --radius: 14px;
  --radius-lg: 20px;
  --header-h: 64px;
  --content-w: 1080px;
  --content-narrow: 760px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #16161c;
  --bg-soft: #1d1d25;
  --surface: #22222c;
  --surface-2: #2b2b37;
  --text: #ececf2;
  --text-soft: #b6b6c4;
  --text-faint: #80808f;
  --accent: #9b8fff;
  --accent-strong: #b4aaff;
  --accent-soft: rgba(155, 143, 255, 0.16);
  --border: #363644;
  --ok: #3ecf7d;
  --ok-soft: rgba(62, 207, 125, 0.15);
  --warn: #f0b23f;
  --warn-soft: rgba(240, 178, 63, 0.16);
  --plan: #6da8ff;
  --plan-soft: rgba(109, 168, 255, 0.16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px -16px rgba(0, 0, 0, 0.6);
}

/* ========== 02. 基础重置与排版 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

h1, h2, h3, h4 {
  line-height: 1.35;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 1em;
}

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

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

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

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

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

/* ========== 03. 布局 ========== */
.container {
  width: min(var(--content-w), 92vw);
  margin-inline: auto;
}

.container--narrow {
  width: min(var(--content-narrow), 92vw);
}

main {
  min-height: 62vh;
}

section {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* ---- 顶部导航 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--bg); /* 老浏览器降级：纯色 */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  margin-right: auto;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  overflow: hidden; /* 图片超出圆角方块时裁掉 */
}

/* 顶栏 logo 放头像图时：填满方块、居中裁切，不变形 */
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-nav .nav-list {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* 汉堡菜单按钮（移动端显示） */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  margin: 3px 0;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* 主题切换按钮 */
.theme-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

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

.theme-toggle .icon-sun {
  display: none;
}

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

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

/* ---- 页脚 ---- */
.site-footer {
  margin-top: 72px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-line {
  color: var(--text-faint);
  font-size: 14px;
  margin: 0;
}

.footer-line a {
  color: var(--text-soft);
}

.social-links {
  display: flex;
  gap: 8px;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color 0.2s, transform 0.2s, border-color 0.2s;
}

.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.social-links svg {
  width: 18px;
  height: 18px;
}

/* ---- 回到顶部 ---- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
    color 0.2s;
}

.to-top.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  color: var(--accent);
}

.to-top svg {
  width: 18px;
  height: 18px;
}

/* ========== 04. 通用组件 ========== */
.page-head {
  padding: 56px 0 12px;
}

.page-title {
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  margin-bottom: 0.25em;
}

.page-lead {
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0;
}

.section {
  padding: 40px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.section-title {
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 5px;
  height: 1.1em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #a29bfe);
}

.section-more {
  font-size: 0.9rem;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s,
    border-color 0.2s, color 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: var(--shadow-md);
}

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

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

.btn-sm {
  padding: 7px 16px;
  font-size: 13.5px;
}

/* 标签 chip */
.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  line-height: 1.6;
}

.tag--accent {
  color: var(--accent);
  border-color: transparent;
  background: var(--accent-soft);
}

/* 状态徽章 */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.badge--done {
  color: var(--ok);
  background: var(--ok-soft);
}

.badge--wip {
  color: var(--warn);
  background: var(--warn-soft);
}

.badge--plan {
  color: var(--plan);
  background: var(--plan-soft);
}

/* 通用卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* 提示条（给未来的自己留的话） */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 36px 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  color: var(--text);
  font-size: 14.5px;
}

.notice b {
  color: var(--accent);
  white-space: nowrap;
}

.notice code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-faint);
}

/* 显隐工具类 */
.hidden {
  display: none !important;
}

/* 有 hidden 属性的元素一律隐藏（防止被其它 display 规则覆盖） */
[hidden] {
  display: none !important;
}

/* ========== 05. 首页 ========== */
.hero {
  padding: clamp(56px, 10vh, 104px) 0 24px;
}

.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  margin-bottom: 0.4em;
  font-weight: 800;
}

.hero-title .accent {
  background: linear-gradient(120deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-soft);
  margin-bottom: 0.6em;
}

.hero-text {
  max-width: 62ch;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* 栏目卡片 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.feature-card {
  display: block;
  padding: 24px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.35em;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-faint);
  line-height: 1.7;
}

.feature-arrow {
  color: var(--text-faint);
}

/* 首页最新动态列表 */
.latest-list {
  display: grid;
  gap: 10px;
}

.latest-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px dashed var(--border);
}

.latest-item:last-child {
  border-bottom: none;
}

.latest-date {
  flex: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  min-width: 96px;
}

.latest-title {
  font-size: 1rem;
  color: var(--text);
  transition: color 0.2s;
}

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

/* ========== 06. 小作文页 ========== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 28px;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 14px;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.entry-item {
  padding: 22px 26px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
}

.entry-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 13.5px;
}

.entry-date {
  font-family: var(--font-mono);
}

.entry-title {
  font-size: 1.2rem;
  margin-bottom: 6px;
  color: var(--text);
}

.entry-excerpt {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
}

.entry-item .tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ========== 07. 项目页 ========== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.project-card .badge {
  position: absolute;
  top: 18px;
  right: 18px;
}

.project-title {
  font-size: 1.18rem;
  margin: 0 0 2px;
  padding-right: 76px;
}

.project-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}

.project-desc {
  margin: 12px 0 16px;
  color: var(--text-soft);
  font-size: 14.5px;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.project-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* ========== 08. 图片页 ========== */
.album {
  margin-bottom: 44px;
}

.album-title {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.album-desc {
  color: var(--text-faint);
  font-size: 14px;
  margin-bottom: 18px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 14px 10px;
  font-size: 13.5px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}

.gallery-item:hover figcaption {
  opacity: 1;
  transform: none;
}

/* ========== 09. 弹层（通用遮罩 + 文章阅读 + 灯箱） ========== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 12, 22, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity 0.22s var(--ease);
}

.overlay.hidden {
  display: none;
}

/* 文章阅读弹窗 */
.overlay-box {
  position: relative;
  width: min(var(--content-narrow), 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop 0.25s var(--ease);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.overlay-close {
  position: sticky;
  top: 14px;
  float: right;
  z-index: 2;
  margin: 14px 14px -44px 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.overlay-close:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(90deg);
}

.article {
  padding: 46px 40px 44px;
}

.article h1 {
  font-size: 1.7rem;
  margin: 0 0 14px;
  padding-right: 30px;
}

.article .article-meta {
  color: var(--text-faint);
  font-size: 13.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px dashed var(--border);
}

.article-content {
  font-size: 16px;
  color: var(--text);
}

.article-content p {
  margin-bottom: 1.1em;
  text-indent: 2em; /* 自然段首行缩进两格（2em ≈ 两个汉字宽度） */
}

.article-content blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: 5px;
  padding: 2px 6px;
}

.article-end {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  color: var(--text-faint);
  font-size: 13.5px;
  text-align: center;
}

/* 灯箱 */
.lightbox {
  background: rgba(8, 8, 14, 0.9);
  padding: 0;
  cursor: zoom-out;
}

/* 舞台铺满整个灯箱，用来居中显示图片；
   按钮 / 说明文字用更高 z-index 叠在它上面 */
.lightbox-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 56px 116px 76px;
  cursor: zoom-out;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.25s var(--ease);
  cursor: default;
}

.lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14.5px;
  padding: 0 96px;
  pointer-events: none; /* 说明文字不挡点击，只有按钮本身可点 */
}

.lightbox-caption #lbCapText {
  display: block;
}

/* “查看原图”按钮：仅当数据里有 full 字段时由 JS 显示 */
.lb-original {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13.5px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.lb-original:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

.lb-original[hidden] {
  display: none;
}

.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  transition: background 0.2s;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lb-prev {
  left: 22px;
}

.lb-next {
  right: 22px;
}

.lb-close {
  top: 20px;
  transform: none;
  right: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
}

/* ========== 10. 关于页 ========== */
.profile {
  display: flex;
  gap: 34px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 34px;
  margin-top: 40px;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  color: #fff;
  font-size: 46px;
  font-weight: 800;
  box-shadow: var(--shadow-md);
  overflow: hidden; /* 图片超出圆形时裁掉，保证始终是圆头像 */
}

/* 头像放图片时的样式：填满圆形并居中裁切，不变形 */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-info {
  flex: 1;
  min-width: 240px;
}

.profile-name {
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.profile-role {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 14px;
}

.interest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.tl-item {
  position: relative;
  margin-bottom: 22px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tl-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}

.tl-item h3 {
  font-size: 1.05rem;
  margin: 2px 0 4px;
}

.tl-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

.contact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-icon svg {
  width: 21px;
  height: 21px;
}

.contact-label {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.contact-value {
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
}

.contact-item a.contact-value:hover {
  color: var(--accent);
}

/* 联系方式里整块文字可点击的链接（如 Bilibili 名片） */
a.contact-item-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

a.contact-item-link:hover .contact-value,
a.contact-item-link:hover .contact-label {
  color: var(--accent);
}

/* ========== 11. 响应式 ========== */
@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .theme-toggle {
    display: none; /* 深色主题可进设置/页面内；移动端先收起来，保持头部干净 */
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s var(--ease);
  }

  body.nav-open .site-nav {
    max-height: 320px;
  }

  .site-nav .nav-list {
    flex-direction: column;
    padding: 10px 4vw 16px;
    gap: 2px;
  }

  .site-nav .nav-link {
    display: block;
    padding: 11px 14px;
  }
}

@media (max-width: 560px) {
  .page-head {
    padding-top: 36px;
  }

  .article {
    padding: 40px 22px 34px;
  }

  .profile {
    justify-content: center;
    text-align: center;
    padding: 26px 18px;
  }

  .profile-info {
    min-width: 0;
  }

  .interest-list,
  .profile-info {
    justify-content: center;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }

  .latest-date {
    min-width: 0;
  }

  .latest-item {
    flex-direction: column;
    gap: 2px;
  }

  .lightbox-stage {
    padding: 60px 5vw;
  }

  .lb-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .lb-prev {
    left: 10px;
  }

  .lb-next {
    right: 10px;
  }
}

/* ========== 12. 项目源码浏览页（project.html） ========== */
.back-link {
  margin: 0 0 14px;
}

.back-link a {
  color: var(--text-soft);
  font-size: 14px;
}

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

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

.repo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 16px;
}

.repo-toolbar-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.repo-toolbar-right {
  font-size: 13.5px;
  color: var(--text-faint);
}

/* 数据来源与免责提示区 */
.repo-notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px dashed var(--warn);
  background: var(--warn-soft);
  color: var(--text);
  font-size: 13.5px;
}

.repo-notice b {
  color: var(--warn);
  font-size: 13px;
}

.repo-notice p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.repo-notice a.repo-notice-link {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
}

.repo-notice a.repo-notice-link:hover {
  color: var(--accent-strong);
}

.repo-notice code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 5px;
}

.repo-split {
  display: grid;
  grid-template-columns: minmax(250px, 340px) 1fr;
  gap: 16px;
  align-items: stretch;
}

.repo-files {
  overflow: hidden;
}

.repo-files-head {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
}

#repoList {
  max-height: 66vh;
  overflow: auto;
  padding: 6px 0;
}

/* 代码 / 数据 分组标题 */
.repo-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.repo-group em {
  font-style: normal;
  font-weight: 500;
}

.repo-group:first-child {
  padding-top: 6px;
}

/* 数据类行稍弱化，代码类行可点预览更醒目 */
.repo-row[data-kind="data"] .file-name {
  color: var(--text-soft);
}

.repo-row[data-kind="data"] {
  cursor: default;
}

.repo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 10px;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 13.5px;
  transition: background 0.15s;
}

.repo-row:hover {
  background: var(--surface-2);
}

.repo-row.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.file-badge {
  flex: none;
  min-width: 42px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--text-faint);
}

.file-badge.b-html { background: #e06c3f; }
.file-badge.b-css { background: #7a5af5; }
.file-badge.b-js, .file-badge.b-mjs { background: #d9a514; }
.file-badge.b-json { background: #4a9d4a; }
.file-badge.b-md, .file-badge.b-txt { background: #5d8aa8; }
.file-badge.b-svg, .file-badge.b-xml { background: #2e9ec7; }
.file-badge.b-csv { background: #3a8f7f; }
.file-badge.b-png, .file-badge.b-jpg, .file-badge.b-jpeg,
.file-badge.b-gif, .file-badge.b-webp { background: #b564d0; }
.file-badge.b-zip { background: #c07a3a; }
.file-badge.b-ps1 { background: #0f7ac0; }
.file-badge.b-py { background: #3572a5; }
.file-badge.b-c, .file-badge.b-h { background: #5b6ea8; }
.file-badge.b-java { background: #b07219; }
.file-badge.b-go { background: #00a6d6; }
.file-badge.b-rs { background: #dea584; }
.file-badge.b-sh { background: #4f8b4f; }
.file-badge.b-yml, .file-badge.b-yaml { background: #7c8b64; }

.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
}

.file-size {
  flex: none;
  font-size: 12px;
  color: var(--text-faint);
}

.file-dl {
  flex: none;
  color: var(--text-faint);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.repo-row:hover .file-dl {
  opacity: 1;
}

.file-dl:hover {
  color: var(--accent);
  background: var(--surface);
}

/* 右侧预览区 */
.repo-viewer {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.viewer-empty {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--text-faint);
  font-size: 14.5px;
}

.viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.viewer-headinfo {
  min-width: 0;
}

.viewer-name {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  word-break: break-all;
}

.viewer-meta {
  font-size: 12px;
  color: var(--text-faint);
}

.viewer-actions {
  display: flex;
  gap: 8px;
}

.viewer-code {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  max-height: 66vh;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface-2);
  white-space: pre;
  tab-size: 2;
}

@media (max-width: 900px) {
  .repo-split {
    grid-template-columns: 1fr;
  }

  .repo-files {
    order: 2;
  }

  .repo-viewer {
    order: 1;
  }

  #repoList {
    max-height: 40vh;
  }

  .viewer-code {
    max-height: 50vh;
  }
}

@media (max-width: 560px) {
  .viewer-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ========== 13. 小作文：时间标签 / 普通·思维导图 ========== */
.cat-count {
  font-style: normal;
  font-size: 11px;
  opacity: 0.75;
  margin-left: 4px;
}

.tag--time {
  color: var(--text-soft);
  background: var(--surface);
  border: 1px dashed var(--border);
}

.tag--kind {
  color: var(--plan);
  background: var(--plan-soft);
  border-color: transparent;
}

.tag--mind {
  color: #9c4dcc;
  background: rgba(156, 77, 204, 0.12);
  border-color: transparent;
  font-weight: 600;
}

[data-theme="dark"] .tag--mind {
  color: #cd9df0;
  background: rgba(205, 157, 240, 0.15);
}

.entry-item--mind {
  border-left: 4px solid #9c4dcc;
}

.entry-item--mind:hover {
  border-color: var(--accent);
}

/* ========== 14. 思维导图页面 ========== */
.mm-mathhint {
  font-size: 13px;
  color: var(--text-faint);
}

.mm-shell {
  margin-bottom: 40px;
}

.mm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.mm-tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mm-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}

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

.mm-btn-wide {
  font-size: 13px;
}

.mm-zoomlabel {
  min-width: 52px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}

.mm-hint {
  font-size: 12.5px;
  color: var(--text-faint);
}

.mm-viewport {
  position: relative;
  height: 68vh;
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle, var(--border) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--bg-soft);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.mm-viewport.mm-dragging {
  cursor: grabbing;
}

.mm-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.mm-svg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  --mm-line: #8a7ff0; /* 降级色 */
  --mm-line: color-mix(in srgb, var(--accent) 45%, var(--border));
}

/* 额外父节点（多父）的虚线 */
.mm-svg .mm-link--extra {
  stroke-dasharray: 6 5;
  opacity: 0.55;
}

.mm-nodes {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.mm-node {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mm-node:hover {
  border-color: var(--accent);
}

.mm-node--root {
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  border: none;
  color: #fff;
  font-weight: 700;
}

.mm-node--root .mm-text {
  color: #fff;
}

.mm-node.selected {
  border-color: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

/* 带大段内容(detail)的节点：右下角小圆点提示可阅读 */
.mm-node--detail::after {
  content: '';
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface);
}

.mm-node--root.mm-node--detail::after {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.mm-text {
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.mm-text .katex,
.mm-text mjx-container {
  font-size: 1.02em;
}

@media (max-width: 700px) {
  .mm-viewport {
    height: 60vh;
    min-height: 340px;
  }

  .mm-hint {
    display: none;
  }
}
