* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f7f8fa;
}

/* ================================
   导航样式（PC + 手机三横菜单 完整版）
================================= */
.nav-wrap {
  width: 80%;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* LOGO + 网站名称 */
.nav-brand a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #2d3748;
}
.logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}
.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* 手机菜单按钮 */
.menu-toggle {
  display: none;
  font-size: 32px;
  cursor: pointer;
  user-select: none;
  color: #2d3748;
  line-height: 1;
}

/* PC 导航 */
.nav {
  display: flex;
  gap: 8px;
  list-style: none;
  align-items: center;
}
.nav li {
  position: relative;
}
.nav a {
  display: block;
  padding: 10px 20px;
  background: #f7fafc;
  cursor: pointer;
  text-decoration: none;
  color: #2d3748;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.nav a:hover { 
  background: #edf2f7;
  transform: translateY(-1px);
}
.nav a.active { 
  background: #48bb78; 
  color: #fff; 
}

.submenu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 160px;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  z-index: 999;
  overflow: hidden;
}
.submenu a {
  padding: 10px 16px;
  white-space: nowrap;
  border-radius: 0;
  background: #fff;
}
.submenu a:hover {
  background: #f7fafc;
}

/* PC 端：鼠标悬浮显示 */
.nav li:hover .submenu {
  display: block;
}

/* 登录注册按钮组 */
.nav-auth {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: 16px;
}
.nav-auth a, .nav-auth button {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}
.btn-login {
  color: #48bb78;
  border: 1px solid #48bb78;
  background: transparent;
}
.btn-login:hover {
  background: #48bb78;
  color: #fff;
  transform: translateY(-1px);
}
.btn-register {
  color: #fff;
  background: #48bb78;
  border: 1px solid #48bb78;
}
.btn-register:hover {
  background: #38a169;
  border-color: #38a169;
  transform: translateY(-1px);
}
.user-name {
  color: #2d3748;
  font-weight: 600;
  padding: 8px 12px;
  font-size: 15px;
}
.btn-logout {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #f56565;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-logout:hover {
  background: #e53e3e;
  transform: translateY(-1px);
}

/* ================================
   手机端导航（修复版）
================================= */
@media (max-width: 768px) {
  .nav-wrap {
    width: 100% !important;
    padding: 12px 16px;
    margin: 0 0 15px 0;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .logo-img {
    width: 40px;
    height: 40px;
  }
  .logo-text {
    display: none; /* 🔥 手机端隐藏网站名称（方案一） */
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 20px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    gap: 16px;
    z-index: 999;
    border-radius: 0 0 12px 12px;
    overflow: visible;
  }

  .menu-toggle {
    display: block;
    font-size: 28px;
  }

  .nav.active {
    display: flex;
  }

  .nav li {
    width: 100%;
  }
  .nav a {
    width: 100%;
    padding: 16px 20px;
    font-size: 18px;
    text-align: center;
    border-radius: 12px;
    background: #f7fafc;
    position: relative;
  }
  .nav a:hover {
    background: #edf2f7;
  }

  .nav li:hover .submenu {
    display: none;
  }

  .submenu {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
    border: none;
    background: #f7fafc;
    display: none;
  }
  .submenu.show {
    display: block !important;
  }
  .submenu a {
    padding: 12px 20px;
    font-size: 16px;
    background: #fff;
    margin: 4px 8px;
    border-radius: 8px;
  }

  .nav-auth {
    margin-left: 0;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
  }
  .nav-auth a, .nav-auth button {
    padding: 12px 28px;
    font-size: 16px;
    border-radius: 24px;
    min-width: 120px;
  }
  .user-name {
    width: 100%;
    text-align: center;
    padding: 12px;
    background: #f7fafc;
    border-radius: 12px;
    font-size: 16px;
  }
}

/* ================================
   主体容器
================================= */
.container {
  flex: 1;
  width: 80%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 20px;
}

#content {
  flex: 1;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  min-height: 500px;
}

/* 文章列表网格 */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 10px;
}

.article-card {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s;
}
.article-card:hover {
  transform: translateY(-3px);
}
.article-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.article-card .info {
  padding: 12px;
}
.article-card .title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #2d3748;
  line-height: 1.4;
}
.article-card .intro {
  font-size: 12px;
  color: #718096;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .meta {
  font-size: 11px;
  color: #a0aec0;
  display: flex;
  justify-content: space-between;
}

/* 分页箭头 */
.page-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 25px;
}
.page-arrow button {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.page-arrow button:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

/* ================================
   右侧热门 + 分类
================================= */
#hot {
  width: 260px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 20px;
  height: fit-content;
}
#hot h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #c53030;
  font-weight: 600;
}
#hot ul { list-style: none; }
#hot li {
  padding: 8px 0;
  font-size: 13px;
  color: #2d3748;
  cursor: pointer;
  transition: color 0.2s;
}
#hot li:hover { color: #c53030; }

.category-sidebar {
  margin-bottom: 25px;
}
.category-sidebar h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #c53030;
  font-weight: 600;
}
#category-sidebar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#category-sidebar-list span {
  padding: 6px 12px;
  background: #f7fafc;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #2d3748;
}
#category-sidebar-list span:hover {
  background: #fef2f2;
  color: #c53030;
  transform: translateY(-2px);
}

/* ================================
   最新文章大图小图布局（已修复：左1大 + 右3小）
================================= */
.latest-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin-bottom: 30px;
}
.latest-main {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s;
}
.latest-main:hover { transform: translateY(-3px); }
.latest-main img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.latest-main .info { padding: 12px; }
.latest-main .title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #2d3748;
}
.latest-main .meta {
  font-size: 11px;
  color: #a0aec0;
  display: flex;
  justify-content: space-between;
}
.latest-sub {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.latest-sub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.03);
  cursor: pointer;
  transition: background 0.2s;
}
.latest-sub-item:hover { background: #f7fafc; }
.latest-sub-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}
.latest-sub-item .title {
  font-size: 13px;
  color: #2d3748;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ================================
   文章详情
================================= */
.article-detail img {
  max-width: 100%;
  border-radius: 8px;
  margin: 10px 0;
}
.article-detail h2 {
  margin-bottom: 10px;
  font-size: 20px;
  color: #2d3748;
}
.article-detail .meta {
  font-size: 12px;
  color: #a0aec0;
  margin-bottom: 15px;
}
.article-detail .content {
  line-height: 1.8;
  font-size: 15px;
  color: #2d3748;
}

/* ================================
   评论区
================================= */
.comment-section {
  margin-top: 40px;
  border-top: 1px solid #e2e8f0;
  padding-top: 30px;
}
.comment-item {
  padding: 15px 0;
  border-bottom: 1px solid #f7fafc;
}
.comment-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #2d3748;
  font-weight: 500;
}
.comment-content {
  color: #2d3748;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-action button {
  border: none;
  background: none;
  color: #48bb78;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: color 0.2s;
}
.comment-action button:hover {
  color: #38a169;
}
.reply-box textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  resize: vertical;
  margin-top: 10px;
  font-size: 14px;
}
#comment-input {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  resize: vertical;
  font-size: 14px;
}
#submit-comment {
  padding: 8px 20px;
  background: #48bb78;
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}
#submit-comment:hover {
  background: #38a169;
  transform: translateY(-1px);
}

/* ================================
   移动端整体适配
================================= */
@media (max-width: 768px) {
  .container {
    width: 100% !important;
    padding: 0 10px !important;
    flex-direction: column;
  }
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  #hot {
    width: 100%;
    position: static;
  }
  .latest-grid {
    grid-template-columns: 1fr;
  }
  .latest-main img { height: 180px; }
}

footer {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 14px;
  margin-top: 20px;
}
.latest-sub-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.latest-sub-time {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

/* 黑底白字 页脚样式 */
.site-footer {
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 50px 20px 20px;
  border-top: 1px solid #333;
  margin-top: 60px;
  font-size: 14px;
  line-height: 1.7;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  padding-bottom: 30px;
  border-bottom: 1px solid #333;
}

.footer-about,
.footer-contact {
  flex: 1;
  min-width: 260px;
}

.site-footer h4 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

.site-footer p {
  margin: 6px 0;
  color: #cccccc;
}

.footer-bottom {
  max-width: 1100px;
  margin: 30px auto 0;
}

.footer-disclaimer {
  background-color: #222;
  padding: 15px 20px;
  border-left: 4px solid #459dff;
  border-radius: 4px;
  margin-bottom: 20px;
}

.footer-disclaimer h4 {
  margin-top: 0;
  color: #ff6b6b;
}

.footer-disclaimer p {
  color: #bbbbbb;
  font-size: 13px;
}

.footer-copyright {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin: 0;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 25px;
  }
}
/* 新增：页脚链接模块 */
.footer-links {
  flex: 1;
  min-width: 260px;
}
.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin: 8px 0;
}
.footer-links a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover {
  color: #459dff;
}
/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #2a9d8f;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9999;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: #238277;
  transform: translateY(-3px);
}

/* 顶部搜索框 */
.search-bar {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  z-index: 100;
  position: relative;
}
.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: all 0.3s;
}
.search-bar input:focus {
  border-color: #2a9d8f;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
}
.search-bar button {
  padding: 12px 20px;
  background: #2a9d8f;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.3s;
  white-space: nowrap;
}
.search-bar button:hover {
  background: #238277;
}

/* 手机端搜索框优化 */
@media (max-width: 768px) {
  .search-bar {
    padding: 0 14px;
    margin: 12px auto;
    gap: 6px;
  }
  .search-bar input {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
  }
  .search-bar button {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 10px;
  }
}

@media (max-width: 380px) {
  .search-bar {
    gap: 4px;
  }
  .search-bar button {
    padding: 10px 12px;
  }
}
/* ================================
   轮播图样式（仅首页显示）
================================= */
.banner-slider {
  width: 80%;
  margin: 0 auto 20px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  height: 400px; /* 可根据需求调整高度 */
  display: none; /* 默认隐藏，仅首页JS控制显示 */
}

.slider-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.slider-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.slider-item.active {
  opacity: 1;
  z-index: 1;
}

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

.slider-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 60px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
}

.slider-caption h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.slider-caption p {
  font-size: 16px;
  opacity: 0.9;
}

/* 轮播指示器 */
.slider-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: #fff;
  width: 30px;
  border-radius: 6px;
}

/* 左右箭头 */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  border: none;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #2d3748;
}

.slider-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.slider-arrow.prev {
  left: 20px;
}

.slider-arrow.next {
  right: 20px;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .banner-slider {
    width: 100%;
    height: 220px;
    border-radius: 0;
    margin-bottom: 15px;
  }

  .slider-caption {
    padding: 20px 30px;
  }

  .slider-caption h2 {
    font-size: 20px;
  }

  .slider-caption p {
    font-size: 13px;
  }

  .slider-arrow {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .slider-arrow.prev {
    left: 10px;
  }

  .slider-arrow.next {
    right: 10px;
  }
}