/* 热流微控 ThermoFluid.Art — Liebling 主题定制 */

/* ===== 亮色模式色彩覆盖 ===== */
:root {
  /* 渐变配色 — fallback（Liebling JS 异步设置 data-theme，:root 确保首次渲染可用） */
  --gradient-teaching: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  --gradient-research: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  --gradient-community: linear-gradient(135deg, #059669 0%, #34d399 100%);
  --gradient-brand: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #2563eb 100%);
  --bg-gradient: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
}

[data-theme="light"] {
  --background-color: #f5f3ff;
  --primary-foreground-color: #4c4575;
  --secondary-foreground-color: #1e1b4b;
  --primary-subtle-color: #7c3aed;
  --secondary-subtle-color: #ede9fe;
  --titles-color: #1e1b4b;
  --link-color: #7c3aed;
  --primary-border-color: #c4b5fd;
  --secondary-border-color: #ede9fe;
  --article-shadow-normal: 0 10px 10px rgba(124, 58, 237, 0.06);
  --article-shadow-hover: 0 4px 60px 0 rgba(124, 58, 237, 0.15);
  --transparent-background-color: rgba(245, 243, 255, 0.99);
  --footer-background-color: #1e1b4b;
  --submenu-shadow-color-opacity: 0.15;
  --button-shadow-color-normal: rgba(124, 58, 237, 0.15);
  --button-shadow-color-hover: rgba(124, 58, 237, 0.25);
  --table-background-color-odd: #f5f3ff;
  --table-head-border-bottom: #c4b5fd;
  --header-menu-gradient-first-color: rgba(255, 255, 255, 0);
  --header-menu-gradient-second-color: #ffffff;

  /* 三层分类色彩 */
  --color-layer-teaching: #7C3AED;
  --color-layer-research: #2563EB;
  --color-layer-community: #059669;

  /* 渐变配色 */
  --gradient-teaching: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  --gradient-research: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  --gradient-community: linear-gradient(135deg, #059669 0%, #34d399 100%);
  --gradient-brand: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #2563eb 100%);

  /* 页面背景渐变 */
  --bg-gradient: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
}

/* ===== 暗色模式色彩覆盖 ===== */
[data-theme="dark"] {
  --background-color: #0f0a1e;
  --primary-foreground-color: #c4b5fd;
  --secondary-foreground-color: #ede9fe;
  --primary-subtle-color: #a78bfa;
  --secondary-subtle-color: #1e1538;
  --titles-color: #c4b5fd;
  --link-color: #a78bfa;
  --primary-border-color: #2e2650;
  --secondary-border-color: #1a1230;
  --article-shadow-normal: 0 4px 5px 5px rgba(124, 58, 237, 0.1);
  --article-shadow-hover: 0 4px 5px 10px rgba(124, 58, 237, 0.15);
  --transparent-background-color: rgba(15, 10, 30, 0.99);
  --footer-background-color: #080510;
  --submenu-shadow-color-opacity: 0.55;
  --button-shadow-color-normal: rgba(124, 58, 237, 0.3);
  --button-shadow-color-hover: rgba(124, 58, 237, 0.4);
  --table-background-color-odd: #1a1230;
  --table-head-border-bottom: #2e2650;
  --header-menu-gradient-first-color: rgba(15, 10, 30, 0);
  --header-menu-gradient-second-color: rgba(15, 10, 30, 0.65);
}

/* ===== 导航栏白色底色 ===== */
.m-header {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e5e7eb;
}

[data-theme="dark"] .m-header {
  background-color: #1e1538 !important;
  border-bottom-color: #2e2650;
}

.m-header .m-nav__left a,
.m-header .m-site-name,
.m-header .m-nav__left .nav-link {
  color: #1e1b4b;
}

[data-theme="dark"] .m-header .m-nav__left a,
[data-theme="dark"] .m-header .m-site-name {
  color: #ede9fe;
}

/* ===== 选中/强调色 ===== */
::selection {
  background-color: rgba(124, 58, 237, 0.2);
  color: #1e1b4b;
}

[data-theme="dark"] ::selection {
  background-color: rgba(167, 139, 250, 0.3);
  color: #ede9fe;
}

/* ===== 按钮强调色 ===== */
.m-button.primary,
.m-button.filled {
  background-color: #7c3aed;
  border-color: #7c3aed;
}

.m-button.primary:hover,
.m-button.filled:hover {
  background-color: #6d28d9;
  border-color: #6d28d9;
}

/* ===== 链接悬停 ===== */
a:hover {
  color: #6d28d9;
}

/* ===== Footer 链接 ===== */
.m-footer a:hover {
  color: #a78bfa;
}

/* ===== Tag page category hero overlays ===== */
.m-hero__category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.m-hero.with-picture .m-hero__content {
  position: relative;
  z-index: 3;
}

/* 交互教具 — purple gradient */
.m-hero__category-overlay.category-teaching {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.85) 0%, rgba(139, 92, 246, 0.7) 50%, rgba(167, 139, 250, 0.6) 100%);
}

/* CFD仿真 — blue gradient */
.m-hero__category-overlay.category-cfd {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.85) 0%, rgba(59, 130, 246, 0.7) 50%, rgba(96, 165, 250, 0.6) 100%);
}

/* 科研Skill — indigo gradient */
.m-hero__category-overlay.category-skill {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.85) 0%, rgba(99, 102, 241, 0.7) 50%, rgba(129, 140, 248, 0.6) 100%);
}

/* 学术动态 — teal gradient */
.m-hero__category-overlay.category-academic {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.85) 0%, rgba(20, 184, 166, 0.7) 50%, rgba(45, 212, 191, 0.6) 100%);
}

/* Ensure hero text is white on colored overlays */
.m-hero.with-picture .m-hero__category-overlay ~ .m-hero-title,
.m-hero.with-picture .m-hero__category-overlay ~ .m-hero-description,
.m-hero.with-picture .m-hero__category-overlay ~ .m-hero__meta {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Dark mode adjustments — slightly deeper overlays */
[data-theme="dark"] .m-hero__category-overlay.category-teaching {
  background: linear-gradient(135deg, rgba(91, 33, 182, 0.9) 0%, rgba(109, 40, 217, 0.8) 50%, rgba(124, 58, 237, 0.7) 100%);
}

[data-theme="dark"] .m-hero__category-overlay.category-cfd {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.9) 0%, rgba(37, 99, 235, 0.8) 50%, rgba(59, 130, 246, 0.7) 100%);
}

[data-theme="dark"] .m-hero__category-overlay.category-skill {
  background: linear-gradient(135deg, rgba(55, 48, 163, 0.9) 0%, rgba(67, 56, 202, 0.8) 50%, rgba(79, 70, 229, 0.7) 100%);
}

[data-theme="dark"] .m-hero__category-overlay.category-academic {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.9) 0%, rgba(13, 148, 136, 0.8) 50%, rgba(20, 184, 166, 0.7) 100%);
}


/* ===== AI问答页面样式 ===== */
.ai-qa-landing {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.ai-qa-hero {
  text-align: center;
  margin-bottom: 48px;
}

.ai-qa-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.ai-qa-hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 12px;
}

[data-theme="dark"] .ai-qa-hero h1 {
  color: #ede9fe;
}

.ai-qa-subtitle {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

[data-theme="dark"] .ai-qa-subtitle {
  color: #a78bfa;
}

.ai-qa-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.ai-qa-feature {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.ai-qa-feature:hover {
  border-color: #7c3aed;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.12);
}

[data-theme="dark"] .ai-qa-feature {
  background: #1a1230;
  border-color: #2e2650;
}

[data-theme="dark"] .ai-qa-feature:hover {
  border-color: #a78bfa;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

.feature-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 12px;
}

.ai-qa-feature h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1e1b4b;
  margin-bottom: 8px;
}

[data-theme="dark"] .ai-qa-feature h3 {
  color: #ede9fe;
}

.ai-qa-feature p {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

[data-theme="dark"] .ai-qa-feature p {
  color: #a78bfa;
}

.ai-qa-cta {
  text-align: center;
  margin-bottom: 56px;
}

.ai-qa-button {
  display: inline-block;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff !important;
  font-size: 18px;
  font-weight: 600;
  padding: 16px 48px;
  border-radius: 12px;
  text-decoration: none !important;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.ai-qa-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  color: #ffffff !important;
}

.ai-qa-hint {
  margin-top: 12px;
  font-size: 13px;
  color: #9ca3af;
}

[data-theme="dark"] .ai-qa-hint {
  color: #6b7280;
}

.ai-qa-guide {
  background: #f5f3ff;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
}

[data-theme="dark"] .ai-qa-guide {
  background: #1a1230;
}

.ai-qa-guide h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 24px;
}

[data-theme="dark"] .ai-qa-guide h2 {
  color: #ede9fe;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guide-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: #7c3aed;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.step-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1e1b4b;
  margin-bottom: 4px;
}

[data-theme="dark"] .step-content h3 {
  color: #ede9fe;
}

.step-content p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

[data-theme="dark"] .step-content p {
  color: #a78bfa;
}

.ai-qa-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px 20px;
}

[data-theme="dark"] .ai-qa-note {
  background: #1c1917;
  border-color: #44403c;
}

.ai-qa-note p {
  font-size: 14px;
  color: #92400e;
  line-height: 1.6;
  margin: 0;
}

[data-theme="dark"] .ai-qa-note p {
  color: #fbbf24;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ai-qa-features {
    grid-template-columns: 1fr;
  }
  .ai-qa-hero h1 {
    font-size: 24px;
  }
  .ai-qa-button {
    font-size: 16px;
    padding: 14px 36px;
  }
  .ai-qa-landing {
    padding: 24px 16px 40px;
  }
}

/* ============================================
   渐变装饰 — 标题渐变 + 下划线 + 背景渐变
   ============================================ */

/* 深色模式渐变变量覆盖 */
[data-theme="dark"] {
  --color-layer-teaching: #7C3AED;
  --color-layer-research: #2563EB;
  --color-layer-community: #059669;
  --gradient-teaching: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
  --gradient-research: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%);
  --gradient-community: linear-gradient(135deg, #34d399 0%, #6ee7b7 100%);
  --gradient-brand: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #60a5fa 100%);
  --bg-gradient: linear-gradient(180deg, #0f0a1e 0%, #1e1b4b 100%);
}

/* --- 页面背景渐变 --- */
body {
  background: var(--bg-gradient) !important;
  background-attachment: fixed !important;
}

/* --- 主页 Hero 标题渐变 --- */
.m-hero-title.bigger {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Hero 标题下方渐变装饰线 --- */
.m-hero__content::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gradient-brand);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* --- Tag 页标题渐变 --- */
.m-hero-title {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Tag 页标题下划线 */
.m-hero.with-picture .m-hero__content::after {
  background: rgba(255, 255, 255, 0.5);
}

/* --- 文章标题渐变装饰线 --- */
.l-post-content .m-hero-title::after,
.single-post .m-hero-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gradient-brand);
  border-radius: 2px;
  margin: 8px auto 0;
}

/* --- 文章卡片标题 hover 渐变 --- */
.m-article-card__title:hover {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- 导航栏品牌 logo 渐变 --- */
.m-site-name {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================
   文章内容宽度一致性：前端 & CMS 编辑器
   ============================================ */

/* --- 前端：统一文章内容宽度基准 ---
   Liebling 的 .l-wrapper.in-post 默认 max-width: 740px，
   与 Ghost Koenig 编辑器的默认内容宽度一致。
   设置 --kg-content-width 让主题和编辑器使用同一宽度。 */
:root {
  --kg-content-width: 740px;
}

/* 前端：文章正文容器宽度对齐 */
.l-wrapper.in-post {
  max-width: 740px;
}

/* 前端：让文字内容（p, h1-h6, blockquote, ol, ul 等）与图片同宽
   文字内容限制在 740px，图片通过 kg-width-wide/full 突破 */
.l-post-content .js-post-content {
  max-width: 740px;
}

/* 前端：kg-width-wide 图片突破到更宽 (约 1200px) */
.l-post-content .kg-width-wide,
.l-content.in-post .kg-width-wide {
  width: calc(100% + 200px);
  max-width: 1200px;
  margin-left: -100px;
  margin-right: -100px;
}

/* 前端：kg-width-full 图片占满全宽 */
.l-post-content .kg-width-full,
.l-content.in-post .kg-width-full {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* 前端：确保文章内图片不超出容器（非 wide/full 的普通图片） */
.l-post-content .kg-card:not(.kg-width-wide):not(.kg-width-full) {
  max-width: 100%;
}

/* 前端：普通图片撑满文字内容宽度 */
.l-post-content .kg-image {
  max-width: 100%;
  height: auto;
}

/* 前端：gallery 卡片默认 wide */
.l-post-content .kg-gallery-card {
  max-width: 100%;
}

/* --- CMS 编辑器：设置 --kg-content-width 让 Koenig 编辑器
   预览宽度与前端渲染宽度一致 ---
   通过 Ghost 全局 codeinjection_head 注入以下样式：
   <style>
     .koenig-lexical .kg-prose { --kg-content-width: 740px; }
   </style>
   这确保 CMS 编辑器中文字和图片的宽度比例与前端一致。 */

