/* ============================================================
   个人网站样式表 — nanfengshui.cn
   设计风格：极致极简，低饱和度中性色系，留白充足
   编码：UTF-8
   ============================================================ */

/* ----------------------------------------------------------
   一、CSS 变量与全局配置
   修改这些变量即可一键更换全站配色
   ---------------------------------------------------------- */
:root {
  --color-text: #1a1a1a;
  --color-text-secondary: #666666;
  --color-text-light: #999999;
  --color-bg: #fafaf8;
  --color-card: #ffffff;
  --color-bg-gray: #f5f5f5;
  --color-border: #e8e8e8;
  --color-accent: #333333;
  --color-accent-hover: #000000;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: SF Mono, "Fira Code", "Cascadia Code", Consolas, monospace;

  --max-width: 960px;
  --max-width-text: 680px;
}

/* ----------------------------------------------------------
   二、全局重置
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  display: block;
  object-fit: scale-down;
}

/* 图片加载失败占位 */
img.img-broken {
  min-width: 100px;
  min-height: 120px;
  background-color: var(--color-bg-gray);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='120' viewBox='0 0 200 120'%3E%3Crect fill='%23f0f0f0' width='200' height='120'/%3E%3Ctext fill='%23aaa' font-size='13' font-family='sans-serif' text-anchor='middle' x='100' y='58'%3E图片加载失败%3C/text%3E%3Ctext fill='%23bbb' font-size='11' font-family='sans-serif' text-anchor='middle' x='100' y='78'%3EImage Error%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  object-fit: contain;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ----------------------------------------------------------
   三、布局工具类
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.container-narrow {
  width: 100%;
  max-width: var(--max-width-text);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Flex */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }
.gap-12 { gap: 3rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ----------------------------------------------------------
   四、间距工具类 (Margin / Padding)
   使用 rem 单位，与 Tailwind 对齐
   ---------------------------------------------------------- */
/* Margin */
.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.mt-20 { margin-top: 5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }

/* Padding */
.p-0 { padding: 0; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-8 { padding-top: 2rem; }
.pt-12 { padding-top: 3rem; }
.pt-16 { padding-top: 4rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-12 { padding-bottom: 3rem; }
.pb-16 { padding-bottom: 4rem; }

/* Section spacing */
.section-pb { padding-bottom: 120px; }

/* ----------------------------------------------------------
   五、排版工具类
   ---------------------------------------------------------- */
/* 字号 */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

/* 字重 */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* 行高 */
.leading-relaxed { line-height: 1.625; }
.leading-loose { line-height: 1.8; }
.leading-normal { line-height: 1.5; }

/* 对齐 */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* 文字颜色 */
.text-primary { color: var(--color-text); }
.text-secondary { color: var(--color-text-secondary); }
.text-light { color: var(--color-text-light); }
.text-white { color: #ffffff; }
.text-gray-200 { color: #e5e5e5; }

/* 等宽字体 */
.font-mono { font-family: var(--font-mono); }

/* 截断 */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------------
   六、背景与边框工具类
   ---------------------------------------------------------- */
.bg-white { background-color: #ffffff; }
.bg-page { background-color: var(--color-bg); }
.bg-gray { background-color: var(--color-bg-gray); }
.bg-dark { background-color: #2a2a2a; }
.bg-darker { background-color: #1e1e1e; }

.border { border: 1px solid var(--color-border); }
.border-t { border-top: 1px solid var(--color-border); }
.border-b { border-bottom: 1px solid var(--color-border); }
.border-none { border: none; }

.rounded { border-radius: 4px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }

/* 阴影 */
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04); }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04); }

/* ----------------------------------------------------------
   七、尺寸与显示工具类
   ---------------------------------------------------------- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }
.max-w-sm { max-width: 384px; }
.max-w-md { max-width: 448px; }
.max-w-lg { max-width: 512px; }
.max-w-xl { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-full { max-width: 100%; }

.object-cover { object-fit: cover; }
.object-center { object-position: center; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ----------------------------------------------------------
   八、交互工具类
   ---------------------------------------------------------- */
.cursor-pointer { cursor: pointer; }
.cursor-zoom-in { cursor: zoom-in; }

.transition { transition: all 0.2s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease; }
.transition-shadow { transition: box-shadow 0.2s ease; }
.duration-200 { transition-duration: 0.2s; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.opacity-100 { opacity: 1; }

/* ----------------------------------------------------------
   九、链接样式
   ---------------------------------------------------------- */
.link-external {
  color: var(--color-text);
  border-bottom: 1px dashed var(--color-text-light);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.link-external:hover {
  color: var(--color-accent-hover);
  border-bottom-color: var(--color-accent-hover);
}

.link-underline {
  position: relative;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-text);
  transition: width 0.2s ease;
}
.link-underline:hover::after {
  width: 100%;
}

/* ----------------------------------------------------------
   十、分隔线
   ---------------------------------------------------------- */
.divider {
  width: 40px;
  height: 1px;
  background-color: var(--color-border);
  margin: 0 auto;
}

/* ----------------------------------------------------------
   十一、导航栏组件
   ---------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.navbar.scrolled {
  border-bottom-color: var(--color-border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
}
.navbar-brand {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.navbar-links a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 2px;
}
.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-text);
  transition: width 0.2s ease;
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--color-text);
}
.navbar-links a:hover::after,
.navbar-links a.active::after {
  width: 100%;
}

/* 汉堡菜单按钮 */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 60;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background-color: var(--color-text);
  transition: all 0.25s ease;
  position: absolute;
}
.hamburger span:nth-child(1) { transform: translateY(-5px); }
.hamburger span:nth-child(2) { transform: translateY(0); }
.hamburger span:nth-child(3) { transform: translateY(5px); }

.hamburger.open span:nth-child(1) { transform: rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg); }

/* 移动端菜单遮罩 */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(250, 250, 248, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}
.mobile-menu.open {
  display: flex;
}
.mobile-menu a {
  font-size: 1.25rem;
  color: var(--color-text);
  font-weight: 500;
  transition: color 0.2s ease;
}
.mobile-menu a:hover {
  color: var(--color-text-secondary);
}

/* ----------------------------------------------------------
   十二、个人介绍栏目
   ---------------------------------------------------------- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}
.hero-content {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}
.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 32px;
  background-color: var(--color-bg-gray);
}
.hero-name {
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.site-desc {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
}
.hero-tagline {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}
.hero-desc {
  font-size: 0.875rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ----------------------------------------------------------
   十三、栏目标题
   ---------------------------------------------------------- */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.section-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-light);
  text-align: center;
  margin-bottom: 48px;
}

/* ----------------------------------------------------------
   十四、兴趣爱好 - 标签切换
   ---------------------------------------------------------- */
.tabs-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs-wrapper::-webkit-scrollbar { display: none; }

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: max-content;
  padding-bottom: 4px;
}
.tab-btn {
  padding: 8px 20px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  position: relative;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--color-text);
  transition: width 0.2s ease;
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active {
  color: var(--color-text);
  font-weight: 500;
}
.tab-btn.active::after { width: 24px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ----------------------------------------------------------
   十五、兴趣爱好 - 作品卡片（通用）
   ---------------------------------------------------------- */
.hobby-intro {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: var(--max-width-text);
  margin: 0 auto 48px;
}

.hobby-item {
  margin-bottom: 64px;
}
.hobby-item:last-child { margin-bottom: 0; }

.hobby-item-header {
  margin-bottom: 20px;
}
.hobby-item-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}
.hobby-item-date {
  font-size: 0.8rem;
  color: var(--color-text-light);
}
.hobby-item-desc {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: var(--max-width-text);
}

/* 图片画廊 */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.gallery.col-1 { grid-template-columns: 1fr; }
.gallery.col-3 { grid-template-columns: repeat(3, 1fr); }
.gallery img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 4px;
  cursor: zoom-in;
  background-color: var(--color-bg-gray);
  transition: opacity 0.3s ease;
}
.gallery img:hover {
  opacity: 0.85;
}

/* 单张大图 */
.figure-full {
  margin-bottom: 20px;
}
.figure-full img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 4px;
  cursor: zoom-in;
  background-color: var(--color-bg-gray);
}

.figure-caption {
  margin-top: 10px;
  font-size: 14px;
  color: #888;
  line-height: 1.8;
  text-align: center;
}

/* 视频容器 (16:9 响应式) */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin-bottom: 20px;
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--color-bg-gray);
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-container video {
  width: 100%;
  max-width: 100%;
  border-radius: 4px;
  display: block;
}

/* 作品链接 */
.hobby-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.hobby-link {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 6px 16px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hobby-link:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* ----------------------------------------------------------
   十六、「造点小玩意儿」专属深色风格卡片
   ---------------------------------------------------------- */
.project-card {
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 32px;
  color: #d4d4d4;
}
.project-card:last-child { margin-bottom: 0; }
.project-card .hobby-item-title {
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1rem;
}
.project-card .hobby-item-date { color: #888; }
.project-card .hobby-item-desc { color: #b0b0b0; }
.project-card .hobby-link {
  color: #c0c0c0;
  border-color: #555;
}
.project-card .hobby-link:hover {
  color: #fff;
  border-color: #999;
}
.project-card .gallery img {
  background-color: #3a3a3a;
}

/* ----------------------------------------------------------
   十七、课程卡片
   ---------------------------------------------------------- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.course-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 28px;
  transition: box-shadow 0.25s ease;
}
.course-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.course-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}
.course-card-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}
.course-card-link {
  font-size: 0.8rem;
  color: var(--color-text-light);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}
.course-card-link:hover { color: var(--color-text); }

/* ----------------------------------------------------------
   十八、记录栏目 - 时间线
   ---------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 40px;
}
/* 时间线竖线 */
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 0;
  width: 1px;
  background-color: var(--color-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 48px;
}
.timeline-item:last-child { margin-bottom: 0; }
/* 时间线圆点 */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-text-light);
}
.timeline-date {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.timeline-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}
.timeline-body {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: var(--max-width-text);
}
.timeline-body p { margin-bottom: 14px; }
.timeline-body p:last-child { margin-bottom: 0; }
.timeline-body img {
  margin: 16px 0;
  border-radius: 4px;
  max-height: 400px;
  object-fit: cover;
  cursor: zoom-in;
  background-color: var(--color-bg-gray);
}

/* ----------------------------------------------------------
   十九、栏目搜索
   ---------------------------------------------------------- */
.records-search-wrapper {
  max-width: 360px;
  margin: 0 auto 32px;
}
.records-search {
  width: 100%;
  padding: 10px 16px 10px 40px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--color-text);
  background-color: var(--color-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
}
.records-search:focus {
  border-color: var(--color-text-light);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.records-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23999'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
  cursor: pointer;
}

.search-hidden { display: none; }

.search-highlight {
  background-color: #fff3b0;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

/* ----------------------------------------------------------
   二十、资料栏目
   ---------------------------------------------------------- */
.resource-section {
  margin-bottom: 48px;
}
.resource-section:last-child { margin-bottom: 0; }
.resource-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

/* 文件下载列表 */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.resource-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  transition: all 0.2s ease;
}
.resource-item:hover {
  border-color: var(--color-text-light);
  background-color: var(--color-bg-gray);
}
.resource-item-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}
.resource-item-info {
  flex: 1;
  min-width: 0;
}
.resource-item-name {
  font-size: 0.9375rem;
  color: var(--color-text);
  font-weight: 500;
}
.resource-item-desc {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 2px;
}
.resource-item-dl {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 4px 14px;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.resource-item-dl:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* 代码块 */
.code-block {
  background-color: #f5f5f5;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background-color: #ebebeb;
  border-bottom: 1px solid var(--color-border);
}
.code-block-lang {
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-family: var(--font-mono);
}
.code-block pre {
  padding: 16px;
  overflow-x: auto;
  margin: 0;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--color-text);
}
/* 简易代码高亮 */
.code-block .kw { color: #d73a49; }        /* 关键字 */
.code-block .str { color: #032f62; }        /* 字符串 */
.code-block .cm { color: #6a737d; }         /* 注释 */
.code-block .fn { color: #6f42c1; }         /* 函数名 */
.code-block .num { color: #005cc5; }        /* 数字 */

/* ----------------------------------------------------------
   二十一、图片预览 Lightbox
   ---------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 28px;
  line-height: 1;
  transition: color 0.2s ease;
  z-index: 101;
}
.lightbox-close:hover { color: #fff; }
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 32px;
  transition: color 0.2s ease;
  z-index: 101;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover { color: #fff; }
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #999;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
@media (max-width: 767px) {
  .lightbox-close { top: 12px; right: 12px; }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}

/* ----------------------------------------------------------
   二十二、页脚
   ---------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 20px;
  text-align: center;
}
.footer-copyright {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 8px;
}
.footer-contact {
  font-size: 0.8rem;
  color: var(--color-text-light);
}
.footer-contact a {
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}
.footer-contact a:hover { color: var(--color-text); }

/* ----------------------------------------------------------
   二十三、内容区通用图文排版
   ---------------------------------------------------------- */
.content-text {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}
.content-text p { margin-bottom: 14px; }
.content-text p:last-child { margin-bottom: 0; }
.content-text a { border-bottom: 1px dashed var(--color-text-light); }
.content-text a:hover { color: var(--color-accent-hover); border-bottom-color: var(--color-accent-hover); }

/* 作品条目之间的分隔 */
.item-divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
  margin: 56px 0;
}

/* ----------------------------------------------------------
   二十四、图文混排排版
   ---------------------------------------------------------- */

/* 长文本容器 */
.rich-text {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.9;
  max-width: var(--max-width-text);
}
.rich-text p { margin-bottom: 16px; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text strong { font-weight: 600; color: var(--color-text); }
.rich-text em { font-style: italic; color: var(--color-text-secondary); }
.rich-text a { border-bottom: 1px dashed var(--color-text-light); }
.rich-text a:hover { color: var(--color-accent-hover); border-bottom-color: var(--color-accent-hover); }

/* 图文左右并排 */
.media-row {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.media-row.reverse { flex-direction: row-reverse; }
.media-row .media-img {
  flex-shrink: 0;
  width: 320px;
}
.media-row .media-img img {
  width: 100%;
  border-radius: 4px;
  cursor: zoom-in;
  background-color: var(--color-bg-gray);
  display: block;
}
.media-row .media-body {
  flex: 1;
  min-width: 0;
}

/* 图片浮动 */
.figure-float-left {
  float: left;
  width: 280px;
  margin: 4px 24px 16px 0;
}
.figure-float-right {
  float: right;
  width: 280px;
  margin: 4px 0 16px 24px;
}
.figure-float-left img,
.figure-float-right img {
  width: 100%;
  border-radius: 4px;
  cursor: zoom-in;
  background-color: var(--color-bg-gray);
  display: block;
}
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ----------------------------------------------------------
   二十五、响应式 — 平板 (768px - 1023px)
   ---------------------------------------------------------- */
@media (max-width: 1023px) {
  .section-pb { padding-bottom: 80px; }

  .courses-grid { grid-template-columns: repeat(2, 1fr); }

  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery.col-1 { grid-template-columns: 1fr; }
  .gallery.col-3 { grid-template-columns: repeat(2, 1fr); }

  .tab-btn { padding: 8px 16px; font-size: 0.8125rem; }

  .timeline { padding-left: 32px; }
  .timeline-item::before { left: -28px; }

  .hero-section { min-height: auto; padding: 100px 24px 80px; }
  .hero-content { max-width: 460px; }
  .hero-name { font-size: 1.75rem; }
  .site-desc { font-size: 0.9rem; }
  .section-title { font-size: 1.375rem; }

  .media-row .media-img { width: 240px; }
}

/* ----------------------------------------------------------
   二十六、响应式 — 手机 (< 768px)
   ---------------------------------------------------------- */
@media (max-width: 767px) {
  .section-pb { padding-bottom: 60px; }

  /* 导航 */
  .navbar-links { display: none; }
  .hamburger { display: flex; }

  /* 课程 */
  .courses-grid { grid-template-columns: 1fr; }

  /* 画廊 */
  .gallery { grid-template-columns: 1fr; gap: 8px; }
  .gallery.col-1 { grid-template-columns: 1fr; }
  .gallery.col-3 { grid-template-columns: 1fr; }

  /* 时间线 */
  .timeline { padding-left: 28px; }
  .timeline-item::before { left: -24px; width: 6px; height: 6px; }

  /* 标签 */
  .tabs { justify-content: flex-start; padding: 0 4px; }
  .tab-btn { padding: 6px 14px; font-size: 0.8rem; }

  /* 标题 */
  .hero-section { min-height: auto; padding: 72px 16px 56px; }
  .hero-content { max-width: 100%; padding: 0 4px; }
  .hero-avatar { width: 96px; height: 96px; margin-bottom: 24px; }
  .hero-name { font-size: 1.5rem; margin-bottom: 10px; }
  .site-desc { font-size: 0.875rem; margin-bottom: 10px; line-height: 1.65; padding: 0 4px; }
  .hero-tagline { font-size: 0.9375rem; margin-bottom: 6px; padding: 0 4px; }
  .hero-desc { font-size: 0.8125rem; padding: 0 4px; }
  .section-title { font-size: 1.25rem; }
  .section-subtitle { margin-bottom: 36px; }

  .records-search-wrapper {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 24px 0;
    padding: 0;
  }
  .records-search {
    display: block;
    width: 100%;
    font-size: 0.875rem;
    padding: 10px 14px 10px 36px;
    background-size: 16px 16px;
    background-position: 14px center;
  }

  /* 图片 */
  img { max-height: 60vh; }
  .figure-full { margin-bottom: 36px; }
  .figure-full img { max-height: 280px; }
  .figure-caption { font-size: 12px; margin-top: 8px; line-height: 1.65; padding: 0 4px; margin-bottom: 4px; }
  .gallery img { height: 220px; object-fit: cover; }

  /* 项目卡片 */
  .project-card { padding: 24px 20px; }

  /* 资源 */
  .resource-item { flex-wrap: wrap; }
  .resource-item-dl { width: 100%; text-align: center; margin-top: 8px; }

  /* 间距缩减 */
  .hobby-item { margin-bottom: 48px; }
  .item-divider { margin: 40px 0; }

  /* 图文混排 — 手机端均切换为上下布局 */
  .media-row { flex-direction: column; margin-bottom: 36px; }
  .media-row.reverse { flex-direction: column; }
  .media-row .media-img { width: 100%; margin-bottom: 12px; }
  .figure-float-left,
  .figure-float-right { float: none; width: 100%; margin: 0 0 28px 0; }
  .clearfix.rich-text { margin-bottom: 32px; }
}

/* ----------------------------------------------------------
   二十七、响应式 — 小屏手机 (< 375px, iPhone SE 等)
   ---------------------------------------------------------- */
@media (max-width: 374px) {
  .hero-section { padding: 56px 12px 44px; }
  .hero-avatar { width: 80px; height: 80px; margin-bottom: 20px; }
  .hero-name { font-size: 1.35rem; }
  .site-desc { font-size: 0.8rem; }
  .hero-tagline { font-size: 0.85rem; }
  .hero-desc { font-size: 0.78rem; }
  .section-title { font-size: 1.15rem; }
  .figure-full { margin-bottom: 28px; }
  .figure-full img { max-height: 220px; }
  .figure-caption { font-size: 11px; }
  .media-row { margin-bottom: 28px; }
  .clearfix.rich-text { margin-bottom: 28px; }

  .records-search-wrapper { margin-bottom: 20px; }
  .records-search { font-size: 0.8125rem; padding: 9px 12px 9px 32px; background-position: 10px center; }
}
