/* ==========================================================================
   瑞亿播放器 · 皮肤开发文档页样式
   ========================================================================== */

.doc-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 72px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

/* ---------------- 侧边目录 ---------------- */
.doc-nav {
  position: sticky; top: 92px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 20px 16px;
  border-radius: var(--ry-radius);
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
}
.doc-nav > b { font-size: 12px; letter-spacing: 1.4px; color: var(--ry-text-mute); text-transform: uppercase; margin-bottom: 10px; padding-left: 10px; }
.doc-nav a {
  padding: 8px 11px; border-radius: 9px;
  font-size: 13.5px; color: var(--ry-text-dim);
  transition: color 0.16s, background 0.16s;
}
.doc-nav a:hover { color: var(--ry-text); background: var(--ry-surface-2); }
.doc-nav__meta {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--ry-border);
  display: flex; flex-direction: column; gap: 5px;
  padding-left: 11px;
}
.doc-nav__meta span { font-size: 11.5px; color: var(--ry-text-mute); }

/* ---------------- 正文 ---------------- */
.doc-main { min-width: 0; }

.doc-hero {
  padding: 40px;
  border-radius: 22px;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--ry-accent) 13%, transparent),
    color-mix(in srgb, var(--ry-accent-2) 9%, transparent));
  border: 1px solid var(--ry-border-strong);
  margin-bottom: 46px;
}
.doc-hero h1 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; letter-spacing: -0.4px; margin-bottom: 16px; }
.doc-hero p { font-size: 15.5px; line-height: 1.9; color: var(--ry-text-dim); }
.doc-hero code { background: var(--ry-surface-2); padding: 2px 7px; border-radius: 5px; font-size: 13.5px; color: var(--ry-accent); }
.doc-hero__btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.doc-main section { margin-bottom: 60px; scroll-margin-top: 90px; }
.doc-main h2 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.3px;
  padding-bottom: 14px; margin-bottom: 20px;
  border-bottom: 1px solid var(--ry-border);
}
.doc-main h3 { font-size: 17px; font-weight: 700; margin: 32px 0 14px; }
.doc-main p { font-size: 14.5px; line-height: 1.95; color: var(--ry-text-dim); margin-bottom: 16px; }
.doc-main p code, .doc-main li code, .doc-main td code {
  background: var(--ry-surface-2);
  padding: 2px 6px; border-radius: 5px;
  font-family: var(--ry-mono); font-size: 12.5px;
  color: var(--ry-accent);
}

/* 步骤 */
.steps { display: grid; gap: 12px; counter-reset: s; margin: 0 0 22px; padding: 0; list-style: none; }
.steps li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--ry-radius);
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  counter-increment: s;
}
.steps li::before {
  content: counter(s);
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ry-accent-grad);
  color: var(--ry-accent-ink);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
}
.steps li b { display: block; font-size: 14.5px; margin-bottom: 5px; }
.steps li span { font-size: 13.5px; line-height: 1.8; color: var(--ry-text-dim); }

/* 小卡片 */
.grid--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.mini { padding: 16px 18px; border-radius: var(--ry-radius); background: var(--ry-surface); border: 1px solid var(--ry-border); }
.mini b { display: block; font-size: 14.5px; margin-bottom: 5px; }
.mini span { font-size: 12.5px; line-height: 1.7; color: var(--ry-text-mute); }

/* 提示框 */
.callout {
  padding: 16px 20px;
  border-radius: var(--ry-radius);
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  border-left: 3px solid var(--ry-accent);
  margin: 20px 0;
}
.callout--warn { border-left-color: #f59e0b; }
.callout--info { border-left-color: #3b82f6; }
.callout b { display: block; font-size: 14px; margin-bottom: 6px; }
.callout p { font-size: 13.5px; line-height: 1.85; margin: 0; color: var(--ry-text-dim); }

/* 代码块 */
.code-block {
  border-radius: var(--ry-radius);
  overflow: hidden;
  border: 1px solid var(--ry-border-strong);
  background: #0a0f1a;
  margin: 18px 0;
  position: relative;
}
.code-block__bar {
  height: 40px; display: flex; align-items: center; gap: 6px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.code-block__bar span { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); display: block; }
.code-block__bar em { margin-left: 10px; font-style: normal; font-size: 11.5px; color: #8b9bb4; font-family: var(--ry-mono); }
.code-block pre { margin: 0; padding: 20px 22px; overflow-x: auto; }
.code-block code { font-family: var(--ry-mono); font-size: 12.5px; line-height: 1.9; color: #cfe0f5; }
.c-key { color: #7dd3fc; }
.c-str { color: #a5f3a0; }
.c-num { color: #fcd34d; }
/* 代码块底部永远是写死的深色 #0a0f1a，因此这里的颜色不能跟主题变量走。
   原 #64748b 在 #0a0f1a 上只有 4.03:1（浅色主题下就是深底上深字），改为 #8b9bb4。 */
.c-com { color: #8b9bb4; font-style: italic; }

.copy {
  margin-left: auto;
  height: 25px; padding: 0 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  font-size: 11.5px;
  transition: all 0.16s;
}
.copy:hover { background: rgba(255, 255, 255, 0.16); color: #e2e8f0; }

/* 表格 */
.tbl-wrap { overflow-x: auto; margin: 18px 0; border-radius: var(--ry-radius); border: 1px solid var(--ry-border); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.tbl thead th {
  text-align: left; padding: 13px 16px;
  background: var(--ry-surface-2);
  font-size: 12.5px; font-weight: 700; color: var(--ry-text-dim);
  border-bottom: 1px solid var(--ry-border);
  white-space: nowrap;
}
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--ry-border); color: var(--ry-text-dim); line-height: 1.75; vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--ry-surface); }
.tbl td:first-child { white-space: nowrap; }
.req { padding: 2px 8px; border-radius: 99px; background: var(--ry-accent-soft); color: var(--ry-accent); font-size: 11px; font-weight: 700; }

/* 皮肤分类小卡（颜色型 / 样式型 / 混合型） */
.kind {
  padding: 18px 20px; border-radius: var(--ry-radius);
  background: var(--ry-surface); border: 1px solid var(--ry-border);
  border-top: 3px solid var(--ry-accent);
}
.kind b { display: block; font-size: 15px; margin-bottom: 7px; }
.kind p { font-size: 13px; line-height: 1.75; color: var(--ry-text-dim); margin: 0 0 10px; }
.kind code { background: var(--ry-surface-2); padding: 2px 6px; border-radius: 5px; font-size: 12px; color: var(--ry-accent); }
.kind--style { border-top-color: #f472b6; }
.kind--mix { border-top-color: #a78bfa; }

/* 布局预设一览 */
.presets { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.preset {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 17px; border-radius: var(--ry-radius);
  background: var(--ry-surface); border: 1px solid var(--ry-border);
}
.preset__pv { width: 68px; height: 46px; border-radius: 8px; flex-shrink: 0; position: relative; overflow: hidden; background: #0d1526; }
.preset__pv i { position: absolute; border-radius: 2px; background: rgba(255, 255, 255, 0.42); display: block; }
.preset b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.preset b code { font-size: 11.5px; color: var(--ry-accent); background: var(--ry-surface-2); padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.preset small { display: block; font-size: 12px; line-height: 1.65; color: var(--ry-text-mute); }

@media (max-width: 980px) {
  .presets { grid-template-columns: minmax(0, 1fr); }
}

/* 打勾列表 */
.ticks { display: grid; gap: 11px; margin: 16px 0; }
.ticks li { display: flex; align-items: flex-start; gap: 11px; font-size: 14px; line-height: 1.75; color: var(--ry-text-dim); }
.ticks svg { width: 18px; height: 18px; color: var(--ry-accent); flex-shrink: 0; margin-top: 3px; }
/* ★ 长串兜底：这里的正文嵌着 <code> 正则（^[a-z0-9_-]{2,32}$）、字段名与 JSON 片段。
   没有断行机会时 li 的 min-content 就等于整串宽度（实测 260px 下要 300.8px），
   li 作为 grid 子项的 min-width:auto 会把它顶给父轨道 → 整页溢出 59~77px。
   只有 `overflow-wrap:anywhere` 会改变 min-content（break-word 不会）。 */
.ticks li, .doc-main li, .doc-main p, .preset b, .preset small { min-width: 0; overflow-wrap: anywhere; }

.doc-end { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding-top: 30px; border-top: 1px solid var(--ry-border); }

@media (max-width: 980px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 26px 18px 56px; }
  .doc-nav { position: static; }
  .doc-hero { padding: 28px 22px; }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
}
