:root {
  /* 主要颜色 - Apple 风格 */
  --primary-color: #0071e3;
  --primary-hover: #0077ed;
  --primary-light: rgba(0, 113, 227, 0.08);

  /* 背景色 */
  --bg-gradient-start: #f5f5f7;
  --bg-gradient-end: #f5f5f7;
  --card-bg: #ffffff;
  --card-featured-bg: #fffbf3;

  /* 文字颜色 */
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-muted: #aeaeb2;
  --text-light: #aeaeb2;

  /* 边框和阴影 */
  --border-color: rgba(0, 0, 0, 0.08);
  --border-input: rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);

  /* 圆角 */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  /* 间距 */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* 过渡动画 */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-normal: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 暗色模式 */
[data-theme="dark"] {
  --primary-color: #0a84ff;
  --primary-hover: #409cff;

  --bg-gradient-start: #000000;
  --bg-gradient-end: #000000;
  --card-bg: #1c1c1e;
  --card-featured-bg: #2c2c2e;

  --text-primary: #f5f5f7;
  --text-secondary: #98989d;
  --text-muted: #636366;
  --text-light: #636366;

  --primary-light: rgba(10, 132, 255, 0.12);

  --border-color: rgba(255, 255, 255, 0.1);
  --border-input: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'Noto Sans SC', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  padding: 1.5rem;
  transition: background var(--transition-normal), color var(--transition-normal);
}

/* 页面容器 */
.page {
  max-width: 1100px;
  margin: 0 auto;
}

.posts {
  display: grid;
  gap: 1.8rem;
}

/* 卡片基础样式 */
.post-card, .sidebar, .footer {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.post-card {
  padding: 2rem;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out both;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(67, 56, 202, 0.06) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.post-card:hover::before { opacity: 1; }

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-card.featured {
  background: var(--card-featured-bg);
  border-color: rgba(245, 220, 183, 0.5);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.post-title {
  font-size: 1.75rem;
  color: var(--text-primary);
  font-weight: 600;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.excerpt { color: var(--text-secondary); }

.post-tags {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-gradient-start);
  color: var(--text-secondary);
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.chip:hover {
  background: var(--primary-light);
  color: var(--primary-color);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.read-more {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
}

.read-more::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-fast);
}

.read-more:hover::after { width: 100%; }
.read-more:hover { transform: translateX(4px); }

.footer {
  margin-top: 2rem;
  padding: 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

/* 吐司通知系统 */
.toast-container {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-icon { font-size: 1.2rem; }

/* 核心 UI 元素 */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  z-index: 100001;
  width: 0;
  transition: width 0.1s ease;
}

.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(67, 56, 202, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.back-to-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(67, 56, 202, 0.5);
}

/* 响应式媒体查询 */
@media (max-width: 900px) {
  .content { grid-template-columns: 1fr; }
  .sidebar { position: static; margin-bottom: 1.5rem; }
}

@media (max-width: 620px) {
  body { padding: 1rem; }
  .post-header { flex-direction: column; align-items: stretch; }
  .post-title { font-size: 1.45rem; }
  .posts { gap: 1.2rem; }
  .post-card { padding: 1.5rem; }
  .chip { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  body { padding: 0.75rem; }
  .hero { padding: 1.5rem 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .post-card { padding: 1.25rem; }
  .post-title { font-size: 1.3rem; }
}

/* 触摸设备优化 */
@media (hover: none) {
  .post-card:hover { transform: none; }
  .back-to-top-btn:active { transform: scale(0.9); }
}
