/*
 Theme Name: 幕匠周记 · 工程风子主题
 Template: blocksy
 Child Theme of: blocksy
 Version: 1.1.0
 Description: 科技技术风，幕墙技术站专用。深色顶栏 + 青蓝强调 + 浅灰阅读区 + 自定义首页。
*/

:root {
  /* 全局配色（科技技术风） */
  --mj-bg-page:       #f5f7fa;
  --mj-bg-card:       #ffffff;
  --mj-text-main:     #1a1a1a;
  --mj-text-sub:      #64748b;
  --mj-ink:           #0f172a;
  --mj-accent:        #06b6d4;   /* 科技青 */
  --mj-accent-hover:  #22d3ee;
  --mj-accent-deep:   #0891b2;
  --mj-dark:          #0f172a;
  --mj-border:        #e2e8f0;
  --mj-code-bg:       #f1f5f9;

  /* Blocksy 顶栏深色科技风覆盖（若后台自定义里改过请以后台为准） */
  --headerBackgroundColor: #0f172a;
  --headerTextColor: #ffffff;
  --headerIndicatorsColor: #cbd5e1;
  --headerBorderColor: rgba(255,255,255,.08);
}

body { background: var(--mj-bg-page); color: var(--mj-text-main); }
a { color: var(--mj-accent-deep); }
a:hover { color: var(--mj-accent-hover); }

/* 强制覆盖 Blocksy 顶栏为深色科技风（防止父主题自定义器优先级更高） */
.site-header, .ct-header, header.site-header, #main-container > header {
  background-color: #0f172a !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}
.site-header .site-title,
.site-header .site-title a,
.site-header .ct-nav-link,
.site-header a.ct-nav-link,
.site-header .ct-header-text,
.site-header .ct-header-search,
.site-header [data-device] a,
.site-header .ct-header-trigger {
  color: #ffffff !important;
}
.site-header .ct-nav-link:hover,
.site-header a.ct-nav-link:hover,
.site-header .site-title a:hover {
  color: #22d3ee !important;
}
.site-header .ct-header-search svg,
.site-header .ct-header-trigger svg {
  fill: #ffffff !important;
}

/* ============ 首页 Hero ============ */
.mj-hero {
  position: relative;
  min-height: 340px;
  background: linear-gradient(135deg, #0f172a 0%, #0c4a6e 50%, #0891b2 100%);
  overflow: hidden;
  color: #fff;
}
.mj-hero-glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.32), transparent 70%);
  top: -120px; right: -60px; pointer-events: none;
}
.mj-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 56px 56px; pointer-events: none;
}
.mj-hero-city {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(to top, rgba(6,182,212,.14), transparent);
  pointer-events: none;
}
.mj-hero-content {
  position: relative; max-width: 1200px; margin: 0 auto;
  padding: 78px 24px 60px;
  text-align: center;
}
.mj-hero-tag {
  display: inline-block; background: rgba(255,255,255,.12); color: #22d3ee;
  font-weight: 700; font-size: 13px; padding: 5px 14px; border-radius: 20px;
  margin-bottom: 16px; border: 1px solid rgba(34,211,238,.3);
}
.mj-hero h1 {
  color: #ffffff !important;
  font-size: 40px; font-weight: 800;
  margin: 0 0 16px; letter-spacing: 1px; line-height: 1.25;
  text-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.mj-hero p { color: rgba(255,255,255,.85); font-size: 16px; margin: 0 auto 18px; max-width: 680px; }
.mj-hero-meta { font-size: 13px; color: rgba(255,255,255,.55); }
@media (max-width: 860px) {
  .mj-hero h1 { font-size: 30px; }
  .mj-hero-content { padding: 64px 20px 48px; }
}

/* ============ 分类标签栏 ============ */
.mj-subnav {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 4px; border-bottom: 1px solid var(--mj-border); flex-wrap: wrap;
}
.mj-subnav a {
  padding: 12px 14px; font-size: 14px; color: var(--mj-text-sub);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.mj-subnav a:hover { color: var(--mj-accent-deep); }
.mj-subnav a.active { color: var(--mj-accent-deep); border-bottom-color: var(--mj-accent); font-weight: 600; }

/* ============ 主内容 + 侧边栏 ============ */
.mj-layout {
  max-width: 1200px; margin: 28px auto 48px; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start;
}
.mj-main { min-width: 0; }

/* ============ 文章卡片网格 ============ */
.mj-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mj-card {
  background: #fff; border: 1px solid var(--mj-border); border-radius: 10px;
  overflow: hidden; transition: .2s; display: flex; flex-direction: column;
}
.mj-card:hover { box-shadow: 0 10px 30px rgba(15,23,42,.12); transform: translateY(-3px); }
.mj-card-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}
.mj-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mj-card-tag {
  position: absolute; top: 10px; left: 10px; background: rgba(15,23,42,.72);
  color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 4px; backdrop-filter: blur(2px);
}
.mj-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.mj-card-title { font-size: 15px; font-weight: 600; line-height: 1.45; margin: 0 0 12px; }
.mj-card-title a { color: var(--mj-ink); }
.mj-card-title a:hover { color: var(--mj-accent-deep); }
.mj-card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mj-text-sub); margin-top: auto; }
.mj-avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--mj-accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0;
}

/* ============ 右侧边栏 ============ */
.mj-sidebar { position: sticky; top: 88px; }
.mj-widget {
  background: #fff; border: 1px solid var(--mj-border); border-radius: 10px;
  padding: 18px; margin-bottom: 20px;
}
.mj-widget h3 {
  font-size: 15px; margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--mj-border); color: var(--mj-ink);
}
.mj-search { display: flex; }
.mj-search input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--mj-border);
  border-radius: 6px 0 0 6px; font-size: 13px; outline: none;
}
.mj-search button {
  background: var(--mj-accent); color: #fff; border: none; padding: 0 16px;
  border-radius: 0 6px 6px 0; cursor: pointer; font-size: 14px;
}
.mj-search button:hover { background: var(--mj-accent-hover); }
.mj-hot-item { display: flex; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--mj-border); font-size: 13px; line-height: 1.5; }
.mj-hot-item:last-child { border-bottom: none; }
.mj-hot-item a { color: var(--mj-text-main); }
.mj-hot-item a:hover { color: var(--mj-accent-deep); }
.mj-tag-cloud .tag-cloud-link {
  display: inline-block; background: var(--mj-code-bg); color: var(--mj-text-sub);
  font-size: 12px !important; padding: 4px 10px; border-radius: 6px; margin: 0 6px 6px 0;
}
.mj-tag-cloud .tag-cloud-link:hover { background: var(--mj-accent); color: #fff; }
.mj-supplier { font-size: 13px; color: var(--mj-text-sub); line-height: 1.8; }

/* ============ 资源板块会员区（保留） ============ */
.mj-resource-zone {
  border: 1px solid var(--mj-border); border-radius: 8px;
  background: var(--mj-bg-card); padding: 20px 24px; margin: 24px 0;
}
.mj-resource-zone .mj-lock-hint { color: var(--mj-text-sub); font-size: 13px; }

/* ============ 文章页（single post）排版优化 ============ */
.single-post {
  --mj-article-maxw: 760px;
}
.single-post .ct-content-block {
  padding: 0 0 48px;
}
.single-post .entry-header,
.single-post .hero-section[data-type="type-1"] {
  background: #fff;
  border-bottom: 1px solid var(--mj-border);
  padding: 36px 0 28px;
  margin-bottom: 0;
}
.single-post .entry-header .page-title,
.single-post .hero-section .page-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--mj-ink);
  max-width: var(--mj-article-maxw);
  margin: 0 auto 16px;
  padding: 0 24px;
  text-align: left;
}
.single-post .entry-meta,
.single-post .post-meta {
  font-size: 13px;
  color: var(--mj-text-sub);
  max-width: var(--mj-article-maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.single-post .entry-meta a,
.single-post .post-meta a {
  color: var(--mj-text-sub);
}
.single-post .entry-meta a:hover,
.single-post .post-meta a:hover {
  color: var(--mj-accent-deep);
}
/* 隐藏 Gravatar 头像（国内常被墙导致裂图），保留文字信息 */
.single-post .entry-meta img.avatar,
.single-post .post-meta img.avatar,
.single-post .hero-section img.avatar,
.single-post .ct-meta-author img {
  display: none !important;
}

/* 正文容器 */
.single-post .entry-content {
  max-width: var(--mj-article-maxw);
  margin: 32px auto 0;
  padding: 0 24px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--mj-text-main);
}

/* 标题层级（正文里 H1 显示成 H2，避免和页面标题冲突） */
.single-post .entry-content h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  margin: 40px 0 18px;
  color: var(--mj-ink);
  border-bottom: 1px solid var(--mj-border);
  padding-bottom: 10px;
}
.single-post .entry-content h2 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  margin: 36px 0 16px;
  color: var(--mj-ink);
}
.single-post .entry-content h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  margin: 28px 0 12px;
  color: var(--mj-ink);
}
.single-post .entry-content h4 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin: 24px 0 10px;
  color: var(--mj-text-main);
}

/* 段落、列表 */
.single-post .entry-content p {
  margin: 0 0 18px;
}
.single-post .entry-content ul,
.single-post .entry-content ol {
  margin: 0 0 18px 22px;
  padding: 0;
}
.single-post .entry-content li {
  margin-bottom: 8px;
}
.single-post .entry-content ul li {
  list-style-type: disc;
}
.single-post .entry-content ol li {
  list-style-type: decimal;
}
.single-post .entry-content strong {
  color: var(--mj-ink);
  font-weight: 700;
}

/* 引用块 */
.single-post .entry-content blockquote {
  margin: 24px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--mj-accent);
  background: var(--mj-code-bg);
  border-radius: 0 8px 8px 0;
  color: var(--mj-text-sub);
  font-size: 15px;
  line-height: 1.75;
}
.single-post .entry-content blockquote p:last-child {
  margin-bottom: 0;
}

/* 表格 */
.single-post .entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--mj-border);
  border-radius: 8px;
  overflow: hidden;
}
.single-post .entry-content th {
  background: var(--mj-dark);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
}
.single-post .entry-content td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--mj-border);
}
.single-post .entry-content tr:nth-child(even) td {
  background: #f8fafc;
}
.single-post .entry-content tr:last-child td {
  border-bottom: none;
}

/* 代码与分隔线 */
.single-post .entry-content code {
  background: var(--mj-code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .9em;
  color: var(--mj-accent-deep);
}
.single-post .entry-content pre {
  background: var(--mj-dark);
  color: #e2e8f0;
  padding: 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 22px 0;
}
.single-post .entry-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.single-post .entry-content hr {
  border: none;
  height: 1px;
  background: var(--mj-border);
  margin: 36px 0;
}

/* 图片 */
.single-post .entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 22px auto;
}

/* 分类/标签入口 */
.single-post .entry-footer {
  max-width: var(--mj-article-maxw);
  margin: 36px auto 0;
  padding: 0 24px;
}
.single-post .post-tags a,
.single-post .post-categories a {
  display: inline-block;
  background: var(--mj-code-bg);
  color: var(--mj-text-sub);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  margin: 0 6px 6px 0;
  text-decoration: none;
}
.single-post .post-tags a:hover,
.single-post .post-categories a:hover {
  background: var(--mj-accent);
  color: #fff;
}

/* 面包屑与导航 */
.single-post .ct-breadcrumbs {
  max-width: var(--mj-article-maxw);
  margin: 18px auto 0;
  padding: 0 24px;
  font-size: 13px;
  color: var(--mj-text-sub);
}

/* 相关文章/评论区容器也限制宽度 */
.single-post .ct-related-posts,
.single-post .ct-comments-container {
  max-width: var(--mj-article-maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .mj-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .mj-layout { grid-template-columns: 1fr; }
  .mj-sidebar { position: static; order: -1; }
  .mj-cards { grid-template-columns: 1fr; }
  .mj-hero h1 { font-size: 30px; }
  .mj-hero-content { padding: 64px 20px 44px; }
}
