* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* View Transitions API - 主题切换圆形扩散动画 */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #333;
}

/* 加载动画 */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.orbiting-circles {
  position: relative;
  width: 200px;
  height: 200px;
}

.center-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.2);
}

.orbit-icon {
  position: absolute;
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* 外圈轨道 */
.orbit-1 {
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  animation: orbit 8s linear infinite;
}

.orbit-1 .orbit-icon {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.orbit-2 {
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  animation: orbit 8s linear infinite;
  animation-delay: -2s;
}

.orbit-2 .orbit-icon {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.orbit-3 {
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  animation: orbit 8s linear infinite;
  animation-delay: -4s;
}

.orbit-3 .orbit-icon {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.orbit-4 {
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  animation: orbit 8s linear infinite;
  animation-delay: -6s;
}

.orbit-4 .orbit-icon {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

/* 内圈轨道（反向） */
.orbit-reverse-1 {
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
  animation: orbit-reverse 5s linear infinite;
}

.orbit-reverse-1 .orbit-icon {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
}

.orbit-reverse-2 {
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
  animation: orbit-reverse 5s linear infinite;
  animation-delay: -2.5s;
}

.orbit-reverse-2 .orbit-icon {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
}

@keyframes orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbit-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.loading-text {
  margin-top: 2rem;
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  letter-spacing: 2px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 全屏封面 */
.cover {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: #1a1a2e;
  background-image: url('../img/home.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 2;
}

.cover-img {
  display: none;
}

/* 封面上的导航栏 - 固定在顶部 */
.cover-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.cover-header .logo {
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-weight: bold;
}

.cover-header nav a {
  color: #fff;
  margin: 0 0.8rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.cover-header nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

.cover-header .avatar {
  border-color: rgba(255,255,255,0.5);
}

.cover-header .avatar:hover {
  border-color: #fff;
}

.cover-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  z-index: 5;
}

.cover-content h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.cover-content p {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* 文字变形动画 - 侧边栏名字 */
.profile-name-container {
  position: relative;
  width: 100%;
  height: 28px;
  margin-bottom: 1rem;
  filter: url(#threshold) blur(0.6px);
}

.morphing-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: auto;
  display: inline-block;
  width: 100%;
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
}

body.dark-mode .morphing-text {
  color: #e0e0e0;
}

.morphing-text-1 {
  opacity: 100%;
}

.morphing-text-2 {
  opacity: 0%;
}

.morphing-filters {
  position: fixed;
  width: 0;
  height: 0;
}

.cover-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.8);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  z-index: 5;
  text-decoration: none;
  font-size: 2rem;
  animation: bounce 2s infinite;
  opacity: 0.8;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* 主内容包装 */
.main-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4rem;
  padding-top: 70px;
  position: relative;
  z-index: 1;
}

/* 首页有封面，不需要顶部间距 */
.cover + .main-wrapper {
  padding-top: 0;
}

/* 左右布局 */
.content-layout {
  display: flex;
  gap: 3rem;
  padding: 20px 0;
  align-items: flex-start;
}

.posts-main {
  flex: 0 1 90%;
  min-width: 0;
}

/* 右侧边栏 */
.sidebar {
  flex: 0 1 10%;
  max-width: 400px;
  min-width: 320px;
  align-self: flex-start;
  margin-top: 76px;
}

/* 个人信息卡片 */
.profile-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.8rem;
  border: 3px solid #eee;
}

.profile-name {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #333;
}

.profile-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.profile-stats .stat-item {
  text-align: center;
}

.profile-stats .stat-num {
  display: block;
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
}

.profile-stats .stat-label {
  font-size: 0.8rem;
  color: #999;
}

.profile-btn {
  display: block;
  background: #49b1f5;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.profile-btn:hover {
  background: #3a9fe5;
}

/* 网站资讯 */
.site-info {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
}

.site-info h4 {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: #333;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.2s;
}

.info-item:hover {
  background: #e9ecef;
  transform: translateX(3px);
}

.info-icon {
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 8px;
  flex-shrink: 0;
}

.info-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-label {
  font-size: 0.85rem;
  color: #666;
}

.info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

body.dark-mode .site-info {
  background: #2a2a3e;
}

body.dark-mode .site-info h4 {
  color: #e0e0e0;
}

body.dark-mode .info-item {
  background: #1a1a2e;
}

body.dark-mode .info-item:hover {
  background: #252538;
}

body.dark-mode .info-icon {
  background: #2a2a3e;
}

body.dark-mode .info-label {
  color: #999;
}

body.dark-mode .info-value {
  color: #e0e0e0;
}

/* 搜索框 - Vanish Input 风格 */
.vanish-search-box {
  position: relative;
  width: 100%;
  height: 42px;
  background: #f5f5f5;
  border-radius: 21px;
  overflow: hidden;
  margin-top: 1rem;
  transition: background 0.2s ease;
}

.vanish-search-box:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px #49b1f5;
}

.vanish-search-box input {
  width: 100%;
  height: 100%;
  padding: 0 45px 0 1rem;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: #333;
}

.vanish-search-box input::placeholder {
  color: transparent;
}

/* 动态占位符 */
.search-placeholder {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: #999;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.vanish-search-box.has-value .search-placeholder {
  opacity: 0;
  transform: translateY(-100%);
}

/* 搜索按钮 */
.search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #e0e0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.search-btn svg {
  color: #666;
  transition: color 0.2s ease;
}

.vanish-search-box.has-value .search-btn {
  background: #49b1f5;
}

.vanish-search-box.has-value .search-btn svg {
  color: #fff;
}

.search-btn:hover {
  transform: translateY(-50%) scale(1.05);
}

body.dark-mode .vanish-search-box {
  background: #1a1a2e;
}

body.dark-mode .vanish-search-box:focus-within {
  background: #2a2a3e;
}

body.dark-mode .vanish-search-box input {
  color: #e0e0e0;
}

body.dark-mode .search-placeholder {
  color: #666;
}

body.dark-mode .search-btn {
  background: #3a3a4e;
}

body.dark-mode .search-btn svg {
  color: #999;
}

body.dark-mode .vanish-search-box.has-value .search-btn {
  background: #49b1f5;
}

body.dark-mode .vanish-search-box.has-value .search-btn svg {
  color: #fff;
}

/* 标签云 */
.tag-cloud {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-top: 1rem;
}

.tag-cloud h4 {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: #333;
}

#tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-start;
  align-items: center;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 18px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  white-space: nowrap;
}

.tag-item:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.tag-item.size-1 { font-size: 0.8rem; padding: 0.35rem 0.8rem; }
.tag-item.size-2 { font-size: 0.85rem; padding: 0.4rem 0.9rem; }
.tag-item.size-3 { font-size: 0.9rem; font-weight: 500; padding: 0.45rem 1rem; }

body.dark-mode .tag-cloud {
  background: #2a2a3e;
}

body.dark-mode .tag-cloud h4 {
  color: #e0e0e0;
}

body.dark-mode .tag-item {
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.98);
  transition: background 0.3s ease;
}

/* 导航栏底部线条容器 */
header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #eee;
  opacity: var(--line-opacity, 1);
}

/* 暗色模式线条 - 所有 header */
body.dark-mode header::before {
  background: #444;
}

header.scrolled {
  padding: 0.8rem 3rem;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

body.dark-mode header:not(.cover-header) {
  background: rgba(26,26,46,0.98);
}

body.dark-mode header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  text-decoration: none;
}

nav {
  flex: 1;
  text-align: center;
}

nav a {
  margin: 0 1rem;
  color: #666;
  text-decoration: none;
}

nav a:hover {
  color: #000;
}

/* 主题切换按钮 - Magic UI AnimatedThemeToggler 风格 */
.theme-toggle {
  --size: 40px;
  --icon-size: 20px;
  
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* 图标容器 */
.theme-toggle .toggle-icon {
  position: relative;
  width: var(--icon-size);
  height: var(--icon-size);
}

/* 太阳图标 - SVG 风格 */
.theme-toggle .sun-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #fbbf24;
  transform: rotate(0deg) scale(1);
  opacity: 1;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.theme-toggle .sun-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 月亮图标 - SVG 风格 */
.theme-toggle .moon-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #e2e8f0;
  transform: rotate(90deg) scale(0);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.theme-toggle .moon-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 深色模式状态 */
body.dark-mode .theme-toggle .sun-icon {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
}

body.dark-mode .theme-toggle .moon-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

/* 封面导航栏的主题按钮 */
.cover-header .theme-toggle .sun-icon {
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.cover-header .theme-toggle .moon-icon {
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* 头部右侧区域 */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cover-header .header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* 个人中心下拉菜单 */
.user-menu {
  position: relative;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
  object-fit: cover;
  border: 2px solid #eee;
}

.avatar:hover {
  transform: scale(1.05);
  border-color: #0066cc;
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 160px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1000;
  padding: 0.5rem 0;
}

.dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.7rem 1rem;
  color: #555;
  text-decoration: none;
  transition: background 0.2s;
}

.dropdown a:hover {
  background: #f5f5f5;
}

main {
  min-height: 70vh;
  padding: 2rem 0;
  padding-top: 80px;
}

.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: #0066cc;
  color: #fff;
}

.btn-primary:hover {
  background: #0055aa;
}

.btn-secondary {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  border-color: #0066cc;
  color: #0066cc;
}

/* 统计数据 */
.stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 2rem 0;
  margin: 1rem 0 2rem;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
}

.stat-item {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: #0066cc;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

/* 首页分类导航 */
.home-categories {
  margin: 2rem 0;
}

.home-categories h2 {
  margin-bottom: 1rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.cat-card {
  background: rgba(255,255,255,0.8);
  padding: 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
  border: 1px solid #eee;
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: #0066cc;
}

.cat-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.cat-card-name {
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.cat-card-count {
  font-size: 0.85rem;
  color: #999;
}

/* 文章列表标题 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.view-all {
  color: #0066cc;
  text-decoration: none;
  font-size: 0.9rem;
}

.view-all:hover {
  text-decoration: underline;
}

@media (max-width: 500px) {
  .stats {
    gap: 1.5rem;
  }
  .stat-num {
    font-size: 1.5rem;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* 带侧边栏布局 */
.with-sidebar {
  display: flex;
  gap: 2rem;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
}

.sidebar h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #666;
}

#category-list .cat-item {
  margin-bottom: 0.3rem;
}

#category-list a {
  display: block;
  padding: 0.5rem 0.8rem;
  color: #555;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

#category-list a:hover {
  background: rgba(0, 102, 204, 0.1);
  color: #0066cc;
}

#category-list a.active {
  background: #0066cc;
  color: #fff;
}

#category-list .cat-main {
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

#category-list .cat-main::after {
  content: '▾';
  font-size: 0.8rem;
  transition: transform 0.2s;
}

#category-list .cat-item.collapsed .cat-main::after {
  transform: rotate(-90deg);
}

.subcategories {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 0.8rem;
  border-left: 2px solid #e0e0e0;
  margin-left: 0.8rem;
  margin-top: 0.3rem;
}

#category-list .cat-item.collapsed .subcategories {
  max-height: 0;
}

.subcategories a {
  font-size: 0.9rem;
  color: #666;
  padding: 0.4rem 0.8rem;
}

.subcategories a:hover {
  background: rgba(0, 102, 204, 0.08);
}

.with-sidebar .posts {
  flex: 1;
}

.posts h2 {
  margin-bottom: 1.5rem;
}

.post-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid #eee;
}

.post-card.with-cover {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: none;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

/* 渐变叠加层 */
.post-card.with-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
  border-radius: 12px;
  pointer-events: none;
}

.post-card.with-cover:hover::before {
  opacity: 1;
}

.post-card.with-cover > * {
  position: relative;
  z-index: 1;
}

/* 偶数文章图片在右边 */
.post-card.with-cover:nth-child(even) {
  flex-direction: row-reverse;
}

.post-card.with-cover:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.post-cover {
  width: 280px;
  height: 180px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-cover img {
  transform: scale(1.05);
}

.post-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 奇数卡片：图片在左，文本居中对齐 */
.post-card.with-cover:nth-child(odd) .post-info {
  text-align: center;
}

.post-card.with-cover:nth-child(odd) .post-meta {
  justify-content: center;
}

.post-card.with-cover:nth-child(odd) .post-tags {
  justify-content: center;
}

/* 偶数卡片：图片在右，文本居中对齐 */
.post-card.with-cover:nth-child(even) .post-info {
  text-align: center;
}

.post-card.with-cover:nth-child(even) .post-meta {
  justify-content: center;
}

.post-card.with-cover:nth-child(even) .post-tags {
  justify-content: center;
}

.post-card h3 {
  margin-bottom: 0.5rem;
}

.post-card h3 a {
  color: #333;
  text-decoration: none;
  font-size: 1.15rem;
  line-height: 1.4;
}

.post-card h3 a:hover {
  color: #49b1f5;
}

.post-meta {
  color: #999;
  font-size: 0.85rem;
  margin: 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.meta-item {
  color: #999;
  font-size: 0.8rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.post-cat {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.post-subcat {
  color: #49b1f5;
  background: rgba(73, 177, 245, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.post-desc {
  color: #666;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.7;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
}

.post-card h3 a {
  color: #333;
  text-decoration: none;
  font-size: 1.15rem;
  line-height: 1.4;
}

.post-card h3 a:hover {
  color: #49b1f5;
}

body.dark-mode .post-card h3 a {
  color: #e0e0e0;
}

body.dark-mode .post-card h3 a:hover {
  color: #49b1f5;
}

@media (max-width: 600px) {
  .post-card.with-cover {
    flex-direction: column;
  }
  .post-cover {
    width: 100%;
    height: 180px;
  }
}

.no-posts {
  color: #999;
  padding: 2rem 0;
}

@media (max-width: 600px) {
  .with-sidebar {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
}

footer {
  padding: 2rem 0;
  border-top: 1px solid #eee;
  text-align: center;
  color: #999;
}

/* 文章页面 */
.article h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.article-content {
  margin-top: 2rem;
  line-height: 1.8;
}

.article-content h2 {
  margin: 2rem 0 1rem;
}

.article-content p {
  margin: 1rem 0;
}

.article-content code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}

.article-content pre {
  background: #f4f4f4;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: #0066cc;
}


/* 深色模式 */
body.dark-mode {
  color: #e0e0e0;
}

body.dark-mode #bg-canvas {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode header:not(.cover-header) {
  border-bottom-color: #333;
}

body.dark-mode .main-wrapper .logo,
body.dark-mode .main-wrapper nav a {
  color: #e0e0e0;
}

body.dark-mode .main-wrapper nav a:hover {
  color: #fff;
}

body.dark-mode .dropdown {
  background: #2a2a3e;
}

body.dark-mode .dropdown a {
  color: #ccc;
}

body.dark-mode .dropdown a:hover {
  background: #333;
}

body.dark-mode .dropdown-divider {
  background: #444;
}

body.dark-mode .user-name {
  color: #fff;
}

body.dark-mode .stats {
  background: rgba(40,40,60,0.7);
}

body.dark-mode .cat-card {
  background: rgba(40,40,60,0.8);
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .post-card {
  border-bottom-color: #333;
}

body.dark-mode .post-card.with-cover {
  background: #2a2a3e;
}

body.dark-mode .post-card.with-cover::before {
  background: var(--hover-gradient, linear-gradient(135deg, #2a2a3e 0%, #2d3a32 50%, #354038 100%));
}

body.dark-mode .post-card h3 a {
  color: #e0e0e0;
}

body.dark-mode .profile-card,
body.dark-mode .search-box {
  background: #2a2a3e;
}

body.dark-mode .profile-name {
  color: #e0e0e0;
}

body.dark-mode .profile-stats {
  border-color: #444;
}

body.dark-mode .profile-stats .stat-num {
  color: #e0e0e0;
}

body.dark-mode .search-box input {
  background: #1a1a2e;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode footer {
  border-top-color: #333;
}

/* 响应式布局 */
@media (max-width: 900px) {
  .content-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    order: -1;
  }
  .profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
  }
  .profile-avatar {
    margin-bottom: 0;
  }
  .profile-stats {
    flex: 1;
    border: none;
    margin: 0;
    padding: 0;
  }
  .profile-btn {
    white-space: nowrap;
  }
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.page-num {
  background: #fff;
  color: #666;
  border: 1px solid #eee;
}

.page-num:hover {
  border-color: #49b1f5;
  color: #49b1f5;
}

.page-num.active {
  background: #49b1f5;
  color: #fff;
  border-color: #49b1f5;
}

.page-btn {
  background: #fff;
  color: #49b1f5;
  border: 1px solid #49b1f5;
}

.page-btn:hover {
  background: #49b1f5;
  color: #fff;
}

body.dark-mode .page-num {
  background: #2a2a3e;
  border-color: #444;
  color: #ccc;
}

body.dark-mode .page-num.active {
  background: #49b1f5;
  color: #fff;
}

body.dark-mode .page-btn {
  background: #2a2a3e;
}

body.dark-mode .page-btn:hover {
  background: #49b1f5;
}

/* 动画效果 */

/* 封面内容淡入 */
.cover-content {
  animation: fadeInUp 1s ease-out;
}

.cover-content h1 {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.cover-content p {
  animation: fadeInUp 1s ease-out 0.4s both;
}

.cover-buttons {
  animation: fadeInUp 1s ease-out 0.6s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.cover-content h1,
.cover-content p,
.cover-buttons {
  animation-name: fadeInUpSimple;
}

@keyframes fadeInUpSimple {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 文章卡片滚动淡入 */
.post-card.with-cover {
  opacity: 0;
  transform: translateY(30px);
  animation: slideIn 0.5s ease-out forwards;
}

.post-card.with-cover:nth-child(1) { animation-delay: 0.1s; }
.post-card.with-cover:nth-child(2) { animation-delay: 0.2s; }
.post-card.with-cover:nth-child(3) { animation-delay: 0.3s; }
.post-card.with-cover:nth-child(4) { animation-delay: 0.4s; }
.post-card.with-cover:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 侧边栏卡片动画 */
.profile-card {
  animation: slideInDown 0.5s ease-out 0.1s both;
}

.site-info {
  animation: slideInDown 0.5s ease-out 0.15s both;
}

.search-box {
  animation: slideInDown 0.5s ease-out 0.2s both;
}

.tag-cloud {
  animation: slideInDown 0.5s ease-out 0.25s both;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 头像旋转效果 */
.profile-avatar {
  transition: transform 0.5s ease, border-color 0.3s;
}

.profile-avatar:hover {
  transform: rotate(360deg) scale(1.1);
  border-color: #49b1f5;
}

/* 按钮波纹效果 */
.profile-btn {
  position: relative;
  overflow: hidden;
}

.profile-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.profile-btn:hover::after {
  width: 300px;
  height: 300px;
}

/* 分页按钮动画 */
.pagination a {
  position: relative;
  overflow: hidden;
}

.pagination a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s;
}

.pagination a:hover::before {
  left: 100%;
}

/* 搜索框聚焦动画 */
.search-box input {
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box input:focus {
  box-shadow: 0 0 0 3px rgba(73, 177, 245, 0.2);
}

/* 导航链接下划线动画 */
.cover-header nav a {
  position: relative;
}

.cover-header nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #fff;
  transition: width 0.3s, left 0.3s;
}

.cover-header nav a:hover::after {
  width: 100%;
  left: 0;
}

.cover-header nav a:hover {
  text-decoration: none;
}

/* 统计数字动画 */
.profile-stats .stat-num {
  transition: transform 0.3s, color 0.3s;
}

.profile-stats .stat-item:hover .stat-num {
  transform: scale(1.2);
  color: #49b1f5;
}

/* 文章标题悬停效果 */
.post-card h3 a {
  position: relative;
  transition: color 0.3s;
}

.post-card h3 a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #49b1f5;
  transition: width 0.3s;
}

.post-card h3 a:hover::after {
  width: 100%;
}

/* 分类标签悬停 */
.post-cat {
  transition: background 0.3s, transform 0.2s;
}

.post-cat:hover {
  background: rgba(73, 177, 245, 0.2);
  transform: scale(1.05);
}

/* ==================== 响应式设计 ==================== */

/* 大屏幕电脑 (1200px+) - 默认样式 */

/* 小屏幕电脑/大平板横屏 (992px - 1199px) */
@media (max-width: 1199px) {
  .main-wrapper {
    padding: 0 3rem;
  }
  
  .cover-header,
  header {
    padding: 1rem 2rem;
  }
  
  .post-cover {
    width: 240px;
    height: 160px;
  }
  
  .sidebar {
    min-width: 280px;
  }
}

/* 平板竖屏 (768px - 991px) */
@media (max-width: 991px) {
  .main-wrapper {
    padding: 0 2rem;
  }
  
  .cover-header nav a,
  header nav a {
    margin: 0 0.5rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }
  
  .cover-content h1 {
    font-size: 2.5rem;
  }
  
  .cover-content p {
    font-size: 1.1rem;
  }
  
  .content-layout {
    gap: 2rem;
  }
  
  .post-cover {
    width: 200px;
    height: 140px;
  }
  
  .post-card.with-cover {
    padding: 1rem;
    gap: 1.5rem;
  }
}

/* 大手机/小平板 (576px - 767px) */
@media (max-width: 767px) {
  .main-wrapper {
    padding: 0 1.5rem;
    padding-top: 60px;
  }
  
  .cover + .main-wrapper {
    padding-top: 0;
  }
  
  .cover-header,
  header {
    padding: 0.8rem 1rem;
  }
  
  .cover-header .logo,
  header .logo {
    font-size: 1.2rem;
  }
  
  .cover-header nav,
  header nav {
    display: none;
  }
  
  .cover-content h1 {
    font-size: 2rem;
  }
  
  .cover-content p {
    font-size: 1rem;
  }
  
  .cover-buttons {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .btn {
    padding: 0.6rem 1.2rem;
  }
  
  .content-layout {
    flex-direction: column;
    gap: 1.5rem;
    padding: 15px 0;
  }
  
  .posts-main {
    flex: 1;
    width: 100%;
  }
  
  .sidebar {
    width: 100%;
    min-width: auto;
    max-width: none;
    order: -1;
  }
  
  .profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    padding: 1rem;
  }
  
  .profile-avatar {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
  }
  
  .profile-stats {
    border: none;
    padding: 0;
    margin: 0;
  }
  
  .post-card.with-cover {
    flex-direction: column !important;
    padding: 1rem;
    gap: 1rem;
  }
  
  .post-cover {
    width: 100%;
    height: 180px;
  }
  
  .post-info {
    text-align: left !important;
  }
  
  .post-meta,
  .post-tags {
    justify-content: flex-start !important;
  }
  
  .site-info,
  .search-box,
  .tag-cloud {
    padding: 0.8rem;
  }
  
  footer {
    padding: 1.5rem 0;
  }
}

/* 小手机 (最大 575px) */
@media (max-width: 575px) {
  .main-wrapper {
    padding: 0 1rem;
    padding-top: 55px;
  }
  
  .cover + .main-wrapper {
    padding-top: 0;
  }
  
  .cover-header,
  header {
    padding: 0.6rem 1rem;
  }
  
  .cover-header .logo,
  header .logo {
    font-size: 1.1rem;
  }
  
  .theme-toggle {
    --toggle-size: 36px;
  }
  
  .avatar {
    width: 35px;
    height: 35px;
  }
  
  .cover-content h1 {
    font-size: 1.6rem;
  }
  
  .cover-content p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .scroll-down {
    font-size: 1.5rem;
    bottom: 20px;
  }
  
  .content-layout {
    padding: 10px 0;
  }
  
  .profile-card {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-stats {
    width: 100%;
    justify-content: space-around;
    padding-top: 0.8rem;
    margin-top: 0.8rem;
    border-top: 1px solid #eee;
  }
  
  .post-card.with-cover {
    margin-bottom: 0.8rem;
  }
  
  .post-cover {
    height: 150px;
  }
  
  .post-card h3 a {
    font-size: 1rem;
  }
  
  .post-meta {
    font-size: 0.75rem;
    gap: 0.5rem;
  }
  
  .post-desc {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .info-item {
    padding: 0.5rem;
  }
  
  .info-icon {
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
  }
  
  .tag-item {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
  }
  
  .pagination {
    gap: 0.3rem;
  }
  
  .pagination a,
  .pagination span {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
}

/* 深色模式下的响应式调整 */
@media (max-width: 767px) {
  body.dark-mode .profile-stats {
    border-top-color: #444;
  }
}
