/* ====================================================
   博客用户端全局美化样式
   统一设计语言：深色宇宙主题 + 玻璃拟态 + 流畅动画
   ==================================================== */

/* ---------- 导入 Fira Code 字体 ---------- */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- CSS 变量系统 ---------- */
:root {
  --primary: #2568ef;
  --primary-rgb: 37, 104, 239;
  --primary-hover: #1a52c4;
  --accent: #00d1b2;
  --accent-rgb: 0, 209, 178;
  --secondary: #1a1a2e;
  --danger: #f72585;
  --warning: #f8961e;
  --success: #00d1b2;
  --text: #2d3748;
  --text-light: #718096;
  --light: #f8fafc;
  --code-bg: #282c34;
  --terminal: #0f172a;
  --glass: rgba(255, 255, 255, 0.88);
  --glass-dark: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.35);
  --neon-glow: 0 0 12px rgba(0, 209, 178, 0.7);
  --blue-glow: 0 0 20px rgba(37, 104, 239, 0.4);
  --gradient-primary: linear-gradient(135deg, #2568ef 0%, #00d1b2 100%);
  --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 8px 32px rgba(37, 104, 239, 0.25);
  --border-radius: 14px;
  --border-radius-sm: 8px;
  --border-radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--text);
  background: var(--secondary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

/* ---------- 粒子背景 ---------- */
.particle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(to bottom, #080c1a, #0f172a, #1a1a2e);
  overflow: hidden;
}

.particle-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(0, 209, 178, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 209, 178, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 60s linear infinite;
}

.particle-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 20% 50%, rgba(37, 104, 239, 0.12) 0%, transparent 60%),
              radial-gradient(ellipse 50% 80% at 80% 20%, rgba(0, 209, 178, 0.08) 0%, transparent 60%);
}

@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

/* ---------- 导航栏 ---------- */
.navbar {
  background: linear-gradient(
    to right,
    rgba(8, 12, 26, 0.95) 0%,
    rgba(37, 104, 239, 0.1) 50%,
    rgba(8, 12, 26, 0.95) 100%
  );
  padding: 0 2rem;
  height: 64px;
  box-shadow: 0 1px 0 rgba(0, 209, 178, 0.2), 0 4px 20px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  color: #fff;
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: var(--transition);
}

.logo:hover {
  color: var(--accent);
}

.logo span {
  color: var(--accent);
  opacity: 0.8;
  font-size: 0.9rem;
}

.logo::after {
  content: '|';
  animation: blink 1.2s step-end infinite;
  color: var(--accent);
  margin-left: 2px;
  font-weight: 300;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  letter-spacing: 0.02em;
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: transform 0.3s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link:hover::before {
  transform: translateX(-50%) scaleX(1);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(0, 209, 178, 0.08);
}

/* 汉堡菜单（移动端） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- 主布局容器 ---------- */
.container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 2rem;
  width: 100%;
  position: relative;
}

/* 容器背景光晕 */
.container::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 30%, rgba(37, 104, 239, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(0, 209, 178, 0.04) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* ---------- 文章卡片 ---------- */
.post {
  /* background: var(--glass); */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--border-radius);
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--glass-border);
  border-left: 3px solid transparent;
  /* background-image: linear-gradient(var(--glass), var(--glass)),
                    linear-gradient(to bottom, var(--primary), var(--accent)); */
  background-origin: border-box;
  background-clip: padding-box, border-box;
  position: relative;
  overflow: hidden;
  animation: fadeSlideIn 0.5s ease-out forwards;
  opacity: 0;
}

.post::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* .post:hover::after {
  opacity: 1;
}

.post:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  background-image: linear-gradient(#fff, #fff),
                    linear-gradient(to bottom, var(--primary), var(--accent));
} */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post:nth-child(1) { animation-delay: 0.05s; }
.post:nth-child(2) { animation-delay: 0.12s; }
.post:nth-child(3) { animation-delay: 0.19s; }
.post:nth-child(4) { animation-delay: 0.26s; }
.post:nth-child(5) { animation-delay: 0.33s; }

/* 文章标题 */
.post-title {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.post-title:hover {
  color: #1a52c4;
}

/* 文章摘要 */
.post-content {
  color: #4a5568;
  margin-bottom: 1.25rem;
  line-height: 1.8;
  font-size: 0.95rem;
  /* 限制为3行 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 文章元信息 */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #718096;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.post-meta > span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.post-meta > span::before {
  content: '📅';
  font-size: 0.75rem;
}

.post-views::before {
  content: '👁️' !important;
  font-size: 0.75rem;
}

/* 标签/徽章 */
.post-tag {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.76rem;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 500;
}

.post-tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

/* 查看全文按钮 */
.btn-read-more,
a.btn.bg-f26868.c-fff {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1.1rem !important;
  background: var(--gradient-primary) !important;
  color: #fff !important;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  margin-left: auto;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
  text-decoration: none;
}

.btn-read-more:hover,
a.btn.bg-f26868.c-fff:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.btn-read-more::after,
a.btn.bg-f26868.c-fff::after {
  content: ' →';
}

/* ---------- 分页组件 ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2.5rem 0 1rem;
  flex-wrap: wrap;
}

.pagination a {
  text-decoration: none;
}

.page-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  color: #fff;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-family: 'Fira Code', monospace;
  position: relative;
  overflow: hidden;
}

.page-btn:hover {
  background: rgba(var(--primary-rgb), 0.2);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.page-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* 侧边栏小部件 */
.widget {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--border-radius);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition);
}

.widget:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.widget-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Fira Code', monospace;
}

.widget-title::before {
  content: '//';
  color: var(--accent);
  font-size: 0.85rem;
  opacity: 0.8;
}

/* 搜索框 */
.search-container {
  margin-bottom: 1.2rem;
}

.search-box {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
  background: rgba(255, 255, 255, 0.15);
}

.search-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-btn {
  padding: 0.7rem 1.2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease;
  letter-spacing: 0.02em;
}

.search-btn:hover {
  background: var(--primary-hover);
}

/* 热门文章列表 */
.popular-posts ul {
  list-style: none;
  padding: 0;
}

.popular-posts li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.popular-posts li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.post-link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.5;
  transition: var(--transition);
}

.post-link:hover {
  color: #fff;
}

.post-rank {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
  margin-top: 1px;
}

.popular-posts li:nth-child(1) .post-rank { background: linear-gradient(135deg, #f6c90e, #e8a000); color: #000; }
.popular-posts li:nth-child(2) .post-rank { background: linear-gradient(135deg, #c0c0c0, #909090); color: #000; }
.popular-posts li:nth-child(3) .post-rank { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }
.popular-posts li:nth-child(n+4) .post-rank { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); }

.post-link .post-views {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(var(--primary-rgb), 0.12);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  transition: var(--transition);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}

.tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

/* 友情链接 */
.friend-links {
  border-top: none !important;
  padding-top: 0 !important;
}

.link-grid a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: rgba(var(--primary-rgb), 0.15);
  color: rgba(255, 255, 255, 0.8) !important;
  border-radius: 6px;
  font-size: 0.8rem;
  margin: 3px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  transition: var(--transition);
  text-decoration: none;
}

.link-grid a:hover {
  background: var(--gradient-primary);
  color: #fff !important;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

/* ---------- 代码块 ---------- */
pre {
  background: #1e2432 !important;
  border-radius: var(--border-radius-sm) !important;
  padding: 1.2em 1.5em !important;
  overflow-x: auto;
  line-height: 1.7;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

pre code {
  font-family: 'Fira Code', 'JetBrains Mono', monospace !important;
  font-size: 0.9rem !important;
}

.code-block-wrapper {
  position: relative;
  margin: 1.5rem 0;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.copy-tooltip {
  position: absolute;
  top: -30px;
  right: 0;
  background: rgba(0, 209, 178, 0.9);
  color: #fff;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

.copy-tooltip.show {
  opacity: 1;
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, rgba(8, 12, 26, 0.97) 0%, rgba(4, 6, 15, 1) 100%);
  backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  overflow: hidden;
  margin-top: 4rem;
}

/* 顶部彩色霓虹线 */
.footer-top-glow {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(37, 104, 239, 0.6) 20%,
    rgba(0, 209, 178, 0.9) 50%,
    rgba(37, 104, 239, 0.6) 80%,
    transparent 100%
  );
  box-shadow: 0 0 12px rgba(0, 209, 178, 0.5);
}

/* 背景网格装饰 */
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 209, 178, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 209, 178, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* 主内容区三栏布局 */
.footer-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  position: relative;
  z-index: 1;
}

/* 品牌区 */
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff !important;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.footer-logo-tag {
  color: var(--accent);
  font-size: 0.9rem;
  opacity: 0.85;
}

.footer-slogan {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  line-height: 1.8;
  margin-top: 0.6rem;
  margin-bottom: 1.4rem;
  letter-spacing: 0.3px;
}

/* 社交图标 */
.footer-social {
  display: flex;
  gap: 0.7rem;
}

.footer-social .social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55) !important;
  transition: var(--transition);
}

.footer-social .social-icon svg {
  width: 16px;
  height: 16px;
}

.footer-social .social-icon:hover {
  background: rgba(0, 209, 178, 0.15);
  border-color: rgba(0, 209, 178, 0.4);
  color: var(--accent) !important;
  box-shadow: 0 0 12px rgba(0, 209, 178, 0.25);
  transform: translateY(-2px);
}

/* 列标题 */
.footer-col-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.2rem;
}

.footer-col-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
  flex-shrink: 0;
}

.footer-col-dot.accent {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* 链接列表 */
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-links li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.87rem;
  transition: var(--transition);
  padding: 0.35rem 0;
}

.footer-links li a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: var(--transition);
}

.footer-links li a:hover {
  color: var(--accent) !important;
  transform: translateX(4px);
}

.footer-links li a:hover svg {
  opacity: 1;
  stroke: var(--accent);
}

/* 技术标签 */
.footer-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}

.tech-tag {
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  background: rgba(37, 104, 239, 0.12);
  border: 1px solid rgba(37, 104, 239, 0.25);
  color: rgba(37, 104, 239, 0.9);
  font-size: 0.75rem;
  letter-spacing: 0.3px;
  transition: var(--transition);
  cursor: default;
}

.tech-tag:hover {
  background: rgba(0, 209, 178, 0.12);
  border-color: rgba(0, 209, 178, 0.35);
  color: var(--accent);
}

/* 统计信息 */
.footer-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
}

.stat-value {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.stat-value.accent-text {
  color: var(--accent);
}

/* 底部版权栏 */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.copy-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
}

.footer-symbol {
  color: var(--accent);
  font-weight: 700;
  font-family: 'Fira Code', monospace;
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.78rem;
}

.icp-link {
  color: rgba(255, 255, 255, 0.35) !important;
  transition: var(--transition);
}

.icp-link:hover {
  color: var(--accent) !important;
}

.footer-divider {
  opacity: 0.2;
}

/* 51la统计小部件 */
.la-widget {
  filter: brightness(0.6) saturate(0) !important;
  opacity: 0.7;
}

/* 响应式页脚 */
@media (max-width: 900px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2.5rem 1.5rem 1.5rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
  }

  .footer-slogan {
    margin-bottom: 0;
  }
}

@media (max-width: 600px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 1.8rem;
    padding: 2rem 1.25rem 1.25rem;
  }

  .footer-brand {
    flex-direction: column;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
  }

  .footer-bottom-right {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ---------- 通用工具类 ---------- */
.text-center { text-align: center; }
.text-muted { color: rgba(255, 255, 255, 0.5); font-size: 0.88rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.45);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: var(--primary);
}

/* 卡片组件 */
.card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.card h2 {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* 表单控件 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-family: inherit;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-control:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
  background: rgba(255, 255, 255, 0.1);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

/* ---------- 文章详情页专用 ---------- */
.post-content.graf-box,
.post-content.w-e-text,
.graf-box.w-e-text {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.9;
  font-size: 1rem;
}

.graf-box h1, .graf-box h2, .graf-box h3,
.graf-box h4, .graf-box h5, .graf-box h6 {
  color: #fff;
  margin: 1.8rem 0 0.8rem;
  line-height: 1.4;
  font-weight: 700;
}

.graf-box h2 {
  font-size: 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.3);
}

.graf-box h3 {
  font-size: 1.15rem;
}

.graf-box p {
  margin-bottom: 1rem;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.82);
}

.graf-box a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.graf-box a:hover {
  color: #fff;
}

.graf-box ul, .graf-box ol {
  margin: 0.8rem 0 0.8rem 1.5rem;
}

.graf-box li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
}

.graf-box blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0;
  background: rgba(0, 209, 178, 0.06);
  border-radius: 0 8px 8px 0;
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
}

.graf-box img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: var(--shadow-md);
}

.graf-box table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.graf-box table th {
  background: rgba(var(--primary-rgb), 0.2);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.graf-box table td {
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
}

.graf-box table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

/* ---------- 留言相关 ---------- */
.message-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.message-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.9rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.avatar .photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.message-meta {
  flex: 1;
}

.message-author {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.message-date {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
  margin-top: 1px;
}

.message-actions {
  display: flex;
  gap: 0.6rem;
}

.action-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-size: 0.82rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.action-btn:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.message-content {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
  font-size: 0.93rem;
  word-break: break-word;
}

.replies {
  margin-top: 1rem;
  padding-left: 2.5rem;
  border-left: 2px solid rgba(var(--primary-rgb), 0.25);
}

.reply-form {
  margin-top: 0.8rem;
  padding-left: 2.5rem;
  display: none;
}

.reply-form.active {
  display: block;
}

/* ---------- 响应式设计 ---------- */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
    height: 56px;
  }

  .container {
    margin: 1rem auto;
    padding: 0 1rem;
    gap: 1.5rem;
  }

  .post {
    padding: 1.3rem 1.2rem;
  }

  .post-title {
    font-size: 1.1rem;
  }

  .post-meta {
    gap: 0.4rem;
    font-size: 0.78rem;
  }

  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(8, 12, 26, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem;
    gap: 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-110%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
  }

  .logo {
    font-size: 1rem;
  }

  .pagination {
    gap: 0.35rem;
  }

  .page-btn {
    width: 36px;
    height: 36px;
    font-size: 0.82rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr 260px;
  }
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- 选中文本颜色 ---------- */
::selection {
  background: rgba(var(--primary-rgb), 0.35);
  color: #fff;
}

/* ---------- 焦点可见性（无障碍） ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 回到顶部按钮 ---------- */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(37, 104, 239, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(37, 104, 239, 0.4);
}

#backToTop svg {
  width: 20px;
  height: 20px;
}

#backToTop.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#backToTop:hover {
  background: rgba(0, 209, 178, 0.85);
  box-shadow: 0 4px 20px rgba(0, 209, 178, 0.45);
  transform: translateY(-3px) scale(1.05);
}

/* ---------- 阅读进度条 ---------- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient-primary);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(0, 209, 178, 0.6);
  border-radius: 0 2px 2px 0;
}

/* ---------- Toast 通知 ---------- */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border-left: 3px solid var(--primary);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success { border-left-color: var(--accent); }
.toast-error   { border-left-color: #f72585; }
.toast-warning { border-left-color: var(--warning); }
.toast-info    { border-left-color: var(--primary); }

.toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
}

.toast-success .toast-icon { color: var(--accent); }
.toast-error   .toast-icon { color: #f72585; }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--primary); }

.toast-msg {
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s;
  margin-left: 0.3rem;
}

.toast-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- 图片灯箱 ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 15, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  transform: scale(0.92);
  transition: transform 0.3s ease;
}

#lightbox.active #lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  backdrop-filter: blur(8px);
}

.lightbox-close:hover {
  background: rgba(247, 37, 133, 0.6);
  border-color: transparent;
}

/* ---------- 汉堡菜单变 X 动画 ---------- */
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 阅读时间标签 ---------- */
.reading-time {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
}

/* ---------- 图片 cursor 提示（灯箱可用时） ---------- */
.article-body img,
.profile-content img {
  cursor: zoom-in;
}

/* ---------- 移动端 Toast 适配 ---------- */
@media (max-width: 600px) {
  #toast-container {
    top: auto;
    bottom: 1.5rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  #backToTop {
    bottom: 1.5rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}
