:root {
  /* 暗金主题变量 */
  --bg: #12100b;          /* 背景主色（深棕黑） */
  --card: #1a1710;        /* 卡片底色（更深） */
  --text: #f5f1e6;        /* 文字（暖白） */
  --muted: #cbbf9e;       /* 次级文字（浅金） */
  --accent: #d4af37;      /* 强调色（暗金） */
}
/* 文字选择样式 - 黑蓝背景 + 暗金文字 */
::selection {
  background: #0d1b2a;
  color: #d4af37;
  text-shadow: none;
}
::-moz-selection {
  background: #0d1b2a;
  color: #d4af37;
  text-shadow: none;
}
html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  font-family: 'Noto Serif SC', serif; /* 统一中文宋体风格 */
  /* 背景图 + 暗色遮罩，固定视差滚动 */
  background:
    linear-gradient(rgba(18, 16, 11, .64), rgba(18, 16, 11, .64)),
    var(--bg-image, none) center/cover fixed no-repeat; /* 背景仅使用 YAML 注入的网络地址 */
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-size: 1rem;                                      /* 确保基础字体大小 */
}

/* 表单元素样式 - 确保文字可见且大小合适 */
.form-control,
.form-label,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
  color: var(--text) !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  font-family: 'Noto Serif SC', serif;
}

.form-label {
  color: var(--text) !important;
  font-size: 1rem !important;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-control {
  background: rgba(212,175,55,.08) !important;
  border: 1px solid rgba(212,175,55,.3) !important;
  color: var(--text) !important;
  padding: 10px 12px !important;
  border-radius: 8px;
  font-size: 1rem !important;
  line-height: 1.5 !important;
}

.form-control:focus {
  background: rgba(212,175,55,.12) !important;
  border-color: rgba(212,175,55,.5) !important;
  color: var(--text) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}

.form-control::placeholder {
  color: var(--muted) !important;
  opacity: 0.7;
}

.form-text {
  color: var(--muted) !important;
  font-size: 0.875rem !important;
}
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 12px 16px 20px;                              /* 为底部导航留出空间 */
  flex: 1 0 auto; 
}
#blog-head { padding: 1.5rem 0 0.8rem; text-align: center; margin-bottom: 1.5rem; }  /* 增加与主内容区域的间距 */
#blog-head h1 { font-weight: 900; letter-spacing: 0.5px; margin-bottom: .25rem; color: #f7f3e3; }
#blog-head h1.gold-title {
  /* 暗金镶边：多层阴影 + 细描边 */
  text-shadow:
    0 1px 0 rgba(0,0,0,.5),
    0 0 2px rgba(212,175,55,.75),
    0 0 8px rgba(212,175,55,.35),
    0 0 18px rgba(212,175,55,.25);
  -webkit-text-stroke: 1px rgba(212,175,55,.65);
}
#blog-head .subtitle { color: var(--muted); font-size: .95rem; opacity: .95; }
.grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;                                          /* 增加间距，提供呼吸感 */
  margin-top: 0.8rem;
  margin-bottom: 0.8rem;
  align-items: start; /* 确保卡片顶部对齐 */
}
/* 平板响应式 */
@media (min-width: 768px) and (max-width: 1199px) { 
  .grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 1.6rem;                                        /* 增加间距 */
    align-items: start; /* 确保卡片顶部对齐 */
  }
  .container {
    padding: 16px 20px 50px;
  }
  .grid .card {
    height: 155px; /* 平板端也保持固定高度 */
  }
  .card-body {
    padding: 12px 14px 14px 14px;                       /* 恢复正常的底部padding */
  }
}

/* 桌面响应式 */
@media (min-width: 1200px) { 
  .grid { 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: 2.4rem;                                        /* 增加间距，提供更好的呼吸感 */
    align-items: start; /* 确保卡片顶部对齐 */
  }
}

/* 手机响应式 */
@media (max-width: 767px) {
  .container {
    padding: 10px 12px 100px;                           /* 为底部导航留出足够空间 */
  }
  #blog-head {
    padding: 1rem 0 0.6rem;
    margin-bottom: 1rem;
  }
  #blog-head h1 {
    font-size: 1.8rem;
  }
  .grid {
    gap: 1.2rem;                                        /* 手机端也增加间距 */
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
    align-items: start; /* 确保卡片顶部对齐 */
  }
  .grid .card {
    height: 150px; /* 手机端也保持固定高度 */
    border-width: 1.5px;
    margin: 0; /* 确保没有额外边距 */
  }
  .card-body {
    padding: 10px 12px 12px 12px;                       /* 恢复正常的底部padding */
  }
  .title {
    font-size: 1rem;
    margin: 5px 0 6px;
  }
  .excerpt {
    font-size: 0.8rem;
    max-height: 2em;
  }
}
/* 首页文章卡片 - 固定高度 */
.grid .card {
  /* 暗金主题：金色边框 + 黑蓝色文字块 */
  position: relative;
  /* 使用双层背景实现“有纹理的边框” */
  background:
    linear-gradient(180deg, rgba(13,27,42,0.92), rgba(6,12,20,0.88)) padding-box,
    /* 金色金属纹理边框：同心渐变 + 细条纹 */
    conic-gradient(from 0deg at 50% 50%, rgba(212,175,55,0.20), rgba(212,175,55,0.08), rgba(212,175,55,0.20)) border-box,
    repeating-linear-gradient(45deg, rgba(212,175,55,0.05) 0 6px, rgba(0,0,0,0) 6px 12px) border-box;
  background-clip: padding-box, border-box, border-box;
  background-origin: border-box;
  border: 3px solid rgba(212,175,55,0.30);
  border-radius: 12px;
  overflow: hidden; /* 防止内容溢出 */
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.4),
    0 0 0 1px rgba(212,175,55,0.14) inset,
    0 0 20px rgba(212,175,55,0.1);
  opacity: 1;
  transform: none;
  height: 160px; /* 固定高度确保大小一致 */
  display: flex;
  flex-direction: column;
  transition: all .3s ease;
  margin: 0; /* 确保没有额外边距 */
  cursor: pointer; /* 添加手型光标，提示可点击 */
  /* 光晕动画变量默认值 */
  --mx: 50%;
  --my: 50%;
}

/* 通用卡片样式 - 不限制高度（用于文章页和管理页面） */
.card:not(.grid .card):not(.article-card) {
  position: relative;
  background: linear-gradient(180deg, rgba(18,16,11,0.92), rgba(16,14,10,0.88));
  border: 2px solid rgba(212,175,55,0.5);
  border-radius: 12px;
  overflow: visible;
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.4),
    0 0 0 1px rgba(212,175,55,0.2) inset,
    0 0 20px rgba(212,175,55,0.1);
  transition: all .3s ease;
  min-height: auto;
  height: auto;
}

/* 黑金祥云装饰边框 - 多层装饰效果（仅首页文章卡片） */
.grid .card .card-decoration {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 18px;
  z-index: 0;
  opacity: 0.7;
  pointer-events: none;                                 /* 装饰层本身不拦截事件，但子元素可以 */
  overflow: visible;                                     /* 允许按钮显示在边界外 */
}

.grid .card .card-decoration::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    /* 祥云图案 - 使用多个径向渐变模拟云朵 */
    radial-gradient(ellipse 80px 40px at 10% 20%, rgba(212,175,55,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60px 30px at 90% 30%, rgba(212,175,55,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 50px 25px at 20% 80%, rgba(212,175,55,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 70px 35px at 80% 70%, rgba(212,175,55,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 40px 20px at 50% 10%, rgba(18,16,11,0.6) 0%, transparent 50%),
    radial-gradient(ellipse 45px 22px at 50% 90%, rgba(18,16,11,0.6) 0%, transparent 50%),
    /* 边框高光 */
    linear-gradient(0deg, transparent 0%, rgba(212,175,55,0.1) 50%, transparent 100%),
    linear-gradient(90deg, transparent 0%, rgba(212,175,55,0.1) 50%, transparent 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 4px, 4px 100%;
  background-position: 0% 0%, 100% 0%, 0% 100%, 100% 100%, 50% 0%, 50% 100%, 0 0, 0 0;
  animation: cloudFlow 25s ease-in-out infinite;
}

.grid .card .card-decoration::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 20px;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 15px,
      rgba(212,175,55,0.06) 15px,
      rgba(212,175,55,0.06) 16px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 15px,
      rgba(212,175,55,0.06) 15px,
      rgba(212,175,55,0.06) 16px
    );
  opacity: 0.5;
  animation: cloudPattern 30s linear infinite;
}

@keyframes cloudFlow {
  0%, 100% {
    background-position: 0% 0%, 100% 0%, 0% 100%, 100% 100%, 50% 0%, 50% 100%, 0 0, 0 0;
    filter: blur(0px);
  }
  25% {
    background-position: 5% 5%, 95% 5%, 5% 95%, 95% 95%, 50% 5%, 50% 95%, 0 0, 0 0;
    filter: blur(1px);
  }
  50% {
    background-position: 10% 10%, 90% 10%, 10% 90%, 90% 90%, 50% 10%, 50% 90%, 0 0, 0 0;
    filter: blur(0.5px);
  }
  75% {
    background-position: 5% 5%, 95% 5%, 5% 95%, 95% 95%, 50% 5%, 50% 95%, 0 0, 0 0;
    filter: blur(1px);
  }
}

@keyframes cloudPattern {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(15px, 15px);
  }
}

.grid .card::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 17px;
  background: 
    linear-gradient(135deg, rgba(212,175,55,0.12) 0%, transparent 40%),
    linear-gradient(225deg, rgba(212,175,55,0.12) 0%, transparent 40%),
    linear-gradient(45deg, rgba(18,16,11,0.7) 0%, transparent 40%),
    linear-gradient(315deg, rgba(18,16,11,0.7) 0%, transparent 40%);
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
  animation: cloudFloat 20s ease-in-out infinite;
}

@keyframes cloudFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }
  33% {
    transform: translate(3px, -3px) scale(1.01);
    opacity: 0.6;
  }
  66% {
    transform: translate(-3px, 3px) scale(0.99);
    opacity: 0.5;
  }
}

.grid .card:hover { 
  transform: translateY(-3px); 
  border-color: rgba(212,175,55,0.48); 
  box-shadow: 
    0 8px 20px rgba(0,0,0,0.5),
    0 0 0 1px rgba(212,175,55,0.18) inset,
    0 0 30px rgba(212,175,55,0.16);
}

/* 跟随鼠标的暗金光晕（黑蓝背景上更明显） */
.grid .card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(180px circle at var(--mx) var(--my), rgba(212,175,55,0.35), rgba(13,27,42,0) 60%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .25s ease;
}

.grid .card.hovering::after {
  opacity: 1;
}

.grid .card:hover .card-decoration {
  opacity: 0.8;
  animation-duration: 10s;
}

/* 通用卡片悬停效果 */
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(212,175,55,0.65);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
/* 首页文章卡片内容 */
.grid .card a {
  position: relative;
  z-index: 1;
  display: block;
  height: 100%;                                         /* 确保链接覆盖整个卡片 */
  text-decoration: none;
  color: inherit;
}

.grid .card .card-body { 
  padding: 14px 16px 12px 16px;                         
  position: relative;
  z-index: 1;
  background: rgba(13,27,42,0.35);
  border-radius: 10px;
  margin: 2px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0; /* 允许flex子元素收缩 */
  height: 100%;                                          /* 确保占满链接区域 */
}

/* 通用卡片内容 */
.card-body {
  padding: 16px;
  position: relative;
  z-index: 1;
}

/* 首页文章卡片内的元素 */
.grid .card .meta { 
  font-size: 12px; 
  color: var(--muted); 
  margin-bottom: 6px; 
  display: flex; 
  gap: 10px; 
  align-items: center; 
}

.grid .card .title { 
  font-size: 1.1rem; 
  font-weight: 900; 
  letter-spacing: 0.5px; 
  line-height: 1.35; 
  margin: 6px 0 auto; /* 使用auto让标题和按钮之间有弹性空间 */
  color: #f7f3e3; 
  font-family: 'Noto Serif SC', serif;
  text-shadow:
    0 1px 0 rgba(0,0,0,.4),
    0 0 2px rgba(212,175,55,.6),
    0 0 6px rgba(212,175,55,.3);
  -webkit-text-stroke: 0.5px rgba(212,175,55,.4);
  transition: all .2s ease;
  flex-shrink: 1; /* 允许标题收缩 */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.grid .card:hover .title {
  color: #faf6e8;
  text-shadow:
    0 1px 0 rgba(0,0,0,.4),
    0 0 3px rgba(212,175,55,.8),
    0 0 8px rgba(212,175,55,.4);
  -webkit-text-stroke: 0.5px rgba(212,175,55,.5);
}

.excerpt { 
  color: #d4c9b0; 
  font-size: 0.85rem; 
  line-height: 1.5; 
  max-height: 2.25em; 
  overflow: hidden; 
  display: -webkit-box; 
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  opacity: 0.9;
}
.badge { background: rgba(212,175,55,.15); color: var(--accent); border: 1px solid rgba(212,175,55,.45); padding: 2px 8px; border-radius: 999px; font-size: 12px; }
/* 确保卡片整齐对齐 */
.grid .card {
  margin-top: 0;
}

/* 主内容包装器 */
.main-content-wrapper {
  display: flex;
  flex-direction: column; /* 垂直排列：先文章网格，后分页 */
  gap: 20px;
  align-items: stretch;
  position: relative;
}

/* 平板和手机：分页导航调整 */
@media (max-width: 1024px) {
  .main-content-wrapper {
    flex-direction: column;
    padding-bottom: 90px; /* 为底部导航留出更多空间 */
  }
  
  .pagination-vertical {
    bottom: 12px !important;
    padding: 10px 16px;
  }
  
  .pagination-vertical-list .page-item .page-link,
  .pagination-vertical-list .page-item a {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 0.85rem;
  }
}

/* 手机端：分页导航放在文章块下方，不再悬浮 */
@media (max-width: 768px) {
  .container {
    padding-bottom: 20px; /* 恢复正常底部内边距 */
  }
  
  .pagination-vertical {
    position: static !important;                        /* 改为正常流式布局 */
    bottom: auto !important;
    left: auto !important;
    transform: none !important;                         /* 移除居中定位 */
    width: 100% !important;
    max-width: 100%;
    margin: 20px auto 0 auto;                           /* 添加顶部间距，水平居中 */
    padding: 8px 10px !important;                      /* 减小内边距 */
    z-index: auto;
    border-radius: 12px !important;                    /* 稍小的圆角 */
  }
  
  .pagination-vertical-list {
    gap: 4px !important;                                /* 减小按钮间距 */
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .pagination-vertical-list .page-item .page-link,
  .pagination-vertical-list .page-item a {
    min-width: 32px !important;                        /* 减小按钮宽度 */
    height: 32px !important;                           /* 减小按钮高度 */
    padding: 0 6px !important;                         /* 减小内边距 */
    font-size: 0.75rem !important;                     /* 减小字体 */
    border-radius: 8px !important;                      /* 稍小的圆角 */
  }
  
  .main-content-wrapper {
    padding-bottom: 0; /* 移除底部预留空间 */
  }
}

/* 小屏手机：分页导航更小 */
@media (max-width: 480px) {
  .container {
    padding-bottom: 16px; /* 恢复正常底部内边距 */
  }
  
  /* 小屏手机端文章内容进一步缩小 */
  .article-card {
    padding: 14px 16px !important;
  }
  
  .article-content {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
  }
  
  .article-content p {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    margin: 0 0 0.9em 0 !important;
  }
  
  .article-content h1 {
    font-size: 1.45rem !important;
    margin: 1em 0 0.5em 0 !important;
  }
  
  .article-content h2 {
    font-size: 1.25rem !important;
    margin: 0.9em 0 0.4em 0 !important;
  }
  
  .article-content h3 {
    font-size: 1.1rem !important;
    margin: 0.8em 0 0.3em 0 !important;
  }
  
  .article-content h4 {
    font-size: 1rem !important;
    margin: 0.7em 0 0.3em 0 !important;
  }
  
  .article-content li {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    margin: 0.35em 0 !important;
  }
  
  .article-content ul,
  .article-content ol {
    margin: 0.7em 0 !important;
    padding-left: 1.4em !important;
  }
  
  .article-content blockquote {
    margin: 0.9em 0 !important;
    padding: 0.7em 1em !important;
    font-size: 0.9rem !important;
  }
  
  .article-content pre {
    padding: 10px 12px !important;
    font-size: 0.8rem !important;
  }
  
  .article-content code {
    font-size: 0.8em !important;
    padding: 2px 5px !important;
  }
  
  #blog-head h1 {
    font-size: 1.6rem !important;
  }
  
  .pagination-vertical {
    margin: 16px auto 0 auto;                           /* 调整间距 */
    padding: 6px 8px !important;                        /* 进一步减小内边距 */
    width: 100% !important;
    max-width: 100%;
    border-radius: 10px !important;
  }
  
  .pagination-vertical-list {
    gap: 3px !important;                                /* 更小的按钮间距 */
  }
  
  .pagination-vertical-list .page-item .page-link,
  .pagination-vertical-list .page-item a {
    min-width: 28px !important;                        /* 更小的按钮 */
    height: 28px !important;
    padding: 0 4px !important;
    font-size: 0.7rem !important;                      /* 更小的字体 */
    border-radius: 6px !important;
  }
  
  .main-content-wrapper {
    padding-bottom: 0;
  }
}

/* 分页导航（重写）：流式放在文章块下方，不悬浮，不覆盖 */
.pagination-vertical {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  z-index: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 24px 0 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.pagination-vertical-list {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  align-items: center !important;
  justify-content: center !important;
}

.pagination-vertical-list .page-item {
  margin: 0;
}

.pagination-vertical-list .page-item .page-link,
.pagination-vertical-list .page-item a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 42px !important;
  height: 42px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(212,175,55,0.45) !important;
  background: linear-gradient(180deg, rgba(20,18,12,0.90), rgba(18,16,11,0.85)) !important;
  color: var(--text) !important;
  text-decoration: none !important;
  transition: all .2s ease !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  font-family: 'Noto Serif SC', serif !important;
  white-space: nowrap !important;
}

.pagination-vertical-list .page-item:hover .page-link,
.pagination-vertical-list .page-item:hover a { border-color: rgba(212,175,55,0.65) !important; background: linear-gradient(180deg, rgba(212,175,55,0.25), rgba(212,175,55,0.20)) !important; transform: translateY(-2px) !important; }

/* 小屏设备：分页按钮缩小 */
@media (max-width: 768px) {
  .pagination-vertical-list { gap: 6px !important; }
  .pagination-vertical-list .page-item .page-link,
  .pagination-vertical-list .page-item a {
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 8px !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 480px) {
  .pagination-vertical-list { gap: 4px !important; }
  .pagination-vertical-list .page-item .page-link,
  .pagination-vertical-list .page-item a {
    min-width: 28px !important;
    height: 28px !important;
    padding: 0 6px !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
  }
}

.pagination-vertical-list .page-item.active .page-link,
.pagination-vertical-list .page-item.active a {
  background: linear-gradient(180deg, rgba(212,175,55,0.35), rgba(212,175,55,0.28));
  border-color: rgba(212,175,55,.7);
  color: #1a1710;
  box-shadow: 0 4px 12px rgba(212,175,55,.4);
  font-weight: 700;
}

.pagination-vertical-list .page-item.disabled .page-link,
.pagination-vertical-list .page-item.disabled a {
  opacity: .35;
  pointer-events: none;
  cursor: not-allowed;
}

/* 旧的分页样式保留（用于其他页面） */
.pagination-bar { padding: 16px 0 8px; margin-top: auto; }
.pagination { gap: 8px; margin: 0; }
.pagination .page-item .page-link,
.pagination .page-item a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,0.45);
  background: rgba(212,175,55,.10);
  color: var(--text);
  text-decoration: none;
  backdrop-filter: saturate(1.1) blur(8px);
  transition: all .2s ease;
}
.pagination .page-item:hover .page-link,
.pagination .page-item:hover a { border-color: rgba(212,175,55,0.65); background: rgba(212,175,55,.16); }
.pagination .page-item.active .page-link,
.pagination .page-item.active a { background: rgba(212,175,55,.28); border-color: rgba(212,175,55,.7); color: #1a1710; }
.pagination .page-item.disabled .page-link,
.pagination .page-item.disabled a { opacity: .45; pointer-events: none; }

/* 尊重系统减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


.edit-card {
  max-width: 1100px;
  margin: 20px auto;
  width: 100%;
}

.edit-textarea {
  min-height: calc(100vh - 320px);
  resize: vertical;
}

@media (max-width: 992px) {
  .edit-card {
    margin: 16px auto;
    max-width: 100%;
  }

  .edit-textarea {
    min-height: 50vh;
  }
}

/* 后台表格统一主题（玻璃 + 天空蓝强调色） */
.admin-table {
  background: rgba(212,175,55,.10);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(212,175,55,.35);
  color: var(--text);
}
.admin-table thead th {
  background: rgba(212,175,55,.16);
  color: var(--text);
  border-color: rgba(212,175,55,.22) !important;
}
.admin-table tbody tr { background: transparent; }
.admin-table tbody tr:nth-child(even) { background: rgba(212,175,55,.05); }
.admin-table tbody tr:hover { background: rgba(212,175,55,.12); }
.admin-table td, .admin-table th { border-color: rgba(212,175,55,.15) !important; }

.admin-table .btn-outline-info { color: var(--accent); border-color: rgba(212,175,55,.6); }
.admin-table .btn-outline-info:hover { background: rgba(212,175,55,.22); color: #1a1710; }
.admin-table .btn-outline-light { color: var(--text); border-color: rgba(255,255,255,.35); }
.admin-table .btn-outline-light:hover { background: rgba(212,175,55,.12); }

/* 文章页：加强可读性（更低透明度 + 细边框） */
.article-card {
  background: rgba(18,16,11,0.92) !important;           /* 深色卡片，阅读更稳 */
  color: #e8e3d5 !important;                            /* 更温和的暖白色，强制设置 */
  border: 1px solid rgba(212,175,55,0.22) !important;  /* 更柔和的边框 */
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  padding: 28px 32px !important;                        /* 增加内边距 */
  min-height: auto !important;                          /* 不受固定高度限制 */
  height: auto !important;                               /* 根据内容自适应高度 */
  overflow: visible !important;                         /* 允许内容正常显示 */
  display: block !important;                            /* 确保是块级元素 */
}

@media (max-width: 768px) {
  .article-card {
    padding: 16px 18px !important;
  }
  
  /* 手机端文章内容文字大小调整 */
.article-content {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
    letter-spacing: 0.01em !important;
    word-spacing: 0.03em !important;
  }
  
  .article-content p {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
    margin: 0 0 1em 0 !important;
  }
  
  .article-content h1 {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
    margin: 1.2em 0 0.6em 0 !important;
  }
  
  .article-content h2 {
    font-size: 1.35rem !important;
    line-height: 1.35 !important;
    margin: 1.1em 0 0.5em 0 !important;
  }
  
  .article-content h3 {
    font-size: 1.15rem !important;
    line-height: 1.4 !important;
    margin: 1em 0 0.4em 0 !important;
  }
  
  .article-content h4 {
    font-size: 1.05rem !important;
    line-height: 1.4 !important;
    margin: 0.9em 0 0.4em 0 !important;
  }
  
  .article-content li {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
    margin: 0.4em 0 !important;
  }
  
  .article-content ul,
  .article-content ol {
    margin: 0.8em 0 !important;
    padding-left: 1.5em !important;
    line-height: 1.65 !important;
  }
  
  .article-content blockquote {
    margin: 1em 0 !important;
    padding: 0.8em 1.2em !important;
    line-height: 1.6 !important;
    font-size: 0.95rem !important;
  }
  
.article-content pre {
    padding: 12px 14px !important;
    margin: 1.2em 0 !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }
  
  .article-content img {
    margin: 1.2em auto !important;
    border-radius: 8px !important;
  }
  
  #blog-head h1 {
    font-size: 1.8rem !important;
  }
}

.article-content {
  font-size: 1.12rem;                                   /* 增大字体 */
  line-height: 2.0;                                      /* 增加行高，更舒适 */
  color: #e8e3d5 !important;                            /* 温和的暖白色，确保文字可见 */
  letter-spacing: 0.015em;                              /* 增加字间距 */
  word-spacing: 0.05em;                                  /* 增加词间距 */
  font-weight: 400;                                     /* 正常字重 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: auto;                                     /* 根据内容自适应 */
  width: 100%;                                          /* 确保占满容器 */
  box-sizing: border-box;                               /* 包含padding */
  overflow: visible;                                    /* 允许内容正常显示 */
}

/* 确保所有文本元素都有正确的颜色和大小 - 精确选择器避免影响代码块 */
.article-content p,
.article-content div:not(pre):not(.hljs):not(code),
.article-content span:not(code):not(.hljs *),
.article-content li,
.article-content td,
.article-content th,
.article-content blockquote {
  color: #e8e3d5 !important;
}

/* 列表样式 */
.article-content ol,
.article-content ul {
  color: #e8e3d5 !important;
  margin: 1em 0 !important;
  padding-left: 1.8em !important;
}

/* 列表项 */
.article-content li {
  color: #e8e3d5 !important;
  margin: 0.5em 0 !important;
  line-height: 2.0 !important;
}

/* 链接保持金色 */
.article-content a {
  color: #d4af37 !important;
  text-decoration-color: rgba(212,175,55,0.4);
}

.article-content a:hover {
  color: #e5c866 !important;
  text-decoration-color: rgba(212,175,55,0.6);
}

.article-content h1 {
  font-size: 2.2rem;
  font-weight: 700;                                     /* 降低字重，更温和 */
  line-height: 1.4;
  color: #f0ead6;                                       /* 稍亮但温和的标题色 */
  margin: 1.8em 0 0.8em 0;
  letter-spacing: 0.02em;
  font-family: 'Noto Serif SC', serif;
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.45;
  color: #f0ead6;
  margin: 1.6em 0 0.7em 0;
  letter-spacing: 0.015em;
  font-family: 'Noto Serif SC', serif;
}

.article-content h3 {
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.5;
  color: #ede8d8;
  margin: 1.4em 0 0.6em 0;
  letter-spacing: 0.01em;
  font-family: 'Noto Serif SC', serif;
}

.article-content h4 {
  font-size: 1.3rem;
  font-weight: 650;
  line-height: 1.5;
  color: #ede8d8;
  margin: 1.2em 0 0.5em 0;
  letter-spacing: 0.01em;
  font-family: 'Noto Serif SC', serif;
}

/* 段落样式 - 确保文字可见且大小合适 */
.article-content p {
  margin: 0 0 1.2em 0 !important;                        /* 增加段落间距 */
  text-align: justify;                                   /* 两端对齐 */
  text-justify: inter-ideograph;                         /* 中文优化 */
  color: #e8e3d5 !important;                            /* 确保文字颜色 */
  font-size: 1.12rem !important;                         /* 确保字体大小 */
  line-height: 2.0 !important;                           /* 确保行高 */
}

/* 强调文字 */
.article-content strong,
.article-content b {
  font-weight: 600 !important;
  color: #ede8d8 !important;
}

.article-content em,
.article-content i {
  font-style: italic;
  color: #e5dfce !important;
}

/* 列表样式 - 已在上方定义，这里确保应用 */
.article-content ul,
.article-content ol {
  margin: 1em 0 !important;
  padding-left: 1.8em !important;
  line-height: 1.95 !important;
  color: #e8e3d5 !important;
}

.article-content li {
  margin: 0.5em 0 !important;
  color: #e8e3d5 !important;
  line-height: 2.0 !important;                           /* 确保列表项行高 */
  font-size: 1.12rem !important;                         /* 确保列表项字体大小 */
}

.article-content blockquote {
  margin: 1.5em 0 !important;
  padding: 1em 1.5em !important;
  border-left: 3px solid rgba(212,175,55,0.35) !important;
  background: rgba(212,175,55,0.06) !important;
  border-radius: 6px;
  color: #e0dac8 !important;
  font-style: italic;
  line-height: 1.9 !important;
  font-size: 1.12rem !important;                         /* 确保引用块字体大小 */
}

/* 代码块与内联代码样式（更温和的配色） */
/* 重置：不在 pre 上设定主题颜色，由 highlight.js 控制 */
.article-content pre {
  background: transparent !important;
  border: none !important;
  margin: 1.5em 0 !important;
  line-height: 1.7 !important;
  font-size: 0.95rem !important;
}

.article-content code:not(.hljs) {
  background: rgba(212,175,55,.10) !important;          /* 更柔和的背景 */
  color: #e5dcc5 !important;                            /* 更温和的代码文字色 */
  padding: 3px 7px !important;
  border-radius: 5px;
  font-size: 0.92em !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}


/* 代码块容器采用暗金背景与圆角，由 hljs 类承载 */
.article-content pre code.hljs,
.article-content .hljs {
  display: block;
  background: #14120c !important;
  color: #e8e3d5 !important; /* 基础前景色，具体 token 由下方覆盖 */
  border: 1px solid rgba(212,175,55,0.18) !important;
  border-radius: 10px;
  padding: 16px 18px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  overflow: auto;
}

/* 兜底：有 language- 类但还未被 hljs 处理时，先给容器基础样式 */
.article-content pre code[class*="language-"] {
  display: block;
  background: #14120c;
  color: #e8e3d5;
  border: 1px solid rgba(212,175,55,0.18);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  overflow: auto;
}

/* 大纲：通用浮动面板与悬浮小球（所有设备） */
.article-toc { display: none; }
.article-toc.open {
  display: block;
  position: fixed;
  right: 16px;
  top: 96px;
  width: 280px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(20,18,12,0.85), rgba(20,18,12,0.78));
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 12px;
  padding: 12px 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  z-index: 1500;
}
.article-toc ul { list-style: none; margin: 0; padding: 0; }
.article-toc li { margin: 4px 0; }
.article-toc a { color: var(--muted); text-decoration: none; display: block; padding: 4px 6px; border-radius: 6px; }
.article-toc a:hover { background: rgba(212,175,55,0.10); color: var(--text); }

.toc-fab {
  position: fixed;
  right: 16px;
  top: 96px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(20,18,12,0.90), rgba(20,18,12,0.85));
  border: 1px solid rgba(212,175,55,0.45);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  z-index: 1501; /* 高于面板标题层，但低于侧栏 */
}
.toc-fab svg { width: 20px; height: 20px; stroke: var(--accent); }
@media (max-width: 767px) { .toc-fab { right: 12px; top: 72px; width: 40px; height: 40px; } .toc-fab svg { width: 18px; height: 18px; } }

/* 暗金风格 token 覆盖（基于 hljs 类） */
.article-content .hljs-keyword,
.article-content .hljs-selector-tag,
.article-content .hljs-literal,
.article-content .hljs-title.class_ {
  color: #e5c866 !important; /* 金色关键字 */
}

.article-content .hljs-string,
.article-content .hljs-attr,
.article-content .hljs-number,
.article-content .hljs-symbol,
.article-content .hljs-bullet {
  color: #d4af37 !important; /* 深金色字符串/数值 */
}

.article-content .hljs-comment,
.article-content .hljs-quote {
  color: #8a8068 !important; /* 柔和注释色 */
  font-style: italic;
}

.article-content .hljs-function .hljs-title,
.article-content .hljs-title.function_ {
  color: #f0ead6 !important; /* 标题/函数名更亮 */
}

.article-content .hljs-built_in,
.article-content .hljs-type,
.article-content .hljs-meta {
  color: #e6d79a !important;
}

/* 文章布局：正文 + 右侧大纲（不挤占正文宽度） */
@media (min-width: 992px) and (max-width: 1199px) {
  /* 中等桌面：暂不显示大纲，避免遮挡正文 */
  .article-toc { display: none; }
}

@media (min-width: 1200px) {
  .article-layout { position: relative; }
  .article-toc {
    position: fixed;               /* 悬浮于屏幕右侧，跟随滚动 */
    top: 96px;                     /* 避开页头 */
    right: 24px;                   /* 贴屏幕右侧 */
    width: 300px;
    /* 取消内部滚动，避免出现第二个滚动条 */
    max-height: none;
    overflow: visible;

    background: linear-gradient(180deg, rgba(20,18,12,0.85), rgba(20,18,12,0.78));
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 12px;
    padding: 16px 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    z-index: 1500;                 /* 低于侧边栏(1999)，高于正文 */
  }

  .article-toc .toc-title {
    font-family: 'Noto Serif SC', serif;
    color: var(--text);
    font-weight: 700;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212,175,55,0.22);
  }

  .article-toc .toc-content {
    max-height: calc(100vh - 140px);
    overflow: auto;
  }

  .article-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .article-toc li { margin: 4px 0; }
  .article-toc a {
    color: var(--muted);
    text-decoration: none;
    display: block;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background .2s ease, color .2s ease;
  }
  .article-toc a:hover { background: rgba(212,175,55,0.10); color: var(--text); }

  .article-toc .toc-l1 { margin-left: 0; font-weight: 700; }
  .article-toc .toc-l2 { margin-left: 8px; }
  .article-toc .toc-l3 { margin-left: 16px; font-size: 0.95em; }
  .article-toc .toc-l4 { margin-left: 24px; font-size: 0.9em; }
}

/* Markdown 图片样式：自适应宽度、圆角与细边框，主题统一 */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(212,175,55,0.18);              /* 更柔和的边框 */
  margin: 1.8em auto;
  display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 主页三杠菜单按钮 */
.menu-toggle-btn {
  position: fixed;
  top: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(20,18,12,0.90), rgba(20,18,12,0.85));
  border: 1.5px solid rgba(212,175,55,0.45);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1000;
  backdrop-filter: saturate(1.2) blur(10px);
  padding: 0;
}

.menu-toggle-left {
  left: 20px;
}

.menu-toggle-right {
  right: 20px;
}

.menu-toggle-btn:hover {
  background: linear-gradient(180deg, rgba(212,175,55,0.25), rgba(212,175,55,0.20));
  border-color: rgba(212,175,55,0.7);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(212,175,55,0.25);
}

.menu-toggle-btn:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.menu-toggle-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  transition: stroke .2s ease;
}

.menu-toggle-btn:hover svg {
  stroke: var(--text);
}

/* 平板和手机：缩小侧边栏按钮 */
@media (max-width: 1024px) {
  .menu-toggle-btn {
    top: 12px;
    width: 40px;
    height: 40px;
  }
  
  .menu-toggle-left {
    left: 12px;
  }
  
  .menu-toggle-right {
    right: 12px;
  }
  
  .menu-toggle-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* 手机端：进一步缩小 */
@media (max-width: 768px) {
  .menu-toggle-btn {
    top: 10px;
    width: 36px;
    height: 36px;
  }
  
  .menu-toggle-left {
    left: 10px;
  }
  
  .menu-toggle-right {
    right: 10px;
  }
  
  .menu-toggle-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* 侧边栏遮罩 */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  top: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: linear-gradient(180deg, rgba(20,18,12,0.95), rgba(18,16,11,0.98));
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  z-index: 1999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  backdrop-filter: saturate(1.2) blur(20px);
}

.sidebar-left {
  left: 0;
  border-right: 1px solid rgba(212,175,55,0.35);
  transform: translateX(-100%);
  visibility: hidden;
  opacity: 0;
}

.sidebar-left.active {
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.sidebar-right {
  right: 0;
  border-left: 1px solid rgba(212,175,55,0.35);
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  transform: translateX(100%);
}

.sidebar-right.active {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(212,175,55,0.22);
  background: rgba(212,175,55,.08);
}

.sidebar-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
  font-family: 'Noto Serif SC', serif;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

.sidebar-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(212,175,55,0.3);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  padding: 0;
}

.sidebar-close:hover {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.5);
  transform: scale(1.05);
}

.sidebar-close:active {
  transform: scale(0.95);
}

.sidebar-close svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
}

.sidebar-close:hover svg {
  stroke: var(--text);
}

.sidebar-content {
  padding: 24px;
}

.stats-summary {
  margin-bottom: 32px;
  padding: 20px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 12px;
}

.stats-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stats-label {
  font-size: 0.9rem;
  color: var(--muted);
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 0.5px;
}

.stats-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  font-family: 'Noto Serif SC', serif;
  text-shadow: 0 2px 4px rgba(212,175,55,0.3);
}

.stats-section {
  margin-top: 24px;
}

.stats-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 0.3px;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(212,175,55,.06);
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 10px;
  transition: all .2s ease;
}

.stats-item:hover {
  background: rgba(212,175,55,.12);
  border-color: rgba(212,175,55,.35);
  transform: translateX(4px);
}

.stats-period {
  font-size: 0.95rem;
  color: var(--text);
  font-family: 'Noto Serif SC', serif;
  font-weight: 500;
}

.stats-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Noto Serif SC', serif;
  min-width: 32px;
  text-align: right;
}

.stats-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-family: 'Noto Serif SC', serif;
}

.stats-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* 侧边栏模块样式 */
.sidebar-module {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(212,175,55,0.15);
}

.sidebar-module:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.module-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 0.3px;
}

/* 个人资料模块 */
.profile-module {
  text-align: center;
}

.profile-avatar {
  margin-bottom: 16px;
}

.avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212,175,55,0.4);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(212,175,55,.12);
  border: 2px solid rgba(212,175,55,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: var(--muted);
}

.profile-info {
  text-align: left;
}

.profile-email {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'Noto Serif SC', serif;
}

.profile-email svg {
  flex-shrink: 0;
  stroke: var(--accent);
}

.profile-signature {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  font-style: italic;
  font-family: 'Noto Serif SC', serif;
}

.profile-signature p {
  margin: 0;
}

/* 留言模块 */
.comments-list {
  margin-bottom: 24px;
  max-height: 300px;
  overflow-y: auto;
}

/* 留言页左右布局 */
.comments-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 992px) {
  .comments-layout {
    grid-template-columns: 1fr;
  }
}

.comment-item {
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(212,175,55,.06);
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 10px;
  transition: all .2s ease;
}

.comment-item:hover {
  background: rgba(212,175,55,.1);
  border-color: rgba(212,175,55,.3);
}

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

.comment-name {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
  font-family: 'Noto Serif SC', serif;
}

.comment-time {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'Noto Serif SC', serif;
}

.comment-content {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
  font-family: 'Noto Serif SC', serif;
}

.comments-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.9rem;
}

.comments-empty p {
  margin: 0;
}

/* 留言表单 */
.comment-form-wrapper {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(212,175,55,0.15);
}

.comment-form-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px 0;
  font-family: 'Noto Serif SC', serif;
}

.comment-form .form-group {
  margin-bottom: 12px;
}

.comment-form .form-control {
  width: 100%;
  padding: 10px 12px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.3);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.9rem;
  transition: all .2s ease;
}

.comment-form .form-control:focus {
  outline: none;
  background: rgba(212,175,55,.12);
  border-color: rgba(212,175,55,.5);
  box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}

.comment-form .form-control::placeholder {
  color: var(--muted);
}

.comment-submit-btn {
  width: 100%;
  padding: 10px 16px;
  background: rgba(212,175,55,.18);
  border: 1px solid rgba(212,175,55,.5);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.comment-submit-btn:hover {
  background: rgba(212,175,55,.28);
  border-color: rgba(212,175,55,.7);
  transform: translateY(-1px);
}

.comment-submit-btn:active {
  transform: translateY(0);
}

.comment-success {
  margin-top: 12px;
  padding: 10px;
  background: rgba(212,175,55,.12);
  border: 1px solid rgba(212,175,55,.3);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.9rem;
  text-align: center;
  font-family: 'Noto Serif SC', serif;
}

.comment-success p {
  margin: 0;
}

/* 美化滚动条 - 符合暗金主题 */
.sidebar::-webkit-scrollbar,
.comments-list::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.sidebar::-webkit-scrollbar-track,
.comments-list::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: rgba(18,16,11,0.5);
  border-radius: 5px;
}

.sidebar::-webkit-scrollbar-thumb,
.comments-list::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.3);
  border-radius: 5px;
  border: 2px solid rgba(18,16,11,0.5);
  transition: background 0.2s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.comments-list::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: rgba(212,175,55,0.5);
}

.sidebar::-webkit-scrollbar-thumb:active,
.comments-list::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active {
  background: rgba(212,175,55,0.6);
}

/* Firefox滚动条样式 */
.sidebar,
.comments-list,
body {
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.3) rgba(18,16,11,0.5);
}

/* 文章页返回首页按钮 - 圆形按钮，左上角 */
.back-home-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(20,18,12,0.90), rgba(20,18,12,0.85));
  border: 1.5px solid rgba(212,175,55,0.45);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: all .3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1000;
  backdrop-filter: saturate(1.2) blur(10px);
}

.back-home-btn:hover {
  background: linear-gradient(180deg, rgba(212,175,55,0.25), rgba(212,175,55,0.20));
  border-color: rgba(212,175,55,0.7);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(212,175,55,0.25);
}

.back-home-btn:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.back-home-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  transition: stroke .2s ease;
}

.back-home-btn:hover svg {
  stroke: var(--text);
}

/* 移动端调整按钮位置 - 移到左下方 */
@media (max-width: 768px) {
  .back-home-btn {
    top: auto;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
  }
  
  .back-home-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* 小屏手机进一步调整 */
@media (max-width: 480px) {
  .back-home-btn {
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
  }
  
  .back-home-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* 导入区域样式 - 统一暗金主题 */
.import-section {
  margin-bottom: 1.5rem;
}

.import-card {
  background: linear-gradient(180deg, rgba(20,18,12,0.85), rgba(20,18,12,0.78));
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.import-card:hover {
  border-color: rgba(212,175,55,0.45);
  box-shadow: 0 14px 38px rgba(0,0,0,0.45);
}

.import-header {
  background: rgba(212,175,55,.16);
  border-bottom: 1px solid rgba(212,175,55,.22);
  padding: 14px 18px;
}

.import-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text);
  font-family: 'Noto Serif SC', serif;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

.import-body {
  padding: 18px;
}

.import-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

/* 平板及以上设备：三列布局 */
@media (min-width: 768px) {
  .import-actions {
    grid-template-columns: repeat(3, 1fr);
  }
}

.import-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-input-wrapper {
  position: relative;
  width: 100%;
}

.file-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all .2s ease;
  font-size: 0.95rem;
  font-family: 'Noto Serif SC', serif;
  min-height: 42px;
}

.file-label:hover {
  background: rgba(212,175,55,.12);
  border-color: rgba(212,175,55,.5);
}

.file-label:active {
  transform: scale(0.98);
}

.file-label-text {
  flex: 1;
  color: var(--muted);
  font-size: 0.9rem;
}

.file-label-icon {
  font-size: 1.1rem;
  margin-left: 8px;
}

.file-input:focus + .file-label {
  border-color: rgba(212,175,55,.6);
  box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}

.file-input:valid + .file-label .file-label-text {
  color: var(--accent);
  font-weight: 600;
}

/* 导入按钮样式 */
.import-btn {
  padding: 10px 16px;
  border: 1px solid rgba(212,175,55,.5);
  border-radius: 10px;
  background: rgba(212,175,55,.15);
  color: var(--text);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all .2s ease;
  backdrop-filter: saturate(1.1) blur(8px);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.import-btn:hover:not(:disabled) {
  background: rgba(212,175,55,.25);
  border-color: rgba(212,175,55,.7);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212,175,55,.2);
}

.import-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(212,175,55,.15);
}

.import-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(212,175,55,.08);
  border-color: rgba(212,175,55,.2);
}

.import-btn-markdown {
  background: rgba(212,175,55,.18);
  border-color: rgba(212,175,55,.55);
}

.import-btn-markdown:hover:not(:disabled) {
  background: rgba(212,175,55,.28);
}

.import-btn-json {
  background: rgba(212,175,55,.18);
  border-color: rgba(212,175,55,.55);
}

.import-btn-json:hover:not(:disabled) {
  background: rgba(212,175,55,.28);
}

.import-btn-export {
  background: rgba(212,175,55,.20);
  border-color: rgba(212,175,55,.6);
}

.import-btn-export:hover:not(:disabled) {
  background: rgba(212,175,55,.30);
}

.export-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.import-hint {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(212,175,55,.15);
}

.hint-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  font-family: 'Noto Serif SC', serif;
}

.hint-item:last-child {
  margin-bottom: 0;
}

.hint-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* 留言页面按钮样式 - 金色主题 */
.btn-index-other-page {
  color: var(--accent) !important;
  border-color: rgba(212,175,55,0.5) !important;
  background: rgba(18,16,11,0.6) !important;
}

/* 悬停和激活效果 */
.btn-index-other-page:hover {
  color: #faf6e8 !important;
  border-color: rgba(212,175,55,0.7) !important;
  background: rgba(212,175,55,0.15) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212,175,55,0.2);
}

/* 激活状态 */
.btn-index-other-page:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(212,175,55,0.15);
}

/* SVG 图标颜色过渡 */
.btn-index-other-page svg {
  stroke: currentColor;
  transition: stroke 0.2s ease;
}


