/* ═══ 汐颜 ROM 开放平台（developers.php / apply.php）═══
   形态对齐主流 AI 开放平台：顶栏 + 左侧文档导航 + 正文 / 控制台，浅色主题。 */
:root {
  --p-bg: #f5f6f7;
  --p-panel: #ffffff;
  --p-line: #e1e4e8;
  --p-text: #1e252d;
  --p-muted: #65707c;
  --p-brand: #2f64d6;
  --p-brand-soft: #edf2fb;
  --p-code: #f4f5f6;
  --p-ok: #237a55;
  --p-warn: #8a5f16;
  --p-err: #b64149;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body.plat {
  margin: 0; background: var(--p-bg); color: var(--p-text);
  font: 14px/1.75 "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

/* ── 顶栏 ── */
.plat-top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--p-line);
}
.plat-top-in {
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; height: 62px;
}
.plat-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--p-text); }
.plat-logo .mark {
  width: 30px; height: 30px; border-radius: 7px; flex: none;
  background: var(--p-brand);
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.plat-logo b { font-size: 15.5px; }
.plat-logo .ver {
  font-size: 11px; color: var(--p-brand); background: var(--p-brand-soft);
  border-radius: 5px; padding: 1px 7px; margin-left: 2px;
}
.plat-top-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plat-top-nav a {
  color: var(--p-muted); text-decoration: none; font-size: 13.5px;
  padding: 7px 13px; border-radius: 8px;
}
.plat-top-nav a:hover { color: var(--p-brand); background: var(--p-brand-soft); }
.plat-top-nav a.solid {
  background: var(--p-brand); color: #fff; padding: 8px 16px; font-weight: 500;
}
.plat-top-nav a.solid:hover { filter: brightness(1.08); background: var(--p-brand); }

/* ── 文档布局 ── */
.plat-wrap {
  max-width: 1200px; margin: 0 auto; padding: 26px 20px 80px;
  display: flex; gap: 34px; align-items: flex-start;
}
.plat-side {
  width: 212px; flex: none; position: sticky; top: 86px;
  max-height: calc(100vh - 110px); overflow: auto;
}
.plat-side .grp { font-size: 11.5px; color: #98a2b3; letter-spacing: .06em; margin: 18px 0 6px; }
.plat-side .grp:first-child { margin-top: 0; }
.plat-side a {
  display: block; color: var(--p-muted); text-decoration: none;
  font-size: 13px; padding: 6px 11px; border-radius: 8px; border-left: 2px solid transparent;
}
.plat-side a:hover { color: var(--p-text); background: #eef1f8; }
.plat-side a.cur { color: var(--p-brand); background: var(--p-brand-soft); border-left-color: var(--p-brand); font-weight: 500; }
.plat-main { flex: 1; min-width: 0; max-width: 830px; }

/* ── 正文排版 ── */
.plat-main h1 { font-size: 27px; line-height: 1.35; margin: 6px 0 10px; letter-spacing: .01em; }
.plat-main h2 {
  font-size: 20px; margin: 46px 0 14px; padding-top: 26px;
  border-top: 1px solid var(--p-line); scroll-margin-top: 86px;
}
.plat-main h3 { font-size: 15.5px; margin: 26px 0 10px; scroll-margin-top: 86px; }
.plat-main p { margin: 10px 0; }
.plat-main p, .plat-main li { color: #3b4557; }
.plat-main .lead { font-size: 15px; color: var(--p-muted); }
.plat-main ul, .plat-main ol { padding-left: 22px; margin: 10px 0; }
.plat-main li { margin: 5px 0; }
.plat-main a { color: var(--p-brand); text-decoration: none; }
.plat-main a:hover { text-decoration: underline; }
.plat-main code {
  background: var(--p-code); border: 1px solid var(--p-line); border-radius: 6px;
  padding: 1.5px 6px; font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #b02a6f;
}
.plat-main pre {
  position: relative; background: #0f172a; color: #dbe4f5; border-radius: 8px;
  padding: 15px 16px; overflow: auto; margin: 12px 0 18px; line-height: 1.65;
}
.plat-main pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 12.5px; }
.copy-btn {
  position: absolute; top: 9px; right: 9px; font-size: 11.5px; cursor: pointer;
  color: #93a4c4; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 7px; padding: 3px 10px;
}
.copy-btn:hover { color: #fff; }
.plat-main table {
  width: 100%; border-collapse: collapse; margin: 12px 0 18px;
  background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 8px; overflow: hidden;
  font-size: 13px;
}
.plat-main th, .plat-main td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--p-line); vertical-align: top; }
.plat-main th { background: #fafbfe; color: var(--p-muted); font-weight: 500; white-space: nowrap; }
.plat-main tr:last-child td { border-bottom: 0; }
.tagm {
  display: inline-block; font-size: 11px; line-height: 1.6; padding: 0 7px;
  border-radius: 5px; background: var(--p-brand-soft); color: var(--p-brand);
}
.tagm.get { background: #e7f6ee; color: var(--p-ok); }
.tagm.free { background: #fff3e2; color: var(--p-warn); }

/* 端点标题行：GET /v1.php?action=… */
.ep {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 10px;
  padding: 10px 14px; margin: 12px 0; font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ep .m { color: var(--p-ok); font-weight: 700; }
.ep .path { color: var(--p-text); word-break: break-all; }

/* ── 概览卡 / 步骤 ── */
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.mini {
  background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 8px; padding: 15px 16px;
}
.mini .t { font-weight: 600; font-size: 14px; }
.mini .d { color: var(--p-muted); font-size: 12.5px; margin-top: 5px; line-height: 1.7; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0; }
.steps li {
  counter-increment: s; position: relative; padding: 0 0 16px 40px;
}
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 25px; height: 25px; border-radius: 50%; background: var(--p-brand-soft); color: var(--p-brand);
  font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.steps li b { display: block; margin-bottom: 2px; }

/* ── 控制台 ── */
.console {
  background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 10px;
  padding: 22px; margin: 16px 0;
}
.console h3 { margin: 0 0 6px; font-size: 16px; }
.cform { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 6px; }
.cform input {
  flex: 1; min-width: 250px; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--p-line); background: var(--p-panel); color: var(--p-text);
  font: 13.5px ui-monospace, Menlo, Consolas, monospace;
}
.cform input:focus { outline: 0; border-color: var(--p-brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .14); }
.cbtn {
  padding: 10px 20px; border-radius: 10px; border: 1px solid var(--p-brand);
  background: var(--p-brand); color: #fff; font: inherit; font-size: 13.5px; cursor: pointer;
}
.cbtn:hover { filter: brightness(1.08); }
.cbtn.ghost { background: transparent; color: var(--p-brand); }
.cbtn.ghost:hover { background: var(--p-brand-soft); filter: none; }
.cbtn.gray { background: #fff; border-color: var(--p-line); color: var(--p-muted); }
.cbtn.gray:hover { border-color: var(--p-brand); color: var(--p-brand); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 11px; margin: 14px 0; }
.metric { border: 1px solid var(--p-line); border-radius: 8px; padding: 12px 13px; background: #fafbfe; }
.metric .k { color: var(--p-muted); font-size: 11.5px; }
.metric .v { font-size: 21px; font-weight: 650; margin-top: 3px; letter-spacing: .01em; }
.metric .v small { font-size: 12px; color: var(--p-muted); font-weight: 400; }
.utable { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.utable th, .utable td { padding: 8px 7px; border-bottom: 1px solid var(--p-line); text-align: left; }
.utable th { color: var(--p-muted); font-weight: 500; }
.st-ok { color: var(--p-ok); } .st-bad { color: var(--p-err); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 5px; background: var(--p-code); border: 1px solid var(--p-line); color: var(--p-muted); }
.cerr {
  color: var(--p-err); background: #fdf0f0; border: 1px solid #f3d1d1;
  border-radius: 10px; padding: 10px 13px; font-size: 13px; margin: 12px 0;
}
.cnote { color: var(--p-muted); font-size: 12.5px; margin: 8px 0; }

/* ── 更新日志 ── */
.log-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--p-line); }
.log-item:last-child { border-bottom: 0; }
.log-ver {
  flex: none; font: 600 12.5px ui-monospace, Menlo, Consolas, monospace;
  color: var(--p-brand); background: var(--p-brand-soft); border-radius: 8px;
  padding: 3px 10px; height: fit-content; min-width: 62px; text-align: center;
}
.log-body .d { color: var(--p-muted); font-size: 12px; margin-bottom: 3px; }

/* ── 申请 Key 页 ── */
.plat-narrow { max-width: 720px; margin: 0 auto; padding: 34px 20px 80px; }
.form-card { background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 10px; padding: 24px; margin: 16px 0; }
.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 12.5px; color: var(--p-muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 13px; border-radius: 10px; border: 1px solid var(--p-line);
  background: var(--p-panel); color: var(--p-text); font-size: 14px;
}
.field input:focus { outline: 0; border-color: var(--p-brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .14); }
.rules { margin: 12px 0 0; padding-left: 20px; color: var(--p-muted); font-size: 12.5px; line-height: 2; }
.ok-box {
  margin: 16px 0; padding: 16px; border-radius: 8px;
  border: 1px solid #bfe6cd; background: #f0faf3;
}
.ok-box .k { font-size: 12px; color: var(--p-ok); }
.ok-box code {
  display: block; margin-top: 8px; font: 600 15px ui-monospace, Menlo, Consolas, monospace;
  color: var(--p-text); word-break: break-all; background: none; border: 0; padding: 0;
}
.plat-foot {
  border-top: 1px solid var(--p-line); color: var(--p-muted); font-size: 12px;
  text-align: center; padding: 22px 16px 34px;
}
.plat-foot a { color: var(--p-brand); text-decoration: none; }

/* ── 响应式 ── */
@media (max-width: 980px) {
  .plat-wrap { flex-direction: column; gap: 18px; }
  .plat-side {
    position: static; width: 100%; max-height: none;
    display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px;
    border-bottom: 1px solid var(--p-line);
  }
  .plat-side .grp { display: none; }
  .plat-side a { white-space: nowrap; border: 1px solid var(--p-line); border-radius: 6px; border-left-width: 1px; }
  .plat-side a.cur { border-color: var(--p-brand); }
}
@media (max-width: 620px) {
  .plat-top-nav a:not(.solid) { display: none; }
  .plat-main h1 { font-size: 23px; }
}
body :where(a, button, input, select, textarea):focus-visible { outline: 3px solid rgba(47, 100, 214, .22); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
