/* ============================================
   Nova Blog - 前台布局样式
   Deep Space Cyber Layout
   ============================================ */

/* ==================== Header 导航栏 ==================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: var(--space-md) 0;
  transition: all var(--duration-normal) var(--ease-default);
  background: transparent;
}

.header-glass {
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}

.header-inner {
  max-width: var(--bp-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-black);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: all var(--duration-normal) var(--ease-default);
}

.header-logo:hover {
  filter: brightness(1.2);
  text-shadow: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-nav-link {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-default);
  position: relative;
  padding: var(--space-xs) 0;
}

.header-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width var(--duration-normal) var(--ease-default);
}

.header-nav-link:hover {
  color: var(--color-text-primary);
  text-shadow: none;
}

.header-nav-link:hover::after {
  width: 100%;
}

.header-nav-link.active {
  color: var(--color-accent);
}

.header-nav-link.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  transition: all var(--duration-fast) var(--ease-default);
}

.mobile-menu-btn:hover {
  border-color: var(--color-border-hover);
  background: rgba(108, 92, 231, 0.1);
}

/* 移动端导航展开 */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-sm);
  }

  .header-nav.mobile-open {
    display: flex;
  }

  .header-nav-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
  }

  .header-nav-link:hover {
    background: rgba(108, 92, 231, 0.1);
  }

  .header-nav-link::after {
    display: none;
  }
}

/* ==================== Hero 首屏区域 ==================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gradient-hero);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 0 var(--space-lg);
  animation: slideUp var(--duration-slow) var(--ease-spring);
}

.hero-greeting {
  font-size: var(--font-size-lg);
  color: var(--color-accent);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-md);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: var(--font-weight-black);
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 打字机光标 */
.hero-title .cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--color-accent);
  margin-left: 4px;
  animation: pulse-glow 1s infinite;
  vertical-align: text-bottom;
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* 扫描线效果 */
.hero-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0.3;
  animation: scan-line 4s linear infinite;
  z-index: 1;
  pointer-events: none;
}

/* ==================== 文章卡片 ==================== */

.post-card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-default);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

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

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--color-border);
}

.post-card-body {
  padding: var(--space-lg);
}

.post-card-category {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.post-card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-tight);
  transition: color var(--duration-fast) var(--ease-default);
}

.post-card:hover .post-card-title {
  color: var(--color-primary-light);
}

.post-card-excerpt {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

/* ==================== 文章详情 ==================== */

.post-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-lg) var(--space-2xl);
}

.post-detail-header {
  margin-bottom: var(--space-2xl);
  animation: slideUp var(--duration-normal) var(--ease-spring);
}

.post-detail-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: var(--font-weight-black);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-lg);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.post-detail-cover {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--color-border);
}

/* Markdown 渲染样式 */
.post-content {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
  animation: route-enter-fade var(--duration-slow) var(--ease-default);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--color-text-primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.post-content h1 {
  font-size: var(--font-size-3xl);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-border);
}

.post-content h2 {
  font-size: var(--font-size-2xl);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

.post-content h3 {
  font-size: var(--font-size-xl);
}

.post-content a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 245, 212, 0.3);
  transition: all var(--duration-fast) var(--ease-default);
}

.post-content a:hover {
  color: var(--color-accent-light);
  border-bottom-color: var(--color-accent);
  text-shadow: 0 0 8px rgba(0, 245, 212, 0.3);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
}

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

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

.post-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: rgba(108, 92, 231, 0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-secondary);
}

.post-content ul {
  list-style: none;
  padding-left: var(--space-xl);
}

.post-content ul li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  margin-right: var(--space-sm);
  margin-left: calc(-1 * var(--space-xl) + var(--space-xs));
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(0, 245, 212, 0.4);
}

.post-content ol {
  padding-left: var(--space-xl);
  counter-reset: ol-counter;
}

.post-content ol li {
  counter-increment: ol-counter;
}

.post-content ol li::before {
  content: counter(ol-counter);
  color: var(--color-accent);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-mono);
  margin-right: var(--space-sm);
}

.post-content img {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

.post-content th,
.post-content td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
}

.post-content th {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

/* 文章导航（上一篇/下一篇） */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--color-border);
}

.post-nav-item {
  padding: var(--space-lg);
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-default);
}

.post-nav-item:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.post-nav-item:last-child {
  text-align: right;
}

.post-nav-item .nav-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.post-nav-item .nav-title {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

/* ==================== 归档页 ==================== */

.archive-list {
  max-width: 800px;
  margin: 0 auto;
}

.archive-year {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-border);
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-lg);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(108, 92, 231, 0.1);
  transition: all var(--duration-fast) var(--ease-default);
}

.archive-item:hover {
  padding-left: var(--space-sm);
  border-bottom-color: var(--color-border-hover);
}

.archive-item .archive-date {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.archive-item .archive-title {
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: var(--font-size-base);
  transition: color var(--duration-fast) var(--ease-default);
}

.archive-item .archive-title:hover {
  color: var(--color-accent);
  text-shadow: 0 0 8px rgba(0, 245, 212, 0.3);
}

/* ==================== 关于页 ==================== */

.about-page {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
}

.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  margin: 0 auto var(--space-lg);
  object-fit: cover;
  box-shadow: var(--shadow-glow);
}

.about-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.about-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: all var(--duration-fast) var(--ease-default);
  font-size: var(--font-size-lg);
}

.about-social a:hover {
  border-color: var(--color-border-hover);
  color: var(--color-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ==================== Footer 页脚 ==================== */

.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-2xl) 0;
  background: var(--color-bg-secondary);
  margin-top: var(--space-4xl);
}

.footer-inner {
  max-width: var(--bp-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  transition: color var(--duration-fast) var(--ease-default);
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-copyright {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ==================== 通用布局 ==================== */

.section {
  padding: var(--space-3xl) 0;
}

.section-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2xl);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

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

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

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

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.page-container {
  max-width: var(--bp-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  padding-top: calc(80px + var(--space-2xl));
  min-height: 70vh;
}

.page-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-2xl);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== 404 页面 ==================== */

.not-found-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: var(--space-4xl);
}

.not-found-code {
  font-size: 8rem;
  font-weight: var(--font-weight-black);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-md);
  animation: float 3s ease-in-out infinite;
}

.not-found-text {
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
}

/* ==================== 搜索框 ==================== */

.search-box {
  position: relative;
  max-width: 400px;
}

.search-box .input {
  padding-left: var(--space-2xl);
}

.search-box-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

/* ==================== 标签云 ==================== */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.tag-cloud .tag {
  font-size: var(--font-size-sm);
  padding: var(--space-xs) var(--space-md);
}
