/* ==================== 全局重置与变量 ==================== */
:root {
  --primary: #6c5ce7;
  --primary-light: #8e7ff5;
  --primary-dark: #5849c4;
  --accent: #00cec9;
  --accent-dark: #00b3ad;
  --bg: #f5f3ff;
  --bg-card: #ffffff;
  --bg-soft: #ede9fe;
  --text: #2d2d44;
  --text-light: #636e72;
  --text-muted: #a29bfe;
  --border: #e0dffd;
  --shadow: 0 4px 20px rgba(108, 92, 231, 0.08);
  --shadow-hover: 0 16px 48px rgba(108, 92, 231, 0.18);
  --gradient: linear-gradient(135deg, #6c5ce7 0%, #00cec9 100%);
  --gradient-soft: linear-gradient(135deg, #ede9fe 0%, #d1f5f3 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  --header-h: 70px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ==================== 导航栏 ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(108, 92, 231, 0.06);
  z-index: 1000;
  transition: var(--transition);
}

.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  position: relative;
  padding: 6px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--primary);
}

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

.nav-toggle span {
  width: 25px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ==================== Hero ==================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../images/hero-banner.jpg') center/cover no-repeat;
  transform: scale(1.05);
  animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  to { transform: scale(1.15); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(45, 45, 68, 0.3) 0%, rgba(108, 92, 231, 0.5) 100%);
}

.hero-content {
  position: relative;
  text-align: center;
  color: #fff;
  z-index: 2;
  padding: 0 20px;
  animation: fadeInUp 1.2s ease;
}

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

.hero-content h1 {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 4px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: 20px;
  margin-bottom: 36px;
  opacity: 0.95;
  letter-spacing: 2px;
}

.hero-btn {
  display: inline-block;
  padding: 14px 44px;
  background: var(--gradient);
  color: #fff;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: var(--transition);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
  border: none;
  cursor: pointer;
}

.hero-btn:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(108, 92, 231, 0.5);
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 24px;
  animation: bounce 2s infinite;
  z-index: 2;
}

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

/* ==================== 通用区段 ==================== */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 38px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  font-weight: 700;
}

.section-title p {
  color: var(--text-light);
  font-size: 16px;
}

.section-title .line {
  width: 60px;
  height: 3px;
  background: var(--gradient);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* ==================== 统计数据 ==================== */
.stats {
  background: var(--gradient);
  padding: 50px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}

.stat-item {
  color: #fff;
}

.stat-num {
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 15px;
  opacity: 0.9;
  letter-spacing: 1px;
}

/* ==================== 日记卡片 ==================== */
.diaries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 28px;
}

.diary-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border);
}

.diary-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.diary-card-img {
  height: 220px;
  overflow: hidden;
  position: relative;
}

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

.diary-card:hover .diary-card-img img {
  transform: scale(1.1);
}

.diary-card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--gradient);
  color: #fff;
  padding: 5px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
}

.diary-card-body {
  padding: 22px;
}

.diary-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

.diary-card-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
  transition: var(--transition);
}

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

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

.diary-card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diary-card-footer .read-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.diary-card-footer .read-more:hover {
  color: var(--accent);
}

/* ==================== 页面头部 ==================== */
.page-header {
  margin-top: var(--header-h);
  padding: 60px 0 50px;
  background: var(--gradient);
  text-align: center;
  color: #fff;
}

.page-header h1 {
  font-size: 42px;
  margin-bottom: 12px;
  font-weight: 700;
}

.page-header p {
  font-size: 16px;
  opacity: 0.9;
}

.breadcrumb {
  margin-top: 16px;
  font-size: 14px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
}

.breadcrumb a:hover {
  color: #fff;
}

.breadcrumb span {
  margin: 0 8px;
  opacity: 0.5;
}

/* ==================== 日记详情页 ==================== */
.diary-detail {
  margin-top: var(--header-h);
  padding: 50px 0 80px;
}

.diary-detail-header {
  text-align: center;
  margin-bottom: 40px;
}

.diary-detail-tag {
  display: inline-block;
  background: var(--gradient);
  color: #fff;
  padding: 5px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.diary-detail-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.3;
}

.diary-detail-meta {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 14px;
}

.diary-detail-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.diary-detail-cover {
  width: 100%;
  height: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 50px;
  box-shadow: var(--shadow-hover);
}

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

.diary-detail-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.9;
  color: var(--text);
}

.diary-detail-content p {
  margin-bottom: 22px;
}

.diary-gallery {
  max-width: 800px;
  margin: 40px auto;
  display: grid;
  gap: 20px;
}

.diary-gallery img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}

.diary-gallery img:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-hover);
}

.diary-nav {
  max-width: 800px;
  margin: 60px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.diary-nav a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 26px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 48%;
  transition: var(--transition);
}

.diary-nav a:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}

.diary-nav .nav-label {
  font-size: 13px;
  color: var(--text-muted);
}

.diary-nav .nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.diary-nav .next {
  text-align: right;
  margin-left: auto;
}

/* ==================== 精选区段 ==================== */
.featured {
  background: var(--gradient-soft);
}

/* ==================== 关于页 ==================== */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content p {
  font-size: 17px;
  line-height: 1.9;
  margin-bottom: 22px;
  color: var(--text-light);
}

.about-author {
  display: flex;
  gap: 30px;
  align-items: center;
  margin: 40px 0;
  padding: 30px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.about-author-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #fff;
  flex-shrink: 0;
}

.about-author-info h3 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.about-author-info p {
  color: var(--text-light);
  margin: 0;
}

/* ==================== 页脚 ==================== */
.footer {
  background: #2d2d44;
  color: rgba(255, 255, 255, 0.85);
  padding: 50px 0 25px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 18px;
}

.footer-col p {
  font-size: 14px;
  line-height: 1.8;
  opacity: 0.8;
}

.footer-col ul {
  list-style: none;
}

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

.footer-col ul a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  opacity: 0.7;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.85);
}

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

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

.pagination a {
  text-decoration: none;
}

.pagination button {
  min-width: 42px;
  height: 42px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.pagination button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
}

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

/* ==================== 返回顶部 ==================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
}

/* ==================== 图片灯箱 ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 40px;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  background: none;
  border: none;
}

/* ==================== 加载与无结果 ==================== */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.no-results .icon {
  font-size: 60px;
  margin-bottom: 16px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .hero-content h1 { font-size: 34px; }
  .hero-content p { font-size: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .stat-num { font-size: 32px; }
  .section { padding: 50px 0; }
  .section-title h2 { font-size: 28px; }
  .diaries-grid { grid-template-columns: 1fr; }
  .diary-detail-title { font-size: 26px; }
  .diary-detail-cover { height: 280px; }
  .diary-detail-meta { gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .about-author { flex-direction: column; text-align: center; }
  .diary-nav { flex-direction: column; }
  .diary-nav a { max-width: 100%; }
  .diary-nav .next { text-align: left; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
  .nav-links.active { display: flex; }
  .nav-toggle { display: flex; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 26px; }
}
