/* ============================================================
   正北以东 · 设计系统适配层（钳秦攻势项目站）
   将项目子站的配色 / 字体 / 标签语言统一到主站设计系统：
   背景 #0a0a10 · 文字 #f4f2ee · 强调橙 #ff5c1a
   标题 Space Grotesk + Noto Sans SC · 标签 JetBrains Mono
   本文件必须在各页面原有样式之后加载。
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700;900&family=JetBrains+Mono:wght@400;500&display=swap");

/* ---------- 1. 变量重映射 ---------- */

:root,
:host {
  /* 字体变量（index bundle / tailwind 默认变量） */
  --font-sans: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  --font-mono: "JetBrains Mono", "Noto Sans SC", monospace !important;
  --default-font-family: var(--font-sans) !important;
  --default-mono-font-family: var(--font-mono) !important;

  /* 主配色（index bundle） */
  --bg: #0a0a10 !important;
  --panel: #0f0f17 !important;
  --panel-2: #15151f !important;
  --text: #f4f2ee !important;
  --muted: rgba(244, 242, 238, 0.62) !important;
  --line: rgba(244, 242, 238, 0.09) !important;
  --red: #ff5c1a !important;
  --red-hot: #ff7a42 !important;
  --gold: #ff5c1a !important;
  --blue: #ff5c1a !important;

  /* 主配色（main bundle） */
  --ivory: #f4f2ee !important;
  --rule: rgba(244, 242, 238, 0.12) !important;

  color-scheme: dark;
}

/* ---------- 2. 页面底色与正文字体 ---------- */

html,
body {
  background: #0a0a10 !important;
  color: #f4f2ee;
  font-family: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

/* 固定画布页：覆盖内联的衬线字体声明，避免首屏衬线闪烁 */
.deck-canvas {
  font-family: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

/* ---------- 3. 衬线标题 → 主站标题语言 ---------- */

h1, h2, h3, h4, h5, h6,
.brand,
.edition,
.dossier-label,
.archive-status small {
  font-family: "Space Grotesk", "Noto Sans SC", "PingFang SC", sans-serif !important;
}

/* 大标题字重向主站 page-head 看齐 */
h1, h2, h3 { font-weight: 900; }

/* ---------- 4. 小标签 → JetBrains Mono ---------- */

.eyebrow,
.site-header nav,
.filter-rail button > small,
.archive-status > div:first-child > span,
.archive-status__count span,
.world-concept-visual figcaption span {
  font-family: "JetBrains Mono", "Noto Sans SC", monospace !important;
}

/* ---------- 5. 分集页（episode）变量适配 ---------- */

.episodeFullPage {
  --episode-red: #ff5c1a !important;
  --episode-gold: #ff5c1a !important;
  --episode-text: #f4f2ee !important;
  --episode-muted: rgba(244, 242, 238, 0.62) !important;
  background: #0a0a10 !important;
  font-family: "Space Grotesk", "Noto Sans SC", "PingFang SC", sans-serif !important;
}

/* ---------- 6. 散落硬编码暖金色 → 主站橙 ---------- */

.world-concept-visual figcaption span { color: #ff5c1a !important; }

/* 暖金/暗红高亮的通用收敛：凡是链接 hover 与强调色统一进主站橙 */
a { color: inherit; }
a:hover { color: #ff7a42; }

/* ---------- 6.5 锚点平滑滚动（尊重减少动态偏好） ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ============================================================
   7. 移动端适配（≤900px）
   注意：qinqin-adapt.js 会通过 setProperty 重写内联样式，
   重写后 style 属性会被浏览器重新序列化（补空格、0→0px），
   因此凡依赖 style 属性内容的尺寸/布局改写都在 JS 侧完成；
   本区块只保留 class / 结构选择器规则（不受序列化影响）。
   ============================================================ */

@media (max-width: 900px) {
  /* 7.1 画布拍平为视口宽度（溢出裁剪在画布层完成，
         不要在 html/body 上设 overflow-x，会触发渲染异常） */
  .deck-canvas {
    width: 100% !important;
    max-width: 1440px;
    overflow-x: clip;
  }

  /* 7.2 吸顶头部：第一行 品牌 + 返回入口，第二行 横向滚动导航 */
  .deck-canvas > div:first-child {
    height: auto !important;
    min-height: 58px;
    grid-template-columns: auto 1fr !important;
    row-gap: 2px;
    padding: 8px 16px !important;
  }
  /* 无 JS 时隐藏右侧刊号（有 JS 时该位置被返回首页链接替换） */
  .deck-canvas > div:first-child > span:last-child {
    display: none !important;
  }
  .deck-canvas > div:first-child > .qinqin-global-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    padding: 4px 0 2px;
    overflow-x: auto;
    scrollbar-width: none;
    font-family: "JetBrains Mono", "Noto Sans SC", monospace !important;
    font-size: 9px !important;
    letter-spacing: .1em !important;
    white-space: nowrap !important;
    text-align: left;
  }
  .deck-canvas > div:first-child > .qinqin-global-nav::-webkit-scrollbar {
    display: none;
  }
  /* 移动端「更多」下拉改为浮层，避免撑开横向滚动条 */
  .deck-canvas .qinqin-more__menu {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: 92px !important;
    width: auto !important;
    margin-top: 0 !important;
    background: #101019;
    border: 1px solid rgba(244, 242, 238, 0.12);
    z-index: 60;
  }

  /* 7.3 图片兜底 */
  .deck-canvas img { max-width: 100%; }

  /* 7.4 首页 Hero（class 体系，样式包未提供移动端规则） */
  .homeSynopsisHero {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }
  .homeConceptPoster {
    order: -1;
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
  }
  .homeConceptPoster > img { height: 100%; }
  .homeConceptPosterFrame { inset: 14px !important; }
  .homeConceptPoster figcaption {
    left: 20px !important;
    right: 20px !important;
    bottom: 20px !important;
  }
  .homeConceptPoster figcaption strong { font-size: 16px !important; max-width: 100% !important; }
  .homeConceptPosterTime { top: 20px !important; right: 20px !important; }
  .homeSynopsisCopy {
    border-right: none !important;
    padding: 40px 20px 44px !important;
  }
  .homeSynopsisCopy::after { display: none !important; }
  .homeSynopsisMeta { flex-wrap: wrap; gap: 10px !important; }
  .homeSynopsisTitle h1 {
    font-size: 62px !important;
    letter-spacing: -.02em !important;
  }
  .homeSynopsisTitle p {
    font-size: 12px !important;
    letter-spacing: .3em !important;
  }
  .homeSynopsisPremise {
    max-width: 100% !important;
    margin-top: 30px !important;
    padding-left: 18px !important;
  }
  .homeSynopsisLogline { font-size: 17px !important; }
  .homeSynopsisSummary { font-size: 13px !important; }
  .homeSynopsisCta { margin-top: 34px !important; }

  /* 7.5 制作页（aiGuide）：keep-all 标题在窄屏不可断行会撑破栅格列，
         放开断行并压缩字号，列宽即可回落到视口内 */
  .aiGuideHeading h2,
  .aiGuideThesis h2,
  .aiGuideSignalGrid h3,
  .aiGuideFormatBand h3,
  .aiGuideRewriteGrid h3,
  .aiGuidePlanningGrid h3 {
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }
  .aiGuideHeading h2,
  .aiGuideThesis h2 { font-size: clamp(30px, 8.5vw, 40px) !important; }

  /* 7.6 世界观页 Hero 水印序号：窄屏缩小并让开标签行 */
  .world-hero__index {
    font-size: 88px !important;
    top: 64px !important;
    right: 20px !important;
  }
}
