/* ==========================================================================
   components.css — 可复用零件：按钮 / 胶囊 / 卡片 / 图标块 / 提示框 /
   表格 / 步骤清单 / 问答 / 目录 / 面包屑 / 图位
   响应式覆盖紧跟各自组件定义，不放到 layout.css
   ========================================================================== */

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: 15px 26px;
  border-radius: var(--r-lg);
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn--brand {
  background: var(--brand);
  /* 品牌绿实心按钮上一律白字。
     ⚠ 不能直接改 --on-brand：那个变量还被「浅绿渐变 CTA 标题」和「浅绿底 callout 图标」
       引用，它们底色是 #f2fcf8~#d5f4e8 的近白绿，改成白色文字会直接看不见。 */
  color: #fff;
}

.btn--brand:hover {
  background: var(--brand-strong);
}

/* 浅灰底上的次级动作不用浅灰实心（看着像禁用），用描边款 */
.btn--ghost {
  background: var(--bg);
  color: var(--brand-ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn--ghost:hover {
  box-shadow: inset 0 0 0 1px var(--brand-chip);
  background: var(--brand-surface);
}

.btn--muted {
  background: #f2f4f7;
  color: var(--ink);
}

.btn--muted:hover {
  background: #e9ecf2;
}

.btn--pill {
  border-radius: var(--r-pill);
}

.btn--sm {
  padding: 10px 20px;
  font-size: var(--fs-xs);
  border-radius: var(--r-pill);
}

/* 浅品牌底的胶囊链接（「查看全部类型」这类次级入口） */
.btn--mint {
  padding: 10px 20px;
  border-radius: var(--r-pill);
  background: var(--brand-surface);
  color: var(--brand-ink);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.btn--mint:hover {
  background: var(--brand-chip);
}

.btn__arrow {
  flex: none;
  width: 14px;
  height: 14px;
}

@media (max-width: 560px) {
  .btn {
    padding: 13px 20px;
    font-size: var(--fs-sm);
  }
}

/* ------------------------------ 胶囊 / 眉标 ------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--brand-surface-2);
  color: var(--brand-ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
}

.pill__dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--brand-mark);
}

.pill--mint {
  background: var(--brand-surface);
  font-size: var(--fs-2xs);
}

@media (max-width: 560px) {
  .pill {
    padding: 5px 10px;
    font-size: var(--fs-micro);
  }
}

/* ------------------------------ 卡片 ------------------------------ */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: 26px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--bg);
}

.card--flat {
  border-color: transparent;
  background: var(--bg-alt);
  box-shadow: none;
}

.card--pad-sm {
  gap: var(--sp-2);
  padding: 18px 20px;
}

/* 整张卡当链接用 */
a.card {
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

a.card:hover {
  text-decoration: none;
  border-color: var(--brand-chip);
  box-shadow: 0 8px 22px rgba(18, 20, 26, 0.07);
}

.card__title {
  font-size: 19px;
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--ink);
}

.card__desc {
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-body);
}

.card__link {
  margin-top: auto;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--brand-ink);
}

@media (max-width: 560px) {
  .card {
    padding: 18px;
    gap: var(--sp-5);
  }

  .card__title {
    font-size: 16px;
  }

  .card__desc {
    font-size: var(--fs-xs);
  }
}

/* ------------------------------ 图标块 ------------------------------ */
.icon-tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--brand-surface);
  color: var(--brand-ink);
}

.icon-tile--gray {
  background: #f2f4f7;
}

.icon-tile svg {
  width: 22px;
  height: 22px;
}

/* ------------------------------ 提示框 ------------------------------ */
.callout {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-5);
  padding: 15px 18px;
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  line-height: 1.85;
}

.callout__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border-radius: var(--r-pill);
  font-size: var(--fs-micro);
  font-weight: 700;
  color: var(--text-invert);
}

.callout__text {
  min-width: 0;
}

.callout--warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.callout--warn .callout__icon {
  background: var(--warn-mark);
}

.callout--amber {
  background: var(--amber-bg);
  color: var(--amber-ink);
}

.callout--amber .callout__icon {
  background: var(--warn-mark);
}

.callout--danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.callout--danger .callout__icon {
  background: var(--danger-mark);
}

.callout--ok {
  align-items: center;
  background: var(--brand-surface);
  color: #1e4a3e;
}

.callout--ok .callout__icon {
  background: var(--brand);
  margin-top: 0;
}

/* ------------------------------ 摘要框 ------------------------------ */
.summary {
  padding: 18px 22px;
  border-radius: var(--r-md);
  background: var(--brand-surface);
  color: #1e4a3e;
  font-size: var(--fs-body);
  line-height: 1.85;
}

/* 摘要条里的分类跳转：必须看得出能点，否则没人会去点 */
.summary a {
  color: var(--brand-ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (max-width: 560px) {
  .summary {
    padding: 14px 16px;
    font-size: var(--fs-xs);
  }
}

/* ------------------------------ 表格 ------------------------------ */
.tbl {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}

.tbl table {
  font-size: var(--fs-sm);
}

.tbl thead th {
  padding: 14px 22px;
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.tbl tbody td {
  padding: 15px 22px;
  color: var(--text-body);
  line-height: 1.6;
  vertical-align: top;
}

.tbl tbody tr:nth-child(even) td {
  background: var(--bg-alt-2);
}

.tbl tbody tr + tr td {
  border-top: 1px solid var(--line-soft);
}

.tbl td:first-child {
  color: var(--ink);
  font-weight: 600;
}

.tbl .is-ok {
  color: var(--brand-ink);
  font-weight: 700;
}

.tbl .is-mid {
  color: var(--amber-ink);
  font-weight: 700;
}

.tbl .is-high {
  color: var(--danger-ink-strong);
  font-weight: 700;
}

.tbl .is-off {
  color: var(--text-muted);
}

/* 窄屏：表格改成一条条记录，避免横向滚动 */
@media (max-width: 640px) {
  .tbl {
    border: 0;
    background: none;
    border-radius: 0;
    overflow: visible;
  }

  .tbl thead {
    display: none;
  }

  .tbl table,
  .tbl tbody,
  .tbl tr,
  .tbl td {
    display: block;
    width: 100%;
  }

  .tbl tbody tr {
    padding: 6px 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg);
  }

  .tbl tbody tr + tr {
    margin-top: var(--sp-4);
  }

  .tbl tbody tr:nth-child(even) td,
  .tbl tbody tr + tr td {
    background: none;
    border-top: 0;
  }

  .tbl tbody td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: var(--sp-4);
    padding: 5px 14px;
    font-size: var(--fs-xs);
  }

  .tbl tbody td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: var(--fs-2xs);
    font-weight: 700;
    line-height: 1.7;
  }
}

/* ------------------------------ 清单：校验 / 排查步骤 ------------------------------ */
.list {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}

.list__item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: var(--sp-7);
  padding: 15px 22px;
  border-top: 1px solid var(--line-soft);
}

.list__item:first-child {
  border-top: 0;
}

.list__item:nth-child(even) {
  background: var(--bg-alt-2);
}

.list__no {
  color: var(--brand-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.list__title {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.7;
  color: var(--ink);
}

.list__desc {
  margin-top: 2px;
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: var(--text-body);
}

/* 8 步排查：说明与标题同一行，省高度 */
.list--inline .list__item {
  grid-template-columns: 26px 176px minmax(0, 1fr);
  align-items: baseline;
}

.list--inline .list__desc {
  margin-top: 0;
}

@media (max-width: 880px) {
  .list--inline .list__item {
    grid-template-columns: 26px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .list__item {
    gap: var(--sp-4);
    padding: 12px 14px;
  }

  .list__title {
    font-size: var(--fs-sm);
  }
}

/* ------------------------------ 问答（原生 details） ------------------------------ */
.qa {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg);
  overflow: hidden;
}

.qa + .qa {
  margin-top: var(--sp-5);
}

.qa__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-7);
  padding: 20px 26px;
  font-size: 16px;
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.qa__q::-webkit-details-marker {
  display: none;
}

.qa[open] .qa__q {
  padding-bottom: 12px;
}

.qa__chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.qa[open] .qa__chevron {
  transform: rotate(180deg);
}

.qa__a {
  max-width: 820px;
  padding: 0 26px 20px;
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: var(--text-body);
}

@media (max-width: 560px) {
  .qa__q {
    padding: 15px 16px;
    font-size: var(--fs-sm);
  }

  .qa[open] .qa__q {
    padding-bottom: 8px;
  }

  .qa__a {
    padding: 0 16px 15px;
    font-size: var(--fs-xs);
  }
}

/* ------------------------------ 目录 ------------------------------ */
.toc {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.toc__title {
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.toc__link {
  display: block;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-body);
}

.toc__link:hover {
  color: var(--brand-ink);
  text-decoration: none;
}

.toc__link[aria-current] {
  color: var(--brand-ink);
  font-weight: 600;
}

/* ------------------------------ 面包屑 ------------------------------ */
.crumb {
  padding-block: 18px;
  background: var(--bg);
}

.crumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
}

.crumb__link {
  color: var(--text-muted);
}

.crumb__sep {
  color: #c7cdd6;
}

/* 分类层级还没有独立页面时用它：是文字，不是假链接 */
.crumb__text {
  color: var(--text-muted);
}

.crumb__here {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 560px) {
  .crumb {
    padding-block: 12px;
  }

  .crumb__list {
    font-size: var(--fs-2xs);
  }
}

/* ------------------------------ 图位 ------------------------------ */
.media {
  display: block;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--brand-surface);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--side {
  border-radius: var(--r-xl);
}

/* ------------------------------ 数据 ------------------------------ */
.stat__num {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}

.stat__num--brand {
  color: var(--brand-ink);
}

/* 量词跟数字同号会把这一行压塌，缩小一档并贴紧 */
.stat__unit {
  margin-left: 3px;
  font-size: 0.6em;
  font-weight: 700;
}

.stat__label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ------------------------------ 小标签 ------------------------------ */
.tagline {
  font-size: var(--fs-2xs);
  font-weight: 500;
  color: var(--brand-ink);
}

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--brand-ink);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

.meta__sep {
  color: #c7cdd6;
}

.meta__ok {
  color: var(--brand-ink);
  font-weight: 500;
}

/* --------------------------- 下载卡（下载页首屏） --------------------------- */
.dlcard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--bg);
}

.dlcard--primary {
  border-color: var(--brand-chip);
  background: var(--brand-surface);
}

.dlcard__os {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-ink);
}

.dlcard__title {
  font-size: 21px;
  font-weight: 800;
  line-height: var(--lh-tight);
  color: var(--ink);
}

.dlcard__meta {
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

/* 撑满卡片宽度：下载按钮是这一屏的主行动点 */
.dlcard__btn {
  width: 100%;
  margin-top: var(--sp-2);
}

.dlcard__alt {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--brand-ink);
  text-align: center;
}

@media (max-width: 640px) {
  .dlcard {
    padding: 20px;
  }

  .dlcard__title {
    font-size: 19px;
  }
}

/* ------------------------- 下载页（单列、卡片为主） ------------------------- */
.dl-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-10);
  max-width: 1000px;
  margin-inline: auto;
}

.dl-page__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dl-page__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* APK 直链的系统提示，只在按钮下面补一句，不单独占一块 */
.dl-page__tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: var(--sp-5);
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

.dl-page__tip-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: var(--r-pill);
  background: var(--brand-chip);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* 下载页只有两张主卡，间距比通用栅格松一档 */
.dl-page .grid {
  gap: var(--sp-7);
}

/* 窄屏下元信息的分隔点会掉到行尾，直接隐藏靠间距区分 */
@media (max-width: 560px) {
  .dl-page__meta .meta__sep {
    display: none;
  }

  .dl-page__meta {
    gap: 6px 14px;
  }
}
