/* ==========================================================================
   官网内容子页专用块：/download/ · /changelog/ · /help/
   骨架（container / doc-head / lead / table / note / code / footer 排版）
   一律复用 css/doc.css，这里只放这三个页面各自独有的块。
   首页与文档页不加载本文件。

   令牌同样只消费不定义，全部带兜底值（理由见 site-nav.css 顶部注释）。
   ========================================================================== */

/* ---------- 页头与正文容器 ---------- */
/* doc.css 的 h1 是 44px 的文档标题尺度，内容页顶栏下再接一屏大标题会顶得太高 */
.page-head {
  padding: 40px 0 8px;
}
.page-head h1 {
  margin-bottom: 16px;
}
.page-body {
  padding: 32px 0 8px;
}
.page-body > section {
  margin-bottom: 56px;
}
.page-body h2 {
  margin-top: 0;
}

/* 小标签：版本号 / 状态 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  border: 1px solid var(--hairline);
  color: var(--muted);
  background: var(--surface-soft);
  white-space: nowrap;
}
.pill.is-accent {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}
@supports not (border-color: color-mix(in srgb, red 50%, transparent)) {
  .pill.is-accent {
    border-color: var(--primary);
  }
}

/* ---------- /download/ ---------- */
.dl-card {
  border: 1px solid var(--primary);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-card);
  padding: 36px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
}
.dl-card h2 {
  font-size: 22px;
  margin: 0 0 8px;
}
.dl-card-sub {
  color: var(--body);
  font-size: 14px;
  margin: 0 0 16px;
}
.dl-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dl-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}
.dl-card-actions .btn {
  width: 100%;
}
.dl-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* 装机信息表：复用 doc.css 的 table，只把首列收窄 */
.dl-table td:first-child,
.dl-table th:first-child {
  white-space: nowrap;
  color: var(--body);
}
.dl-table code {
  background: transparent;
  padding: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}
.steps li {
  position: relative;
  padding-left: 38px;
  font-size: 14.5px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps strong {
  color: var(--ink);
}

/* ---------- /changelog/ ---------- */
.cl-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cl-item {
  position: relative;
  padding: 0 0 40px 28px;
  border-left: 1px solid var(--hairline);
}
.cl-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.cl-item::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--canvas);
  border: 1.5px solid var(--hairline);
}
.cl-item.is-latest::before {
  background: var(--primary);
  border-color: var(--primary);
}
.cl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.cl-ver {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.cl-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.cl-scope {
  font-size: 12px;
  color: var(--muted);
}
.cl-body ul {
  margin: 0;
  padding-left: 18px;
}
.cl-body li {
  font-size: 14.5px;
  margin-bottom: 10px;
}
.cl-body li strong {
  color: var(--ink);
}

/* ---------- /help/ ---------- */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.help-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-soft);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.help-card:hover {
  border-color: var(--primary);
  background: var(--surface-card);
}
.help-card-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.help-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

/* 顶部搜索（js/help-search.js 即时过滤）：容器默认 hidden，脚本摘掉才出现。
   hidden 属性会被任何 display 声明盖掉（.help-search 若写了 display 就再也藏不住），
   所以这里显式补一条 [hidden] 规则——同 .shot-ctl[hidden] 的教训。 */
.help-search[hidden],
.help-search-status[hidden] {
  display: none;
}
.help-search {
  margin-top: 22px;
  max-width: 520px;
}
.help-search-input {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md, 8px);
  outline: none;
  transition:
    border-color 0.2s,
    background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.help-search-input::placeholder {
  color: var(--muted);
}
.help-search-input:focus {
  border-color: var(--primary);
  background: var(--surface-card);
}
/* 搜索期间被 JS 隐藏的条目/整段：hidden 默认 display:none 已够，
   但 .faq-item 若被别处声明过 display 需兜底（details 元素无此声明，保险起见） */
.faq-item[hidden] {
  display: none;
}
.help-search-status {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.help-search-status a {
  color: var(--primary);
}

.faq {
  border-top: 1px solid var(--hairline);
  padding: 0;
}
.faq-item {
  border-bottom: 1px solid var(--hairline);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 32px 18px 0;
  position: relative;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 400;
  color: var(--primary);
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item summary:hover {
  color: var(--primary);
}
.faq-body {
  padding: 0 32px 22px 0;
  font-size: 14.5px;
}
.faq-body > :last-child {
  margin-bottom: 0;
}
.faq-body ul {
  padding-left: 18px;
}

/* ---------- /status/ 服务状态 ---------- */
/* 三态配色：正常沿用品牌青（--accent-teal），降级用琥珀，故障用砖红。
   故障红刻意不复用 --primary（橙红）——那是品牌色，"降级"与"故障"必须一眼分得开。 */
.st-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
}
.st-dot[data-state='operational'] {
  background: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(93, 184, 166, 0.22);
}
.st-dot[data-state='degraded'] {
  background: #d9a441;
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.22);
}
.st-dot[data-state='outage'] {
  background: #c0503f;
  box-shadow: 0 0 0 3px rgba(192, 80, 63, 0.22);
}

.st-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 26px;
  border: 1px solid var(--hairline);
  border-left-width: 3px;
  border-radius: var(--radius-md, 8px);
  background: var(--surface-soft);
}
.st-banner[data-state='operational'] {
  border-left-color: var(--accent-teal);
}
.st-banner[data-state='degraded'] {
  border-left-color: #d9a441;
}
.st-banner[data-state='outage'] {
  border-left-color: #c0503f;
}
.st-banner[data-state='unknown'] {
  border-left-color: var(--muted);
}
.st-banner .st-dot {
  margin-top: 7px;
}
.st-banner-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.st-banner-sub {
  font-size: 14px;
  color: var(--body);
  line-height: 1.7;
}

.st-updated {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.st-refresh {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.st-refresh:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface-soft);
}
.st-refresh:disabled {
  color: var(--muted);
  cursor: default;
}

.st-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
}
.st-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}
.st-item .st-dot {
  margin-top: 7px;
}
.st-item-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.st-item-note {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
}

.st-table th {
  width: 148px;
  white-space: nowrap;
  color: var(--body);
  font-weight: 500;
}
.st-table td {
  font-size: 14px;
}

/* ---------- /i/<code> 邀请落地页 ---------- */
/* 这一页只服务一个动作：让被邀请人点下那个按钮。所以 CTA 放在一张
   带品牌色描边的卡里，邀请码本身就是卡的主角。 */
.iv-card {
  border: 1px solid var(--primary);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-card);
  padding: 32px;
  max-width: 640px;
}
.iv-code-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.iv-code {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink);
  padding: 8px 16px;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm, 6px);
  background: var(--canvas);
  /* 码是手抄友好的大写字母表，别让浏览器把它拆行 */
  white-space: nowrap;
}
.iv-copy {
  font: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.iv-copy:hover {
  border-color: var(--primary);
  background: var(--surface-soft);
}
.iv-copy.is-done {
  color: var(--accent-teal);
  border-color: var(--accent-teal);
}
.iv-code-hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 22px;
}
.iv-card .note,
.iv-card .note.warn {
  margin-bottom: 22px;
}
.iv-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.iv-fineprint {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.iv-attribution {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 640px;
}

.iv-hooks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.iv-hook {
  padding: 20px 22px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-soft);
}
.iv-hook-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.iv-hook-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--body);
  line-height: 1.7;
}

@media (max-width: 560px) {
  .iv-card {
    padding: 24px 20px;
  }
  .iv-code {
    font-size: 21px;
    letter-spacing: 0.12em;
    padding: 7px 12px;
  }
  .iv-actions .btn {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .dl-card {
    grid-template-columns: 1fr;
    padding: 28px 22px;
  }
  .dl-card-actions {
    min-width: 0;
  }
  .page-head {
    padding-top: 28px;
  }
}

@media (max-width: 560px) {
  .page-body > section {
    margin-bottom: 44px;
  }
  .cl-item {
    padding-left: 20px;
  }
  .faq-item summary {
    font-size: 15px;
    padding-right: 28px;
  }
  .faq-body {
    padding-right: 4px;
  }
  .st-banner {
    padding: 20px 18px;
  }
  .st-banner-title {
    font-size: 17px;
  }
  .st-table th {
    width: auto;
  }
}
