/**
 * 知识铺首页样式 v3.0 - ULTRATHINK设计系统
 * Homepage Styles - Modern Design System
 * Author: AI设计大师
 * Date: 2025-10-18
 * 优化: 性能 + 可访问性 + 响应式 + 深色模式
 */

/* ==========================================
   CSS变量系统 - Design Tokens
   ========================================== */
:root {
  /* 主色调 */
  --primary-brand: #6366F1;
  --primary-ai: #3B82F6;
  --primary-tech: #10B981;
  --primary-finance: #EF4444;
  --primary-create: #F59E0B;
  --primary-health: #06B6D4;

  /* 中性色阶 */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* 语义色彩 */
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #F9FAFB;
  --color-bg-elevated: #FFFFFF;
  --color-text-primary: #111827;
  --color-text-secondary: #6B7280;
  --color-text-tertiary: #9CA3AF;
  --color-border: #E5E7EB;
  --color-border-light: #F3F4F6;

  /* 间距系统 (8px基准) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* 动画时序 */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 350ms;
  --easing: cubic-bezier(0.4, 0, 0.2, 1);

  /* 布局尺寸 */
  --sidebar-width: 240px;
  --header-height: 60px;
  --right-sidebar-width: 300px;
}

/* 深色模式 */
[data-theme="dark"] {
  --color-bg-primary: #0F172A;
  --color-bg-secondary: #1E293B;
  --color-bg-elevated: #334155;
  --color-text-primary: #F1F5F9;
  --color-text-secondary: #CBD5E1;
  --color-text-tertiary: #94A3B8;
  --color-border: #334155;
  --color-border-light: #1E293B;
}

/* ==========================================
   全局样式重置
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ==========================================
   主容器布局
   ========================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ==========================================
   左侧固定导航栏
   ========================================== */
.left-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--color-bg-primary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

/* 滚动条样式 */
.left-sidebar::-webkit-scrollbar {
  width: 6px;
}

.left-sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Logo区域 */
.sidebar-header {
  padding: var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  transition: opacity var(--duration-base) var(--easing);
}

.logo-link:hover {
  opacity: 0.8;
}

.logo-icon {
  font-size: 24px;
}

/* 导航区域 */
.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
}

.nav-section {
  margin-bottom: var(--space-6);
}

.nav-section-title {
  padding: var(--space-2) var(--space-4);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  font-size: 15px;
  transition: all var(--duration-base) var(--easing);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--primary-brand);
  transform: scaleY(0);
  transition: transform var(--duration-base) var(--easing);
}

.nav-item:hover,
.nav-item.active {
  background: var(--gray-50);
  color: var(--color-text-primary);
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
  background: var(--color-bg-elevated);
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-item.active {
  font-weight: 600;
}

.nav-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
}

.nav-badge {
  font-size: 12px;
  padding: 2px 8px;
  background: var(--primary-ai);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.nav-count {
  font-size: 12px;
  padding: 2px 8px;
  background: var(--gray-100);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  font-weight: 600;
  margin-left: auto;
  transition: all var(--duration-base) var(--easing);
}

[data-theme="dark"] .nav-count {
  background: var(--gray-700);
  color: var(--gray-400);
}

.nav-item:hover .nav-count {
  background: var(--primary-brand);
  color: white;
}

/* 侧边栏底部 */
.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

.sidebar-stats {
  display: flex;
  gap: var(--space-4);
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

/* ==========================================
   主内容容器
   ========================================== */
.main-container {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================
   顶部Header
   ========================================== */
.top-header {
  height: var(--header-height);
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-content {
  height: 100%;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

/* 汉堡菜单(移动端) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  color: var(--color-text-primary);
}

.menu-icon {
  width: 24px;
  height: 2px;
  background: currentColor;
  display: block;
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: currentColor;
  left: 0;
}

.menu-icon::before {
  top: -8px;
}

.menu-icon::after {
  bottom: -8px;
}

/* 移动端Logo */
.mobile-logo {
  display: none;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
}

/* Header搜索栏 */
.header-search {
  flex: 1;
  max-width: 600px;
}

.search-form {
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0 var(--space-2);
  transition: all var(--duration-base) var(--easing);
}

.search-input-wrapper:focus-within {
  border-color: var(--primary-brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
  font-size: 18px;
  padding: 0 var(--space-2);
  color: var(--color-text-tertiary);
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  padding: var(--space-3) var(--space-2);
  font-size: 14px;
  color: var(--color-text-primary);
  outline: none;
}

.search-input::placeholder {
  color: var(--color-text-tertiary);
}

.search-submit {
  background: none;
  border: none;
  padding: var(--space-2);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--duration-base) var(--easing);
}

.search-submit:hover {
  background: var(--gray-100);
  color: var(--primary-brand);
}

/* Header工具栏 */
.header-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toolbar-btn {
  position: relative;
  background: none;
  border: none;
  padding: var(--space-2);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--duration-base) var(--easing);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  background: var(--gray-100);
  color: var(--color-text-primary);
}

.toolbar-icon {
  font-size: 20px;
}

/* 主题切换 */
.theme-toggle .theme-dark {
  display: none;
}

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

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

/* 版本切换按钮 */
.version-switch {
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
}

.version-label {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: var(--radius-full);
  transition: all var(--duration-base) var(--easing);
  display: inline-block;
}

.version-switch:hover .version-label {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 通知徽章 */
.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--primary-finance);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* ==========================================
   页面主内容
   ========================================== */
.page-main {
  flex: 1;
  padding: 0;
}

/* ==========================================
   Hero英雄区
   ========================================== */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: var(--space-16) var(--space-6);
  color: white;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 18px;
  opacity: 0.95;
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

/* Hero搜索框 */
.hero-search {
  margin-bottom: var(--space-10);
}

.hero-search-form {
  display: flex;
  gap: var(--space-3);
  max-width: 600px;
  margin: 0 auto;
}

.hero-search-input {
  flex: 1;
  padding: var(--space-4) var(--space-6);
  font-size: 16px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.95);
  color: var(--gray-900);
  outline: none;
  transition: all var(--duration-base) var(--easing);
}

.hero-search-input:focus {
  background: white;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.hero-search-input::placeholder {
  color: var(--gray-500);
}

.hero-search-btn {
  padding: var(--space-4) var(--space-8);
  background: white;
  color: var(--primary-brand);
  border: none;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 600;
  transition: all var(--duration-base) var(--easing);
}

.hero-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Hero统计数据 */
.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.hero-stat-item {
  text-align: center;
}

.hero-stat-value {
  display: block;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.hero-stat-label {
  display: block;
  font-size: 14px;
  opacity: 0.9;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
}

/* Hero背景装饰 */
.hero-bg-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.decoration-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 20s infinite;
}

.decoration-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.decoration-2 {
  width: 200px;
  height: 200px;
  top: 50%;
  right: -50px;
  animation-delay: 5s;
}

.decoration-3 {
  width: 150px;
  height: 150px;
  bottom: -50px;
  left: 30%;
  animation-delay: 10s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(180deg);
  }
}

/* ==========================================
   快速分类Tab
   ========================================== */
.category-tabs-sticky {
  position: sticky;
  top: var(--header-height);
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  z-index: 80;
  overflow-x: auto;
}

.category-tabs-wrapper {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  min-width: min-content;
}

.category-tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--duration-base) var(--easing);
  position: relative;
}

.category-tab:hover {
  background: var(--gray-50);
  color: var(--color-text-primary);
}

.category-tab.active {
  color: var(--primary-brand);
  border-bottom-color: var(--primary-brand);
  border-bottom-width: 2px;
  font-weight: 600;
}

.tab-icon {
  font-size: 16px;
}

/* ==========================================
   内容布局 - 两栏
   ========================================== */
.content-layout {
  display: grid;
  grid-template-columns: 1fr var(--right-sidebar-width);
  gap: var(--space-8);
  padding: var(--space-8) var(--space-6);
  max-width: 1600px;
  margin: 0 auto;
}

/* ==========================================
   内容主区域
   ========================================== */
.content-main {
  min-width: 0;
}

/* 区块标题 */
.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--space-6);
  color: var(--color-text-primary);
}

.title-icon {
  font-size: 28px;
}

.section-more {
  margin-left: auto;
  font-size: 14px;
  color: var(--primary-brand);
  font-weight: 600;
  transition: gap var(--duration-base) var(--easing);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.section-more:hover {
  gap: var(--space-2);
}

/* ==========================================
   特色项目卡片
   ========================================== */
.featured-projects {
  margin-bottom: var(--space-12);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.featured-card {
  position: relative;
  background: linear-gradient(135deg, var(--featured-color-1), var(--featured-color-2));
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  color: white;
  overflow: hidden;
  transition: transform var(--duration-base) var(--easing);
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* 各类型项目色彩 */
.featured-card-ai {
  --featured-color-1: #F59E0B;
  --featured-color-2: #D97706;
}

.featured-card-game {
  --featured-color-1: #8B5CF6;
  --featured-color-2: #7C3AED;
}

.featured-card-ecg {
  --featured-color-1: #06B6D4;
  --featured-color-2: #0891B2;
}

.featured-card-bg {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all var(--duration-slow) var(--easing);
}

.featured-card:hover .featured-card-bg {
  top: -30%;
  right: -30%;
  width: 250px;
  height: 250px;
}

.featured-card-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.featured-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}

.featured-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.featured-desc {
  font-size: 14px;
  opacity: 0.95;
  line-height: 1.6;
  margin-bottom: var(--space-4);
  flex: 1;
}

.featured-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.featured-tags .tag {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.featured-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  align-self: flex-start;
  transition: all var(--duration-base) var(--easing);
}

.featured-card:hover .featured-action {
  background: rgba(255, 255, 255, 0.3);
  gap: var(--space-3);
}

/* ==========================================
   文章网格
   ========================================== */
.articles-section {
  margin-bottom: var(--space-12);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

/* 骨架屏 */
.article-card-skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-100) 0px,
    var(--gray-50) 40px,
    var(--gray-100) 80px
  );
  background-size: 800px 104px;
  animation: shimmer 1.5s infinite;
  height: 320px;
  border-radius: var(--radius-lg);
}

@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

/* 加载更多 */
.load-more-wrapper {
  text-align: center;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--duration-base) var(--easing);
}

.load-more-btn:hover {
  background: var(--primary-brand);
  color: white;
  border-color: var(--primary-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==========================================
   右侧边栏
   ========================================== */
.content-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 60px);
  height: fit-content;
}

/* 边栏Widget */
.sidebar-widget {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.widget-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-text-primary);
}

.widget-icon {
  font-size: 18px;
}

/* 热点列表 */
.hot-topics-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hot-topic-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--duration-base) var(--easing);
}

.hot-topic-item:hover {
  background: var(--gray-50);
}

.topic-rank {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-tertiary);
  background: var(--gray-100);
  border-radius: var(--radius-sm);
}

.topic-rank.rank-1 {
  background: #EF4444;
  color: white;
}

.topic-rank.rank-2 {
  background: #F59E0B;
  color: white;
}

.topic-rank.rank-3 {
  background: #10B981;
  color: white;
}

.topic-text {
  flex: 1;
  font-size: 14px;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-badge {
  flex-shrink: 0;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.topic-badge.hot {
  background: #FEE2E2;
  color: #EF4444;
}

.topic-badge.new {
  background: #DBEAFE;
  color: #3B82F6;
}

.topic-badge.ai {
  background: #E0E7FF;
  color: #6366F1;
}

/* Loading skeleton for hot topics */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.skeleton-line {
  height: 32px;
  background: linear-gradient(
    90deg,
    var(--gray-100) 0%,
    var(--gray-200) 50%,
    var(--gray-100) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

[data-theme="dark"] .skeleton-line {
  background: linear-gradient(
    90deg,
    var(--gray-700) 0%,
    var(--gray-600) 50%,
    var(--gray-700) 100%
  );
  background-size: 200% 100%;
}

/* Empty and error states */
.empty-state,
.error-state {
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 14px;
}

.error-state {
  color: var(--primary-finance);
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag-cloud a {
  padding: 6px 12px;
  background: var(--gray-50);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  font-size: 13px;
  transition: all var(--duration-base) var(--easing);
}

.tag-cloud a:hover {
  background: var(--primary-brand);
  color: white;
  transform: translateY(-2px);
}

.loading-text {
  color: var(--color-text-tertiary);
  font-size: 14px;
}

/* 站点统计 */
.site-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--color-border);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-brand);
}

/* ==========================================
   页脚
   ========================================== */
.page-footer {
  background: var(--color-bg-primary);
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) var(--space-6);
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-info p {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-2);
}

.footer-info a {
  color: var(--primary-brand);
  transition: opacity var(--duration-base) var(--easing);
}

.footer-info a:hover {
  opacity: 0.8;
}

.footer-tech {
  margin-top: var(--space-3);
}

/* ==========================================
   返回顶部按钮
   ========================================== */
.back-to-top {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  width: 48px;
  height: 48px;
  background: var(--primary-brand);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--duration-base) var(--easing);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #4f46e5;
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* ==========================================
   响应式设计
   ========================================== */

/* 平板端 (768px - 1199px) */
@media (max-width: 1199px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .content-sidebar {
    display: none;
  }

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

/* 移动端 (<768px) */
@media (max-width: 767px) {
  .left-sidebar {
    transform: translateX(-100%);
    transition: transform var(--duration-base) var(--easing);
  }

  .left-sidebar.open {
    transform: translateX(0);
  }

  .main-container {
    margin-left: 0;
  }

  .menu-toggle,
  .mobile-logo {
    display: flex;
  }

  .header-search {
    display: none;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-stat-value {
    font-size: 28px;
  }

  .hero-stat-divider {
    display: none;
  }

  .category-tabs-wrapper {
    padding: var(--space-3) var(--space-4);
  }

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

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

/* 小屏手机 (<480px) */
@media (max-width: 479px) {
  .hero-section {
    padding: var(--space-10) var(--space-4);
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .content-layout {
    padding: var(--space-6) var(--space-4);
  }

  .section-title {
    font-size: 20px;
  }
}

/* 打印样式 */
@media print {
  .left-sidebar,
  .top-header,
  .category-tabs-sticky,
  .content-sidebar,
  .back-to-top {
    display: none;
  }

  .main-container {
    margin-left: 0;
  }
}
