/* ============================================================
   鲸致 API — 内页样式（文档 / 条款 / 隐私 / 状态）
   依赖 style.css 的 CSS 变量，引用顺序：style.css → page.css
   基调沿用 Studio Dark：克制、极细边框、单一强调色
   ============================================================ */

/* ---------------- 通用页头 ---------------- */
.page { padding: 52px 0 96px; }

.page-head {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 44px;
}
.page-title {
  font-size: clamp(27px, 4vw, 40px);
  font-weight: 620;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.page-desc {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 700px;
  line-height: 1.72;
}
.page-meta {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--text-mute);
}

.crumb {
  font-size: 13.5px;
  color: var(--text-mute);
  margin-bottom: 18px;
}
.crumb a { transition: color 0.18s var(--ease); }
.crumb a:hover { color: var(--text); }
.crumb span { margin: 0 8px; opacity: 0.5; }

/* ============================================================
   文档页
   ============================================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 208px 1fr;
  gap: 52px;
  align-items: start;
}

.docs-nav { position: sticky; top: 92px; }
.docs-nav h4 {
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 500;
  margin-bottom: 14px;
  padding-left: 12px;
}
.docs-nav ul { list-style: none; }
.docs-nav a {
  display: block;
  font-size: 14.5px;
  color: var(--text-mute);
  padding: 7px 12px;
  border-left: 1.5px solid var(--border);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.docs-nav a:hover { color: var(--text); border-left-color: var(--text-mute); }
.docs-nav a.active {
  color: var(--text);
  border-left-color: var(--accent);
}

.doc-sec { padding-bottom: 56px; margin-bottom: 48px; border-bottom: 1px solid var(--border); }
.doc-sec:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.doc-sec > h2 {
  font-size: 23px;
  font-weight: 620;
  letter-spacing: -0.012em;
  margin-bottom: 12px;
}
.doc-sec > h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 12px;
}
.doc-sec p {
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 14px;
}
.doc-sec > p { max-width: 760px; }

.endpoint {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  padding: 12px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13.5px;
  margin-bottom: 18px;
  word-break: break-all;
}
.method {
  flex-shrink: 0;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 69, 0.28);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 14.5px;
}
.doc-table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.doc-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
  line-height: 1.65;
}
.doc-table tr:last-child td { border-bottom: none; }
.doc-table td code { font-size: 12.5px; white-space: nowrap; }
.doc-table .req { color: var(--accent); font-size: 12.5px; }

.callout {
  display: flex;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(127, 179, 232, 0.04);
  margin: 20px 0;
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.72;
}
.callout.warn {
  border-left-color: var(--accent);
  background: rgba(255, 122, 69, 0.045);
}
.callout strong { color: var(--text); font-weight: 600; }

/* ============================================================
   条款 / 隐私 等法律页
   ============================================================ */
.legal-wrap {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 52px;
  align-items: start;
}
.legal { max-width: 780px; }

.toc {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.toc h4 {
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 500;
  margin-bottom: 12px;
}
.toc ol { list-style: decimal; padding-left: 17px; }
.toc li { font-size: 14px; color: var(--text-dim); margin-bottom: 7px; line-height: 1.6; }
.toc a { transition: color 0.18s var(--ease); }
.toc a:hover { color: var(--accent); }

.legal h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 44px 0 14px;
}
.legal h2:first-of-type { margin-top: 0; }
.legal h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 10px;
  color: var(--text);
}
.legal p {
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.85;
  margin-bottom: 14px;
}
.legal ul { list-style: none; margin: 0 0 16px; }
.legal li {
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.8;
  padding-left: 19px;
  position: relative;
  margin-bottom: 8px;
}
.legal li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-mute);
}
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--blue); }
.legal a:hover { text-decoration: underline; }

.legal-note {
  padding: 15px 19px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 122, 69, 0.045);
  margin: 24px 0;
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.75;
}
.legal-foot {
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-mute);
}

/* ============================================================
   服务状态页
   ============================================================ */
.status-card {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 44px;
}
.status-card .pulse {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #4CAF7D;
}
.status-card h2 { font-size: 19px; font-weight: 600; margin-bottom: 3px; }
.status-card p { font-size: 14.5px; color: var(--text-mute); }

.block-title {
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 500;
  margin-bottom: 14px;
}

.comp {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 44px;
}
.comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.comp-row:last-child { border-bottom: none; }
.comp-name { font-size: 15px; }
.comp-sub { font-size: 13px; color: var(--text-mute); margin-top: 2px; }
.comp-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.dot-ok   { width: 7px; height: 7px; border-radius: 50%; background: #4CAF7D; }
.dot-warn { width: 7px; height: 7px; border-radius: 50%; background: #D9A441; }
.dot-down { width: 7px; height: 7px; border-radius: 50%; background: #D0554B; }
/* 待接入 / 无记录：刻意用中性灰，不与"正常"的绿混淆 */
.dot-idle { width: 7px; height: 7px; border-radius: 50%; background: #5A6472; }

.uptime-wrap { margin-bottom: 44px; }
.uptime-bar {
  display: flex;
  gap: 2px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.uptime-day { flex: 1; height: 30px; border-radius: 2px; background: #21302A; }
.uptime-day.deg  { background: #3A3220; }
.uptime-day.bad  { background: #3A2422; }
/* 无记录：比"正常"更暗的灰，一眼能看出这段没有数据 */
.uptime-day.idle { background: #202024; }
.uptime-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-mute);
}
.legend-items { display: flex; gap: 18px; align-items: center; }
.legend-items span { display: inline-flex; align-items: center; gap: 7px; }

.incident { border-left: 1.5px solid var(--border); padding-left: 24px; margin-left: 7px; }
.incident-item { position: relative; padding-bottom: 26px; }
.incident-item:last-child { padding-bottom: 0; }
.incident-item::before {
  content: "";
  position: absolute;
  left: -28.5px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.incident-date { font-size: 13px; color: var(--text-mute); margin-bottom: 4px; }
.incident-title { font-size: 15.5px; font-weight: 500; margin-bottom: 5px; }
.incident-body { font-size: 14.5px; color: var(--text-dim); line-height: 1.72; }

/* 关于页「服务范围」表下的执行说明：比正文再弱一级，不与正文抢注意力 */
.scope-note {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.78;
  color: var(--text-mute);
}

.empty-note {
  padding: 22px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 14.5px;
  color: var(--text-mute);
  text-align: center;
}

/* ============================================================
   关于页 / 支持页
   ------------------------------------------------------------
   类名刻意不复用 .legal —— 这两页不是法律文件。
   若共用 .legal，将来调法律页排版会连带改动它们，
   而现有测试没有任何断言能发现"关于页排版悄悄走样"。
   因此把需要的排版层显式重写一遍：多十几行 CSS，换掉一个隐式耦合。
   ============================================================ */

.side-wrap {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 52px;
  align-items: start;
}
.side-main { max-width: 780px; }

.side-main h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 44px 0 14px;
}
.side-main h2:first-of-type { margin-top: 0; }
.side-main h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 10px;
  color: var(--text);
}
.side-main p {
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.85;
  margin-bottom: 14px;
}
.side-main ul { list-style: none; margin: 0 0 16px; }
.side-main li {
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.8;
  padding-left: 19px;
  position: relative;
  margin-bottom: 8px;
}
.side-main li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-mute);
}
.side-main strong { color: var(--text); font-weight: 600; }
.side-main a { color: var(--blue); }
.side-main a:hover { text-decoration: underline; }

/* ---------- 运营信息表（关于页） ---------- */
.info-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0 24px;
}
.info-row {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-row dt { font-size: 14px; color: var(--text-mute); }
.info-row dd { font-size: 15px; color: var(--text-dim); line-height: 1.68; }
.info-row dd code { color: var(--text); font-size: 0.88em; }

/* ---------- 原则条目（关于页） ---------- */
.principles { display: grid; gap: 12px; margin: 20px 0 24px; }
.principle {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.principle-n {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--text-mute);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.principle h3 { font-size: 15.5px; font-weight: 600; margin: 2px 0 5px; }
.principle p { font-size: 14.5px; color: var(--text-dim); line-height: 1.7; margin: 0; }

/* ---------- 求助通道卡（支持页） ---------- */
.chan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0 30px;
}
.chan {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.chan h3 { font-size: 16px; font-weight: 600; margin: 0 0 7px; }
.chan p { font-size: 14.5px; color: var(--text-dim); line-height: 1.68; margin: 0 0 13px; }
/* 状态标签 —— 刻意**不做成按钮外观**。
   原样式（描边 + 底色 + 圆角 + 内边距）与真正的按钮几乎一样，但它是 <span>，
   不可点；且下方真正可点的 .chan-link 只隔 14px —— 用户按"按钮"的直觉去点，
   要么点空、要么误触链接。现改为明确的"标签"形态：无边框、弱化配色、
   左侧一条细竖线；与链接的间距同时拉开（见 support.html 里那段的上边距）。 */
.chan-tag {
  display: inline-block;
  font-size: 12.5px;
  color: var(--text-mute);
  background: none;
  border: none;
  border-left: 2px solid var(--border-strong);
  border-radius: 0;
  padding: 1px 0 1px 9px;
  letter-spacing: 0.01em;
}
.chan-link { display: inline-block; font-size: 14px; color: var(--blue); }

/* ---------- 折叠问答：原生 details ----------
   支持页刻意不走首页那套 .faq-item + JS 的写法。
   首页 .faq-a 靠固定 max-height 做展开动画，内容一长就会被
   overflow:hidden 静默裁掉（不报错、不滚动，用户以为答案就这么短）。
   问答越多越长的页面不能沿用这条路。 */
.sup-group { margin-bottom: 34px; }
.sup-group > h3 {
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 500;
  margin: 0 0 10px;
}
.sup-list { border-top: 1px solid var(--border); }
.sup-item { border-bottom: 1px solid var(--border); }
.sup-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  transition: color 0.2s var(--ease);
}
.sup-q::-webkit-details-marker { display: none; }
.sup-q:hover { color: var(--accent); }
.sup-x { position: relative; flex-shrink: 0; width: 13px; height: 13px; }
.sup-x::before,
.sup-x::after {
  content: "";
  position: absolute;
  background: var(--text-mute);
  transition: transform 0.28s var(--ease), background 0.2s var(--ease);
}
.sup-x::before { width: 13px; height: 1.5px; top: 6px; left: 0; }
.sup-x::after { width: 1.5px; height: 13px; left: 6px; top: 0; }
.sup-item[open] > .sup-q .sup-x::after { transform: rotate(90deg); }
.sup-item[open] > .sup-q .sup-x::before,
.sup-item[open] > .sup-q .sup-x::after { background: var(--accent); }
.sup-a { padding: 0 4px 20px; font-size: 15px; color: var(--text-dim); line-height: 1.78; }
.sup-a p { margin-bottom: 10px; }
.sup-a p:last-child { margin-bottom: 0; }
.sup-a ul { list-style: none; margin: 0 0 10px; }
.sup-a li { padding-left: 17px; position: relative; margin-bottom: 6px; }
.sup-a li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-mute);
}

/* ---------- 流程步骤（支持页） ---------- */
.steps {
  counter-reset: step;
  border-left: 1.5px solid var(--border);
  padding-left: 26px;
  margin: 18px 0 28px;
}
.step { position: relative; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -39px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step h4 { font-size: 15.5px; font-weight: 600; margin: 0 0 4px; }
.step p { font-size: 14.5px; color: var(--text-dim); line-height: 1.72; margin: 0; }

/* ---------- 举报与申诉块（支持页） ---------- */
.report-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  margin: 20px 0 26px;
}
.report-box h4 { font-size: 15.5px; font-weight: 600; margin: 0 0 6px; }
.report-box p { font-size: 14.5px; color: var(--text-dim); line-height: 1.72; margin: 0 0 8px; }
.report-box p:last-child { margin-bottom: 0; }
.report-box code { font-size: 0.88em; }

/* ---------------- 窄屏抗溢出（这两条是一组，缺一不可）----------------
   内容列 .side-main / .docs-body / .legal 都是 grid 子项。
   grid/flex 子项的 min-width 默认是 auto —— 它等于内容的 min-content，
   于是只要内容里有一处断不开的长东西（典型是 .doc-table 里
   white-space:nowrap 的单元格，实测 min-content 能到 1024px），
   子项就死也不肯收缩，把整页顶出视口。
   清零之后表格自带的 overflow-x:auto 才真正生效 ——
   在此之前它的宽度早被父级定死成 780px，"自己横向滚动"无从谈起。 */
.side-main,
.docs-body,
.legal { min-width: 0; }

/* 长 URL / 无空格 token 在窄屏必须能断开。
   这里必须用 anywhere 而不是 break-word：只有 anywhere 会参与
   min-content 计算，才能把容器的 min-content 真正压下来；
   break-word 只在排版时生效，对"撑破容器"无效。 */
.side-main code,
.docs-body code,
.legal code { overflow-wrap: anywhere; }
/* 代码块例外：保持原样，靠自身的 overflow-x 横向滚动 */
pre code { overflow-wrap: normal; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  /* 单列化：目录（.docs-nav / .toc）**不能 display:none**。
     那会让 docs / guide / support / about / terms / privacy / open-source
     这些长页面在手机上失去唯一的页内跳转手段 —— 正文只能用拇指一路滚到底。
     改为：目录仍显示，但退掉 sticky、用 order 提到正文之前，
     当作"本页目录"用（这也是长文移动端的常规做法）。 */
  .docs-layout,
  .legal-wrap,
  .side-wrap { grid-template-columns: 1fr; gap: 26px; }
  .docs-nav,
  .toc {
    position: static;
    top: auto;
    order: -1;                 /* 单列里若排在正文之后，要滚到底才看得到 */
    max-width: none;
    width: 100%;
  }
  .docs-nav { padding-left: 2px; }
  .page { padding: 36px 0 72px; }
  .doc-table { display: block; overflow-x: auto; white-space: nowrap; }
  .chan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .comp-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .status-card { gap: 13px; }
  .info-row { grid-template-columns: 1fr; gap: 4px; }
  .principle { gap: 13px; }
}
