:root {
  --bg: #0d1117;
  --card-bg: #161b22;
  --card-bg-hover: #1c2129;
  --text: #e6edf3;
  --muted: #8b949e;
  --border: #30363d;
  --primary: #1896DA;          /* 改为新强调色 */
  --primary-dark: #1478B3;     /* 对应深色版本 */
  --red: #f85149;
  --yellow-bg: #2d2a1e;
  --yellow-border: #d29922;
  --yellow-text: #e3b341;
  --blue-bg: #1c2a3a;
  --blue-border: #58a6ff;      /* 保持不变，若想统一也可改为 #1896DA 或类似 */
  --blue-text: #79c0ff;
  --red-bg: #2d1b1b;
  --red-border: #f85149;
  --red-text: #ff7b72;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.5);
  --code-bg: #0d1117;
  --code-inline-bg: #21262d;
  --input-bg: #0d1117;
  --header-bg: rgba(13, 17, 23, 0.40);
  --header-border: rgba(48, 54, 61, 0.5);
  --bg-secondary: #21262d;
  --bg-hover: #30363d;
  --border-hover: #3d444d;
  --btn-danger-bg: #b62324;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f8f9fa;                /* 极浅灰白 */
  --card-bg: #ffffff;
  --card-bg-hover: #f1f3f5;
  --text: #212529;              /* 深灰，不刺眼 */
  --muted: #6c757d;
  --border: #dee2e6;
  --primary: #0d6efd;           /* 标准蓝 */
  --primary-dark: #0a58ca;
  --red: #dc3545;
  --yellow-bg: #fff3cd;
  --yellow-border: #ffc107;
  --yellow-text: #856404;
  --blue-bg: #cfe2ff;
  --blue-border: #0d6efd;
  --blue-text: #084298;
  --red-bg: #f8d7da;
  --red-border: #dc3545;
  --red-text: #842029;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.1);
  --code-bg: #f1f3f5;
  --code-inline-bg: #e9ecef;
  --input-bg: #ffffff;
  --header-bg: rgba(248, 249, 250, 0.8);
  --header-border: rgba(222, 226, 230, 0.5);
  --bg-secondary: #e9ecef;
  --bg-hover: #dee2e6;
  --border-hover: #ced4da;
  --btn-danger-bg: #bb2d3b;

  color-scheme: light;
}

:root[data-theme="OLED"] {
  /* ===== OLED 纯黑背景 ===== */
  --bg: #000000;                /* 纯黑背景，省电且对比度最高 */
  --card-bg: #0a0a0a;           /* 极深灰，略高于纯黑以区分卡片 */
  --card-bg-hover: #141414;     /* 悬停时稍微提亮 */
  --text: #e6edf3;              /* 保持亮白文字，高对比 */
  --muted: #8b949e;             /* 辅助文字保持灰色 */
  --border: #1f1f1f;            /* 深灰边框，弱化但保留边界 */
  --primary: #1896DA;           /* 强调色保持不变 */
  --primary-dark: #1478B3;
  --red: #f85149;
  --yellow-bg: #2d2a1e;
  --yellow-border: #d29922;
  --yellow-text: #e3b341;
  --blue-bg: #1c2a3a;
  --blue-border: #58a6ff;
  --blue-text: #79c0ff;
  --red-bg: #2d1b1b;
  --red-border: #f85149;
  --red-text: #ff7b72;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.6);      /* 阴影更深，凸显层次 */
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.8);
  --code-bg: #0a0a0a;           /* 代码块背景与卡片一致 */
  --code-inline-bg: #1a1a1a;    /* 行内代码背景略亮于卡片 */
  --input-bg: #0a0a0a;          /* 输入框背景同卡片 */
  --header-bg: rgba(0, 0, 0, 0.7);   /* 导航栏半透明纯黑 */
  --header-border: rgba(31, 31, 31, 0.5);
  --bg-secondary: #1a1a1a;      /* 按钮、表头、标签背景 */
  --bg-hover: #2a2a2a;          /* 悬停状态 */
  --border-hover: #3a3a3a;      /* 悬停边框 */
  --btn-danger-bg: #b62324;

  color-scheme: dark;           /* 浏览器控件跟随深色 */
}

/* ========== 初音未来主题 ========== */
:root[data-theme="miku"] {
  --bg: #e8f5f7;                /* 浅青白背景 */
  --card-bg: #ffffff;
  --card-bg-hover: #f0fbfc;
  --text: #2c3e50;
  --muted: #7f8c8d;
  --border: #b2dfdb;
  --primary: #00a2ae;           /* 葱绿色 */
  --primary-dark: #00838f;
  --red: #e74c3c;
  --yellow-bg: #fef9e7;
  --yellow-border: #f1c40f;
  --yellow-text: #9a7d0a;
  --blue-bg: #e0f7fa;
  --blue-border: #00bcd4;
  --blue-text: #006064;
  --red-bg: #fdedec;
  --red-border: #e74c3c;
  --red-text: #c0392b;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --code-bg: #f0f4f5;
  --code-inline-bg: #e0f2f1;
  --input-bg: #ffffff;
  color-scheme: light;
  /* 新增变量 - Miku 主题浅色值 */
  --header-bg: rgba(232, 245, 247, 0.4);
  --header-border: rgba(178, 223, 219, 0.5);
  --bg-secondary: #eef2f2;
  --bg-hover: #d5e5e5;
  --border-hover: #90a9a6;
  --btn-danger-bg: #c0392b;
}

* { box-sizing: border-box; }

body {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 20px 20px;   /* 上边距从 20px 改为 30px */
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);

  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body, .card, .btn, .tag, .hint, .comment-item, footer, header,
.list-item, .code-copy-btn, .post-card, .pagination a,
input, textarea, select {
  transition: background-color 0.25s ease,
              color 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              opacity 0.25s ease;
}

main {
  flex: 1;
  margin-top: 10px;
}

header,
footer {
  flex-shrink: 0;
}

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

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--header-border);
}

/* 导航 */
header nav {
  display: flex;
  align-items: center;
  gap: 15px;               /* 链接之间的间距 */
  padding: 15px 10px;
}
header nav a {
  font-weight: 600;
  color: var(--text);
}
header nav a:hover {
  color: var(--primary);
}

/* 卡片 */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
  /*transition: box-shadow 0.2s, border-color 0.2s;*/
}
.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary);
  padding-left: 10px;
  color: var(--text);
}

/* 提示条 */
.hint {
  padding: 10px 15px;
  border-radius: 6px;
  margin: 10px 0;
  line-height: 1.5;
  font-size: 0.95rem;
}
.hint-blue {
  background: var(--blue-bg);
  color: var(--blue-text);
  border-left: 4px solid var(--blue-border);
}
.hint-yellow {
  background: var(--yellow-bg);
  color: var(--yellow-text);
  border-left: 4px solid var(--yellow-border);
}
.hint-red {
  background: var(--red-bg);
  color: var(--red-text);
  border-left: 4px solid var(--red-border);
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
  /*transition: background 0.2s, border-color 0.2s;*/
  margin: 2px;
}
.btn:hover {
  background: var(--bg-hover);
  border-color: var(--muted);
  text-decoration: none;
}
.btn-highlight {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.btn-highlight:hover {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-red {
  background: var(--btn-danger-bg);
  border-color: var(--btn-danger-bg);
  color: #fff;
}
.btn-red:hover {
  background: var(--red);
  border-color: var(--red);
}
.btn-text {
  background: none;
  color: var(--primary);
  padding: 5px 15px;
  border: none;
  cursor: pointer;
}
.btn-text:hover {
  text-decoration: underline;
}

/* 列表项 */
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 10px 0;
  /*transition: background 0.2s, border-color 0.2s;*/
}
.list-item:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-hover);
}
.list-item .logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  margin-right: 15px;
  object-fit: cover;
}
.list-item .content {
  flex: 1;
}
.list-item .title {
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.list-item .info {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* 横向布局 */
.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* 文本辅助 */
.text-muted { color: var(--muted); }
.center { text-align: center; }

/* 文章详情内容 */
.content {
  margin-top: 20px;
}
.content h1, .content h2, .content h3, .content h4 {
  padding-bottom: 0.2em;
  color: var(--text);
}
.content pre {
  background: var(--code-bg);
  padding: 14px;
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.content code {
  background: var(--code-inline-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--text);
}
.content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}
.content blockquote {
  border-left: 4px solid var(--border-hover);
  padding-left: 15px;
  color: var(--muted);
  margin-left: 0;
}
.content img {
  max-width: 100%;
  border-radius: 6px;
}
.content table {
  border-collapse: collapse;
  width: 100%;
}
.content th, .content td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
}
.content th {
  background: var(--bg-secondary);
}
.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* 评论区域 */
.comments form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.comments input[type="text"],
.comments textarea {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  resize: vertical;
}
.comments input[type="text"]:focus,
.comments textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.comment-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.comment-item:last-child {
  border-bottom: none;
}
.comment-item .comment-author {
  font-weight: 700;
  margin-right: 10px;
  color: var(--text);
}
.comment-item .comment-date {
  color: var(--muted);
  font-size: 0.85rem;
}
.comment-item p {
  margin: 5px 0 0 0;
}

/* 表单输入（编辑页） */
input[type="text"],
input[type="file"],
select,
textarea {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  font-family: inherit;
  width: 100%;
  margin-bottom: 15px;
}
input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* 页脚 */
footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ========== EasyMDE 暗色主题覆盖 ========== */
.EasyMDEContainer .CodeMirror {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}
.EasyMDEContainer .CodeMirror-cursor {
  border-left: 1px solid var(--text);
}
.EasyMDEContainer .editor-toolbar {
  border-color: var(--border);
  background: var(--bg-secondary);
}
.EasyMDEContainer .editor-toolbar button {
  color: var(--text) !important;
}
.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
  background: var(--bg-hover);
  border-color: var(--border);
}
.EasyMDEContainer .editor-preview {
  background: var(--card-bg);
  color: var(--text);
}
.EasyMDEContainer .editor-preview pre {
  background: var(--code-bg);
}
.EasyMDEContainer .editor-preview code {
  background: var(--code-inline-bg);
  color: var(--text);
}
.EasyMDEContainer .editor-statusbar {
  color: var(--muted);
  border-color: var(--border);
}

/* 管理表格 */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th, .admin-table td {
  border: 1px solid var(--border);
  padding: 10px;
  text-align: left;
}
.admin-table th {
  background: var(--bg-secondary);
  color: var(--text);
}
.admin-table tr:nth-child(even) {
  background: var(--card-bg-hover);
}

/* 代码块复制按钮 */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--muted);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.7;
  /*transition: opacity 0.2s;*/
}
.code-copy-btn:hover {
  opacity: 1;
}


.comment-fingerprint {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.7rem;
  opacity: 0.45;
  cursor: help;
  user-select: none;
}
.comment-fingerprint:hover {
  opacity: 0.8;
}


/* 标签 */
.tags {
  margin: 10px 0;
}
.tag {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-right: 6px;
  border: 1px solid var(--border);
  /*transition: background 0.2s, border-color 0.2s;*/
}
.tag:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  text-decoration: none;
  color: var(--blue-text);  /* 保持原样，也可用 var(--primary) 但原为 #79c0ff，这里不变 */
}

/* 搜索框 */
/* 搜索框靠右 */
.search-form {
  margin-left: auto;         /* 将搜索框推到最右侧 */
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form input[type="text"] {
  width: 220px;
  padding: 8px 12px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.search-form input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

.search-form button {
  margin: 0;
  flex-shrink: 0;
}

/* 反馈卡片 */
.feedback-card {
  margin-top: 30px;
  padding: 15px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.feedback-question {
  margin: 0 0 10px 0;
  font-weight: 600;
}
.feedback-form {
  display: flex;
  gap: 10px;
}
.feedback-thanks {
  color: var(--muted);
}
.feedback-stats {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 10px 0 0 0;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}
.meta-row p {
  margin: 0;
}

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

/* ========== 移动端响应式 ========== */

/* 小屏幕手机（宽度小于 600px） */
@media screen and (max-width: 600px) {
  body {
    padding: 12px;
    max-width: 100%;
  }

  /* 导航栏：允许换行，调整间距 */
  header nav {
    flex-wrap: nowrap;          /* 禁止换行 */
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 20px;
  }

  header nav a {
    font-size: 0.9rem;
    white-space: nowrap;        /* 防止链接文字换行 */
    flex-shrink: 0;             /* 链接不缩小 */
  }

  
  /* 卡片：减少内边距 */
  .card {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
  }
  .card-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    padding-left: 8px;
  }

  /* 文章标题 */
  h1 {
    font-size: 1.5rem;
  }
  h2 {
    font-size: 1.2rem;
  }

  /* 代码块：允许横向滚动，字体稍小 */
  .content pre {
    padding: 10px;
    font-size: 0.85rem;
    border-radius: 4px;
  }
  .content code {
    font-size: 0.8rem;
  }

  /* 表格：允许横向滚动 */
  .content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* 图片：圆角减小 */
  .content img,
  .post-image {
    border-radius: 4px;
  }

  /* 按钮：全宽显示更易点击 */
  .btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    margin: 4px 0;
  }

  /* 反馈按钮组 */
  .feedback-actions {
    flex-direction: column;
    gap: 8px;
  }
  .feedback-actions .btn {
    width: 100%;
  }

  /* 标签 */
  .tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    margin-right: 4px;
  }

  /* 评论区 */
  .comments input[type="text"],
  .comments textarea {
    font-size: 0.95rem;
    padding: 8px;
  }
  .comment-item {
    padding: 10px 0;
  }

  /* 首页文章卡片内部的按钮行 */
  .flex-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .flex-row .btn {
    width: 100%;
  }

  /* 管理表格：允许横向滚动 */
  .admin-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* 搜索框 */
  .search-form {
    margin-left: auto;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  /* 输入框：自动填充可用宽度 */
  .search-form input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding: 6px 8px;
    font-size: 0.85rem;
    border-radius: 4px;
  }

  /* 按钮：紧凑，不抢占过多空间 */
  .search-form button {
    flex: 0 0 auto;            /* 不拉伸、不收缩，宽度由内容决定 */
    width: auto;               /* 确保宽度自适应内容 */
    padding: 6px 12px;         /* 适当的内边距，不要太大 */
    font-size: 0.85rem;        /* 较小的字体 */
    border-radius: 4px;
    white-space: nowrap;       /* 防止文字换行 */
  }
}

/* 中等屏幕（平板，601px ~ 900px） */
@media screen and (min-width: 601px) and (max-width: 900px) {
  body {
    padding: 20px;
    max-width: 100%;
  }

  .card {
    padding: 18px;
  }

  .btn {
    padding: 9px 18px;
  }

  .feedback-actions {
    gap: 10px;
  }

  .search-form input[type="text"] {
    width: 180px;
  }
}

@media (max-width: 600px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}
.post-card {
  display: flex;
  flex-direction: column;
}
.post-image {
  max-height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 15px;
}

/* LQIP 模糊占位：先显示模糊小图，主图加载完成后淡入（由模糊到清晰） */
.lqip-img {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}
.lqip-placeholder {
  display: block;
  width: 100%;
  height: auto;
  filter: blur(18px);
  transform: scale(1.15);
}
.lqip-full {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lqip-full.loaded {
  opacity: 1;
}

/* 列表卡片版：固定 200px 高度，占位图与主图都用 object-fit: cover 同样裁切 */
.lqip-img-card {
  height: 200px;
  margin-bottom: 15px;
}
.lqip-img-card .lqip-placeholder {
  height: 100%;
  object-fit: cover;
}
.list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.sort-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-form label {
  font-size: 0.9rem;
  line-height: 1;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}
.sort-form select {
  height: 30px;
  line-height: 30px;
  padding: 0 10px;
  margin: 0;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.pagination {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  justify-content: center;
  align-items: center;
}
.pagination a, .pagination span {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
}
.pagination a:hover {
  background: var(--bg-secondary);
}
.pagination .disabled {
  opacity: 0.5;
  pointer-events: none;
}
/* ========== 分类导航（列表页） ========== */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
  align-items: center;
}
.category-nav .tag {
  margin: 0;
}
.tag-active {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
}
.tag-active:hover {
  color: #fff;
  background: var(--primary);
}
.tag-category {
  border-style: dashed;
  border-color: var(--primary);
}

/* ========== 楼中楼回复 ========== */
.comment-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}
.comment-reply-btn {
  font-size: 0.8rem;
  padding: 2px 8px;
  opacity: 0.6;
}
.comment-reply-btn:hover {
  opacity: 1;
}
.comment-replies {
  margin: 8px 0 0 20px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
}
.comment-reply {
  border-bottom: 1px dashed var(--border);
  padding: 8px 0;
}
.comment-reply:last-child {
  border-bottom: none;
}
#reply-form {
  gap: 8px;
}

/* ========== 上一篇 / 下一篇 + 相关文章 ========== */
.prev-next-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}
.prev-next-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
  color: var(--text);
  text-decoration: none;
}
.prev-next-card:hover {
  text-decoration: none;
}
.prev-next-card.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.related-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
}
.related-item:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-hover);
  text-decoration: none;
}
.related-title {
  font-weight: 600;
}
.related-excerpt {
  font-size: 0.85rem;
}

/* ========== 移动端适配 ========== */
@media screen and (max-width: 600px) {
  .prev-next-nav {
    grid-template-columns: 1fr;
  }
  .comment-replies {
    margin-left: 10px;
    padding-left: 10px;
  }
}
/* ========== 阅读进度条 ========== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #58a6ff);
  z-index: 2000;
  transition: width 0.1s linear;
}

/* ========== 文章目录（TOC） ========== */
/* 移动端：显示在标题下方，默认折叠（details 由 JS 控制 open） */
.toc-wrap {
  display: none;
}
.toc-wrap.has-toc {
  display: block;
  margin: 0 0 20px 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
}
/* 桌面宽屏：固定侧边栏，位于内容区右侧，默认展开 */
@media screen and (min-width: 1360px) {
  .toc-wrap.has-toc {
    position: fixed;
    top: 90px;
    left: calc(50% + 470px);
    width: 230px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    margin: 0;
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow);
  }
}
.toc-wrap details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}
.toc-wrap nav ul {
  list-style: none;
  margin: 10px 0 0 0;
  padding-left: 12px;
}
.toc-wrap nav li {
  margin: 4px 0;
  line-height: 1.5;
}
.toc-wrap nav li.toc-h3 {
  padding-left: 14px;
  font-size: 0.9rem;
}
.toc-wrap nav a {
  color: var(--muted);
  text-decoration: none;
}
.toc-wrap nav a:hover {
  color: var(--primary);
  text-decoration: underline;
}
/* 目录当前阅读标题高亮 */
.toc-wrap nav a.toc-active {
  color: var(--primary);
  font-weight: 600;
}

/* 文章列表页标题行 + 深度搜索入口 */
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.list-head .card-title {
  margin-bottom: 15px;
}
.hint-actions {
  margin-left: 10px;
  white-space: nowrap;
}
.hint-actions .btn-text {
  padding: 0 2px;
  font-size: 0.9rem;
}
.hint-actions a {
  margin-right: 8px;
}


/* 锚点跳转平滑滚动，并避开吸顶导航栏 */
html {
  scroll-behavior: smooth;
}
/* ========== 深度搜索提示框 ========== */
.deep-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 20px;
}
.deep-search-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-hover);
}
.deep-search-box input[type="text"] {
  width: 100%;
  margin: 10px 0;
}
/* ========== 置顶勾选框 ========== */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  width: auto;
}
.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}


.content h1, .content h2, .content h3, .content h4 {
  scroll-margin-top: 80px;
}
/* ========== 评论字数统计 ========== */
.comment-count-row {
  text-align: right;
  margin: -6px 0 0 0;
}
.comment-count-row .text-muted {
  font-size: 0.8rem;
}
.comment-count-row .over-limit {
  color: var(--red-text);
  font-weight: 600;
}
/* ========== 禁用按钮：显著置灰（不同意指纹时） ========== */
.btn:disabled,
.btn[disabled],
.btn.disabled {
  background: var(--bg-secondary) !important;
  color: var(--muted) !important;
  border-color: var(--border) !important;
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn:disabled:hover,
.btn[disabled]:hover {
  background: var(--bg-secondary) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
  text-decoration: none;
}

/* ========== 反馈按钮指纹提示小字（仅未投票时显示） ========== */
.feedback-fp-note {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
/* ========== 代码块语言标签 ========== */
.code-lang {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  opacity: 0.75;
  pointer-events: none;
}
/* ========== 图片点击放大 ========== */
.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  cursor: zoom-out;
}
.img-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}






