/* ============================================================
   zyker.cn 品牌视觉 —— 暖灰暗色 + 琥珀金
   2026-09-09
   ============================================================ */

:root {
  --wk-bg: #0d0c0a;          /* 页面背景 极深暖黑 */
  --wk-surface: #1a1816;     /* 卡片/容器背景 深灰暖调 */
  --wk-surface-2: #252220;   /* 次级容器 中深灰 */
  --wk-text: #e8e3db;        /* 正文 浅米白 */
  --wk-text-2: #a0988a;      /* 二级文字 中灰 */
  --wk-text-3: #6b6458;      /* 弱文字 暗灰 */
  --wk-accent: #d4a050;      /* 强调色/链接 暗琥珀金 */
  --wk-accent-2: #e8c06a;    /* 链接悬停 亮金 */
  --wk-border: rgba(255, 255, 255, 0.06);
  --wk-code-bg: #141210;     /* 代码块背景 极深底 */
  --wk-code-text: #e0d6c8;   /* 代码字体色 暖白 */
}

/* ---------- 1. 全局底色与文字 ---------- */
html,
body {
  background-color: var(--wk-bg) !important;
  color: var(--wk-text) !important;
}

/* 强制覆盖浅色模式下的浅底组件 */
body,
header,
footer,
main,
aside,
nav,
section,
article,
div[class*="bg-white"],
[class*="bg-slate-50"],
[class*="bg-gray-50"] {
  background-color: transparent;
}

/* 卡片/容器统一用深灰暖调 */
.rounded-xl,
.rounded-lg,
.rounded-md,
article,
aside > div,
nav > div {
  background-color: var(--wk-surface) !important;
  border-color: var(--wk-border) !important;
}

/* ---------- 2. 文字层级 ---------- */
body,
p,
li,
span,
td,
th {
  color: var(--wk-text);
}

h1, h2, h3, h4, h5, h6 {
  color: #f2ede6 !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* 弱化文字 */
.text-gray-400, .text-gray-500, .text-slate-400, .text-slate-500,
.text-gray-600, .text-slate-300 {
  color: var(--wk-text-2) !important;
}

/* ---------- 3. 链接:琥珀金 + 下划线 ---------- */
a {
  color: var(--wk-accent) !important;
  text-decoration: underline;
  text-decoration-color: rgba(212, 160, 80, 0.4);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--wk-accent-2) !important;
  text-decoration-color: var(--wk-accent-2);
}

/* 导航/按钮类链接不要下划线(它们是块级控件) */
header a, nav a, .menu-dropdown a, footer a,
a[class*="rounded"], a[class*="btn"], a[class*="inline-flex"] {
  text-decoration: none;
}
header a:hover, nav a:hover, footer a:hover {
  color: var(--wk-accent-2) !important;
}

/* ---------- 4. 文章正文排版 ---------- */
#content,
.markdown-body,
.tailwind-typography {
  max-width: 760px;          /* 最佳阅读宽度 720-780px */
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--wk-text);
}

#content p,
.markdown-body p,
.tailwind-typography p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.25em;
}

/* 标题层级:拉开差距 */
#content h1, .markdown-body h1 {
  font-size: 2.2rem; font-weight: 700; line-height: 1.3;
  margin-top: 1.6em; margin-bottom: 0.8em;
  padding-bottom: 0.4em; border-bottom: 1px solid var(--wk-border);
}
#content h2, .markdown-body h2 {
  font-size: 1.6rem; font-weight: 600; line-height: 1.4;
  margin-top: 1.5em; margin-bottom: 0.7em;
}
#content h3, .markdown-body h3 {
  font-size: 1.3rem; font-weight: 600; line-height: 1.45;
  margin-top: 1.4em; margin-bottom: 0.6em;
}
#content h4, .markdown-body h4 {
  font-size: 1.12rem; font-weight: 600;
}

/* 引用块:左侧 4px 边框 + 浅底 */
#content blockquote,
.markdown-body blockquote {
  margin: 1.5em 0;
  padding: 1em 20px;
  border-left: 4px solid var(--wk-accent);
  background-color: var(--wk-surface-2);
  border-radius: 0 8px 8px 0;
  color: var(--wk-text-2);
  font-style: normal;
}
#content blockquote p,
.markdown-body blockquote p {
  margin-bottom: 0.5em;
  color: var(--wk-text-2);
}
#content blockquote p:last-child { margin-bottom: 0; }

/* 代码块 */
#content pre,
.markdown-body pre {
  background-color: var(--wk-code-bg) !important;
  border: 1px solid var(--wk-border);
  border-radius: 8px;
  padding: 1em 1.2em;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.7;
}
#content pre code,
.markdown-body pre code,
#content code,
.markdown-body code {
  background-color: transparent !important;
  color: var(--wk-code-text) !important;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
}
/* 行内代码 */
#content p code, .markdown-body p code,
#content li code, .markdown-body li code {
  background-color: var(--wk-surface-2) !important;
  color: var(--wk-accent-2) !important;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* 表格 */
#content table, .markdown-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  margin: 1.5em 0;
}
#content th, .markdown-body th,
#content td, .markdown-body td {
  border: 1px solid var(--wk-border);
  padding: 0.6em 0.9em;
  color: var(--wk-text);
}
#content th, .markdown-body th {
  background-color: var(--wk-surface-2);
  font-weight: 600;
}

/* 图片 */
#content img, .markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5em 0;
}

/* 分割线 */
#content hr, .markdown-body hr {
  border-color: var(--wk-border);
  margin: 2em 0;
}

/* ---------- 5. 边框统一 ---------- */
hr, .border, .border-t, .border-b {
  border-color: var(--wk-border) !important;
}

/* ---------- 6. 强调色元素:精选徽章/分类高亮 ---------- */
.bg-orange-100, .bg-orange-50 {
  background-color: rgba(212, 160, 80, 0.15) !important;
}
.text-orange-700, .text-orange-600, .text-orange-500 {
  color: var(--wk-accent) !important;
}

/* ---------- 7. 代码块上方的模糊样式修正 ---------- */
pre:has(code) {
  filter: none !important;
  padding: 1em 1.2em !important;
}

/* ---------- 8. 移动端适配 ---------- */
@media (max-width: 768px) {
  #content,
  .markdown-body,
  .tailwind-typography {
    padding-left: 16px;
    padding-right: 16px;
    font-size: 1rem;
  }
  #content h1, .markdown-body h1 { font-size: 1.7rem; }
  #content h2, .markdown-body h2 { font-size: 1.35rem; }
  #content h3, .markdown-body h3 { font-size: 1.15rem; }
}

/* ---------- 9. 目录 TOC + 阅读时间 ---------- */
.zyker-reading-time {
  color: var(--wk-text-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.zyker-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
}
.zyker-toc-list li {
  margin: 0;
  padding: 0;
}
.zyker-toc-list a {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--wk-text-2) !important;
  text-decoration: none !important;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zyker-toc-list a:hover {
  color: var(--wk-accent-2) !important;
  background-color: var(--wk-surface-2);
  border-left-color: var(--wk-accent);
}
.zyker-toc-list .zyker-toc-h3 a {
  padding-left: 20px;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ---------- 10. 关于页:头像 / 标签 / 图标 / CTA ---------- */
.zyker-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a050 0%, #e8c06a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 700;
  color: #0d0c0a;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(212, 160, 80, 0.25);
}
.zyker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.zyker-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background-color: rgba(212, 160, 80, 0.12);
  border: 1px solid rgba(212, 160, 80, 0.3);
  color: var(--wk-accent) !important;
  font-size: 0.85rem;
  text-decoration: none !important;
  transition: all 0.2s ease;
}
.zyker-tag:hover {
  background-color: rgba(212, 160, 80, 0.22);
  color: var(--wk-accent-2) !important;
}
.zyker-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}
.zyker-contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background-color: var(--wk-surface-2);
  border: 1px solid var(--wk-border);
  color: var(--wk-text) !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  min-height: 44px;
}
.zyker-contact a:hover {
  border-color: var(--wk-accent);
  color: var(--wk-accent-2) !important;
}
.zyker-cta {
  margin-top: 28px;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212,160,80,0.10) 0%, rgba(212,160,80,0.03) 100%);
  border: 1px solid rgba(212, 160, 80, 0.25);
}
.zyker-cta p { margin: 0 !important; color: var(--wk-text) !important; }
.zyker-cta strong { color: var(--wk-accent); }

/* ============================================================
   首页精选区 / 最新文章 间距修正 (2026-09-09 补刀)
   ============================================================ */

/* 问题C: 精选区背景区隔(比卡片更深一级) */
.zyker-featured-panel {
  background-color: var(--wk-surface-2);
  border: 1px solid var(--wk-border);
}
.zyker-featured-item h3 {
  line-height: 1.5;
}
.zyker-featured-meta {
  margin-top: 0.35rem;
}

/* 问题B: 拉开文章卡片内部分区(标题/摘要 与 分类标签) */
/* post-card 内容容器: 子元素间距从 0.5rem 提到 1rem */
.group .space-y-2 {
  --tw-space-y-reverse: 0;
}
.group > div .space-y-2 > * + * {
  margin-top: 1rem !important;
}
/* 分类/标签行 与 标题 之间 */
.post-card-catrow,
#post-list .space-y-2 > div:first-child {
  margin-bottom: 0.2rem;
}
/* 标题与摘要之间再拉开 */
#post-list h1,
#post-list .line-clamp-2 {
  margin-top: 0.25rem;
}
/* 标签容器明确留白 */
#post-list .space-y-2 a[href*="/categories/"],
#post-list .space-y-2 a[href*="/tags/"] {
  display: inline-block;
}
