/* 汉堡菜单按钮样式 */
.blog-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--white);
  cursor: pointer;
  margin-left: 1rem;
  z-index: 110;
}

@media (max-width: 768px) {
  .blog-menu-toggle {
    display: block;
    position: absolute;
    top: 12px;
    right: 18px;
    margin-left: 0;
  }
  .blog-nav-links {
    display: none;
    position: absolute;
    top: 60px;
    right: 10px;
    background: rgba(40,40,40,0.98);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    border-radius: 8px;
    flex-direction: column;
    gap: 0;
    min-width: 140px;
    padding: 0.5rem 0;
    z-index: 109;
    animation: fadeInUp 0.3s;
  }
  .blog-nav-links.open {
    display: flex;
  }
  .blog-nav {
    position: relative;
  }
  .blog-nav-links a {
    padding: 0.8rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .blog-nav-links a:last-child {
    border-bottom: none;
  }
}
/* 博客系统通用样式 */

:root {
  --primary-color: #d4af37;
  --secondary-color: #b8860b;
  --background-gradient: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  --text-color: #e0e0e0;
  --text-light: #b0b0b0;
  --white: #ffffff;
  --light-bg: rgba(120, 120, 120, 0.9);
  --card-bg: rgba(100, 100, 100, 0.95);
  --border-color: #4a4a4a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --border-radius: 5px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: url(../assets/background.jpg) no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  color: var(--text-color);
  line-height: 1.6;
  position: relative;
  z-index: 0;
}

/* 添加黑色半透明蒙版 */
body::before {
  content: "";
  position: fixed; /* 保持背景位置固定 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* 黑色，透明度50% */
  z-index: -1; /* 保证在内容之后、背景之前 */
  pointer-events: none; /* 不影响点击事件 */
}

/* 头部导航 */
.blog-header {
  background: rgba(80, 80, 80, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.blog-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.blog-logo:hover {
  transform: scale(1.05);
}


/* 默认隐藏菜单，只有大屏幕显示 */
.blog-nav-links {
  display: none;
  gap: 2rem;
  list-style: none;
}

@media (min-width: 769px) {
  .blog-nav-links {
    display: flex;
  }
}

.blog-nav-links a {
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 7px;
}

.blog-nav-links a:hover {
  background: rgba(120, 120, 120, 0.5);
  transform: translateY(-2px);
}

.blog-nav-links a.active {
  background: rgba(120, 120, 120, 0.5);
}

/* 认证相关样式 */
.auth-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.user-info {
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.username {
  font-weight: 500;
}

.logout-btn {
  background: rgba(120, 120, 120, 0.5);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.3s;
}

.logout-btn:hover {
  background: rgba(140, 140, 140, 0.7);
}

/* 博客图片样式 */
.blog-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #999;
  overflow: hidden;
}

.blog-image-photo {
  padding: 0;
}

.blog-image-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-image-photo img {
  transform: scale(1.05);
}

.blog-title {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--text-color);
}

.blog-excerpt {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.read-more {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.read-more:hover {
  color: var(--secondary-color);
}

.blog-date, .blog-views {
  color: var(--text-light);
}

/* 容器 */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* 英雄区域 */
.blog-hero {
  text-align: center;
  margin-bottom: 4rem;
  color: var(--black);
}

.blog-hero h1 {
  font-size: 3rem;
  font-family: 'NSimSun';
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  animation: fadeInUp 1s ease;
}

.blog-hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease 0.2s both;
}

/* 卡片样式 */
.blog-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.blog-card .blog-content {
  padding: 1.5rem;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* 网格布局 */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* 按钮样式 */
.blog-btn {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}

.blog-btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.blog-btn-primary:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

.blog-btn-secondary {
  background: #6c757d;
  color: var(--white);
}

.blog-btn-secondary:hover {
  background: #5a6268;
}

.blog-btn-success {
  background: #28a745;
  color: var(--white);
}

.blog-btn-success:hover {
  background: #218838;
}

/* 浮动按钮 */
.blog-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  z-index: 1000;
}

.blog-fab:hover {
  background: var(--secondary-color);
  transform: scale(1.1);
}

/* 表单样式 */
.blog-form-group {
  margin-bottom: 1.5rem;
}

.blog-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
}

.blog-form-input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.blog-form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.blog-form-textarea {
  min-height: 150px;
  resize: vertical;
  font-family: 'Courier New', monospace;
  line-height: 1.6;
}

/* 文章内容样式 */
.blog-content {
  line-height: 1.8;
  color: var(--text-color);
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  color: var(--text-color);
  margin: 1.5rem 0 1rem 0;
  font-weight: 600;
}

.blog-content h1 { font-size: 2.5rem; }
.blog-content h2 { font-size: 2rem; }
.blog-content h3 { font-size: 1.5rem; }

.blog-content p {
  margin-bottom: 1.2rem;
}

.blog-content ul,
.blog-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
}

.blog-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: #f8f9fa;
  border-radius: 5px;
  font-style: italic;
}

.blog-content code {
  background: #f1f3f4;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

.blog-content pre {
  background: #2d3748;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

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

.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  margin: 1rem 0;
}

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

.blog-content a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* 元信息样式 */
.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-category {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.2rem 0.8rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 500;
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
  .blog-hero h1 {
    font-size: 2rem;
  }
  
  .blog-nav {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .blog-nav-links {
    gap: 1rem;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-container {
    padding: 1rem;
  }
  
  .blog-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .blog-hero h1 {
    font-size: 1.8rem;
  }
  
  .blog-nav-links {
    flex-direction: column;
    width: 100%;
    text-align: center;
  }
  
  .blog-fab {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}

/* 加载动画 */
.blog-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: var(--white);
  font-size: 1.2rem;
}

.blog-loading::before {
  content: '';
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 1rem;
}

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

/* 兼容旧页面的图片封面类 */
.blog-image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}
