/* =========================================================
   Clash之家 · components.css
   跨页面组件:tab / toc / FAQ / 术语卡 / 客户端卡 / 文章卡
   callout / dl-fab / 线路干线与站点 / 信息屏 / 徽章 / Hero 示意卡
   ========================================================= */

/* ---------- 1. Tab 切换(站台式) ---------- */
.tabs { }

.tab-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: var(--stroke);
  background: var(--panel);
}

.tab-stop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  background: var(--panel);
  border-right: var(--stroke);
  cursor: pointer;
}
.tab-stop:last-child { border-right: 0; }
.tab-stop svg { flex-shrink: 0; }

.tab-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1px 6px;
  background: var(--panel-dim);
  border: 1px solid var(--ink);
  flex-shrink: 0;
}

.tab-stop[aria-selected="true"] {
  background: var(--signal);
  color: var(--panel);
}
.tab-stop[aria-selected="true"] .tab-code {
  background: var(--ink);
  color: var(--signal);
  border-color: var(--ink);
}
.tab-stop:hover:not([aria-selected="true"]) { background: var(--panel-dim); }

.tab-cab {
  border: var(--stroke);
  border-top: 0;
  background: var(--panel);
  padding: clamp(18px, 3vw, 30px);
}
.tab-cab[hidden] { display: none; }

@media (max-width: 640px) {
  .tab-rail { flex-direction: column; }
  .tab-stop {
    width: 100%;
    border-right: 0;
    border-bottom: var(--stroke);
    justify-content: flex-start;
  }
  .tab-stop:last-child { border-bottom: 0; }
}

/* ---------- 2. 长页分类跳转导航(toc 站点带) ---------- */
.toc-strip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border: var(--stroke);
  background: var(--panel);
  scrollbar-width: thin;
}

.toc-stop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border-right: 1px solid var(--panel-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.toc-stop:hover { background: var(--panel-dim); color: var(--ink); }

.toc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--ink);
  flex-shrink: 0;
}
.toc-stop:hover .toc-dot { background: var(--signal); }

/* ---------- 3. FAQ 折叠项 ---------- */
.qa {
  border: var(--stroke);
  background: var(--panel);
  margin-bottom: 14px;
}

.qa summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15.5px;
}
.qa summary::-webkit-details-marker { display: none; }

.qa summary::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
}

.qa summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--signal-deep);
  flex-shrink: 0;
}
.qa[open] summary::after { content: "\2212"; }
.qa[open] summary::before { background: var(--signal); }
.qa[open] summary { border-bottom: 2px solid var(--panel-dim); }

.qa-a {
  padding: 16px 18px 18px 42px;
  color: var(--text);
  font-size: 15px;
}
.qa-a p:last-child { margin-bottom: 0; }

/* ---------- 4. 术语卡 ---------- */
.term-card {
  border: var(--stroke);
  background: var(--panel);
  padding: 18px 20px;
}

.term-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  background: var(--ink);
  color: var(--signal);
  margin-bottom: 10px;
}

.term-card h3 { margin-bottom: 8px; }
.term-card p { margin-bottom: 0; font-size: 14.5px; color: var(--text); }
.term-en {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 8px;
  font-weight: 400;
}

/* ---------- 5. 下载客户端卡片 ---------- */
.client-card {
  border: var(--stroke);
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

.client-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: var(--stroke);
}
.client-head img { flex-shrink: 0; display: block; }
.client-head h3 { margin: 0; }

.client-ver {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.client-body { padding: 16px 20px 20px; }
.client-body p { font-size: 14.5px; }

.client-meta {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 13.5px;
  color: var(--text-dim);
}
.client-meta li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--panel-dim);
}
.client-meta li::before {
  content: "\25AA";
  color: var(--signal);
  flex-shrink: 0;
}

.client-get {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

/* 徽章(站牌章) */
.stamp {
  display: inline-block;
  padding: 2px 10px;
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}
.stamp-best { background: var(--signal); color: var(--panel); border-color: var(--ink); }
.stamp-good { background: var(--panel); color: var(--ok); border-color: var(--ok); }
.stamp-dead { background: var(--panel-dim); color: var(--text-dim); border-color: var(--text-dim); }

/* ---------- 6. 博客文章卡 ---------- */
.post-card {
  border: var(--stroke);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.post-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 0 var(--ink);
}

.post-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.post-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--signal-deep);
  background: var(--paper);
}

.post-card h3 { margin-bottom: 10px; }
.post-card h3 a {
  color: var(--ink);
  text-decoration: none;
}
.post-card h3 a:hover { color: var(--signal-deep); text-decoration: underline; }

.post-sum {
  font-size: 14.5px;
  color: var(--text-dim);
  margin-bottom: 0;
}

/* ---------- 7. Callout 引用块 ---------- */
.callout {
  border: var(--stroke);
  border-left: 8px solid var(--signal);
  background: var(--panel);
  padding: 16px 20px;
  margin: 0 0 1.4em;
}
.callout p:last-child { margin-bottom: 0; }

.callout-t {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--signal-deep);
  margin-bottom: 8px;
  text-transform: uppercase;
}

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

/* ---------- 8. dl-fab 右下角常驻下载引导 ---------- */
.dl-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px  20px;
  background: var(--signal);
  color: var(--panel);
  border: var(--stroke);
  box-shadow: 5px 5px 0 0 var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
}
.dl-fab svg { flex-shrink: 0; }
.dl-fab:hover {
  background: var(--signal-deep);
  color: var(--panel);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 0 var(--ink);
}
.dl-fab:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--ink);
}

@media (max-width: 640px) {
  .dl-fab { right: 12px; bottom: 12px; padding: 9px 16px; font-size: 14px; }
}

/* ---------- 9. 线路干线与站点(featuresLayout 骨架) ---------- */
.metro {
  position: relative;
}
.metro::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: var(--rail-w);
  background: var(--signal);
}

.station {
  position: relative;
  padding-left: 64px;
  padding-bottom: clamp(40px, 6vw, 72px);
}
.station:last-child { padding-bottom: 0; }

.station::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  border: 4px solid var(--paper);
  box-shadow: 0 0 0 2px var(--ink);
}

.station-no {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 2px 10px;
  background: var(--ink);
  color: var(--paper);
  margin-bottom: 10px;
}

.station h3, .station h2 { margin-bottom: 10px; }

.station-body {
  max-width: 62ch;
  font-size: 15px;
  color: var(--text);
}

.station-xfer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--signal-deep);
  text-decoration: none;
  border-bottom: 2px solid var(--signal);
  padding-bottom: 2px;
}
.station-xfer:hover { color: var(--signal); }
.station-xfer svg { flex-shrink: 0; }

/* 桌面:干线居中偏左,站点交替挂两侧 */
@media (min-width: 961px) {
  .metro::before { left: calc(38% - var(--rail-w) / 2); }

  .station {
    width: 58%;
    padding-left: 0;
    padding-right: 0;
  }
  .station:nth-child(odd) {
    margin-left: 42%;
    padding-left: 56px;
  }
  .station:nth-child(odd)::before {
    left: calc(-4% - 12px + var(--rail-w) / 2);
  }
  .station:nth-child(even) {
    margin-left: 0;
    width: 34%;
    padding-right: 56px;
    text-align: right;
  }
  .station:nth-child(even)::before {
    left: auto;
    right: calc(-4% / 0.34 * 0.34);
    right: -12px;
  }
  .station:nth-child(even) .station-body { margin-left: auto; }
  .station:nth-child(even) .station-xfer { flex-direction: row-reverse; }
}

/* ---------- 10. 车厢信息屏(代码块升级版) ---------- */
.cab-screen {
  border: var(--stroke);
  background: var(--ink);
  margin: 0 0 1.4em;
}

.cab-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--signal);
  color: var(--panel);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 6px 14px;
  border-bottom: var(--stroke);
}
.cab-strip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--panel);
  flex-shrink: 0;
}

.cab-screen pre {
  border: 0;
  margin: 0;
}

.cab-copy {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--panel);
  background: var(--ink);
  border: 1px solid var(--panel);
  padding: 2px 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.cab-copy:hover { background: var(--signal-deep); }

/* ---------- 11. Hero 静态设置面板示意卡 ---------- */
.hero-visual {
  position: relative;
}

/* 巨型「6」线路徽章 */
.badge6 {
  position: absolute;
  z-index: 0;
  width: clamp(180px, 24vw, 320px);
  height: clamp(180px, 24vw, 320px);
  border-radius: 50%;
  background: var(--signal);
  border: 10px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(96px, 13vw, 180px);
  color: var(--ink);
  line-height: 1;
  left: -12%;
  top: -10%;
  user-select: none;
}

.mock-panel {
  position: relative;
  z-index: 1;
  background: var(--panel);
  border: var(--stroke);
  transform: rotate(-1.5deg);
  box-shadow: 8px 8px 0 0 var(--ink);
  max-width: 420px;
  margin-left: auto;
}

.mock-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--signal);
  color: var(--panel);
  border-bottom: var(--stroke);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}

.mock-rows { padding: 8px 0; }

.mock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-dim);
  font-size: 14px;
  font-weight: 700;
}
.mock-row:last-child { border-bottom: 0; }
.mock-row .mono {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}
.mock-note {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  flex-shrink: 0;
}

/* 静态开关 */
.mock-switch {
  margin-left: auto;
  width: 44px;
  height: 24px;
  border: 2px solid var(--ink);
  position: relative;
  flex-shrink: 0;
  background: var(--panel-dim);
}
.mock-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--ink);
}
.mock-switch.is-on { background: var(--signal); }
.mock-switch.is-on::after { left: auto; right: 2px; background: var(--panel); }

/* 静态单选组 */
.mock-radios {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.mock-radio {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  white-space: nowrap;
}
.mock-radio.is-on { background: var(--signal); color: var(--panel); }

@media (max-width: 960px) {
  .mock-panel { margin: 40px auto 0; max-width: 100%; }
  .badge6 { left: -8%; top: -6%; }
}

/* ---------- 12. 文末下载引导卡(博客文章用) ---------- */
.post-cta {
  border: var(--stroke);
  border-top: var(--rail-w) solid var(--signal);
  background: var(--panel);
  padding: clamp(20px, 4vw, 32px);
  margin-top: clamp(32px, 5vw, 48px);
}
.post-cta h2, .post-cta h3 { margin-bottom: 10px; }
.post-cta p { color: var(--text-dim); font-size: 15px; }
.post-cta-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 13. 面包屑(博客文章页) ---------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  list-style: none;
  padding: 0;
}
.crumb li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.crumb li + li::before {
  content: "\203A";
  color: var(--signal-deep);
  flex-shrink: 0;
}
.crumb a { color: var(--text-dim); text-decoration: none; }
.crumb a:hover { color: var(--signal-deep); }
.crumb .crumb-cur {
  color: var(--ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 42ch;
}

/* ---------- 14. 标签筛选条(博客列表) ---------- */
.tag-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 16px;
  border: var(--stroke);
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tag-pill:hover { background: var(--panel-dim); }
.tag-pill.on {
  background: var(--ink);
  color: var(--signal);
}