/* ============================================================
   爱洣库 imiku · 文章列表 / 详情页样式（article.css）
   依赖：base.css（变量与公共组件）、home.css（文章卡片，列表页）
   ============================================================ */

/* ------------------------------------------------------------
   顶部区（列表 / 详情共用）
   ------------------------------------------------------------ */
.article-hero {
  position: relative;
  padding: 8.5rem 0 3rem;
  overflow: hidden;
}

.article-hero-title {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: var(--text-main, rgba(200, 230, 255, 0.92));
}

.article-hero .hero-desc { max-width: 40rem; }

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--miku-blue, #66ccff);
  opacity: 0.85;
}

.article-back:hover { opacity: 1; }

/* ------------------------------------------------------------
   列表页：分类筛选 chips
   ------------------------------------------------------------ */
.article-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.8rem;
}

.article-chip {
  padding: 0.3rem 0.95rem;
  border: 1px solid rgba(102, 204, 255, 0.22);
  border-radius: 999px;
  background: rgba(10, 18, 32, 0.6);
  color: rgba(190, 222, 245, 0.78);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  transition: all 0.25s ease;
}

.article-chip:hover { border-color: rgba(102, 204, 255, 0.55); color: var(--miku-blue, #66ccff); }

.article-chip.active {
  border-color: rgba(102, 204, 255, 0.65);
  background: rgba(102, 204, 255, 0.16);
  color: var(--miku-blue, #66ccff);
  box-shadow: 0 0 16px rgba(102, 204, 255, 0.18);
}

/* ------------------------------------------------------------
   列表页：卡片链接与空态
   ------------------------------------------------------------ */
.article-card-link { display: block; height: 100%; color: inherit; }
.article-card-link:hover { color: inherit; }

.article-empty {
  padding: 4rem 1.5rem;
  text-align: center;
  color: rgba(180, 215, 240, 0.65);
}

.article-empty .article-empty-title {
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
  color: var(--text-main, rgba(200, 230, 255, 0.92));
}

/* ------------------------------------------------------------
   列表页：分页（Bootstrap pagination 深色适配）
   ------------------------------------------------------------ */
.article-pagination { margin-top: 2.8rem; }

.article-pagination .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.article-pagination .page-link {
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(102, 204, 255, 0.2);
  border-radius: 8px;
  background: rgba(10, 18, 32, 0.72);
  color: rgba(190, 222, 245, 0.8);
  font-size: 0.85rem;
}

.article-pagination .page-link:hover {
  border-color: rgba(102, 204, 255, 0.5);
  background: rgba(102, 204, 255, 0.12);
  color: var(--miku-blue, #66ccff);
}

.article-pagination .page-item.active .page-link {
  border-color: rgba(102, 204, 255, 0.6);
  background: rgba(102, 204, 255, 0.2);
  color: #e8f6ff;
}

.article-pagination .page-item.disabled .page-link { opacity: 0.4; }

/* ------------------------------------------------------------
   详情页：头部信息
   ------------------------------------------------------------ */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.article-cat {
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.article-cat.blue { background: rgba(102, 204, 255, 0.12); color: var(--miku-blue, #66ccff); }
.article-cat.pink { background: rgba(255, 119, 170, 0.12); color: var(--miku-pink, #ff77aa); }

.article-detail-title {
  margin: 0 0 1.2rem;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text-main, rgba(200, 230, 255, 0.92));
}

.article-detail-desc {
  max-width: 46rem;
  margin: 0;
  padding-left: 1rem;
  border-left: 3px solid rgba(102, 204, 255, 0.5);
  font-size: 0.95rem;
  line-height: 1.9;
  color: rgba(180, 215, 240, 0.72);
}

/* 封面 */
.article-cover {
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(102, 204, 255, 0.18);
  border-radius: 14px;
}

.article-cover img { display: block; width: 100%; height: auto; }

/* ------------------------------------------------------------
   详情页：正文排版
   ------------------------------------------------------------ */
.article-body-card { padding: clamp(1.4rem, 4vw, 2.8rem); }

.article-content {
  font-size: 1rem;
  line-height: 2;
  color: rgba(205, 230, 250, 0.86);
  word-break: break-word;
}

.article-content > :first-child { margin-top: 0; }
.article-content > :last-child { margin-bottom: 0; }

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin: 2em 0 0.7em;
  line-height: 1.45;
  font-weight: 700;
  color: #eaf6ff;
}

.article-content h1 { font-size: 1.7rem; }
.article-content h2 {
  padding-left: 0.75rem;
  font-size: 1.45rem;
  border-left: 3px solid var(--miku-blue, #66ccff);
  box-shadow: -1px 0 12px rgba(102, 204, 255, 0.35);
}
.article-content h3 { font-size: 1.22rem; }
.article-content h4 { font-size: 1.08rem; }

.article-content p { margin: 0 0 1.15em; }

.article-content a {
  color: var(--miku-blue, #66ccff);
  text-decoration: underline;
  text-decoration-color: rgba(102, 204, 255, 0.35);
  text-underline-offset: 3px;
}

.article-content a:hover { color: #a8e2ff; text-decoration-color: currentColor; }

.article-content strong, .article-content b { color: #f2fbff; }

.article-content ul,
.article-content ol { margin: 0 0 1.15em; padding-left: 1.6rem; }

.article-content li { margin: 0.3em 0; }

.article-content li::marker { color: rgba(102, 204, 255, 0.7); }

.article-content blockquote {
  margin: 0 0 1.3em;
  padding: 0.9rem 1.2rem;
  border-left: 3px solid var(--miku-pink, #ff77aa);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 119, 170, 0.07);
  color: rgba(220, 200, 215, 0.85);
}

.article-content blockquote > :last-child { margin-bottom: 0; }

.article-content pre {
  margin: 0 0 1.3em;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid rgba(102, 204, 255, 0.16);
  border-radius: 10px;
  background: rgba(4, 10, 20, 0.9);
  font-size: 0.86rem;
  line-height: 1.8;
}

.article-content code {
  padding: 0.12em 0.4em;
  border-radius: 4px;
  background: rgba(102, 204, 255, 0.1);
  color: #9fdcff;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9em;
}

.article-content pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.article-content img {
  max-width: 100%;
  height: auto;
  margin: 0.4rem 0 1.2rem;
  border: 1px solid rgba(102, 204, 255, 0.14);
  border-radius: 12px;
}

.article-content hr {
  margin: 2em 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 204, 255, 0.45), transparent);
}

.article-content table {
  width: 100%;
  margin: 0 0 1.3em;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.article-content th,
.article-content td {
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(102, 204, 255, 0.16);
  text-align: left;
}

.article-content th { background: rgba(102, 204, 255, 0.08); color: #eaf6ff; }

.article-empty-text { color: rgba(180, 215, 240, 0.6); }

/* 正文底部标签 */
.article-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px dashed rgba(102, 204, 255, 0.18);
}

/* ------------------------------------------------------------
   详情页：上一篇 / 下一篇
   ------------------------------------------------------------ */
.article-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  margin-top: 1.4rem;
}

.article-pager a {
  flex: 1 1 240px;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(102, 204, 255, 0.16);
  border-radius: 12px;
  background: rgba(10, 18, 32, 0.6);
  color: rgba(190, 222, 245, 0.8);
  font-size: 0.86rem;
  line-height: 1.6;
  transition: all 0.25s ease;
}

.article-pager a:hover {
  border-color: rgba(102, 204, 255, 0.5);
  color: var(--miku-blue, #66ccff);
  transform: translateY(-2px);
}

.article-pager .pager-next { text-align: right; }

/* ------------------------------------------------------------
   详情页：侧栏
   ------------------------------------------------------------ */
.article-side {
  position: sticky;
  top: 96px;
  padding: 1.5rem;
}

.article-side-list { margin: 0; }

.article-side-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px dashed rgba(102, 204, 255, 0.14);
  font-size: 0.85rem;
}

.article-side-item:last-child { border-bottom: 0; }
.article-side-item dt { margin: 0; color: rgba(170, 205, 230, 0.6); font-weight: normal; }
.article-side-item dd { margin: 0; color: rgba(215, 240, 255, 0.85); text-align: right; }

.article-side-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.2rem;
  color: var(--miku-blue, #66ccff);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */
@media (max-width: 991.98px) {
  .article-side { position: static; }
  .article-hero { padding-top: 7rem; }
}

/* ------------------------------------------------------------
   知识星图入口（文章列表页）
   ------------------------------------------------------------ */
.article-starmap-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.article-starmap-entry .btn-imiku-primary { display: inline-flex; align-items: center; gap: 0.4rem; }

.article-starmap-tip {
  font-size: 0.78rem;
  color: rgba(190, 222, 245, 0.55);
  letter-spacing: 0.06em;
}

/* 标签筛选区 */
.article-chips-tags { margin-top: 0.9rem; }

.article-chips-label {
  align-self: center;
  margin-right: 0.3rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: rgba(150, 190, 220, 0.5);
}

.article-chip-tag em {
  margin-left: 0.3rem;
  padding: 0 0.35rem;
  font-style: normal;
  font-size: 0.66rem;
  border-radius: 999px;
  background: rgba(102, 204, 255, 0.12);
  color: rgba(190, 225, 250, 0.75);
}

.tag-chip-link { cursor: pointer; }
.tag-chip-link:hover { border-color: rgba(102, 204, 255, 0.55); color: #bfe6ff; }

/* ------------------------------------------------------------
   正文双链
   ------------------------------------------------------------ */
.note-link {
  color: var(--miku-blue, #66ccff);
  border-bottom: 1px dashed rgba(102, 204, 255, 0.45);
  text-decoration: none;
}

.note-link:hover { color: #bfe6ff; border-bottom-style: solid; }

.note-link--missing {
  color: rgba(160, 180, 200, 0.55);
  border-bottom: 1px dotted rgba(160, 180, 200, 0.35);
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   阅读增强：进度条 / 目录 / 相关文章
   ------------------------------------------------------------ */
.article-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1080;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--miku-blue, #66ccff), rgba(255, 119, 170, 0.9));
  box-shadow: 0 0 10px rgba(102, 204, 255, 0.6);
  transition: width 0.08s linear;
}

.article-toc {
  position: sticky;
  top: 96px;
  margin-top: 1rem;
  padding: 1.2rem 1.4rem;
  max-height: calc(100vh - 140px);
  overflow: auto;
}

.article-toc-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.9;
}

.article-toc-item { color: rgba(180, 215, 240, 0.7); }
.article-toc-item.is-sub { margin-left: 0.8rem; font-size: 0.78rem; }

.article-toc-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.article-toc-link:hover {
  color: var(--miku-blue, #66ccff);
  border-bottom-color: rgba(102, 204, 255, 0.45);
}

.article-toc-fab {
  display: none;
  position: fixed;
  right: 1.1rem;
  bottom: 5.5rem;
  z-index: 1070;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(102, 204, 255, 0.35);
  background: rgba(8, 16, 28, 0.92);
  color: var(--miku-blue, #66ccff);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.article-related {
  margin-top: 1.6rem;
}

.article-related-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.article-related-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(102, 204, 255, 0.14);
  border-radius: 10px;
  background: rgba(10, 18, 32, 0.55);
  color: rgba(210, 235, 255, 0.85);
  font-size: 0.86rem;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.article-related-item:hover {
  border-color: rgba(102, 204, 255, 0.45);
  transform: translateY(-2px);
  color: #bfe6ff;
}

.article-related-meta {
  font-size: 0.74rem;
  color: rgba(160, 195, 225, 0.6);
}

@media (max-width: 991.98px) {
  .article-toc {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 5.5rem;
    top: auto;
    z-index: 1075;
    max-height: 55vh;
    display: none;
    margin-top: 0;
  }

  .article-toc.is-open { display: block; }
  .article-toc-fab { display: inline-flex; }
}

/* ------------------------------------------------------------
   详情页知识关联 / 反向链接
   ------------------------------------------------------------ */
.article-relations {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.2rem;
}

.article-relation-card { padding: 1.4rem 1.5rem; }

.article-relation-group + .article-relation-group { margin-top: 1rem; }

.article-relation-group-title {
  margin: 0 0 0.6rem;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: rgba(190, 225, 250, 0.8);
}

.article-relation-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.article-relation-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(102, 204, 255, 0.16);
  border-radius: 8px;
  background: rgba(12, 24, 38, 0.45);
}

.article-relation-item:hover { border-color: rgba(102, 204, 255, 0.42); }

.article-relation-name {
  font-size: 0.85rem;
  color: rgba(220, 242, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-relation-meta {
  font-size: 0.72rem;
  color: rgba(150, 185, 215, 0.6);
}

@media (max-width: 575.98px) {
  .article-relation-items { grid-template-columns: 1fr; }
}
