﻿/* ============================================================
   嘉华数字科技 - 简约高级定制
   大留白 · 克制红 · 干净字体 · 扁平
   ============================================================ */

:root {
  --jh-primary: #1a1a1a;        /* 主色：深灰黑（豆瓣风克制） */
  --jh-primary-dark: #000000;   /* 深色 悬浮 */
  --jh-accent: #c0392b;         /* 品牌红（仅 logo/强调少量用） */
  --jh-text: #1c1917;           /* 主文本（暖黑） */
  --jh-text-soft: #999999;      /* 次级文本（浅灰，豆瓣式） */
  --jh-line: #e0e0e0;           /* 分隔线 */
  --jh-bg: #ffffff;             /* 背景 */
}

/* ---------- 主色替换：indigo/blue -> 红 ---------- */
.text-indigo-400, .text-indigo-500,
.text-blue-600, .text-blue-500, .text-blue-400,
.text-red-600, .text-red-500 {
  color: var(--jh-primary) !important;
}
.hover\:text-blue-600:hover, .hover\:text-indigo-500:hover,
.hover\:text-indigo-600:hover {
  color: var(--jh-primary-dark) !important;
}
.bg-indigo-600, .bg-indigo-500, .bg-indigo-400,
.bg-blue-600, .bg-blue-500 {
  background-color: var(--jh-primary) !important;
}
.hover\:bg-indigo-600:hover, .hover\:bg-indigo-700:hover,
.hover\:bg-blue-600:hover {
  background-color: var(--jh-primary-dark) !important;
}
.border-indigo-400, .border-indigo-500, .border-indigo-600,
.border-blue-500, .border-blue-600 {
  border-color: var(--jh-primary) !important;
}
.ring-indigo-600, .focus\:ring-indigo-600, .focus\:border-indigo-500 {
  --tw-ring-color: var(--jh-primary) !important;
  border-color: var(--jh-primary) !important;
}

/* ---------- 背景：纯白干净 ---------- */
body {
  background-color: var(--jh-bg) !important;
  font-size: 18px !important;
}
.dark body {
  background-color: #171412 !important;
}

/* ---------- 扁平化：无阴影，细分隔线 ---------- */
.shadow-sm, .shadow-md, .shadow-lg, .shadow-xl {
  box-shadow: none !important;
  border: 1px solid var(--jh-line) !important;
}
.dark .shadow-sm, .dark .shadow-md, .dark .shadow-lg, .dark .shadow-xl {
  border-color: #292524 !important;
}
.rounded-xl, .rounded-2xl, .rounded-3xl {
  border-radius: 4px !important;
}
.rounded, .rounded-lg {
  border-radius: 3px !important;
}

/* ---------- 文字色：暖黑 / 暖灰 ---------- */
.text-gray-900, .text-gray-800, .text-slate-900, .text-slate-800, .text-slate-700 {
  color: var(--jh-text) !important;
}
.text-gray-600, .text-gray-500, .text-slate-600, .text-slate-500 {
  color: var(--jh-text-soft) !important;
}
.dark .text-gray-900, .dark .text-gray-800, .dark .text-slate-900, .dark .text-slate-800 {
  color: #f5f0ec !important;
}
.dark .text-gray-600, .dark .text-slate-600 {
  color: #a8a29e !important;
}

/* ---------- 品牌站名（导航）：克制红，清爽 ---------- */
#site-title {
  color: var(--jh-text) !important;
  font-weight: 700;
  font-size: 1.5rem !important;
  letter-spacing: 0.02em;
}
#site-title::after {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--jh-primary) 0%, var(--jh-primary) 40%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
#site-title:hover::after {
  opacity: 1;
}

/* ---------- 导航菜单 ---------- */
#header-menu ul li a {
  font-size: 1.05rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em;
}
#header-menu a:hover {
  color: var(--jh-primary) !important;
}

/* ---------- 首页 hero：保留背景图 + 精致标题 ---------- */
section > div[style*="background-image"] {
  position: relative !important;
  overflow: hidden !important;
}
section > div[style*="background-image"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 0;
}
section > div[style*="background-image"] .text-5xl,
section > div[style*="background-image"] span.text-5xl {
  font-size: 3.5rem !important;      /* 56px 适中 */
  line-height: 1.15 !important;
  font-weight: 700 !important;       /* 粗体更有力 */
  letter-spacing: 0.06em !important;
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}
section > div[style*="background-image"] span.text-5xl:first-of-type {
  color: #ffffff !important;
}
section > div[style*="background-image"] span.text-5xl:first-of-type::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 18px auto 0;
  background: linear-gradient(90deg, var(--jh-primary), var(--jh-primary-dark));
}
section > div[style*="background-image"] span.text-sm {
  font-size: 1rem !important;
  letter-spacing: 0.24em !important;
  color: #f5f0ec !important;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
section > div[style*="background-image"].h-96 {
  min-height: 26rem !important;
}

/* ---------- 文章列表 ---------- */
#post-list .group {
  border: none !important;
  border-bottom: 1px solid var(--jh-line) !important;
  border-radius: 0 !important;
  transition: all 0.25s ease !important;
  padding-bottom: 1.5rem !important;
}
#post-list .group:hover {
  border-bottom-color: var(--jh-primary) !important;
  transform: none !important;
  box-shadow: none !important;
}
#post-list h1 {
  font-size: 1.6rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}
#post-list h1 a:hover {
  color: var(--jh-primary) !important;
}
#post-list .text-gray-600,
#post-list .text-gray-800,
#post-list .text-sm {
  font-size: 1rem !important;
}

/* ---------- 分类筛选 ---------- */
#filters a span {
  font-size: 1rem !important;
  font-weight: 400 !important;
}
#filters a[class*="!bg-gray-100"] {
  background: var(--jh-primary) !important;
  color: #fff !important;
}
#filters a[class*="!bg-gray-100"]:hover {
  background: var(--jh-primary-dark) !important;
}

/* ---------- 链接 ---------- */
a:hover {
  color: var(--jh-primary) !important;
}

/* ---------- 文章标题 hover ---------- */
.post-title a:hover {
  color: var(--jh-primary) !important;
}

/* ============================================================
   移动端阅读优化（手机/平板）
   ============================================================ */

/* 手机端：导航站名大小 */
@media (max-width: 640px) {
  #site-title {
    font-size: 1.25rem !important;
  }
  #header-menu ul li a {
    font-size: 0.95rem !important;
  }
}

/* 手机端：hero 标题缩小，避免溢出 */
@media (max-width: 640px) {
  section > div[style*="background-image"] .text-5xl,
  section > div[style*="background-image"] span.text-5xl {
    font-size: 2.2rem !important;      /* 35px */
    letter-spacing: 0.04em !important;
    text-align: center !important;
    padding: 0 0.5rem !important;
  }
  section > div[style*="background-image"] span.text-5xl:first-of-type::after {
    margin: 14px auto 0 !important;
  }
  section > div[style*="background-image"] span.text-sm {
    font-size: 0.8rem !important;
    letter-spacing: 0.16em !important;
  }
  section > div[style*="background-image"].h-96 {
    min-height: 20rem !important;
  }
}

/* 手机端：文章列表标题大小 */
@media (max-width: 640px) {
  #post-list h1 {
    font-size: 1.3rem !important;
  }
  #post-list .text-gray-600,
  #post-list .text-gray-800,
  #post-list .text-sm {
    font-size: 0.9rem !important;
  }
}

/* 手机端：侧栏隐藏，主体占满 */
@media (max-width: 1024px) {
  section[class*="max-w-7xl"] {
    flex-direction: column !important;
  }
}

/* 手机端：文章正文阅读体验 */
@media (max-width: 640px) {
  .prose, .content, article .content, .markdown-body,
  .article-content, [class*="prose"] {
    font-size: 16.5px !important;
    line-height: 1.75 !important;
    padding: 0 0.25rem !important;
  }
  .prose h1 { font-size: 1.5rem !important; }
  .prose h2 { font-size: 1.3rem !important; }
  .prose h3 { font-size: 1.15rem !important; }
}

/* 手机端：图片自适应 */
@media (max-width: 640px) {
  img { height: auto !important; }
  article img, .article-content img, .markdown-body img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* 手机端：顶部间距 */
@media (max-width: 640px) {
  section[class*="mt-6"] {
    margin-top: 1rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* 手机端：分类筛选按钮可横向滚动 */
@media (max-width: 640px) {
  #filters {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem !important;
  }
  #filters::-webkit-scrollbar {
    display: none;
  }
}

/* ============================================================
   豆瓣风排版（保留红色品牌色）
   紧凑信息 · 列表化 · 标题/摘要对比 · 虚线分隔 · 浅灰辅助
   ============================================================ */

/* 页面底色：柔白，比纯白更温和 */
body {
  background-color: #fafaf8 !important;
}

/* 正文基准字号 16px，行高舒适 */
body {
  font-size: 16px !important;
}

/* ---------- 模块标题：豆瓣式「标题 ····」 ---------- */
.um-section-title {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #333 !important;
  letter-spacing: 0.03em;
}
.um-section-title::before {
  content: none !important;
}
.um-section-title::after {
  content: "········";
  color: #c0392b;
  font-weight: 400;
  margin-left: 6px;
  letter-spacing: 1px;
  font-size: 13px;
}

/* ---------- 推文/资讯卡片：豆瓣广播式列表 ---------- */
.um-post-card {
  background: #fff !important;
  border: none !important;
  border-bottom: 1px dashed #e0e0e0 !important;
  border-radius: 0 !important;
  padding: 16px 4px !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
  transition: background 0.2s !important;
}
.um-post-card:hover {
  background: #f6f6f3 !important;
  box-shadow: none !important;
  transform: none !important;
}
/* 作者行：浅灰小字 */
.um-post-card .um-comment-nick {
  color: #666 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}
.um-post-card .um-comment-time,
.um-post-card .um-views-badge {
  color: #999 !important;
  background: transparent !important;
  border: none !important;
  font-size: 12px !important;
  padding: 0 !important;
}
/* 标题：大号加粗、醒目，与摘要拉开间距 */
.um-post-card .um-post-title {
  color: #111 !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 8px 0 10px !important;
  letter-spacing: 0.01em !important;
}
.um-post-card .um-post-title:hover {
  color: #1a1a1a !important;
  text-decoration: underline !important;
  text-underline-offset: 4px !important;
  text-decoration-color: #c0392b !important;
}
/* 内容摘要：灰色，最多2行 */
.um-post-card .um-post-content {
  color: #777 !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  white-space: normal !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 左右布局：左图右文 */
.um-post-card-row .um-post-main {
  display: flex;
  gap: 16px;
}
.um-post-thumbs {
  flex: 0 0 130px;
  min-height: 100px;
  max-height: 130px;
}
.um-post-thumb {
  border-radius: 3px !important;
  border: 1px solid #eee !important;
}
.um-post-body {
  flex: 1;
  min-width: 0;
}

/* ---------- Skill 卡片：同样列表化 ---------- */
.um-skill-card {
  background: #fff !important;
  border: none !important;
  border-bottom: 1px dashed #e0e0e0 !important;
  border-radius: 0 !important;
  padding: 16px 4px !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
}
.um-skill-card:hover {
  background: #f6f6f3 !important;
  transform: none !important;
  box-shadow: none !important;
}
.um-skill-card .um-comment-nick {
  color: #111 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}
.um-skill-card .um-comment-time {
  color: #999 !important;
  font-size: 12px !important;
}
.um-skill-meta {
  color: #999 !important;
  font-size: 12px !important;
}
.um-skill-file {
  background: #f5f5f3 !important;
  color: #333 !important;
  border-radius: 2px !important;
}

/* ---------- 发布面板：淡边框，更轻 ---------- */
.um-host-panel {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 0 8px !important;
  box-shadow: none !important;
}
.um-toolbar {
  border-bottom: 1px solid #e0e0e0 !important;
  padding-bottom: 10px !important;
  margin-bottom: 8px !important;
}

/* ---------- 豆瓣式小按钮（下载/发布） ---------- */
.um-btn-primary.um-btn-sm {
  border-radius: 3px !important;
  font-size: 13px !important;
  padding: 5px 16px !important;
  box-shadow: none !important;
  background: #fff !important;
  color: #1a1a1a !important;
  border: 1px solid #d1d5db !important;
}
.um-btn-primary.um-btn-sm:hover {
  background: #1a1a1a !important;
  color: #fff !important;
  border-color: #1a1a1a !important;
}
/* 顶部发布大按钮：深灰黑 */
.um-btn-xl {
  border-radius: 3px !important;
  background: #1a1a1a !important;
  box-shadow: none !important;
}
.um-btn-xl:hover {
  background: #000 !important;
}

/* 深色模式微调 */
.dark body { background-color: #171412 !important; }
.dark .um-post-card { background: transparent !important; border-color: #292524 !important; }
.dark .um-post-card:hover { background: #211d1b !important; }
.dark .um-skill-card { background: transparent !important; border-color: #292524 !important; }
.dark .um-skill-card:hover { background: #211d1b !important; }
.dark .um-post-card .um-post-title { color: #f5f0ec !important; }
.dark .um-post-card .um-comment-nick { color: #a8a29e !important; }
.dark .um-post-card .um-comment-time, .dark .um-post-card .um-views-badge { color: #78716c !important; }
.dark .um-post-card .um-post-content { color: #a8a29e !important; }
.dark .um-post-content p { color: #a8a29e !important; }
.dark .um-skill-card .um-comment-nick { color: #f5f0ec !important; }
.dark .um-toolbar { border-color: #292524 !important; }
.dark .um-section-title { color: #e7e5e4 !important; }
