:root {
  /* 亮色模式 */
  --bg-top: #dffaff;
  --bg-bottom: #e8f2ff;
  --text-color: #444;
  --banner-bg: rgba(255,255,255,0.55);
  --card-bg: rgba(255,255,255,0.88);
  --nav-bg: linear-gradient(90deg, #2ec7c9 0%, #2970ea 100%);
  --post-title: #2b82e7;
  --post-title-hover: #2ec7c9;

  /* 夜间模式 */
  --night-bg-top: #0a0f19;
  --night-bg-bottom: #0f1a2d;
  --night-text: #cfd8ff;
  --night-banner-bg: rgba(40,50,70,0.55);
  --night-card-bg: rgba(30,40,60,0.75);
  --night-nav-bg: linear-gradient(90deg, #1c8ca3 0%, #2352a5 100%);
  --night-post-title: #7aa8ff;
  --night-post-title-hover: #3cd5ff;
}

/* ===============================
   页面整体——关键修复 overflow-y
   =============================== */
body.light {
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text-color);

  overflow-x: hidden;
  overflow-y: scroll; 
}
body.night {
  background: linear-gradient(180deg, var(--night-bg-top) 0%, var(--night-bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--night-text);

  overflow-x: hidden;
  overflow-y: scroll; 
}

/* 星空背景canvas */
#star-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* 夜间模式切换按钮 */
.night-toggle {
  position: relative;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 1.2em;
  z-index: 1000;
  transition: 0.25s;
}
body.night .night-toggle {
  background: rgba(40,40,60,0.45);
  color: #fff;
}

/* 导航栏 */
.menu-nav {
  width: 100%;
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(41,112,234,0.22);
  border-bottom: 4px solid rgba(255,255,255,0.35);
}
body.night .menu-nav {
  background: var(--night-nav-bg);
  border-bottom-color: rgba(255,255,255,0.15);
}

.menu-container {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
}
.menu-container .menu-function{
  display: flex;
  align-items: center;
  gap: 15px;
}
.menu-logo a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.4em;
}
.menu-list {
  list-style: none;
  display: flex;
  gap: 28px;
}
.menu-item {
  color: #fff;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  transition: 0.25s;
}
.menu-item:hover,
.menu-item.active {
  background: rgba(255,255,255,0.28);
}

/* Banner */
.banner {
  max-width: 900px;
  margin: 40px auto 0;
  padding: 40px 20px;
  text-align: center;
  border-radius: 24px;
  backdrop-filter: blur(12px);
  background: var(--banner-bg);
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 6px 22px rgba(41,112,234,0.22);
}
body.night .banner {
  background: var(--night-banner-bg);
  box-shadow: 0 6px 22px rgba(10,20,40,0.6);
}

@keyframes float {
  0% { transform: translateY(0);}
  50% { transform: translateY(-6px);}
  100% { transform: translateY(0);}
}

.banner h1 {
  font-size: 2.4em;
  margin: 0;
  color: #2970ea;
}
body.night .banner h1 {
  color: #7aa8ff;
}

/* 内容区卡片 */
.section {
  max-width: 900px;
  margin: 34px auto;
  padding: 24px;
  background: var(--card-bg);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(41,112,234,0.17);
}
body.night .section {
  background: var(--night-card-bg);
  box-shadow: 0 4px 18px rgba(5,8,18,0.7);
}
.section h2 {
  color: var(--title-color);
  margin-top: 0;
}
body.night .section h2 {
  color: var(--night-title);
}

.post-title {
  text-decoration: none;
  color: var(--post-title);
  font-weight: bold;
}
.post-title:hover {
  color: var(--post-title-hover);
}
body.night .post-title {
  color: var(--night-post-title);
}
body.night .post-title:hover {
  color: var(--night-post-title-hover);
}

#backToTop { 
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.7);
  color: #2970ea;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 999;
}

/* 显示时的状态 */
#backToTop.show {
  opacity: 1;
  pointer-events: auto;
}

/* 悬浮效果 */
#backToTop:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,0.8);
  box-shadow: 0 6px 16px rgba(41,112,234,0.25);
}

/* 夜间模式适配 */
body.night #backToTop {
  background: rgba(40,40,60,0.55);
  border-color: rgba(255,255,255,0.2);
  color: #7aa8ff;
}
body.night #backToTop:hover {
  background: rgba(60,60,90,0.7);
  box-shadow: 0 6px 16px rgba(10,20,40,0.6);
}

/* ===== 评论区容器 ===== */
.comment-container {
  margin: 40px auto;
  max-width: 900px;
  padding: 20px;
}

/* ===== 玻璃拟态基础 ===== */
.glass-box {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.12);
  margin-bottom: 25px;
}

/* 🔆 亮色模式：深色文本 */
body.light .comment-nick,
body.light .comment-content,
body.light .comment-time,
body.light .glass-input,
body.light .glass-textarea {
  color: #1b1b1b !important;
}

/* 🔆 亮色模式：深色边线 */
body.light .comment-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

/* 🌙 夜间模式：浅蓝/青色文字（与你全站一致） */
body.night .comment-nick {
  color: #8ffcff !important;
}
body.night .comment-content {
  color: #e4ffff !important;
}
body.night .comment-time {
  color: rgba(200, 255, 255, 0.7) !important;
}

/* 🌙 夜间模式：浅青色边线（修复你文件中的唯一冲突点） */
body.night .comment-item {
  border-bottom: 1px solid rgba(200, 255, 255, 0.12);
}

/* 🌙 夜间模式：输入框文字浅色 */
body.night .glass-input,
body.night .glass-textarea {
  color: #e0faff !important;
}

/* ===== 输入框玻璃风 ===== */
.glass-input,
.glass-textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: none;
  outline: none;

  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);

  color: #e0faff;
  font-size: 15px;
}

.glass-textarea {
  min-height: 80px;
  resize: vertical;
}

/* ===== 提交按钮 ===== */
.glass-button {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;

  font-weight: bold;
  color: #fff;

  background: linear-gradient(135deg, #15c9ff, #21ffb3);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
  transition: 0.25s;
}

.glass-button:hover {
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
  transform: scale(1.03);
}

/* ===== 评论列表 ===== */
.comment-item {
  padding: 12px 8px;
  /* 默认是亮色模式的边框，但会被 body.light/body.night 覆盖 */
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  animation: fadeIn 0.25s ease forwards;
}

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

.comment-nick {
  font-weight: bold;
}

.comment-content {
  margin-top: 4px;
  white-space: pre-wrap;
}

.comment-time {
  font-size: 13px;
  margin-top: 4px;
  opacity: 0.6;
}


/* ===== 渐入动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 汉堡按钮：默认隐藏，只在竖屏显示 */
.hamburger {
  display: none;
  position: relative;
  top: -2px;
  font-size: 1.8em;
  color: white;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: 0.2s;
}
body.night .hamburger {
  color: #ddd;
}

/* ---- 移动端竖屏适配 ---- */
@media (max-width: 820px), (max-aspect-ratio: 3/4) {

  /* 让容器上下堆叠 */
  .menu-container {
    flex-direction: row;
    justify-content: space-between;
  }

  /* 汉堡按钮显示 */
  .hamburger {
    display: block;
  }

  /* 默认隐藏菜单 */
  .menu-list {
    position: absolute;
    top: 65px;
    right: 58px;
    max-width: 100px;
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 0;
    animation: fadeIn 0.25s ease;
    box-shadow: 0 0 5px 5px rgba(0,0,0,0.15);
  }

  body.night .menu-list {
    background: var(--night-nav-bg);
  }

  /* 展开菜单时添加这个 class */
  .menu-list.show {
    display: flex;
  }

  /* 菜单项样式（竖排） */
  .menu-list li {
    text-align: center;
    z-index: 9999;
  }
  .menu-item {
    display: block;
    width: 100%;
    padding: 12px 0;
    border-radius: 0;
  }
}

/* 小动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

