/**
 * ========================================
 * 主样式表
 * ========================================
 * 包含：基础布局、底部目录、内容样式、交互组件
 * ========================================
 */

/* ========================================
 * 第一部分：基础布局
 * ======================================== */

/* 页面整体 */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #1a1a1a;
  color: #e0e0e0;
}



/* 导航栏 */
.nav-bar {
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 8px 20px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  background: rgba(40, 40, 40, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-menu:hover {
  background: rgba(45, 45, 45, 0.7);
  border: 1px solid rgba(138, 180, 248, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.nav-menu li {
  position: relative;
  padding: 6px 0;
}

.nav-menu li:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.nav-menu:hover li:not(:last-child)::after {
  background: rgba(138, 180, 248, 0.3);
}



.nav-menu li a {
  color: #c8c8c8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
}

.nav-menu li a:hover {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.1);
}

/* 首页内容 */
.home-content {
  text-align: center;
  padding: 80px 20px;
  color: #e0e0e0;
}

/* 页面内容 */
.page-content {
  padding: 40px 20px;
  color: #e0e0e0;
  max-width: 1200px;
  margin: 0 auto;
}

.home-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 32px;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.home-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #c8c8c8;
}

.home-subtitle {
  font-size: 18px;
  color: #a0a0a0;
  margin-bottom: 32px;
}

.home-description {
  font-size: 14px;
  color: #808080;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========================================
 * 第二部分：主内容区域
 * ======================================== */

.main-container {
  min-height: 100vh;
  padding: 40px 30px 20px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.content-wrap {
  max-width: 1500px;
  margin: 0 auto;
  background-color: rgba(35, 35, 35, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 44px;
  position: relative;
  transition: box-shadow 0.4s ease;
  z-index: 1;
}

.content-wrap:hover {
  box-shadow:
    0 0 25px rgba(74, 158, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* ========================================
 * 第三部分：底部目录区域
 * ======================================== */

.sidebar {
  width: 100%;
  background: #252525;
  border-top: 1px solid #404040;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
  padding: 24px 20px;
  box-sizing: border-box;

}

.sidebar-toc {
  max-width: 1200px;
  margin: 0 auto;
}

/* 目录整体 - 横向排列分类 */
.toc {
  display: flex;
  gap: 8px;
  white-space: nowrap;
  padding: 4px 0;
  align-items: flex-start;
  overflow-x: auto;
}

/* 一级分类 - 横向排列的卡片 */
.toc-level-1 {
  display: inline-block;
  flex-shrink: 0;
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 12px;
  padding: 14px 24px;
  vertical-align: top;
}

/* 分类标题 */
.toc-header {
  color: #c8c8c8;
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 10px 0;
  padding: 0 0 8px 0;
  border-bottom: 1px solid #404040;
  letter-spacing: 0.5px;
}

/* 子分类标题（如"Web"、"Python"等） */
.toc-level-1 > .toc-level-2 > .toc-header,
.toc-level-1 > .toc-level-3 > .toc-header {
  color: #a0a0a0;
  font-weight: 600;
  font-size: 12px;
  margin: 8px 0 6px 0;
  padding: 0;
  border-bottom: none;
}

/* 子项容器 - 竖向排列 */
.toc-level-2,
.toc-level-3,
.toc-level-4,
.toc-level-5,
.toc-level-6 {
  display: block;
  margin: 0;
}

/* 目录链接 */
.toc a {
  color: #a0a0a0;
  text-decoration: none;
  display: block;
  padding: 4px 10px;
  margin: 2px 0;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.toc a:hover {
  background: #404040;
  color: #e0e0e0;
}

/* ========================================
 * 跳到底部按钮（右侧悬浮）
 * ======================================== */

.jump-to-toc-btn {
  position: fixed;
  right: 24px;
  top: 50%;
  margin-top: 10px;
  z-index: 999;
  padding: 12px 20px;
  background: rgba(35, 35, 35, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #c8c8c8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.jump-to-toc-btn:hover {
  background: rgba(50, 50, 50, 0.9);
  border-color: rgba(138, 180, 248, 0.5);
  color: #e0e0e0;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* 跳到顶部按钮（右侧悬浮） */
.jump-to-top-btn {
  position: fixed;
  right: 24px;
  top: 50%;
  margin-top: -64px;
  z-index: 999;
  padding: 12px 20px;
  background: rgba(35, 35, 35, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #c8c8c8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.jump-to-top-btn:hover {
  background: rgba(50, 50, 50, 0.9);
  border-color: rgba(138, 180, 248, 0.5);
  color: #e0e0e0;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* ========================================
 * 第四部分：Markdown 内容样式
 * ======================================== */

.content {
  color: #e0e0e0;
  line-height: 1.8;
  max-width: 1500px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
  color: #c8c8c8;
  margin-top: 2em;
  margin-bottom: 1em;
  font-weight: 700;
  position: relative;
  padding-bottom: 10px;
}

.content h1 {
  font-size: 2.2em;
  color: #d0d0d0;
  margin-top: 0.5em;
}

.content h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: #555;
  border-radius: 2px;
}

.content h2 {
  font-size: 1.8em;
  padding-bottom: 8px;
}

.content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: #555;
  border-radius: 2px;
}

.content h3 { font-size: 1.4em; }
.content h4 { font-size: 1.2em; }

.content p { margin-bottom: 1.2em; }

.content code {
  background: #1a1a1a;
  color: #c9a0dc;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-weight: 500;
}

.content pre {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 20px;
  margin: 1.5em 0;
  overflow-x: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.content pre code {
  background: transparent;
  color: #e0e0e0;
  padding: 0;
}

.content blockquote {
  background: #1a1a1a;
  border-left: 4px solid #555;
  padding: 1em 1.5em;
  margin: 1.5em 0;
  color: #a0a0a0;
  border-radius: 0 8px 8px 0;
}

.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.content th, .content td {
  border: 1px solid #404040;
  padding: 12px 16px;
  text-align: left;
  color: #e0e0e0;
}

.content th {
  background: #1a1a1a;
  color: #c8c8c8;
  font-weight: 600;
}

.content tr:nth-child(even) {
  background-color: #1a1a1a;
}

.content tr:hover {
  background-color: #404040;
}

.content a {
  color: #8ab4f8;
  text-decoration: none;
  font-weight: 500;
}

.content a:hover {
  text-decoration: underline;
  color: #a8c7fa;
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
}

.content ul, .content ol {
  padding-left: 2em;
  margin-bottom: 1.2em;
}

.content li {
  margin-bottom: 0.5em;
  line-height: 1.8;
}

/* ========================================
 * 第五部分：加载样式
 * ======================================== */

.loading {
  text-align: center;
  padding: 80px 50px;
  color: #e0e0e0;
}

/* ========================================
 * 站点视觉刷新：更安静的技术博客版式
 * ======================================== */

:root {
  --site-bg: #111316;
  --site-bg-soft: #15191c;
  --site-panel: #1a1f22;
  --site-panel-strong: #20262a;
  --site-line: #30383c;
  --site-text: #f3f5f4;
  --site-muted: #aeb8b2;
  --site-muted-strong: #cbd5cf;
  --site-accent: #5eead4;
  --site-accent-green: #94d82d;
  --site-accent-warm: #f5c451;
  --site-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --site-glow: 0 0 0 1px rgba(94, 234, 212, 0.14),
    0 18px 70px rgba(0, 0, 0, 0.34);
}

html {
  color-scheme: dark;
}

body,
body.light-mode {
  background:
    radial-gradient(circle at 18% 12%, rgba(94, 234, 212, 0.08), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(245, 196, 81, 0.06), transparent 24%),
    linear-gradient(135deg, #101214 0%, #151a1c 52%, #0f1717 100%);
  animation: none;
  color: var(--site-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

.nav-bar {
  background: rgba(17, 19, 22, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 0;
}

.nav-container {
  max-width: 1120px;
  padding: 0 24px;
}

.nav-menu {
  width: fit-content;
  margin: 0 auto;
  gap: 6px;
  padding: 6px;
  background: rgba(28, 33, 36, 0.88);
  border: 1px solid var(--site-line);
  border-radius: 8px;
  box-shadow: none;
}

.nav-menu:hover {
  background: rgba(32, 38, 42, 0.94);
  border-color: rgba(94, 234, 212, 0.28);
  box-shadow: none;
  transform: none;
}

.nav-menu li {
  padding: 0;
}

.nav-menu li:not(:last-child)::after {
  display: none;
}

.nav-menu li a {
  color: var(--site-muted-strong);
  border-radius: 6px;
  font-size: 14px;
  padding: 9px 14px;
  letter-spacing: 0;
}

.nav-menu li a:hover {
  color: var(--site-text);
  background: rgba(94, 234, 212, 0.12);
}

.main-container {
  min-height: auto;
  padding: clamp(28px, 5vw, 72px) clamp(18px, 4vw, 44px) 48px;
  overflow: visible;
}

.home-page .main-container,
.about-page .main-container {
  min-height: calc(100vh - 74px);
  display: grid;
  place-items: center;
}

.home-content {
  max-width: 760px !important;
  margin: 0 auto !important;
  padding: clamp(36px, 6vw, 60px) clamp(24px, 5vw, 56px) !important;
  background: rgba(26, 31, 34, 0.86) !important;
  border: 1px solid var(--site-line) !important;
  border-radius: 8px !important;
  box-shadow: var(--site-shadow) !important;
  backdrop-filter: blur(8px) saturate(110%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(110%) !important;
  animation: none !important;
}

.home-avatar {
  width: 118px !important;
  height: 118px !important;
  border: 2px solid rgba(94, 234, 212, 0.38) !important;
  box-shadow: none !important;
}

.home-avatar:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 34px rgba(94, 234, 212, 0.16) !important;
}

.home-title {
  color: var(--site-text) !important;
  font-size: clamp(2rem, 5vw, 3.25rem) !important;
  letter-spacing: 0 !important;
  margin-bottom: 14px !important;
}

.home-subtitle {
  color: var(--site-accent) !important;
  font-size: clamp(1rem, 2.5vw, 1.2rem) !important;
  margin-bottom: 22px !important;
}

.home-description {
  color: var(--site-muted) !important;
  line-height: 1.75 !important;
  margin-bottom: 8px !important;
}

.page-content {
  max-width: 780px !important;
  margin: 0 auto !important;
  padding: clamp(28px, 5vw, 46px) !important;
  background: rgba(26, 31, 34, 0.9) !important;
  color: var(--site-text) !important;
  border: 1px solid var(--site-line) !important;
  border-radius: 8px !important;
  box-shadow: var(--site-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
}

.page-content h1 {
  margin-top: 0;
  color: var(--site-text);
}

.page-content p {
  color: var(--site-muted-strong);
  line-height: 1.9;
}

.blog-page > .loading {
  padding: 38px 20px 22px;
}

.blog-page > .loading h1 {
  color: var(--site-text);
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 14px;
}

.blog-page > .loading p {
  color: var(--site-muted);
  margin: 0;
}

#stats-card-container {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  width: min(920px, calc(100% - 48px)) !important;
  box-sizing: border-box !important;
  margin: 28px auto 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(26, 31, 34, 0.88) !important;
  border: 1px solid var(--site-line) !important;
  border-radius: 8px !important;
  color: var(--site-text) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#stats-card-container > div {
  min-width: 0 !important;
  padding: 18px 16px !important;
  border-right: 1px solid var(--site-line);
}

#stats-card-container > div:last-child {
  border-right: 0;
}

#stats-card-container > div > div:first-child {
  color: var(--site-muted);
}

#stats-card-container > div > div:nth-child(2) {
  color: var(--site-text);
  font-size: clamp(22px, 3vw, 30px) !important;
  line-height: 1.25;
}

.content-wrap {
  max-width: 920px;
  min-height: min(560px, calc(100vh - 260px));
  background:
    linear-gradient(145deg, rgba(27, 34, 36, 0.96), rgba(21, 26, 29, 0.96));
  border: 1px solid var(--site-line);
  border-radius: 8px;
  box-shadow: var(--site-shadow);
  padding: clamp(24px, 4vw, 48px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    transform 0.25s ease;
}

.content-wrap:hover {
  border-color: rgba(94, 234, 212, 0.26);
  box-shadow: var(--site-glow);
  transform: translateY(-2px);
}

.content {
  max-width: 860px;
  color: var(--site-muted-strong);
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  color: var(--site-text);
  letter-spacing: 0;
}

.content h1 {
  font-size: clamp(1.9rem, 4vw, 2.65rem);
}

.content h1::after,
.content h2::after {
  background: linear-gradient(90deg, var(--site-accent), var(--site-accent-warm));
}

.content p,
.content li {
  color: var(--site-muted-strong);
}

.content a {
  color: var(--site-accent);
}

.content a:hover {
  color: var(--site-accent-green);
}

.content code {
  background: #101214;
  color: #ffd166;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.content pre,
.content blockquote {
  background: #101214;
  border: 1px solid var(--site-line);
}

.content blockquote {
  border-left: 4px solid var(--site-accent);
}

.content img {
  border: 1px solid var(--site-line);
  border-radius: 8px;
  box-shadow: none;
}

.sidebar {
  background: rgba(17, 19, 22, 0.72);
  border-top: 1px solid var(--site-line);
  box-shadow: none;
  padding: 28px 20px;
}

.sidebar-toc {
  max-width: 1120px;
}

.toc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  white-space: normal;
  overflow: visible;
  align-items: start;
}

.toc-level-1 {
  display: block;
  background: rgba(26, 31, 34, 0.82);
  border: 1px solid var(--site-line);
  border-radius: 8px;
  padding: 14px;
  transition: border-color 0.2s ease, background 0.2s ease,
    transform 0.2s ease;
}

.toc-level-1:hover {
  background: rgba(31, 38, 41, 0.92);
  border-color: rgba(94, 234, 212, 0.24);
  transform: translateX(2px);
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--site-text);
  border-bottom-color: var(--site-line);
  letter-spacing: 0;
  padding-bottom: 8px;
}

.toc-header::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--site-accent);
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.55);
}

.toc-level-1 > .toc-level-2 > .toc-header,
.toc-level-1 > .toc-level-3 > .toc-header {
  color: var(--site-muted);
}

.toc a {
  position: relative;
  color: var(--site-muted-strong);
  white-space: normal;
  border-radius: 6px;
  padding: 7px 10px 7px 16px;
  line-height: 1.45;
  border: 1px solid transparent;
  transform: translateX(0);
  transition: background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
}

.toc a::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(203, 213, 207, 0.42);
  transform: translateY(-50%);
}

.toc a:hover {
  background: rgba(94, 234, 212, 0.12);
  color: var(--site-text);
  border-color: rgba(94, 234, 212, 0.18);
  transform: translateX(4px);
}

.toc a.is-active,
.toc a[aria-current="page"] {
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.18), rgba(245, 196, 81, 0.09));
  border-color: rgba(94, 234, 212, 0.34);
  color: #ffffff;
}

.toc a.is-active::before,
.toc a[aria-current="page"]::before {
  background: var(--site-accent-warm);
  box-shadow: 0 0 12px rgba(245, 196, 81, 0.55);
}

.jump-to-top-btn,
.jump-to-toc-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  background: rgba(26, 31, 34, 0.92);
  border-color: var(--site-line);
  border-radius: 8px;
  color: var(--site-muted-strong);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s ease, border-color 0.2s ease,
    background 0.2s ease, color 0.2s ease;
}

.jump-to-top-btn:hover,
.jump-to-toc-btn:hover {
  background: rgba(32, 38, 42, 0.98);
  border-color: rgba(94, 234, 212, 0.4);
  color: var(--site-text);
  transform: translateY(-2px);
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--site-accent), var(--site-accent-warm));
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.42);
  transition: transform 0.08s linear;
}

@media (min-width: 1180px) {
  .blog-page {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(720px, 920px);
    grid-template-rows: auto auto 1fr;
    column-gap: 28px;
    align-items: start;
    justify-content: center;
  }

  .blog-page .nav-bar {
    padding: 10px 0;
  }

  .blog-page > .loading {
    padding: 30px 20px 8px;
  }

  .blog-page > .loading h1 {
    font-size: clamp(2.35rem, 3vw, 3.1rem);
  }

  .blog-page #stats-card-container {
    margin-top: 22px !important;
  }

  .blog-page .nav-bar,
  .blog-page > .loading {
    grid-column: 1 / -1;
  }

  .blog-page > .sidebar {
    grid-column: 1;
    grid-row: 3;
    position: sticky;
    top: 92px;
    height: min(760px, calc(100vh - 112px));
    overflow: auto;
    align-self: start;
    border: 1px solid var(--site-line);
    border-radius: 8px;
    padding: 12px;
    margin: 20px 0 56px;
    background: rgba(17, 19, 22, 0.58);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.18);
    scrollbar-width: thin;
    scrollbar-color: rgba(203, 213, 207, 0.34) rgba(255, 255, 255, 0.05);
  }

  .blog-page > .main-container {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    padding: 20px 0 56px;
  }

  .blog-page .sidebar-toc {
    max-width: none;
  }

  .blog-page .toc {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .blog-page .content-wrap {
    margin: 0;
  }
}

@media (min-width: 721px) and (max-width: 1179px) {
  .blog-page > .main-container,
  .blog-page > .sidebar {
    width: min(920px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
  }

  .blog-page > .main-container {
    padding-top: 18px;
  }

  .blog-page > .sidebar {
    border: 1px solid var(--site-line);
    border-radius: 8px;
    padding: 16px;
    margin-top: 18px;
    margin-bottom: 48px;
  }

  .blog-page .toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-container {
    padding: 0 14px;
  }

  .nav-menu {
    width: 100%;
    justify-content: center;
  }

  .nav-menu li a {
    font-size: 13px;
    padding: 8px 10px;
  }

  .blog-page > .loading {
    padding: 34px 14px 20px;
  }

  #stats-card-container {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: calc(100% - 28px) !important;
    margin-top: 22px !important;
  }

  #stats-card-container > div {
    border-right: 0;
    border-bottom: 1px solid var(--site-line);
  }

  #stats-card-container > div:nth-child(odd) {
    border-right: 1px solid var(--site-line);
  }

  #stats-card-container > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .main-container {
    padding: 24px 14px 36px;
  }

  .home-page .main-container,
  .about-page .main-container {
    min-height: auto;
  }

  .home-content,
  .page-content,
  .content-wrap {
    padding: 24px 18px !important;
  }

  .content h1 {
    font-size: 1.75rem;
  }

  .sidebar {
    padding: 22px 14px 28px;
  }

  .toc {
    grid-template-columns: 1fr;
  }

  .jump-to-top-btn,
  .jump-to-toc-btn {
    right: 14px;
    width: 42px;
    height: 42px;
    top: auto;
    margin-top: 0;
  }

  .jump-to-top-btn {
    bottom: 70px;
  }

  .jump-to-toc-btn {
    bottom: 18px;
  }
}

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

/* ========================================
 * 第六部分：交互组件
 * ======================================== */

/* 滚动感知按钮显隐 */
.jump-to-top-btn.is-hidden,
.jump-to-toc-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* 内容加载过渡 */
.content.is-loading {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.content.is-loaded {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* 阅读时间标签 */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--site-muted);
  padding: 4px 12px;
  background: rgba(26, 31, 34, 0.7);
  border: 1px solid var(--site-line);
  border-radius: 20px;
  margin-bottom: 16px;
}

.reading-time svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* 代码复制按钮 */
.content pre {
  position: relative;
}

.content pre .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--site-muted);
  background: rgba(26, 31, 34, 0.85);
  border: 1px solid var(--site-line);
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  user-select: none;
  letter-spacing: 0.3px;
}

.content pre:hover .copy-btn {
  opacity: 1;
}

.content pre .copy-btn:hover {
  color: var(--site-accent);
  border-color: rgba(94, 234, 212, 0.35);
}

.content pre .copy-btn.copied {
  color: var(--site-accent-green);
  border-color: rgba(148, 216, 45, 0.35);
}

/* 图片 Lightbox */
.img-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  cursor: zoom-out;
}

.img-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.img-lightbox-overlay img {
  max-width: 96vw;
  max-height: 94vh;
  object-fit: contain;
  border-radius: 0;
  border: none;
  box-shadow: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-drag: none;
}

/* 可点击图片的光标提示 */
.content img {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.content img:hover {
  transform: scale(1.015);
}

/* 目录搜索框 */
.toc-search-wrap {
  margin-bottom: 10px;
  position: relative;
}

.toc-search-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  font-size: 12px;
  color: var(--site-muted-strong);
  background: rgba(17, 19, 22, 0.65);
  border: 1px solid var(--site-line);
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.toc-search-input:focus {
  border-color: rgba(94, 234, 212, 0.35);
  background: rgba(22, 27, 30, 0.8);
}

.toc-search-input::placeholder {
  color: var(--site-muted);
  opacity: 0.55;
}

.toc-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--site-muted);
  opacity: 0.45;
  pointer-events: none;
}

/* 搜索无结果提示 */
.toc-no-result {
  text-align: center;
  padding: 14px 10px;
  font-size: 12px;
  color: var(--site-muted);
  opacity: 0.6;
}

/* 搜索隐藏的目录项 */
.toc a.is-filtered-hidden {
  display: none;
}

/* ========================================
 * 第七部分：友链页面
 * ======================================== */

.friends-page .main-container {
  padding-top: 28px;
}

.page-header {
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--site-line);
}

.page-header h1 {
  color: var(--site-text);
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 10px;
  letter-spacing: 0;
}

.page-header p {
  color: var(--site-muted);
  margin: 0;
  font-size: 15px;
}

/* 分组区域 */
.friend-section {
  margin-bottom: 40px;
}

.friend-section-title {
  color: var(--site-text);
  font-size: 1.25rem;
  margin: 0 0 18px;
  letter-spacing: 1px;
}

/* 友链卡片 */
.friend-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(26, 31, 34, 0.82);
  border: 1px solid var(--site-line);
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.22s ease, border-color 0.22s ease,
    box-shadow 0.22s ease, background 0.22s ease;
  position: relative;
  margin-bottom: 14px;
}

.friend-card:hover {
  transform: translateX(4px) translateY(-2px);
  border-color: rgba(94, 234, 212, 0.32);
  background: rgba(31, 38, 41, 0.92);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2), 0 0 20px rgba(94, 234, 212, 0.05);
}

/* 编号徽章 */
.friend-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--site-muted-strong);
  background: rgba(17, 19, 22, 0.8);
  border: 1px solid var(--site-line);
  border-radius: 50%;
  line-height: 1;
}

/* 头像 */
.friend-avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--site-line);
  transition: border-color 0.2s ease;
}

.friend-card:hover .friend-avatar {
  border-color: rgba(94, 234, 212, 0.45);
}

/* 本站信息头像稍大 */
.friend-site-avatar {
  width: 64px;
  height: 64px;
  min-width: 64px;
}

/* 无头像时用首字母占位 */
.friend-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--site-accent);
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.12), rgba(245, 196, 81, 0.08));
  border-color: rgba(94, 234, 212, 0.25);
}

/* 信息区 */
.friend-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.friend-name {
  color: var(--site-text);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-url {
  color: var(--site-accent);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.friend-desc {
  color: var(--site-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 本站信息卡片特殊样式（爱心） */
.friend-card-self {
  padding: 20px 24px;
}

.friend-heart {
  flex-shrink: 0;
  font-size: 20px;
  margin-left: auto;
  padding-left: 14px;
}

/* 加载状态 */
.friends-loading {
  text-align: center;
  padding: 48px 20px;
  color: var(--site-muted);
  font-size: 14px;
}

/* ========================================
 * 友链申请表单
 * ======================================== */

.friend-apply-section {
  margin-top: 8px;
  padding-top: 32px;
  border-top: 1px solid var(--site-line);
}

.apply-header-icon {
  text-align: center;
  font-size: 30px;
  margin-bottom: 10px;
  line-height: 1;
}

.apply-title {
  color: var(--site-text);
  font-size: 1.35rem;
  margin: 0 0 10px;
  text-align: center;
}

.apply-desc {
  color: var(--site-muted-strong);
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 14px;
  text-align: center;
}

.apply-conditions {
  list-style: none;
  margin: 0 auto 20px;
  padding: 14px 18px;
  max-width: 420px;
  background: rgba(26, 31, 34, 0.7);
  border: 1px solid var(--site-line);
  border-radius: 8px;
}

.apply-condition-item {
  color: var(--site-muted-strong);
  font-size: 13px;
  line-height: 1.7;
  padding: 4px 0 4px 22px;
  position: relative;
}

.apply-condition-item::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--site-accent);
  font-weight: 700;
  font-size: 14px;
}

.apply-form {
  max-width: 440px;
  margin: 0 auto;
}

.apply-botcheck {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
}

/* 通用表单输入 */
.apply-field-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--site-text);
  background: rgba(26, 31, 34, 0.85);
  border: 1px solid var(--site-line);
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.apply-field-input::placeholder {
  color: var(--site-muted);
  opacity: 0.55;
}

.apply-field-input:focus {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(22, 27, 30, 0.92);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.08);
}

.apply-field-input--error {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.apply-field-input--error:focus {
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* 两列输入行 */
.apply-fields-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.apply-fields-row .apply-field-input {
  flex: 1;
  min-width: 0;
}

.apply-submit-btn {
  flex-shrink: 0;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #111316;
  background: var(--site-accent);
  border: 1px solid var(--site-accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  white-space: nowrap;
}

.apply-submit-btn--full {
  width: 100%;
  margin-top: 4px;
}

.apply-submit-btn:hover {
  background: rgba(94, 234, 212, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(94, 234, 212, 0.18);
}

.apply-submit-btn:active {
  transform: translateY(0);
}

.apply-submit-btn:disabled,
.apply-submit-btn--loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.apply-success {
  text-align: center;
  padding: 24px 16px;
}

.apply-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(94, 234, 212, 0.15);
  color: var(--site-accent);
  font-size: 24px;
  margin-bottom: 12px;
}

.apply-success-text {
  color: var(--site-muted-strong);
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

.apply-error-msg {
  margin: 10px 0 0 !important;
  font-size: 13px !important;
  color: rgba(239, 68, 68, 0.85);
  text-align: center;
}

.apply-note {
  margin-top: 14px !important;
  font-size: 13px !important;
  opacity: 0.72;
  text-align: center;
}

@media (max-width: 440px) {
  .apply-fields-row {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }

  .apply-conditions {
    max-width: 100%;
  }
}

@media (max-width: 580px) {
  .friend-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .friend-avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }

  .friend-site-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }

  .friend-name { font-size: 15px; }
  .friend-url   { font-size: 12px; }
  .friend-desc { font-size: 12px; }
}
