/* ===== 基础变量与重置 ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text-primary: #e8e8ed;
  --text-secondary: #9898a6;
  --text-muted: #5a5a6e;
  --accent: #6c63ff;
  --accent-light: #8b83ff;
  --accent-glow: rgba(108, 99, 255, 0.15);
  --accent-gradient: linear-gradient(135deg, #6c63ff, #a855f7);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Noto Serif SC', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.guest-mode {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ===== 登录遮罩 ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

.auth-logo {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-group {
  text-align: left;
}

.auth-label {
  display: block;
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  font-family: var(--font-mono);
  letter-spacing: 8px;
  text-align: center;
  outline: none;
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-input::placeholder {
  letter-spacing: 1px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-pwd-input {
  letter-spacing: 1px;
  font-size: 0.95rem;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

.auth-error {
  color: #ef4444;
  font-size: 0.84rem;
  min-height: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-guest-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

.auth-show-setup {
  display: inline-block;
  margin-top: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.auth-show-setup:hover {
  color: var(--accent-light);
}

.auth-setup {
  text-align: center;
}

.auth-qr {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

.auth-qr img,
.auth-qr table {
  border-radius: 8px;
}

.auth-qr td {
  padding: 0;
}

.auth-hint {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-bottom: 24px;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
  backdrop-filter: blur(0px);
}

.navbar.scrolled {
  padding: 10px 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.logo-bracket {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

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

.auth-mode-badge {
  display: none;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.auth-mode-badge.admin {
  display: inline-block;
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(108, 99, 255, 0.3);
}

.auth-mode-badge.guest {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.nav-logout-btn {
  padding: 6px 16px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Hero 区域 ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black, transparent);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
}

.hero-glow-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -100px;
  background: var(--accent);
  opacity: 0.12;
}

.hero-glow-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -50px;
  background: #a855f7;
  opacity: 0.1;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 20px;
  background: var(--accent-glow);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-light);
  margin-bottom: 28px;
  animation: fadeInUp 0.8s ease;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.title-dot {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 60px;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(108, 99, 255, 0.4);
}

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

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

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

.btn-outline:hover {
  color: var(--accent-light);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

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

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: fadeInUp 0.8s ease 0.6s both;
}

.scroll-mouse {
  width: 26px;
  height: 42px;
  border: 2px solid var(--text-muted);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-wheel {
  width: 3px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 3px;
  animation: scrollWheel 1.8s ease-in-out infinite;
}

/* ===== Section 通用 ===== */
section {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ===== 置顶文章 ===== */
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 48px;
  transition: var(--transition);
}

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

.featured-image {
  position: relative;
  min-height: 360px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.featured-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, rgba(108,99,255,0.1), rgba(168,85,247,0.1));
}

.featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 14px;
  background: var(--accent-gradient);
  color: white;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}

.featured-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.meta-sep {
  color: var(--border);
}

.post-category {
  color: var(--accent-light);
  font-weight: 500;
}

.post-read {
  color: var(--text-muted);
}

.featured-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 14px;
  transition: var(--transition);
}

.featured-post:hover .featured-title {
  color: var(--accent-light);
}

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

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tag {
  padding: 4px 12px;
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.15);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--accent-light);
  font-family: var(--font-mono);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--accent-light);
  font-size: 0.92rem;
  transition: var(--transition);
}

.read-more:hover {
  gap: 10px;
}

.arrow {
  transition: var(--transition);
}

/* ===== 文章轮播 ===== */
.articles-carousel {
  position: relative;
  padding: 0 0 44px;
}

.posts-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 2px 2px 8px;
}

.posts-track::-webkit-scrollbar {
  display: none;
}

.article-page {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  scroll-snap-align: start;
}

.carousel-arrow {
  position: absolute;
  top: 42%;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: rgba(18, 18, 28, 0.82);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: var(--transition);
}

.carousel-arrow:hover {
  color: var(--accent-light);
  border-color: rgba(108, 99, 255, 0.35);
  background: rgba(108, 99, 255, 0.12);
  box-shadow: 0 0 18px rgba(108, 99, 255, 0.18);
}

.carousel-arrow:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  box-shadow: none;
}

.carousel-arrow-prev {
  left: -58px;
}

.carousel-arrow-next {
  right: -58px;
}

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(108, 99, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: var(--transition);
}

.carousel-dot:hover,
.carousel-dot.active {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 0 12px rgba(108, 99, 255, 0.45);
}

.post-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

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

.post-card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  background: linear-gradient(
    135deg,
    hsl(var(--hue, 220), 40%, 12%),
    hsl(var(--hue, 220), 50%, 18%)
  );
  transition: var(--transition);
}

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

.post-card-body {
  padding: 24px;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
  transition: var(--transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-title a,
.post-card-title a {
  color: inherit;
  text-decoration: none;
}

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

.post-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.load-more-wrapper {
  text-align: center;
}

/* ===== 关于我 ===== */
.about {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-content {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  max-width: 800px;
  margin: 0 auto;
}

.about-avatar {
  flex-shrink: 0;
}

.avatar-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  padding: 3px;
  background: var(--accent-gradient);
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--accent-light);
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.02rem;
  line-height: 1.85;
}

.tech-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.tech-tag {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  transition: var(--transition);
}

.tech-tag:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
}

/* ===== 联系方式 ===== */
.contact-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  min-width: 160px;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.15);
}

.contact-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent-light);
}

.contact-label {
  font-weight: 500;
  font-size: 0.95rem;
}

.email-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
}
.email-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--accent);
}
.email-popup.show {
  display: flex;
}
.email-popup-addr {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  user-select: all;
}
.email-copy-btn {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: var(--transition);
  flex-shrink: 0;
}
.email-copy-btn:hover {
  background: var(--accent-light);
}
.email-copy-btn.copied {
  background: #22c55e;
}

/* ===== Chat Popup ===== */
.chat-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
}
.chat-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--accent);
}
.chat-popup.show {
  display: block;
}
.chat-popup-img {
  width: 200px;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* ===== WeChat QR Popup ===== */
.wechat-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
}
.wechat-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--bg-secondary);
}
.wechat-popup.show {
  display: flex;
}
.wechat-qr-img {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  object-fit: cover;
}
.wechat-popup-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== 页脚 ===== */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  text-align: center;
}

.footer-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.footer-built {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.heart {
  color: #ef4444;
  animation: heartbeat 1.5s ease infinite;
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollWheel {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.3; transform: translateY(6px); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* 滚动显示动画 */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .articles-carousel {
    padding-left: 48px;
    padding-right: 48px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 16px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

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

  .featured-image {
    min-height: 220px;
  }

  .featured-content {
    padding: 28px;
  }

  .articles-carousel {
    padding-left: 0;
    padding-right: 0;
  }

  .article-page {
    grid-template-columns: 1fr;
  }

  .carousel-arrow {
    top: auto;
    bottom: 0;
    width: 36px;
    height: 36px;
  }

  .carousel-arrow-prev {
    left: calc(50% - 88px);
  }

  .carousel-arrow-next {
    right: calc(50% - 88px);
  }

  .about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-stats {
    gap: 20px;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .auth-card {
    padding: 36px 24px;
  }

  .auth-mode-badge {
    display: none !important;
  }
}

/* ===== Utility Buttons ===== */
.btn-sm {
  padding: 8px 16px;
  font-size: 0.84rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-delete-text {
  background: none;
  border: none;
  color: #ef4444;
  padding: 4px 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete-text:hover {
  color: #f87171;
}

/* ===== Articles Toolbar ===== */
.articles-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.filter-btn.active {
  color: var(--accent-light);
  background: var(--accent-glow);
  border-color: rgba(108, 99, 255, 0.3);
}

.admin-toolbar {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ===== Admin Action Buttons ===== */
.admin-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
  opacity: 0;
  transition: var(--transition);
}

.post-card:hover .admin-actions,
.news-item:hover .admin-actions {
  opacity: 1;
}

.admin-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.admin-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.admin-action-btn.btn-delete {
  color: #ef4444;
}

.admin-action-btn.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ===== News Section ===== */
.news {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.news-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.news-item {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.news-item-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
}

.news-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.news-item-meta {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.news-item-date,
.news-item-source {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.news-item-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
}

.news-item-title a {
  color: var(--text-primary);
  transition: var(--transition);
}

.news-item-title a:hover {
  color: var(--accent-light);
}

.news-item-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.news-tag {
  padding: 2px 8px;
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.15);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--accent-light);
  font-family: var(--font-mono);
}

.news-item-actions {
  position: absolute;
  top: 12px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: var(--transition);
}

.news-item:hover .news-item-actions {
  opacity: 1;
}

/* ===== Article Detail Overlay ===== */
.article-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-primary);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.article-detail-overlay.active {
  opacity: 1;
  visibility: visible;
}

.article-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.detail-top-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 16px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.detail-share-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.detail-back:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.detail-share-top:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.detail-admin-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-article {
  padding-top: 40px;
  padding-bottom: 80px;
}

.detail-header {
  margin-bottom: 48px;
}

.detail-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

/* ===== Detail Content (Markdown) ===== */
.detail-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.detail-content h1,
.detail-content h2,
.detail-content h3 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  margin-top: 2em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.detail-content h1 {
  font-size: 1.8rem;
  color: var(--text-primary);
}

.detail-content h2 {
  font-size: 1.45rem;
}

.detail-content h3 {
  font-size: 1.2rem;
}

.detail-content p {
  line-height: 1.85;
  margin-bottom: 1.2em;
  color: var(--text-secondary);
}

.detail-content a {
  color: var(--accent-light);
  transition: var(--transition);
}

.detail-content a:hover {
  text-decoration: underline;
}

.detail-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

.detail-content pre {
  background: var(--bg-card);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid var(--border);
}

.detail-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.detail-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

.detail-content ul,
.detail-content ol {
  padding-left: 24px;
  margin-bottom: 1.2em;
}

.detail-content li {
  margin-bottom: 0.4em;
}

.detail-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1em 0;
}

/* ===== Modal Overlay & Container ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 680px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.3s ease;
}

.modal-sm {
  max-width: 480px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ===== Editor Form ===== */
.editor-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.editor-field label {
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.editor-field input,
.editor-field textarea,
.editor-field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
}

.editor-field input:focus,
.editor-field textarea:focus,
.editor-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.editor-field textarea {
  resize: vertical;
  min-height: 120px;
}

.editor-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239898a6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.editor-row {
  display: flex;
  gap: 16px;
}

.cover-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.cover-upload:hover {
  border-color: var(--accent);
}

.cover-upload.cover-dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.cover-upload-placeholder {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.cover-upload-preview {
  position: relative;
}

.cover-upload-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
  border-radius: calc(var(--radius-sm) - 2px);
}

.cover-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.cover-remove-btn:hover {
  background: rgba(239, 68, 68, 0.6);
}

.featured-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.detail-cover {
  margin-bottom: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.detail-cover img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
}

/* ===== Responsive Updates (New Components) ===== */
@media (max-width: 768px) {
  .editor-row {
    flex-direction: column;
    gap: 20px;
  }

  .modal-container {
    width: 95%;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }

  .news-item {
    gap: 12px;
    padding: 16px 12px;
  }

  .news-item-desc {
    display: none;
  }

  .detail-content {
    font-size: 0.95rem;
  }

  .articles-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-toolbar {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .category-filter {
    gap: 6px;
  }

  .filter-btn {
    padding: 5px 12px;
    font-size: 0.78rem;
  }

  .carousel-dots {
    gap: 7px;
  }

  .detail-title {
    font-size: 1.6rem;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 12px;
  }
}

/* ===== 点赞与评论 ===== */
.article-interactions {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border-primary, #2a2a3a);
}

.share-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text-secondary, #b0b0c0);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.share-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary, #e8e8f0);
  border-color: rgba(255,255,255,0.2);
}
.share-toast {
  position: absolute;
  left: 130px;
  top: 50%;
  transform: translateY(-50%);
  background: #22c55e;
  color: #fff;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.share-toast.show {
  opacity: 1;
}

.like-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--bg-card, #16161f);
  border: 1px solid var(--border-primary, #2a2a3a);
  border-radius: 24px;
  color: var(--text-primary, #e8e8ed);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.like-btn:hover {
  border-color: var(--accent, #6366f1);
  background: rgba(99, 102, 241, 0.08);
}

.like-btn.liked {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
}

.like-btn.liked .like-icon {
  transform: scale(1.2);
}

.like-icon {
  font-size: 1.2rem;
  transition: transform 0.25s ease;
}

.like-count {
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

.comments-section h3 {
  font-size: 1.1rem;
  color: var(--text-primary, #e8e8ed);
  margin-bottom: 16px;
  font-weight: 600;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.comment-input-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.comment-textarea {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  background: var(--bg-card, #16161f);
  border: 1px solid var(--border-primary, #2a2a3a);
  border-radius: 10px;
  color: var(--text-primary, #e8e8ed);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.comment-textarea:focus {
  border-color: var(--accent, #6366f1);
}

.comment-textarea::placeholder {
  color: var(--text-muted, #6b6b80);
}

.comment-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-char-count {
  font-size: 0.78rem;
  color: var(--text-muted, #6b6b80);
}

.comment-char-count.near-limit {
  color: #f59e0b;
}

.comment-char-count.over-limit {
  color: #f43f5e;
}

.comment-submit-btn {
  padding: 7px 20px;
  background: var(--accent, #6366f1);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.comment-submit-btn:hover {
  opacity: 0.85;
}

.comment-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted, #6b6b80);
  font-size: 0.88rem;
}

.comment-item {
  padding: 14px 16px;
  background: var(--bg-card, #16161f);
  border: 1px solid var(--border-primary, #2a2a3a);
  border-radius: 10px;
}

.comment-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent, #6366f1);
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-muted, #6b6b80);
}

.comment-text {
  font-size: 0.9rem;
  color: var(--text-secondary, #a0a0b0);
  line-height: 1.6;
  word-break: break-word;
}

/* Responsive */
@media (max-width: 640px) {
  .like-section {
    margin-bottom: 28px;
  }

  .like-btn {
    padding: 8px 18px;
    font-size: 0.88rem;
  }

  .comment-textarea {
    min-height: 60px;
  }
}
