/* ============================================================
   40-article.css
   文章详情页：article-entry/inner / h2-h4 装饰 / code / table /
   blockquote / details / kbd / polaroid / archive / TOC
   依赖: 00-tokens.css
   ============================================================ */

/* 文章整体容器：合并基础结构 + box-shadow */
.article-inner {
  background: rgba(22, 27, 34, 0.82) !important;
  border: 1px solid rgba(48, 54, 61, 0.6);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 12px 36px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* 正文文字 */
.article-entry {
  color: var(--text-1) !important;
}

.article-entry p,
.article-entry li,
.article-entry td,
.article-entry th {
  color: var(--text-1) !important;
}

/* h2 — 装饰条 */
.article-entry h2 {
  color: var(--accent) !important;
  border-bottom: 1px solid rgba(88, 166, 255, 0.2) !important;
  padding-bottom: 6px;
  position: relative;
  padding-left: 14px !important;
}
.article-entry h2::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 10px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

/* h3 — 装饰条 */
.article-entry h3 {
  color: var(--accent) !important;
  position: relative;
  padding-left: 12px !important;
}
.article-entry h3::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

/* h4 */
.article-entry h4 {
  color: var(--accent) !important;
}

/* 链接：渐隐下划线动画（合并 base 颜色 + 精修动画） */
.article-entry a {
  color: var(--accent) !important;
  position: relative;
  text-decoration: none !important;
  background-image: linear-gradient(180deg, transparent 94%, rgba(88, 166, 255, 0.5) 94%);
  transition: background-size 0.3s ease, color 0.2s ease;
}

.article-entry a:hover {
  color: var(--accent-strong) !important;
  background-image: linear-gradient(180deg, rgba(88, 166, 255, 0.15) 0%, rgba(88, 166, 255, 0.15) 100%);
  border-radius: 2px;
  padding: 0 2px;
}

/* 加粗 */
.article-entry strong {
  color: var(--accent) !important;
}

/* 列表符号 */
.article-entry ul li::marker {
  color: var(--accent);
}

.article-entry ol li::marker {
  color: var(--accent);
}

/* 分隔线 */
.article-entry hr {
  border-color: rgba(48, 54, 61, 0.6) !important;
}

/* 文章标题 */
.article-inner .article-title {
  color: var(--text-0) !important;
}

/* 文章元信息 */
.article-meta {
  color: var(--text-2) !important;
}

.article-date-link {
  color: var(--text-2) !important;
}

.article-category-link {
  color: var(--accent) !important;
}

.article-category-link:hover {
  color: var(--accent-strong) !important;
}

.article-tag-list-link {
  color: var(--text-2) !important;
}

.article-tag-list-link:hover {
  color: var(--accent-strong) !important;
}

/* 文章页脚导航 */
.article-footer a {
  color: var(--accent) !important;
}

.article-footer a:hover {
  color: var(--accent-strong) !important;
}

/* ========================================
   归档页配色
   ======================================== */
.archive-section-title { color: var(--text-0) !important; }
.archive-item-link a { color: var(--text-1) !important; }
.archive-item-link a:hover { color: var(--accent) !important; }
.archive-item-date { color: var(--text-2) !important; }

/* 分类/标签页 */
.category-list-link { color: var(--accent) !important; }
.category-list-link:hover { color: var(--accent-strong) !important; }
.tag-link { color: var(--text-2) !important; }
.tag-link:hover { color: var(--accent-strong) !important; }

/* ========================================
   文章目录 TOC
   ======================================== */
#toc, .toc {
  background: rgba(22, 27, 34, 0.82) !important;
  border: 1px solid rgba(48, 54, 61, 0.6);
  border-radius: 12px;
}

/* 目录标题 */
.toc-title {
  color: var(--text-0) !important;
}

/* 一级目录 */
.toc-list > .toc-item > a {
  color: var(--accent) !important;
}

/* 二级目录 */
.toc-list > .toc-item > .toc-child > .toc-item > a {
  color: var(--accent) !important;
}

/* 三级目录 */
.toc-list > .toc-item > .toc-child > .toc-item > .toc-child > .toc-item > a {
  color: var(--text-1) !important;
}

/* 通用目录链接 */
.toc-link {
  color: var(--text-1) !important;
  transition: color 0.2s;
}

.toc-link:hover {
  color: var(--accent) !important;
}

/* 当前激活 */
.toc-link.active,
.toc-item.active > a {
  color: var(--accent) !important;
  border-left-color: var(--accent) !important;
}

/* 目录序号 */
.toc-number {
  color: var(--accent) !important;
}

/* 目录文字 */
.toc-text {
  color: inherit !important;
}

/* ========================================
   文章图文混排 — 朋友圈/日记风格
   ======================================== */

/* 图片基础样式 */
.article-entry .photo {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 8px 0;
}

.article-entry .photo:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* 右浮动图片 */
.article-entry .float-right {
  float: right;
  margin: 4px 0 16px 24px;
  shape-margin: 12px;
}

/* 左浮动图片 */
.article-entry .float-left {
  float: left;
  margin: 4px 24px 16px 0;
  shape-margin: 12px;
}

/* 拍立得风格 */
.article-entry .polaroid {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 8px 28px 8px;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  transform: rotate(-1.5deg);
  transition: transform 0.3s ease;
  display: inline-block;
}

.article-entry .polaroid:hover {
  transform: rotate(0deg) scale(1.03);
}

.article-entry .polaroid img {
  border-radius: 2px;
  display: block;
}

.article-entry .polaroid .caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 6px;
  font-style: italic;
}

/* 拍立得 — 右倾斜 */
.article-entry .polaroid.tilt-right {
  transform: rotate(2deg);
}

.article-entry .polaroid.tilt-right:hover {
  transform: rotate(0deg) scale(1.03);
}

/* 并排图片容器 */
.article-entry .photo-row {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.article-entry .photo-row .polaroid {
  flex: 1;
  min-width: 140px;
}

.article-entry .photo-row .polaroid img {
  width: 100%;
  height: auto;
}

/* 清除浮动 */
.article-entry .clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* 时间线节点标记 */
.article-entry .year-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* ============================================================
   Ledger Minimalism · 文章框体精修（v3）
   精修克制：hairline 边 + 左强调色 + 紧凑 padding，不做膨胀卡片
   ============================================================ */

/* ---------- 代码块 ---------- */
body .article-entry pre,
body .article-entry .highlight {
  margin: 0.6em 0 !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  overflow: auto !important;
  box-shadow: none !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  background: rgba(13, 17, 23, 0.72) !important;
  position: relative;
}
/* 左侧细边强调 */
body .article-entry pre::before,
body .article-entry .highlight::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(224,139,168,0.8), rgba(224,139,168,0.2));
  border-radius: 6px 0 0 6px;
}
body .article-entry pre code,
body .article-entry .chroma,
body .article-entry .chroma code {
  font-size: 0.86em !important;
  line-height: 1.65 !important;
  font-family: 'JetBrains Mono','Fira Code',ui-monospace,Menlo,monospace !important;
}
/* 行号 */
body .article-entry .chroma .lnt,
body .article-entry .chroma .ln {
  padding: 0 10px 0 2px !important;
  opacity: 0.38 !important;
  font-size: 0.92em !important;
  user-select: none;
}

/* ---------- 行内代码（保留更精确的后段定义，删早期冗余） ---------- */
body .article-entry p code,
body .article-entry li code,
body .article-entry td code {
  font-size: 0.85em !important;
  padding: 1px 6px !important;
  margin: 0 1px !important;
  background: rgba(255,255,255,0.06) !important;
  border-radius: 3px !important;
  vertical-align: baseline !important;
}

/* ---------- 引用块：deep-pink 细线，斜体 ---------- */
body .article-entry blockquote {
  margin: 0.6em 0 !important;
  padding: 2px 16px !important;
  border-left: 3px solid var(--accent) !important;
  background: transparent !important;
  color: rgba(216, 221, 230, 0.88) !important;
  font-style: italic;
  letter-spacing: 0.01em;
  border-radius: 0 !important;
}
body .article-entry blockquote p {
  margin: 0.3em 0 !important;
  line-height: 1.72 !important;
  color: var(--text-1) !important;
}
body .article-entry blockquote > *:first-child { margin-top: 0 !important; }
body .article-entry blockquote > *:last-child  { margin-bottom: 0 !important; }

/* ---------- 表格：只留横线，克制 ---------- */
body .article-entry table {
  width: 100% !important;
  margin: 0.6em 0 !important;
  border-collapse: collapse !important;
  background: transparent !important;
  border: none !important;
  font-size: 0.94em !important;
}
body .article-entry table th,
body .article-entry table td {
  padding: 5px 12px !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  line-height: 1.55 !important;
  vertical-align: top !important;
}
body .article-entry table thead th {
  color: var(--accent) !important;
  font-weight: 500 !important;
  text-align: left !important;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(224, 139, 168, 0.35) !important;
  background: transparent !important;
  font-size: 0.88em !important;
  text-transform: none;
}
body .article-entry table tbody tr:last-child td { border-bottom: none !important; }
body .article-entry table tbody tr:hover { background: rgba(255,255,255,0.025) !important; }

/* ---------- details 折叠 ---------- */
body .article-entry details {
  margin: 0.6em 0 !important;
  padding: 4px 12px !important;
  background: transparent !important;
  border: none !important;
  border-left: 2px solid rgba(255,255,255,0.12) !important;
  border-radius: 0 !important;
  transition: border-color 0.25s ease;
}
body .article-entry details[open] {
  border-left-color: var(--accent) !important;
}
body .article-entry details summary {
  padding: 2px 0 2px 16px !important;
  color: #d8dde6 !important;
  font-weight: 500 !important;
  cursor: pointer;
  list-style: none !important;
  position: relative;
  outline: none;
}
body .article-entry details summary::-webkit-details-marker { display: none; }
body .article-entry details summary::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 0.82em;
  transition: transform 0.2s ease;
}
body .article-entry details[open] summary::before {
  transform: translateY(-50%) rotate(90deg);
}
body .article-entry details > *:not(summary) {
  margin-top: 0.5em !important;
}

/* ---------- kbd 按键：拟物双色边 ---------- */
body .article-entry kbd {
  display: inline-block;
  padding: 1px 6px !important;
  margin: 0 2px !important;
  font-family: 'JetBrains Mono',ui-monospace,monospace !important;
  font-size: 0.78em !important;
  line-height: 1.4;
  color: #e0e6ef !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 3px !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4), inset 0 -1px 0 rgba(255,255,255,0.08) !important;
  vertical-align: baseline !important;
}

/* ---------- 段落 / 列表节奏 ---------- */
body .article-entry > p,
body .article-entry > ul,
body .article-entry > ol {
  margin: 0.7em 0 !important;
  line-height: 1.85 !important;
}
body .article-entry > blockquote {
  margin: 1em 0 !important;
}
body .article-entry ul,
body .article-entry ol {
  padding-left: 1.4em !important;
}
body .article-entry li {
  margin: 0.15em 0 !important;
  line-height: 1.78 !important;
}
body .article-entry li > p { margin: 0.2em 0 !important; }
body .article-entry li ul,
body .article-entry li ol { margin: 0.2em 0 !important; }

/* ---------- 标题节奏 ---------- */
body .article-entry h2 { margin-top: 1.5em !important; margin-bottom: 0.5em !important; }
body .article-entry h3 { margin-top: 1.2em !important; margin-bottom: 0.4em !important; }
body .article-entry h4 { margin-top: 1em !important;   margin-bottom: 0.3em !important; }

/* 标题与紧邻第一个内容节距收紧 */
body .article-entry h2 + pre,
body .article-entry h3 + pre,
body .article-entry h2 + .highlight,
body .article-entry h3 + .highlight,
body .article-entry h2 + table,
body .article-entry h3 + table,
body .article-entry h2 + blockquote,
body .article-entry h3 + blockquote { margin-top: 0.5em !important; }
