/* ==========================================================================
   sections.css —— 内容区块：结论 / 功能 / 弹幕社区 / 分类 / 安装 / 问答 / 收尾 CTA / 页脚
   每个组件的响应式覆盖都跟在本组件定义之后。
   ========================================================================== */

/* ---------------- 30 秒结论 ---------------- */
.answer {
  margin-bottom: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(59, 232, 216, 0.35);
}

.answer__label {
  color: var(--neon);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.answer__text {
  margin-top: var(--sp-3);
  color: var(--text-body);
  font-size: var(--fs-body);
  line-height: 1.9;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 1.375rem;
  border-radius: var(--r-md);
  background: var(--surface);
}

.fact__k {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.fact__v {
  color: var(--accent, var(--neon));
  font-family: var(--font-num);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.4;
}

.fact__s {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* ---------------- 核心功能 ---------------- */
.feat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feat:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 1px var(--accent, var(--neon));
}

.feat__title {
  font-size: var(--fs-h3);
}

.feat__text {
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: 1.65;
}

/* ---------------- 弹幕社区 ---------------- */
.danmu {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--sp-6);
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 61, 139, 0.28);
}

.reader {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.reader__screen {
  position: relative;
  height: 340px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface-2);
}

.reader__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 弹幕层：绝对定位 + left 动画。
   用 left 而不是 transform，是因为位移距离要按「容器宽度 + 自身宽度」算，
   transform 的百分比只认元素自身，做不到。容器 overflow:hidden 会裁掉裁切边。 */
.dm-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.dm-layer .dm {
  position: absolute;
  left: 100%;
  top: var(--t, 10%);
  animation: dm-run var(--d, 16s) linear var(--delay, 0s) infinite;
}

.dm-layer .dm:nth-of-type(1) { --t: 8%; --d: 15s; --delay: -1s; }
.dm-layer .dm:nth-of-type(2) { --t: 22%; --d: 18s; --delay: -6s; }
.dm-layer .dm:nth-of-type(3) { --t: 38%; --d: 16s; --delay: -11s; }
.dm-layer .dm:nth-of-type(4) { --t: 54%; --d: 20s; --delay: -3s; }

@keyframes dm-run {
  from { left: 100%; }
  to { left: -100%; }
}

.dm-form {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px 5px 5px var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.dm-input {
  flex: 1;
  min-width: 0;
  padding-block: 6px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: var(--fs-xs);
}

.dm-input::placeholder {
  color: var(--text-muted);
}

/* 焦点环画在整条胶囊上：画在 input 上会切成「左圆右直」的怪形状 */
.dm-input:focus-visible {
  outline: none;
}

.dm-form:focus-within {
  box-shadow: inset 0 0 0 1px var(--neon);
}

.dm-send {
  flex: none;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--neon);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.dm-status {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
  text-align: center;
}

.dm-status.is-live {
  color: var(--neon);
}

.rules {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.rule {
  padding: var(--sp-5);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.rule--mine {
  background: #2a1030;
  box-shadow: inset 0 0 0 1px rgba(255, 61, 139, 0.5);
}

.rule__title {
  margin-top: var(--sp-2);
  font-size: var(--fs-h3);
}

.rule__text {
  margin-top: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: 1.7;
}

.rule--mine .rule__text {
  color: #d9cde8;
}

@media (max-width: 900px) {
  .danmu {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-5);
  }

  .reader {
    width: min(300px, 100%);
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* 关掉动画时气泡必须落回静态流，否则会全部停在 left:100% 看不见 */
  .dm-layer {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    padding: var(--sp-3);
  }

  .dm-layer .dm {
    position: static;
    left: auto;
    animation: none;
  }
}

/* ---------------- 题材分类 ---------------- */
.genre {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 8.125rem;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.genre:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px var(--accent, var(--neon));
}

.genre__en {
  color: var(--accent, var(--neon));
  font-family: var(--font-num);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.genre__zh {
  margin-top: var(--sp-2);
  color: var(--text);
  font-size: 1.4375rem;
  font-weight: 900;
  line-height: 1.2;
}

.genre__sub {
  margin-top: var(--sp-1);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* ---------------- 安装步骤 ---------------- */
.install__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.os-col {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.os-col__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.os-col__meta {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.step {
  display: flex;
  gap: var(--sp-3);
}

.step + .step {
  margin-top: var(--sp-4);
}

.step__num {
  flex: none;
  width: 1.5rem;
  color: var(--accent, var(--neon));
  font-family: var(--font-num);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.4;
}

.step__title {
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: 700;
}

.step__text {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

@media (max-width: 760px) {
  .install__cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------- 常见问题 ---------------- */
.qa {
  padding: var(--sp-5);
  border-radius: var(--r-md);
  background: var(--surface);
}

.qa__q {
  color: var(--accent, var(--neon));
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.5;
}

.qa__a {
  margin-top: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.75;
}

/* ---------------- 收尾 CTA ---------------- */
.cta {
  padding-block: var(--sp-9);
  background: var(--neon);
  text-align: center;
}

.cta__title {
  margin-top: var(--sp-3);
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.cta__lead {
  margin-top: var(--sp-3);
  color: var(--ink-soft);
  font-size: var(--fs-body);
  font-weight: 500;
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.cta__version {
  margin-top: var(--sp-4);
  color: var(--ink-soft);
  font-size: var(--fs-xs);
}

@media (max-width: 620px) {
  .cta {
    padding-block: var(--sp-8);
  }

  .cta__actions .btn {
    width: 100%;
  }
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  padding-block: var(--sp-8) var(--sp-6);
  background: #08060c;
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-7);
}

.footer__name {
  color: var(--text);
  font-family: var(--font-num);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.footer__desc {
  margin-top: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-7);
}

.footer__title {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.footer__list {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

.footer__list a {
  color: var(--text-muted);
}

.footer__list a:hover {
  color: var(--neon);
}

.footer__bottom {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.8;
}

@media (max-width: 620px) {
  .footer__cols {
    gap: var(--sp-6) var(--sp-7);
  }
}

/* ---------------- 2026-12-03 追加：栅格后紧接结论块 ----------------
   原来 .answer 只带 margin-bottom，前面接 .grid 时会贴死。
   只加一条相邻兄弟间隔，不改既有 .answer 规则本身。 */
.grid + .answer {
  margin-top: var(--sp-4);
}
