:root {
  --bear-bg: #ffffff;
  --bear-ink: #171717;
  --bear-black: #000000;
  --bear-muted: #4d4d4d;
  --bear-faint: #737373;
  --bear-line: #ebebeb;
  --bear-soft: #fafafa;
  --bear-soft-2: #f5f5f5;
  --bear-blue: #0a72ef;
  --bear-blue-soft: #ebf5ff;
  --bear-pink: #de1d8d;
  --bear-pink-soft: #fff0f8;
  --bear-red: #c03221;
  --bear-red-soft: #fff1f0;
  --bear-green: #147a3f;
  --bear-green-soft: #ecfdf3;
  --bear-gold: #a15c00;
  --bear-gold-soft: #fff7e6;
  --bear-ring: rgba(0, 0, 0, 0.08) 0 0 0 1px;
  --bear-ring-light: rgb(235, 235, 235) 0 0 0 1px;
  --bear-card: rgba(0, 0, 0, 0.08) 0 0 0 1px,
    rgba(0, 0, 0, 0.04) 0 2px 2px,
    rgba(0, 0, 0, 0.04) 0 8px 8px -8px,
    #fafafa 0 0 0 1px;
  --bear-mono: "Geist Mono", "SFMono-Regular", "Roboto Mono", Menlo, Consolas,
    monospace;
  --bear-sans: "Geist", "SF Pro Display", "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bear-bg);
  color: var(--bear-ink);
  font-family: var(--bear-sans);
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bear-bg);
  color: var(--bear-ink);
  font-family: var(--bear-sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body.bear-console-page {
  background: var(--bear-soft);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

a {
  color: inherit;
  text-decoration-color: rgba(0, 0, 0, 0.24);
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
}

code,
pre,
kbd {
  font-family: var(--bear-mono);
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: var(--bear-ring-light);
}

.brand-link,
.console-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  color: var(--bear-ink);
  font-weight: 650;
  text-decoration: none;
}

.brand-link img,
.console-brand img {
  width: 28px;
  height: 28px;
}

.shell-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--bear-soft);
  box-shadow: var(--bear-ring-light);
  font-size: 14px;
  font-weight: 500;
  color: var(--bear-muted);
}

.shell-nav a {
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 6px;
  text-decoration: none;
}

.shell-nav a[aria-current="page"],
.shell-nav a:hover {
  background: #fff;
  color: var(--bear-ink);
  box-shadow: var(--bear-ring-light);
}

.shell-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button,
.ghost-button,
.icon-button,
.danger-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
}

.button {
  background: var(--bear-ink);
  color: #fff;
  box-shadow: var(--bear-ring);
}

.button:hover {
  background: var(--bear-black);
}

.ghost-button,
.icon-button,
.copy-button {
  background: #fff;
  color: var(--bear-ink);
  box-shadow: var(--bear-ring-light);
}

.ghost-button:hover,
.icon-button:hover,
.copy-button:hover {
  background: var(--bear-soft);
}

.danger-button {
  background: var(--bear-red-soft);
  color: var(--bear-red);
  box-shadow: rgba(192, 50, 33, 0.18) 0 0 0 1px;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.button:focus-visible,
.ghost-button:focus-visible,
.icon-button:focus-visible,
.danger-button:focus-visible,
.copy-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--bear-blue);
  outline-offset: 2px;
}

.page-shell {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(380px, 1.08fr);
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 180px);
  padding: 48px 0;
}

.hero.compact-hero {
  min-height: 0;
  padding: 56px 0 40px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.pill,
.status-pill,
.method-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.eyebrow {
  margin-bottom: 18px;
  background: var(--bear-blue-soft);
  color: #0068d6;
}

.pill {
  background: var(--bear-soft-2);
  color: var(--bear-muted);
  box-shadow: var(--bear-ring-light);
}

.status-pill {
  background: var(--bear-green-soft);
  color: var(--bear-green);
}

.status-pill.warn {
  background: var(--bear-gold-soft);
  color: var(--bear-gold);
}

.status-pill.error {
  background: var(--bear-red-soft);
  color: var(--bear-red);
}

.method-badge {
  border-radius: 6px;
  background: #171717;
  color: #fff;
  font-family: var(--bear-mono);
}

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

h1 {
  max-width: 820px;
  margin-bottom: 20px;
  font-size: clamp(42px, 6vw, 66px);
  line-height: 1.02;
  font-weight: 650;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 32px;
  line-height: 1.18;
  font-weight: 650;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: 0;
}

.lead {
  max-width: 690px;
  margin-bottom: 26px;
  color: var(--bear-muted);
  font-size: 19px;
  line-height: 1.7;
}

.muted {
  color: var(--bear-muted);
}

.faint {
  color: var(--bear-faint);
}

.hero-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.endpoint-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 720px);
  margin-top: 28px;
  padding: 10px 12px 10px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--bear-card);
}

.endpoint-strip code {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: 12px;
  color: var(--bear-ink);
}

.endpoint-strip + .code-card {
  margin-top: 16px;
}

.hero-preview,
.console-preview,
.card,
.metric-card,
.model-card,
.table-panel,
.form-panel,
.empty-panel,
.callout,
.request-browser,
.console-panel,
.stat-card {
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--bear-card);
}

.hero-preview {
  min-width: 0;
  padding: 16px;
}

.preview-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
}

.window-dots {
  display: inline-flex;
  gap: 6px;
}

.window-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bear-line);
}

.request-browser {
  overflow: hidden;
}

.request-browser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  background: var(--bear-soft);
  box-shadow: var(--bear-ring-light);
}

.request-browser-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--bear-muted);
  font-size: 13px;
  font-weight: 600;
}

.request-stack {
  display: grid;
  gap: 0;
}

.request-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 14px 16px;
  border-top: 1px solid var(--bear-line);
}

.request-row:first-child {
  border-top: 0;
}

.request-row code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--bear-ink);
  font-size: 13px;
}

.request-row span:not(.method-badge) {
  color: var(--bear-muted);
  font-size: 13px;
}

.request-browser > .code-card {
  margin: 16px;
}

.request-browser > .metric-grid {
  padding: 16px;
}

.arrow-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--bear-ring-light);
  color: var(--bear-faint);
}

.code-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #171717;
  color: #fafafa;
  box-shadow: var(--bear-card);
}

.code-card pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
}

.code-card .copy-button + pre {
  padding-top: 52px;
}

.code-card .copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 28px;
  padding: 0 10px;
}

.model-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.section {
  padding: 64px 0;
  border-top: 1px solid var(--bear-line);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-header p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--bear-muted);
}

.grid-2,
.grid-3,
.metric-grid,
.model-grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3,
.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.metric-card,
.model-card,
.empty-panel,
.callout,
.stat-card {
  padding: 20px;
}

.card p,
.metric-card p,
.model-card p,
.empty-panel p,
.callout p,
li {
  color: var(--bear-muted);
}

.metric-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 650;
}

.metric-card span {
  color: var(--bear-muted);
  font-size: 14px;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.workflow-step {
  position: relative;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--bear-ring-light);
}

.workflow-step::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 0;
  width: 3px;
  border-radius: 0 9999px 9999px 0;
  background: var(--bear-blue);
}

.workflow-step:nth-child(2)::before {
  background: var(--bear-pink);
}

.workflow-step:nth-child(3)::before {
  background: var(--bear-red);
}

.workflow-step b {
  display: block;
  margin-bottom: 10px;
  color: var(--bear-faint);
  font-family: var(--bear-mono);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.doc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 36px;
  padding: 56px 0 72px;
}

.doc-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
}

.doc-sidebar nav {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--bear-ring-light);
}

.doc-sidebar a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--bear-muted);
  text-decoration: none;
  font-size: 14px;
}

.doc-sidebar a:hover {
  background: var(--bear-soft);
  color: var(--bear-ink);
}

.doc-content {
  min-width: 0;
}

.doc-section {
  padding: 0 0 44px;
  border-bottom: 1px solid var(--bear-line);
  margin-bottom: 44px;
}

.doc-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--bear-line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table th {
  background: var(--bear-soft);
  color: var(--bear-ink);
  font-weight: 650;
}

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

.table-panel {
  overflow-x: auto;
}

.table-panel .data-table {
  min-width: 680px;
}

.form-row,
.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: var(--bear-ink);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--bear-ink);
  box-shadow: var(--bear-ring-light);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.form-panel {
  padding: 18px;
}

.notice,
.error-box,
.success-box {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.notice {
  background: var(--bear-soft);
  color: var(--bear-muted);
  box-shadow: var(--bear-ring-light);
}

.error-box {
  background: var(--bear-red-soft);
  color: var(--bear-red);
  box-shadow: rgba(192, 50, 33, 0.18) 0 0 0 1px;
}

.success-box {
  background: var(--bear-green-soft);
  color: var(--bear-green);
  box-shadow: rgba(20, 122, 63, 0.18) 0 0 0 1px;
}

.site-footer {
  padding: 36px 0 56px;
  border-top: 1px solid var(--bear-line);
  color: var(--bear-faint);
  font-size: 13px;
}

.site-footer .page-shell {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.console-shell {
  min-height: 100vh;
}

.console-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.console-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  height: 100vh;
  padding: 18px 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--bear-ring-light);
}

.console-brand {
  min-height: 40px;
  margin: 0 8px;
}

.console-nav {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.console-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px 0 14px;
  border-radius: 6px;
  color: var(--bear-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
}

.console-nav a:hover,
.console-nav a.active {
  background: var(--bear-soft);
  color: var(--bear-ink);
}

.console-nav a.active::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 9999px 9999px 0;
  background: var(--bear-blue);
}

.console-side-card {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: var(--bear-soft);
  color: var(--bear-muted);
  box-shadow: var(--bear-ring-light);
  font-size: 12px;
}

.console-side-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--bear-ink);
  font-size: 13px;
}

.console-main {
  min-width: 0;
  padding: 24px;
}

.console-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.console-title h1 {
  margin-bottom: 6px;
  font-size: 34px;
  line-height: 1.15;
}

.console-title p {
  margin-bottom: 0;
  color: var(--bear-muted);
}

.console-content {
  display: grid;
  gap: 16px;
}

.console-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.console-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.console-panel {
  min-width: 0;
  padding: 18px;
}

.console-panel h2,
.console-panel h3 {
  margin-bottom: 8px;
}

.console-panel h2 {
  font-size: 20px;
  line-height: 1.25;
}

.console-panel h3 {
  font-size: 18px;
  line-height: 1.3;
}

.console-panel p {
  color: var(--bear-muted);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2,
.panel-head h3 {
  margin-bottom: 0;
}

.stat-value {
  display: block;
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 650;
}

.stat-label {
  color: var(--bear-muted);
  font-size: 13px;
}

.stat-card {
  min-height: 124px;
}

.stat-card .stat-label {
  display: block;
  margin-top: 8px;
}

.mini-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mini-kpi > div {
  padding: 12px;
  border-radius: 8px;
  background: var(--bear-soft);
  box-shadow: var(--bear-ring-light);
}

.mini-kpi strong {
  display: block;
  font-size: 20px;
}

.mini-kpi span {
  color: var(--bear-muted);
  font-size: 12px;
}

.skeleton {
  min-height: 14px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #f3f3f3, #fbfbfb, #f3f3f3);
  background-size: 200% 100%;
  animation: bear-loading 1.2s ease-in-out infinite;
}

@keyframes bear-loading {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.hidden {
  display: none !important;
}

.mobile-only {
  display: none;
}

@media (max-width: 980px) {
  .shell-nav {
    display: none;
  }

  .hero,
  .doc-layout,
  .grid-2,
  .grid-3,
  .metric-grid,
  .model-grid,
  .workflow,
  .console-layout,
  .console-grid,
  .console-grid.two,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding: 52px 0;
  }

  .console-sidebar {
    position: static;
    height: auto;
  }

  .console-side-card {
    display: none;
  }

  .console-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .console-nav a {
    justify-content: center;
    white-space: nowrap;
  }

  .doc-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .shell-header {
    min-height: 58px;
    padding: 0 16px;
  }

  .shell-actions .ghost-button {
    display: none;
  }

  .page-shell {
    width: min(100% - 28px, 1160px);
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 26px;
  }

  .lead {
    font-size: 17px;
  }

  .endpoint-strip,
  .section-header,
  .site-footer .page-shell,
  .console-topbar,
  .panel-head,
  .request-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .request-row .arrow-glyph {
    display: none;
  }

  .endpoint-strip .copy-button,
  .endpoint-strip .icon-button {
    width: 100%;
  }

  .section {
    padding: 52px 0;
  }

  .console-main {
    padding: 16px 14px 24px;
  }

  .console-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }

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