/* CcApi 接入文档 · CC Image light workbench style */

:root {
  color: #202124;
  background: #f7f8fb;
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --ink: #202124;
  --muted: #6b7280;
  --muted-soft: #8b95a5;
  --paper: #ffffff;
  --paper-soft: rgba(255, 255, 255, 0.82);
  --soft: #f4f6f8;
  --line: rgba(17, 24, 39, 0.1);
  --line-strong: rgba(17, 24, 39, 0.16);
  --accent: #ff4f2e;
  --accent-soft: rgba(255, 79, 46, 0.1);
  --success: #18794e;
  --warning: #b76e00;
  --danger: #b42318;
  --cyan: #0369a1;
  --yellow: #936600;
  --mono: "SF Mono", "Menlo", "Cascadia Code", "Consolas", "Courier New", monospace;
  --radius: 8px;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(226, 232, 240, 0.82), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: #ffffff;
  background: rgba(255, 79, 46, 0.28);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin: 0;
}

strong,
b {
  color: var(--ink);
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px max(16px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.topbar .brand b {
  color: var(--accent);
}

.topbar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(24, 121, 78, 0.1);
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-left: auto;
}

.topbar nav a {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.topbar nav a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--soft);
  text-decoration: none;
}

.topbar nav a.active {
  color: var(--accent);
  border-color: rgba(255, 79, 46, 0.22);
  background: var(--accent-soft);
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
}

.hero .kicker,
.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .cursor {
  display: inline-block;
  width: 10px;
  height: 0.92em;
  margin-left: 5px;
  vertical-align: -2px;
  border-radius: 999px;
  background: var(--accent);
  animation: blink 1.05s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero p.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

/* ---------- section ---------- */
section {
  margin: 24px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

h2.sec {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2.sec .num {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 900;
}

h3 {
  margin: 24px 0 10px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.3;
}

p {
  color: var(--muted);
}

code.inline,
.kbd {
  display: inline-block;
  max-width: 100%;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  background: var(--soft);
  font-family: var(--mono);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

hr.sep {
  margin: 40px 0;
  border: 0;
  border-top: 1px dashed var(--line-strong);
}

/* ---------- terminal / code block ---------- */
.term {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.07);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.term-bar .tl {
  display: flex;
  gap: 7px;
}

.term-bar .tl i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.term-bar .tl .r {
  background: #ff5f56;
}

.term-bar .tl .y {
  background: #ffbd2e;
}

.term-bar .tl .g {
  background: #27c93f;
}

.term-bar .title {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
}

.term-bar .copy {
  margin-left: auto;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.term-bar .copy:hover {
  color: var(--accent);
  border-color: rgba(255, 79, 46, 0.28);
  background: var(--accent-soft);
}

.term-bar .copy.ok {
  color: var(--success);
  border-color: rgba(24, 121, 78, 0.28);
}

.term pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre;
}

.term pre .p {
  color: var(--success);
}

.term pre .c {
  color: var(--muted-soft);
  font-style: italic;
}

.term pre .k,
.term pre .hl {
  color: var(--accent);
  font-weight: 800;
}

.term pre .s {
  color: var(--cyan);
}

.term pre .v {
  color: var(--yellow);
}

.term pre .o {
  color: var(--muted);
}

/* ---------- callout ---------- */
.note {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 79, 46, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--accent-soft);
  font-size: 14px;
  line-height: 1.65;
}

.note.warn {
  border-color: rgba(183, 110, 0, 0.26);
  background: rgba(251, 191, 36, 0.12);
}

.note.tip {
  border-color: rgba(24, 121, 78, 0.2);
  background: rgba(24, 121, 78, 0.08);
}

.note .lbl {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.note.warn .lbl {
  color: var(--warning);
}

.note.tip .lbl {
  color: var(--success);
}

/* ---------- steps ---------- */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps > li {
  position: relative;
  margin: 0 0 16px;
  padding: 0 0 4px 44px;
}

.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 900;
}

.steps > li h3 {
  margin-top: 2px;
}

/* ---------- cards grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  display: block;
  min-height: 150px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--soft);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.card::after {
  content: "→";
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--muted-soft);
  font-size: 18px;
  transition: transform 160ms ease, color 160ms ease;
}

.card:hover {
  border-color: rgba(255, 79, 46, 0.24);
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  transform: translateY(-2px);
}

.card:hover::after {
  color: var(--accent);
  transform: translateX(4px);
}

.card .tag {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card h3 {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 18px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.card .ico {
  margin-bottom: 6px;
  font-size: 22px;
}

/* ---------- ref table ---------- */
table.ref {
  width: 100%;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

table.ref th,
table.ref td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

table.ref th {
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

table.ref td {
  color: var(--muted);
}

table.ref tr:last-child td {
  border-bottom: 0;
}

table.ref tr:hover td {
  background: rgba(255, 79, 46, 0.035);
}

table.ref code {
  color: var(--accent);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.post {
  color: var(--success);
  border-color: rgba(24, 121, 78, 0.26);
  background: rgba(24, 121, 78, 0.08);
}

.badge.get {
  color: var(--cyan);
  border-color: rgba(3, 105, 161, 0.24);
  background: rgba(3, 105, 161, 0.08);
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  margin-bottom: -1px;
  padding: 9px 15px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tabpane {
  display: none;
}

.tabpane.active {
  display: block;
}

/* ---------- footer / prevnext ---------- */
.prevnext {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 24px;
}

.prevnext a {
  flex: 1;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.prevnext a:hover {
  border-color: rgba(255, 79, 46, 0.24);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  transform: translateY(-1px);
}

.prevnext a small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.prevnext a.next {
  text-align: right;
}

footer.foot {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

footer.foot b {
  color: var(--accent);
}

/* utility */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.pill {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

/* ---------- screenshots ---------- */
.shot {
  margin: 14px 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--soft);
  vertical-align: middle;
}

.shot figcaption {
  padding: 11px 14px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.shot figcaption b {
  color: var(--ink);
  font-weight: 800;
}

.shot-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 860px) {
  .shot-row.two {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .wrap {
    width: min(100% - 24px, 1120px);
    padding: 24px 0 40px;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 12px;
  }

  .topbar nav {
    justify-content: flex-start;
    margin-left: 0;
  }

  .hero,
  section {
    padding: 20px;
  }

  .hero h1 {
    font-size: clamp(28px, 10vw, 38px);
  }

  h2.sec {
    align-items: flex-start;
    font-size: 21px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .prevnext {
    flex-direction: column;
  }

  .prevnext a.next {
    text-align: left;
  }

  table.ref {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
