/* ==============================================================
   Clash安装官网 · components.css
   跨页面组件:tab / toc / FAQ / 术语卡 / 客户端卡 / 文章卡 /
   callout / 徽章 / 账目表特性行 / Hero 示意卡 / dl-fab / 引导卡
   ============================================================== */

/* ---------- Tab 切换 ---------- */
.tabset {
  min-width: 0;
}

.tab-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  background: var(--paper-tint);
  border-radius: var(--r-pill);
  width: fit-content;
  max-width: 100%;
  margin-bottom: 28px;
}

.tab-btn {
  border: none;
  background: none;
  border-radius: var(--r-pill);
  padding: 9px 22px;
  font-family: var(--ff-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.tab-btn:hover {
  color: var(--brand);
}

.tab-btn[aria-selected="true"] {
  background: var(--brand);
  color: var(--paper);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.tab-pane {
  display: none;
  min-width: 0;
}

.tab-pane.on {
  display: block;
}

/* ---------- 长页分类跳转导航(纯锚点) ---------- */
.toc-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 4px;
  padding-bottom: 12px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}

.toc-rail a {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 14px;
  white-space: nowrap;
}

.toc-rail a:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

/* ---------- FAQ 折叠项(details/summary,无 JS 可用) ---------- */
.faq-fold {
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  overflow: hidden;
}

.faq-fold summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  font-weight: 700;
  color: var(--ink);
  font-size: 16px;
}

.faq-fold summary::-webkit-details-marker {
  display: none;
}

.faq-fold summary::after {
  content: "+";
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 18px;
  color: var(--ink-soft);
  transition: transform 0.18s var(--ease);
}

.faq-fold[open] summary::after {
  transform: rotate(45deg);
  color: var(--brand);
}

.faq-fold summary:hover {
  color: var(--brand);
}

.faq-body {
  padding-top: 0;
  padding-bottom: 20px;
  padding-inline: 24px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.faq-body p:last-child {
  margin-bottom: 0;
}

/* ---------- 术语卡 ---------- */
.term-card {
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  min-width: 0;
}

.term-card dt,
.term-name {
  font-weight: 800;
  color: var(--ink);
  font-size: 17px;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.term-code {
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  background: var(--paper-tint);
  border-radius: var(--r-tag);
  padding: 2px 8px;
}

.term-card dd,
.term-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.8;
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.term-grid > * {
  min-width: 0;
}

/* ---------- 客户端下载卡 ---------- */
.client-card {
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  padding: 26px;
  margin-bottom: 20px;
  min-width: 0;
}

.client-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.client-head img {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.client-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.client-ver {
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.client-desc {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.client-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-pill);
  padding: 3px 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-prime {
  background: var(--brand);
  color: var(--paper);
}

.badge-good {
  background: var(--paper-tint2);
  color: var(--brand);
}

.badge-halt {
  background: var(--paper-tint);
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
}

.badge-ok {
  background: var(--paper-tint);
  color: var(--ok);
}

.badge-warn {
  background: var(--paper-tint);
  color: var(--amber);
}

.badge-err {
  background: var(--paper-tint);
  color: var(--danger);
}

/* 事实胶囊(hero 小标签行) */
.fact-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fact-pills li {
  margin: 0;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

/* ---------- 博客文章卡 ---------- */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  padding: 26px;
  min-width: 0;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.post-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.post-date {
  font-family: var(--ff-mono);
}

.tagchip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--paper-tint);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.post-card h3 {
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.post-card h3 a {
  color: var(--ink);
}

.post-card h3 a:hover {
  color: var(--brand);
  text-decoration: none;
}

.post-sum {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.post-grid > * {
  min-width: 0;
}

/* ---------- Callout 引用块 ---------- */
.callout {
  border-left: 3px solid var(--brand);
  background: var(--paper-tint);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-inline: 20px;
  margin: 0 0 1.2em;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.callout-ok {
  border-left-color: var(--ok);
}

.callout-warn {
  border-left-color: var(--amber);
}

.callout-err {
  border-left-color: var(--danger);
}

/* ---------- 账目表式特性清单 ---------- */
.ledger {
  border-top: 1px solid var(--hairline);
}

.ledger-row {
  display: grid;
  grid-template-columns: 32% 1fr;
  gap: 16px 40px;
  align-items: start;
  padding-top: 30px;
  padding-bottom: 30px;
  padding-inline: 16px;
  border-bottom: 1px solid var(--hairline);
  transition: background-color 0.18s var(--ease);
}

.ledger-row > * {
  min-width: 0;
}

.ledger-row:hover {
  background: var(--paper-tint);
}

.ledger-name h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.ledger-sub {
  color: var(--ink-soft);
  font-weight: 300;
  font-size: 14px;
  margin: 0;
}

.ledger-body {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.ledger-body p:last-child {
  margin-bottom: 0;
}

.ledger-chip {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--brand-deep);
  background: var(--paper-tint2);
  border-radius: var(--r-tag);
  padding: 4px 10px;
  word-break: break-all;
}

/* ---------- Hero 静态客户端示意卡(纯静态,无动画) ---------- */
.mockcard {
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  max-width: 460px;
  width: 100%;
  font-size: 13px;
}

.mock-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
  padding-inline: 16px;
  border-bottom: 1px solid var(--hairline);
}

.mock-dots {
  display: flex;
  gap: 6px;
}

.mock-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper-tint2);
  flex-shrink: 0;
}

.mock-title {
  flex: 1;
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 33px;
}

.mock-main {
  display: grid;
  grid-template-columns: 128px 1fr;
}

.mock-main > * {
  min-width: 0;
}

.mock-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-inline: 12px;
  background: var(--paper-tint);
  border-right: 1px solid var(--hairline);
}

.mock-group {
  border-radius: var(--r-pill);
  padding: 6px 14px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-group.is-live {
  background: var(--brand);
  color: var(--paper);
  font-weight: 600;
}

.mock-list {
  padding-top: 12px;
  padding-bottom: 12px;
  padding-inline: 16px;
}

.mock-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--paper-tint);
  color: var(--ink);
}

.mock-node:last-child {
  border-bottom: none;
}

.mock-node-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mock-ms {
  font-family: var(--ff-mono);
  color: var(--ok);
  flex-shrink: 0;
}

.mock-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-inline: 16px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-family: var(--ff-mono);
  font-size: 12px;
}

.mock-foot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}

/* ---------- 静态事实装饰条 ---------- */
.factline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-size: 13px;
}

.factline b {
  font-family: var(--ff-mono);
  font-weight: 700;
  color: var(--brand);
  margin-right: 6px;
}

/* ---------- 步骤序号(教程/快速上手) ---------- */
.step-flow {
  list-style: none;
  margin: 0 0 1.2em;
  padding: 0;
  counter-reset: stepnum;
}

.step-flow > li {
  counter-increment: stepnum;
  position: relative;
  padding-left: 56px;
  margin-bottom: 28px;
  min-width: 0;
}

.step-flow > li::before {
  content: counter(stepnum, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper-tint2);
  color: var(--brand);
  font-family: var(--ff-mono);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- 文末下载引导卡(博客文章页) ---------- */
.dl-cta {
  background: var(--paper-tint);
  border-radius: var(--r-card);
  padding-top: 32px;
  padding-bottom: 32px;
  padding-inline: 32px;
  margin-top: 48px;
  text-align: center;
}

.dl-cta h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.dl-cta p {
  color: var(--ink-soft);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.dl-cta-acts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- 右下角常驻下载浮层 ---------- */
.dl-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand);
  color: var(--paper);
  border-radius: var(--r-pill);
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.dl-fab:hover {
  background: var(--brand-deep);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-2px);
}

.dl-fab svg {
  flex-shrink: 0;
}

/* ---------- 面包屑(博客文章页) ---------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--ink-soft);
  list-style: none;
  padding: 0;
}

.crumbs li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.crumbs li + li::before {
  content: "/";
  color: var(--hairline);
  flex-shrink: 0;
}

.crumbs a {
  color: var(--ink-soft);
}

.crumbs a:hover {
  color: var(--brand);
}

.crumbs .crumb-now {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46vw;
}

/* ---------- 色板样例(仅 design-preview 使用) ---------- */
.swatch-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.swatch-row > * {
  min-width: 0;
}

.swatch {
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  background: var(--paper);
}

.swatch i {
  display: block;
  height: 72px;
}

.swatch span {
  display: block;
  padding-top: 8px;
  padding-bottom: 10px;
  padding-inline: 12px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink-soft);
  word-break: break-all;
}

.sw-paper i {
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.sw-tint i {
  background: var(--paper-tint);
}

.sw-tint2 i {
  background: var(--paper-tint2);
}

.sw-hairline i {
  background: var(--hairline);
}

.sw-brand i {
  background: var(--brand);
}

.sw-branddeep i {
  background: var(--brand-deep);
}

.sw-link i {
  background: var(--link-blue);
}

.sw-ink i {
  background: var(--ink);
}

.sw-inksoft i {
  background: var(--ink-soft);
}

.sw-ok i {
  background: var(--ok);
}

.sw-amber i {
  background: var(--amber);
}

.sw-danger i {
  background: var(--danger);
}

/* ---------- 组件响应式 ---------- */
@media (max-width: 720px) {
  .ledger-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-inline: 8px;
  }

  .mock-main {
    grid-template-columns: 104px 1fr;
  }

  .dl-fab {
    right: 14px;
    bottom: 16px;
    padding: 11px 18px;
    font-size: 14px;
  }

  .dl-cta {
    padding-inline: 20px;
  }
}