/**
 * Shiguang 拾光集 - 主样式表
 * 设计风格：毛玻璃 · 简约白 · 插画
 */

/* ========== 设计令牌 ========== */
:root {
  --primary: #6C9FFF;
  --primary-light: #A8C8FF;
  --primary-dark: #4A7FE0;
  --accent: #FFB87A;
  --accent-light: #FFD4A8;
  --bg: #F5F7FB;
  --bg-warm: #FFF9F3;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #FFFFFF;
  --glass-border: rgba(255, 255, 255, 0.55);
  --text: #1A1A2E;
  --text-secondary: #6B7B8D;
  --text-light: #9CAAB8;
  --border: rgba(0, 0, 0, 0.05);
  --border-strong: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(100, 120, 160, 0.06);
  --shadow: 0 4px 24px rgba(100, 120, 160, 0.08);
  --shadow-lg: 0 12px 40px rgba(100, 120, 160, 0.12);
  --shadow-glow: 0 0 40px rgba(108, 159, 255, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --nav-height: 64px;
  --max-width: 1200px;
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 基础重置 ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

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

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

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

input, textarea, select {
  font-family: var(--font);
  font-size: inherit;
}

/* ========== 排版 ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p {
  color: var(--text-secondary);
  line-height: 1.8;
}

.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-light); }

/* ========== 容器 ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 72px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.section-more {
  font-size: 14px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.section-more:hover {
  color: var(--primary);
}

.section-more::after {
  content: '→';
  transition: transform var(--transition);
}

.section-more:hover::after {
  transform: translateX(3px);
}

/* ========== 导航栏 ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  transition: all var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 20px rgba(100, 120, 160, 0.08);
}

.navbar .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 40px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nav-brand-text {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-brand-sub {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: rgba(108, 159, 255, 0.08);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* 导航用户区 */
#navUserSlot {
  display: flex;
  align-items: center;
}

.nav-user-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 4px;
  border-radius: var(--radius-full);
  background: rgba(108, 159, 255, 0.06);
  transition: all var(--transition);
}

.nav-user-link:hover {
  background: rgba(108, 159, 255, 0.12);
  color: var(--text);
}

.nav-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(108, 159, 255, 0.2);
}

.nav-user-name {
  font-size: 13px;
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-login-btn {
  padding: 7px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 2px 12px rgba(108, 159, 255, 0.3);
  transition: all var(--transition);
}

.nav-login-btn:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108, 159, 255, 0.4);
}

/* 汉堡菜单 */
.nav-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
  position: relative;
}

.nav-hamburger span::before,
.nav-hamburger span::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-hamburger span::before { top: -6px; }
.nav-hamburger span::after { top: 6px; }

/* 移动端菜单 */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 16px 24px 24px;
  border-bottom: 1px solid var(--border);
  z-index: 999;
  box-shadow: var(--shadow);
}

.mobile-nav.open {
  display: block;
  animation: slideDown 0.25s ease;
}

.mobile-nav a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.mobile-nav a:hover {
  background: rgba(108, 159, 255, 0.06);
  color: var(--primary);
}

/* ========== 页脚 ========== */
.footer {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.7);
  padding: 56px 0 32px;
  margin-top: 80px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.footer-brand-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.5);
  max-width: 320px;
}

.footer-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

/* ========== 毛玻璃卡片 ========== */
.glass-card {
  background: var(--card);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.glass-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: rgba(108, 159, 255, 0.15);
}

/* 实心白卡片 */
.white-card {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.white-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 2px 12px rgba(108, 159, 255, 0.3);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108, 159, 255, 0.4);
}

.btn-ghost {
  color: var(--primary);
  background: rgba(108, 159, 255, 0.08);
  border: 1px solid rgba(108, 159, 255, 0.15);
}

.btn-ghost:hover {
  background: rgba(108, 159, 255, 0.14);
}

.btn-outline {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108, 159, 255, 0.04);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 16px;
}

/* ========== 标签 / 徽章 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.badge-primary {
  color: var(--primary);
  background: rgba(108, 159, 255, 0.1);
}

.badge-accent {
  color: #D4804A;
  background: rgba(255, 184, 122, 0.15);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108, 159, 255, 0.06);
}

/* ========== 文章卡片 ========== */
.post-card {
  overflow: hidden;
  cursor: pointer;
}

.post-card .card-cover {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.post-card .card-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.post-card .card-body {
  padding: 18px 20px 20px;
}

.post-card .card-category {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 8px;
}

.post-card .card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .card-excerpt {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.post-card .card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-light);
}

.post-card .card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 横向文章卡片 */
.post-card-h {
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  cursor: pointer;
}

.post-card-h .card-cover {
  position: relative;
  min-height: 100%;
  overflow: hidden;
}

.post-card-h .card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card-h:hover .card-cover img {
  transform: scale(1.05);
}

.post-card-h .card-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ========== 分类卡片 ========== */
.category-card {
  text-align: center;
  padding: 28px 20px;
  cursor: pointer;
}

.category-card .cat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 14px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(108, 159, 255, 0.1), rgba(255, 184, 122, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card .cat-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.category-card .cat-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.category-card .cat-count {
  font-size: 12px;
  color: var(--text-light);
}

/* ========== 网格系统 ========== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }

/* ========== 加载 / 空状态 ========== */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.loading-spinner::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
}

/* 加载更多 */
.load-more {
  text-align: center;
  padding: 40px 0;
}

/* ========== 页面头部 ========== */
.page-header {
  padding: 120px 0 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg,
    rgba(108, 159, 255, 0.06) 0%,
    rgba(255, 184, 122, 0.03) 50%,
    transparent 100%);
  pointer-events: none;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  position: relative;
}

.page-header p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

/* ========== 搜索框 ========== */
.search-box {
  display: flex;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 6px 4px 20px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 159, 255, 0.1);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  padding: 10px 0;
}

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

.search-box button {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.search-box button:hover {
  box-shadow: 0 2px 12px rgba(108, 159, 255, 0.3);
}

/* ========== 分页 ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
}

.pagination button {
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination button:hover {
  background: rgba(108, 159, 255, 0.08);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========== 动画 ========== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* 延迟动画 */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ========== 装饰元素 ========== */
.deco-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

.deco-blob-1 {
  width: 300px;
  height: 300px;
  background: rgba(108, 159, 255, 0.15);
  top: -100px;
  right: -50px;
}

.deco-blob-2 {
  width: 200px;
  height: 200px;
  background: rgba(255, 184, 122, 0.12);
  bottom: -60px;
  left: -40px;
}

/* ========== 主内容区偏移 ========== */
.main-content {
  padding-top: var(--nav-height);
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-5 { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .container { padding: 0 16px; }
  .section { padding: 48px 0; }
  .section-header { margin-bottom: 24px; }
  .section-title { font-size: 1.25rem; }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

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

  .post-card-h {
    grid-template-columns: 1fr;
  }

  .post-card-h .card-cover {
    padding-top: 50%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .page-header {
    padding: 100px 0 36px;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }

  .nav-brand-sub { display: none; }

  .btn-lg {
    padding: 12px 28px;
    font-size: 15px;
  }
}
