/* ============================================================
   StarMoon-z1 — 子页面共享样式（features / train / eval）
   依赖：styles.css 的 :root 变量、动画 keyframes、header/nav/burger
   ============================================================ */

/* 子页面允许滚动（首页 overflow:hidden 仅单视口） */
body.sub {
  overflow: auto;
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(16px, 2.4vh, 28px) clamp(14px, 3vw, 32px) clamp(48px, 8vh, 80px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 页头（每页主标题区） */
.page-hero {
  text-align: center;
  padding: clamp(28px, 6vh, 56px) 0 clamp(22px, 4vh, 36px);
}
.page-kicker {
  display: inline-block;
  font-family: var(--font-display);
  color: var(--muted);
  font-size: clamp(12px, 1.4vw, 14px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: clamp(10px, 1.6vh, 16px);
}
.page-title {
  font-family: var(--font-display);
  color: #fff;
  font-weight: 400;
  font-size: clamp(30px, 5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.page-sub {
  max-width: 620px;
  margin: clamp(12px, 2vh, 18px) auto 0;
  font-family: var(--font-cn);
  color: #d0d0d0;
  opacity: 0.82;
  font-size: clamp(13.5px, 1.55vw, 16px);
  line-height: 1.65;
}

/* 主内容区 */
.content { flex: 1; }

/* 通用卡片栅格 */
.grid {
  display: grid;
  gap: clamp(12px, 2vw, 18px);
}
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: clamp(18px, 2.6vw, 26px);
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
}
.card-icon {
  width: clamp(40px, 4.6vw, 48px);
  height: clamp(40px, 4.6vw, 48px);
  border-radius: 13px;
  background: var(--pill-dark);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  margin-bottom: clamp(12px, 1.8vh, 16px);
}
.card-icon i {
  font-size: clamp(16px, 2vw, 19px);
  color: #fff;
}
.card h3 {
  font-family: var(--font-cn);
  font-weight: 600;
  color: #fff;
  font-size: clamp(15.5px, 1.8vw, 18px);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.card p {
  font-family: var(--font-cn);
  color: var(--muted);
  font-size: clamp(12.5px, 1.45vw, 13.5px);
  line-height: 1.65;
}
.card ul {
  list-style: none;
  margin-top: 10px;
}
.card li {
  font-family: var(--font-cn);
  color: #c8c8c8;
  font-size: clamp(12.5px, 1.45vw, 13.5px);
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
}
.card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

/* 小节标题 */
.section { margin-top: clamp(34px, 6vh, 56px); }
.section-title {
  font-family: var(--font-cn);
  font-weight: 600;
  color: #fff;
  font-size: clamp(19px, 2.6vw, 26px);
  letter-spacing: -0.02em;
  margin-bottom: clamp(6px, 1vh, 10px);
}
.section-desc {
  font-family: var(--font-cn);
  color: var(--muted);
  font-size: clamp(12.5px, 1.5vw, 14px);
  margin-bottom: clamp(16px, 2.6vh, 24px);
}

/* 步骤卡（训练流程） */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 18px);
  counter-reset: step;
}
.step {
  position: relative;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: clamp(20px, 2.8vw, 28px);
  transition: transform 0.35s ease, border-color 0.35s ease;
}
.step:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.24); }
.step-num {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  color: rgba(255, 255, 255, 0.22);
  line-height: 1;
  margin-bottom: 10px;
}
.step h3 {
  font-family: var(--font-cn);
  color: #fff;
  font-weight: 600;
  font-size: clamp(15.5px, 1.9vw, 18px);
  margin-bottom: 8px;
}
.step p {
  font-family: var(--font-cn);
  color: var(--muted);
  font-size: clamp(12.5px, 1.45vw, 13.5px);
  line-height: 1.65;
}
.step .tag {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #c8c8c8;
  font-family: var(--font-cn);
  font-size: 11.5px;
}

/* 代码块（命令示例） */
.codeblock {
  background: #0d0d0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: clamp(16px, 2.4vw, 22px) clamp(18px, 2.6vw, 26px);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(12px, 1.5vw, 13.5px);
  line-height: 1.75;
  color: #d8d8d8;
  overflow-x: auto;
  white-space: pre;
}
.codeblock .cm { color: #6b6b6b; }       /* 注释 */
.codeblock .cmd-p { color: #4ade80; }    /* 提示符 $ */
.codeblock .fl { color: #7dd3fc; }       /* 参数旗标 */

/* 表格 */
.tbl-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* 两侧渐变阴影提示可横滑 */
  background:
    linear-gradient(to right, rgba(0,0,0,0.5), transparent) left / 24px 100% no-repeat,
    linear-gradient(to left, rgba(0,0,0,0.5), transparent) right / 24px 100% no-repeat;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-cn);
  font-size: clamp(12.5px, 1.5vw, 14px);
  min-width: 520px;
}
.tbl thead th {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: clamp(11px, 1.6vh, 14px) clamp(14px, 2vw, 18px);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.tbl tbody td {
  padding: clamp(11px, 1.6vh, 14px) clamp(14px, 2vw, 18px);
  color: #c8c8c8;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
.tbl tbody tr { transition: background 0.2s ease; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
.tbl td.mono, .tbl th.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}
.tbl .hl { color: #fff; font-weight: 600; }

/* 配比条（训练领域混合） */
.mix {
  display: flex;
  height: clamp(40px, 5.4vh, 48px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mix > div {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cn);
  font-size: clamp(11px, 1.3vw, 12.5px);
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: filter 0.25s ease;
}
.mix > div:hover { filter: brightness(1.2); }
.mix .m-code { background: #1d4ed8; width: 35%; }
.mix .m-general { background: #166534; width: 30%; }
.mix .m-math { background: #9a3412; width: 25%; }
.mix .m-reason { background: #5b21b6; width: 10%; }
.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 12px;
}
.mix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-cn);
  color: var(--muted);
  font-size: 12.5px;
}
.mix-legend i {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block;
}

/* 大数字亮点（评测页） */
.bigstat {
  text-align: center;
  padding: clamp(18px, 3vh, 28px) clamp(12px, 2vw, 18px);
}
.bigstat .num {
  font-family: var(--font-display);
  color: #fff;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
}
.bigstat .cap {
  font-family: var(--font-cn);
  color: var(--muted);
  font-size: clamp(11.5px, 1.35vw, 12.5px);
  margin-top: 6px;
}

/* 页脚 */
.site-footer {
  flex-shrink: 0;
  margin-top: clamp(40px, 8vh, 72px);
  padding-top: clamp(18px, 3vh, 26px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-cn);
  color: var(--muted);
  font-size: 12.5px;
}
.site-footer a { color: #c8c8c8; transition: color 0.2s ease; }
.site-footer a:hover { color: #fff; }
.site-footer .f-links { display: flex; gap: 18px; }

/* 返回首页 */
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-cn);
  font-size: 13px;
  margin-bottom: clamp(8px, 1.4vh, 14px);
  transition: color 0.2s ease;
}
.back-home:hover { color: #fff; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  /* 表格收窄：更小的 min-width + 紧凑单元格 + 长 token 可断行（特异性对齐基础规则 table.tbl） */
  table.tbl { min-width: 380px; }
  table.tbl thead th, table.tbl tbody td {
    padding: 9px 11px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* 代码块允许横向滚动且不挤压布局 */
  .codeblock { font-size: 12px; }
  .mix { flex-direction: column; height: auto; }
  .mix > div { width: 100% !important; padding: 9px 0; }
}
