/*
 * 主页方案「纸本编辑」：仅改变既有首页的排版，不搬运 DOM 或复制动态文案。
 * 与全站使用相同 layer，限定的 important 用于覆盖旧组件的绝对定位和画布样式。
 */
@layer debater-visual-system {
  html[data-ft-mode]:not([data-debater-tech='on']) app-home {
    --he-copy: var(--ft-text-primary, #f5efe3);
    --he-muted: var(--ft-text-secondary, #b9afa2);
    --he-gold: #e7c987;
    --he-red: #f0645a;
    --he-action: #bd3b34;
    --he-red-hover: #a9332d;
    --he-rule: rgba(200, 163, 93, 0.26);
    --he-secondary: #282116;
    --he-surface: #17130e;
  }

  html[data-ft-mode='paper']:not([data-debater-tech='on']) app-home {
    --he-gold: #946b19;
    --he-red: #c1272d;
    --he-action: #c1272d;
    --he-red-hover: #a92b2a;
    --he-rule: rgba(122, 92, 54, 0.2);
    --he-secondary: #f2ebdf;
    --he-surface: #fdfbf6;
  }

  /* display:contents 让原有文案、印章与统计参与同一网格，原事件和数据绑定不变。 */
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .home-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px) !important;
    grid-template-rows: auto auto !important;
    column-gap: clamp(32px, 4vw, 56px) !important;
    row-gap: 26px !important;
    align-content: center !important;
    align-items: start !important;
    min-height: 670px !important;
    padding: clamp(68px, 6vw, 88px) max(24px, calc((100% - 1240px) / 2)) 56px !important;
    border-bottom: 1px solid var(--he-rule) !important;
    color: var(--he-copy) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .home-hero::after {
    display: none !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-layout {
    display: contents !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-copy {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-eyebrow {
    min-height: 34px !important;
    max-width: 100% !important;
    padding: 7px 12px !important;
    font-size: 11px !important;
    letter-spacing: 0.1em !important;
    line-height: 1.5 !important;
    color: var(--he-gold) !important;
    border-color: var(--he-rule) !important;
    overflow-wrap: anywhere;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-kicker {
    margin-top: 22px !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
    letter-spacing: 0.26em !important;
    color: var(--he-muted) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-copy h1 {
    max-width: none !important;
    margin: 18px 0 0 !important;
    font-size: clamp(54px, 5vw, 76px) !important;
    font-weight: 600 !important;
    line-height: 1.14 !important;
    letter-spacing: -0.025em !important;
    color: var(--he-copy) !important;
    overflow-wrap: anywhere;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-copy h1 span {
    margin-top: 8px !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-copy h1 em {
    color: var(--he-red) !important;
    text-shadow: none !important;
  }

  /* 管理后台的副标题仍按原值显示，不能为贴图而丢弃可管理内容。 */
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-subheadline {
    max-width: 720px !important;
    margin: 14px 0 0 !important;
    font-size: 17px !important;
    line-height: 1.65 !important;
    letter-spacing: 0.025em !important;
    color: var(--he-muted) !important;
    overflow-wrap: anywhere;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-description {
    max-width: 720px !important;
    margin: 22px 0 0 !important;
    font-size: 18px !important;
    line-height: 1.75 !important;
    color: var(--he-muted) !important;
    overflow-wrap: anywhere;
    white-space: normal !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: 28px !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions .action {
    width: auto !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 0 18px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    letter-spacing: 0.02em !important;
    box-shadow: none !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions .action--primary {
    background: var(--he-action) !important;
    border-color: var(--he-action) !important;
    color: #fffdf6 !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions .action--primary:hover {
    background: var(--he-red-hover) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions .action--secondary {
    background: var(--he-secondary) !important;
    border-color: var(--he-rule) !important;
    color: var(--he-copy) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions .action--text {
    padding-inline: 8px !important;
    background: transparent !important;
    border-color: transparent !important;
    color: var(--he-muted) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-capabilities {
    display: none !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    width: 100% !important;
    max-width: 340px !important;
    margin: 0 !important;
    align-self: center !important;
    justify-self: end !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem__halo,
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem__frame::after {
    display: none !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem__frame {
    aspect-ratio: 1 !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem figcaption {
    gap: 9px !important;
    margin-top: 10px !important;
    color: var(--he-gold) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem figcaption::before,
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem figcaption::after {
    display: none !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem figcaption span {
    font-size: 15px !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem figcaption small {
    font-size: 10px !important;
    color: var(--he-muted) !important;
  }

  /* 统计保持三份原始动态数值，取消旧底部绝对定位与整块玻璃表面。 */
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stats {
    position: relative !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px 22px !important;
    border: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stat {
    min-width: 0 !important;
    min-height: 32px !important;
    padding: 0 !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    border: 0 !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stat strong {
    font-size: 27px !important;
    line-height: 1.2 !important;
    color: var(--he-gold) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stat span {
    font-size: 12px !important;
    letter-spacing: 0.02em !important;
    color: var(--he-muted) !important;
  }

  /* 三步流程沿用原来的 ol/li 与文字，用数字、留白和细线建立顺序。 */
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey {
    padding: 38px max(24px, calc((100% - 1240px) / 2)) 42px !important;
    color: var(--he-copy) !important;
  }

  /* 正文区必须有实体底，固定山河仅在 hero 和页面边缘承载装饰。
     home-shell 的额外限定使本规则也高于旧的画布透明声明；不影响其它功能页。 */
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .home-shell > :is(.journey, .evidence, .final-cta) {
    background: var(--he-surface) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey::before {
    display: none !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey .section-heading {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    text-align: left !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey .section-heading > p,
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey .section-heading > span,
  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey .step-icon {
    display: none !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey .section-heading h2 {
    margin: 0 !important;
    font-size: clamp(26px, 2.4vw, 34px) !important;
    line-height: 1.4 !important;
    color: var(--he-copy) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 26px !important;
    margin: 26px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps li {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 16px !important;
    align-content: start !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 24px 0 0 !important;
    border: 0 !important;
    border-right: 1px solid var(--he-rule) !important;
    background: transparent !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps li:last-child {
    border-right: 0 !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps .step-number {
    position: static !important;
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    color: var(--he-gold) !important;
    font-family: var(--ft-font-serif, Georgia, serif) !important;
    font-size: 38px !important;
    font-weight: 400 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.025em !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps h3 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    font-size: 22px !important;
    line-height: 1.35 !important;
    color: var(--he-copy) !important;
  }

  html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps p {
    grid-column: 2 !important;
    grid-row: 2 !important;
    margin: 7px 0 0 !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: var(--he-muted) !important;
    overflow-wrap: anywhere;
  }

  /* 桌面按已归一的选中方案恢复主要比例，手机与平板仍使用紧凑布局。 */
  @media (min-width: 1101px) {
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .home-hero {
      grid-template-columns: minmax(0, 1fr) minmax(280px, 380px) !important;
      column-gap: 56px !important;
      row-gap: 48px !important;
      align-content: start !important;
      min-height: 880px !important;
      padding: 184px max(24px, calc((100% - 1304px) / 2)) 64px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-copy h1 {
      font-size: clamp(54px, 6.4vw, 92px) !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-description {
      margin-top: 34px !important;
      font-size: 22px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions {
      margin-top: 44px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions .action {
      min-height: 58px !important;
      font-size: 16px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stat strong {
      font-size: 32px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem {
      max-width: 380px !important;
    }
  }

  @media (min-width: 768px) and (max-width: 1100px) {
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .home-hero {
      min-height: 720px !important;
      padding-top: 84px !important;
      grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) !important;
      column-gap: 28px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-copy h1 {
      font-size: clamp(46px, 5.4vw, 58px) !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem {
      max-width: 280px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions {
      gap: 10px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions .action {
      padding-inline: 14px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps {
      gap: 18px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps li {
      column-gap: 12px !important;
      padding-right: 16px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps h3 {
      font-size: 20px !important;
    }
  }

  @media (max-width: 767px) {
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .home-hero {
      grid-template-columns: minmax(0, 1fr) !important;
      grid-template-rows: auto auto auto !important;
      row-gap: 26px !important;
      min-height: 0 !important;
      /* 手机固定导航约65–72px，保留其下至少12px的内容安全距离。 */
      padding: 90px 24px 34px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-copy h1 {
      margin-top: 16px !important;
      font-size: clamp(36px, 7vw, 48px) !important;
      line-height: 1.16 !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-subheadline {
      font-size: 16px !important;
      line-height: 1.65 !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-description {
      margin-top: 18px !important;
      font-size: 16px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stats {
      grid-column: 1 !important;
      grid-row: 2 !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem {
      grid-column: 1 !important;
      grid-row: 3 !important;
      max-width: 180px !important;
      justify-self: center !important;
      margin-top: 4px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem figcaption {
      flex-wrap: wrap !important;
      gap: 5px 8px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem figcaption span {
      font-size: 14px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem figcaption small {
      width: auto !important;
      font-size: 9px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey {
      padding: 30px 24px 34px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps {
      grid-template-columns: minmax(0, 1fr) !important;
      margin-top: 20px !important;
      gap: 20px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps li {
      column-gap: 16px !important;
      padding: 0 0 20px !important;
      border-right: 0 !important;
      border-bottom: 1px solid var(--he-rule) !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey-steps li:last-child {
      padding-bottom: 0 !important;
      border-bottom: 0 !important;
    }
  }

  @media (max-width: 480px) {
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .home-hero {
      padding: 90px 20px 30px !important;
      row-gap: 24px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-eyebrow {
      font-size: 10px !important;
      letter-spacing: 0.04em !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-kicker {
      margin-top: 18px !important;
      font-size: 10px !important;
      letter-spacing: 0.2em !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-copy h1 {
      font-size: clamp(34px, 9.5vw, 42px) !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions {
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 10px !important;
      margin-top: 24px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-actions .action {
      width: 100% !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stats {
      display: grid !important;
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 12px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stat {
      flex-direction: column !important;
      align-items: center !important;
      gap: 5px !important;
      text-align: center !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stat strong {
      font-size: 24px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .hero-stat span {
      font-size: 11px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .cloud-emblem {
      max-width: 156px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey {
      padding-inline: 20px !important;
    }
    html[data-ft-mode]:not([data-debater-tech='on']) app-home .journey .section-heading h2 {
      font-size: 25px !important;
    }
  }
}
