/**
 * YoLiCo Theme - 现代简约风格
 * 玻璃拟态设计 + 非线性动效
 */

/* ===== 基础变量 ===== */
:root {
  /* 背景色 - 更柔和的色调 */
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0f0;
  --bg-elevated: rgba(255, 255, 255, 0.8);
  
  /* 文字色 */
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-tertiary: #bbbbbb;
  
  /* 边框和阴影 */
  --border-color: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
  --shadow-float: 0 12px 60px rgba(0, 0, 0, 0.12);
  
  /* 强调色 - 避免蓝紫色渐变，使用中性色 */
  --accent-color: #2a2a2a;
  --accent-hover: #404040;
  --link-color: #1a1a1a;
  --link-hover: #666666;
  
  /* 短代码颜色 */
  --sc-info-bg: rgba(59, 130, 246, 0.1);
  --sc-info-border: rgba(59, 130, 246, 0.3);
  --sc-info-text: #2563eb;
  --sc-warning-bg: rgba(245, 158, 11, 0.1);
  --sc-warning-border: rgba(245, 158, 11, 0.3);
  --sc-warning-text: #d97706;
  --sc-error-bg: rgba(239, 68, 68, 0.1);
  --sc-error-border: rgba(239, 68, 68, 0.3);
  --sc-error-text: #dc2626;
  --sc-success-bg: rgba(34, 197, 94, 0.1);
  --sc-success-border: rgba(34, 197, 94, 0.3);
  --sc-success-text: #16a34a;
  
  /* 圆角 - 更大的圆角 */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  
  /* 尺寸 */
  --header-height: 72px;
  --max-width: 720px;
  
  /* 动效曲线 - 非线性 */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --bg-elevated: rgba(30, 30, 30, 0.8);
    
    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --text-tertiary: #505050;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-float: 0 12px 60px rgba(0, 0, 0, 0.5);
    
    --accent-color: #e0e0e0;
    --accent-hover: #ffffff;
    --link-color: #f5f5f5;
    --link-hover: #a0a0a0;
    
    /* 暗色模式短代码颜色 */
    --sc-info-bg: rgba(59, 130, 246, 0.15);
    --sc-info-border: rgba(59, 130, 246, 0.4);
    --sc-info-text: #60a5fa;
    --sc-warning-bg: rgba(245, 158, 11, 0.15);
    --sc-warning-border: rgba(245, 158, 11, 0.4);
    --sc-warning-text: #fbbf24;
    --sc-error-bg: rgba(239, 68, 68, 0.15);
    --sc-error-border: rgba(239, 68, 68, 0.4);
    --sc-error-text: #f87171;
    --sc-success-bg: rgba(34, 197, 94, 0.15);
    --sc-success-border: rgba(34, 197, 94, 0.4);
    --sc-success-text: #4ade80;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.5s var(--ease-out-quart), color 0.5s var(--ease-out-quart);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.3s var(--ease-out-quart);
}

a:hover {
  color: var(--link-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== 顶栏 - 玻璃拟态 ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-elevated);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.4s var(--ease-out-expo);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  transition: transform 0.3s var(--ease-out-back);
}

.site-title:hover {
  transform: scale(1.02);
}

/* 导航菜单 */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  position: relative;
  transition: all 0.3s var(--ease-out-quart);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 50%;
  transform: translateX(-50%) scale(0);
  transition: transform 0.3s var(--ease-out-back);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: translateX(-50%) scale(1);
}

/* ===== 移动端底栏 - 玻璃拟态 ===== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--bg-elevated);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  width: auto;
}

.mobile-nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 4px;
}

.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.65rem;
  gap: 4px;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  transition: all 0.3s var(--ease-out-quart);
  min-width: 64px;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
}

.mobile-nav i {
  font-size: 1.3rem;
  transition: transform 0.3s var(--ease-out-back);
}

.mobile-nav a:hover i,
.mobile-nav a.active i {
  transform: scale(1.1);
}

/* ===== 搜索弹窗 - 极简玻璃拟态 ===== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease-out-expo);
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.search-box {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.4s var(--ease-out-back);
  position: relative;
}

.search-modal.active .search-box {
  transform: scale(1) translateY(0);
}

/* 关闭按钮 */
.search-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-out-quart);
  z-index: 10;
}

.search-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* 搜索表单 */
.search-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input-wrapper::before {
  content: '\f002';
  font-family: 'FontAwesome';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.3s var(--ease-out-quart);
}

.search-input-wrapper input {
  width: 100%;
  padding: 14px 20px 14px 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s var(--ease-out-quart);
  box-sizing: border-box;
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--border-color);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04);
}

.search-modal:focus-within .search-input-wrapper::before {
  color: var(--accent-color);
}

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

/* 搜索按钮 */
.search-submit-btn {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s var(--ease-out-back);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.search-submit-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.search-submit-btn:active {
  transform: scale(0.98);
}

/* ===== 移动端搜索优化 ===== */
@media (max-width: 768px) {
  .search-modal {
    padding: 0;
    align-items: flex-end;
  }
  
  .search-box {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px 28px;
    transform: translateY(100%);
    max-height: 90vh;
    background: rgba(255, 255, 255, 0.95);
  }
  
  .search-modal.active .search-box {
    transform: translateY(0);
  }
  
  .search-close-btn {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }
  
  .search-form {
    flex-direction: column;
    gap: 12px;
  }
  
  .search-input-wrapper input {
    padding: 14px 16px 14px 44px;
    font-size: 16px; /* 防止 iOS 自动缩放 */
  }
  
  .search-submit-btn {
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
  }
}

/* ===== 主内容区 ===== */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + 48px) 24px 48px;
  min-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
  .site-header {
    display: none;
  }
  
  .mobile-nav {
    display: block;
  }
  
  .main-content {
    padding-top: 24px;
    padding-bottom: 120px;
  }
}

/* ===== 文章卡片 - 现代UI ===== */
.post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
  box-shadow: var(--shadow-sm);
}

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

.post-thumb-link {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.post-thumb {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
}

.post-card:hover .post-thumb {
  transform: scale(1.05);
}

.post-content-wrap {
  padding: 28px;
}

.post-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.post-title a {
  color: var(--text-primary);
  background: linear-gradient(to right, var(--text-primary) 50%, var(--text-secondary) 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.4s var(--ease-out-quart);
}

.post-title a:hover {
  background-position: 0 0;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-excerpt {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s var(--ease-out-quart);
}

.read-more::after {
  content: '→';
  transition: transform 0.3s var(--ease-out-back);
}

.read-more:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  border-color: var(--accent-color);
  transform: translateX(4px);
}

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

/* ===== 文章详情页 - 现代UI ===== */
.post-detail {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.post-hero {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
}

.post-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-header {
  padding: 40px 36px 28px;
  border-bottom: 1px solid var(--border-color);
}

.post-detail-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.post-content {
  padding: 40px 36px;
  line-height: 1.85;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--text-primary);
  margin: 40px 0 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.post-content h2 {
  font-size: 1.6rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.post-content p {
  margin-bottom: 20px;
}

.post-content a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: all 0.3s var(--ease-out-quart);
}

.post-content a:hover {
  text-decoration-thickness: 2px;
}

.post-content code {
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.9em;
  color: var(--text-primary);
}

.post-content pre {
  background: var(--bg-tertiary);
  padding: 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border-color);
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content blockquote {
  border-left: 3px solid var(--text-primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--bg-tertiary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-content img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.post-content ul,
.post-content ol {
  margin: 20px 0;
  padding-left: 28px;
}

.post-content li {
  margin: 10px 0;
}

/* 文章信息 */
.post-info {
  padding: 28px 36px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-weight: 600;
  color: var(--text-primary);
}

.post-link {
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.permalink {
  word-break: break-all;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* 上一篇/下一篇 */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 28px 36px;
  border-top: 1px solid var(--border-color);
}

.nav-prev,
.nav-next {
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: all 0.3s var(--ease-out-quart);
  border: 1px solid transparent;
}

.nav-prev:hover,
.nav-next:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-title {
  font-weight: 600;
  color: var(--text-primary);
}

.nav-next {
  text-align: right;
}

/* ===== 分页 - 现代UI ===== */
.pagination {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
}

.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.page-nav a,
.page-nav span {
  padding: 14px 28px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s var(--ease-out-quart);
  background: var(--bg-secondary);
}

.page-nav a:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.page-nav .current {
  background: var(--accent-color);
  color: var(--bg-primary);
  border-color: var(--accent-color);
}

.page-nav .prev,
.page-nav .next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ===== 评论区 - 现代UI ===== */
.comments-section {
  margin-top: 48px;
  padding: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.comments-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments-title i {
  font-size: 1.1rem;
}

.comments-list {
  margin-bottom: 36px;
}

/* 评论卡片样式 */
.comment-item {
  position: relative;
  padding: 28px 32px;
  margin-bottom: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-out-quart);
}

.comment-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.comment-body {
  flex: 1;
}

/* 评论头部 */
.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  padding: 6px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-date::before {
  content: '·';
  color: var(--text-tertiary);
}

/* 评论内容 */
.comment-content {
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 0.95rem;
  margin-bottom: 20px;
  padding-left: 4px;
}

.comment-content p {
  margin-bottom: 12px;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

/* 回复按钮 */
.comment-reply {
  display: flex;
  justify-content: flex-end;
}

.comment-reply a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  transition: all 0.3s var(--ease-out-quart);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.comment-reply a::before {
  content: '↩';
  font-size: 0.9rem;
}

.comment-reply a:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--border-strong);
  transform: scale(1.02);
}

/* 子评论中的回复按钮 */
.comment-children .comment-reply a {
  background: var(--bg-secondary);
  padding: 6px 14px;
  font-size: 0.75rem;
}

/* 子评论样式 - 嵌套气泡式布局 */
.comment-children {
  margin-top: 20px;
  padding: 0 0 4px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-left: 2px solid var(--border-color);
}

.comment-children .comment-item {
  margin-left: 0;
  margin-bottom: 4px;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.comment-children .comment-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

/* 父评论标识 */
.comment-parent {
  background: var(--bg-secondary);
}

/* 子评论标识 */
.comment-child {
  position: relative;
}

/* 子评论头部样式 */
.comment-child .comment-header {
  margin-bottom: 10px;
  flex-wrap: nowrap;
}

/* 子评论作者标签 */
.comment-child .comment-author {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 4px 12px;
  flex-shrink: 0;
}

/* 子评论内容更紧凑 */
.comment-child .comment-content {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

/* 子评论回复按钮 */
.comment-child .comment-reply a {
  background: transparent;
  border: none;
  padding: 4px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-child .comment-reply a:hover {
  background: transparent;
  color: var(--text-primary);
  transform: none;
}

/* 回复指示器 */
.comment-child .comment-header::after {
  content: '回复';
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 8px;
  white-space: nowrap;
}

/* 评论表单 */
.respond {
  margin-top: 48px;
  padding: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.respond-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.respond-title::before {
  content: '✍️';
  font-size: 1.4rem;
}

.comment-form .form-row {
  margin-bottom: 20px;
}

.comment-form .form-row:first-child {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .comment-form .form-row:first-child {
    grid-template-columns: 1fr;
  }
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s var(--ease-out-quart);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

/* 评论输入框确保可交互 */
.form-textarea,
.form-input {
  pointer-events: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  user-select: text !important;
}

.form-textarea:focus,
.form-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
  background: var(--bg-secondary);
}

.form-textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.7;
}

.form-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.submit-btn {
  padding: 16px 40px;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-quart);
  box-shadow: var(--shadow-sm);
}

.submit-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 取消回复按钮 */
#cancel-comment-reply-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  transition: all 0.3s var(--ease-out-quart);
}

#cancel-comment-reply-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--border-strong);
}

.logged-in {
  margin-bottom: 24px;
  color: var(--text-secondary);
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.6;
}

.logged-in a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  margin: 0 4px;
}

.logged-in a:hover {
  text-decoration: underline;
}

/* ===== 页脚 - 现代UI ===== */
.site-footer {
  margin-top: 80px;
  padding: 48px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.social-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.social-links a,
.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  transition: all 0.3s var(--ease-out-quart);
  border: 1px solid transparent;
}

.social-links a:hover,
.footer-links a:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
  border-color: var(--border-color);
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-secondary);
  transition: color 0.3s var(--ease-out-quart);
}

.footer-bottom a:hover {
  color: var(--text-primary);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

/* ===== 短代码样式 ===== */

/* 提示框 */
.sc-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease-out-quart);
}

.sc-notice:hover {
  transform: translateX(4px);
}

.sc-notice-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.sc-notice-icon svg {
  width: 100%;
  height: 100%;
}

.sc-notice-content {
  flex: 1;
  line-height: 1.6;
}

.sc-notice-info {
  background: var(--sc-info-bg);
  border-color: var(--sc-info-border);
  color: var(--sc-info-text);
}

.sc-notice-warning {
  background: var(--sc-warning-bg);
  border-color: var(--sc-warning-border);
  color: var(--sc-warning-text);
}

.sc-notice-error {
  background: var(--sc-error-bg);
  border-color: var(--sc-error-border);
  color: var(--sc-error-text);
}

.sc-notice-success {
  background: var(--sc-success-bg);
  border-color: var(--sc-success-border);
  color: var(--sc-success-text);
}

/* B站视频 */
.sc-bili {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 20px 0;
  background: var(--bg-tertiary);
}

.sc-bili iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* 音乐播放器 */
.sc-aplayer {
  margin: 20px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* 折叠框 */
.sc-collapse {
  margin: 20px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
}

.sc-collapse-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.3s var(--ease-out-quart);
}

.sc-collapse-header:hover {
  background: var(--border-color);
}

.sc-collapse-title {
  flex: 1;
  text-align: left;
}

.sc-collapse-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease-out-back);
}

.sc-collapse-arrow svg {
  width: 100%;
  height: 100%;
}

.sc-collapse.active .sc-collapse-arrow {
  transform: rotate(180deg);
}

.sc-collapse-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out-expo);
}

.sc-collapse.active .sc-collapse-content {
  max-height: 2000px;
}

.sc-collapse-body {
  padding: 20px;
}

/* 相册 */
.sc-photos {
  margin: 20px 0;
}

.sc-photo-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  transition: all 0.3s var(--ease-out-quart);
}

.sc-photo-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.sc-photo-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s var(--ease-out-expo);
}

.sc-photo-item:hover img {
  transform: scale(1.03);
}

.sc-photo-desc {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease-out-expo);
}

.sc-photo-item:hover .sc-photo-desc {
  transform: translateY(0);
}

/* ===== 动画 - 非线性动效 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.post-card {
  animation: fadeInUp 0.6s var(--ease-out-expo) forwards;
  opacity: 0;
}

.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }

.post-detail {
  animation: fadeInScale 0.5s var(--ease-out-expo) forwards;
}

.comments-section {
  animation: slideInFromBottom 0.6s var(--ease-out-expo) 0.2s forwards;
  opacity: 1;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 悬浮按钮 */
.fab {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.3s var(--ease-out-back);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  .fab {
    bottom: 100px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

/* 标签样式 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.3s var(--ease-out-quart);
}

.tag:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

/* 分隔线 */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-color), transparent);
  margin: 40px 0;
}

/* ===== 友链页面样式 ===== */

/* 友链列表容器 */
.yolico-links {
  margin: 32px 0;
}

/* 卡片式布局 */
.yolico-links-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.yolico-link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.4s var(--ease-out-expo);
  box-shadow: var(--shadow-sm);
}

.yolico-link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.yolico-link-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.yolico-link-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yolico-link-info {
  flex: 1;
  min-width: 0;
}

.yolico-link-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.05rem;
}

.yolico-link-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 列表式布局 */
.yolico-links-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yolico-link-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.3s var(--ease-out-quart);
}

.yolico-link-item:hover {
  transform: translateX(4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.yolico-link-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.yolico-link-title {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.yolico-link-item .yolico-link-desc {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 紧凑式布局 */
.yolico-links-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.yolico-link-compact {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s var(--ease-out-quart);
}

.yolico-link-compact:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* 空状态 */
.yolico-links-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 1.1rem;
}

/* 申请表单 */
.yolico-apply-form {
  max-width: 600px;
  margin: 32px auto 0;
  padding: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.yolico-apply-form h3 {
  margin: 0 0 24px;
  font-size: 1.25rem;
  text-align: center;
  color: var(--text-primary);
}

.yolico-form-group {
  margin-bottom: 20px;
}

.yolico-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.yolico-input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s var(--ease-out-quart);
}

.yolico-input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.yolico-input::placeholder {
  color: var(--text-muted);
}

.yolico-apply-form .submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-quart);
  margin-top: 8px;
}

.yolico-apply-form .submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 选中文字样式 */
::selection {
  background: var(--text-primary);
  color: var(--bg-primary);
}
