:root {
  color-scheme: light;
  --canvas: #f4f6f7;
  --surface: #ffffff;
  --ink: #101416;
  --muted: #59656c;
  --line: #d8dfe2;
  --brand: #b8e0f1;
  --brand-strong: #1f678b;
  --success: #2d8251;
  --success-soft: #dceee3;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --danger: #b54747;
  --content-width: 1160px;
  --page-space: 32px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; letter-spacing: 0; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; background: var(--canvas); }
body { min-width: 320px; min-height: 100vh; min-height: 100svh; margin: 0; display: grid; grid-template-rows: auto 1fr auto; overflow-x: hidden; background: var(--canvas); color: var(--ink); }
body, button { font: inherit; }
a { color: inherit; text-decoration: none; }
a, button { cursor: pointer; touch-action: manipulation; }
img { display: block; max-width: 100%; }
button { border: 0; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 3px; }
h1, h2, h3, p, code { overflow-wrap: anywhere; }
.shell { width: min(calc(100% - (var(--page-space) * 2)), var(--content-width)); min-width: 0; margin-inline: auto; }
.mono-label { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; text-transform: uppercase; }

.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.ambient-danmaku { position: fixed; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; user-select: none; }
.ambient-danmaku span {
  position: absolute;
  top: var(--danmaku-top);
  left: 100%;
  color: var(--danmaku-color);
  font-size: var(--danmaku-size);
  font-weight: 700;
  line-height: 1;
  opacity: var(--danmaku-opacity);
  text-shadow: 0 0 2px rgba(16, 20, 22, 0.06), 0 0 5px currentColor;
  white-space: nowrap;
  will-change: transform;
  animation: ambient-danmaku-scroll var(--danmaku-duration) linear var(--danmaku-delay) both;
}

.header-inner, .hero-copy, .gateway-visual, .capability-grid, .format-inner, .footer-inner { position: relative; z-index: 2; }
main { min-height: 0; display: grid; grid-template-rows: minmax(408px, 1fr) auto auto; }
.site-header { position: relative; z-index: auto; min-height: 72px; border-bottom: 1px solid var(--line); background: rgba(244, 246, 247, 0.9); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { min-width: 0; min-height: 48px; display: inline-flex; align-items: center; gap: 12px; }
.brand-icon { width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--ink); border-radius: 50%; background: var(--surface); object-fit: cover; }
.brand-copy { min-width: 0; display: grid; gap: 2px; }
.brand-name { font-size: 15px; font-weight: 750; line-height: 1.1; }
.brand-meta { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 600; line-height: 1.1; }
.nav { display: flex; align-items: center; gap: 10px; }
.nav-action { min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--muted); font-size: 13px; font-weight: 750; }
.admin-login { border-color: var(--line); background: rgba(255, 255, 255, 0.72); transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.admin-login:hover { border-color: var(--ink); background: var(--surface); box-shadow: 4px 4px 0 var(--brand); transform: translate(-2px, -2px); }
.header-action { padding-inline: 16px; gap: 9px; border-color: var(--ink); background: var(--ink); color: var(--surface); }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #d4a45a; }
.header-action[data-state="online"] .status-dot { background: #65bd84; animation: status-pulse 2.8s ease-in-out infinite; }
.header-action[data-state="offline"] .status-dot { background: #df7777; }

.hero { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); background: rgba(244, 246, 247, 0.78); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); align-items: center; gap: clamp(48px, 8vw, 112px); padding-block: 48px; }
.hero-copy { min-width: 0; max-width: 640px; animation: reveal-up 520ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.eyebrow { width: fit-content; margin: 0 0 20px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.2; }
.live-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); animation: live-breathe 2.8s ease-in-out infinite; }
h1 { margin: 0; font-size: 56px; font-weight: 820; line-height: 1.05; }
.hero-slogan { max-width: 570px; margin: 18px 0 0; font-size: 24px; font-weight: 650; line-height: 1.35; }
.hero-description { max-width: 600px; margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-width: 136px; min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--ink); border-radius: var(--radius-md); font-size: 14px; font-weight: 750; transition: color 180ms ease-out, background 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out; }
.button-primary { background: var(--ink); color: var(--surface); }
.button-secondary { background: var(--surface); }
.button-primary:hover { background: #263033; box-shadow: 4px 4px 0 var(--brand); transform: translate(-2px, -2px); }
.button-secondary:hover { background: var(--brand); box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.button-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.button-primary.is-copied { background: #17221b; box-shadow: 4px 4px 0 var(--success-soft); }
.model-line { margin-top: 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1; }
.model-separator { width: 18px; height: 1px; background: #a9b2b6; }

.gateway-visual { --tilt-x: 0deg; --tilt-y: 0deg; width: 100%; max-width: 380px; justify-self: end; scroll-margin-top: 24px; padding: 24px; border: 1px solid var(--ink); border-radius: var(--radius-md); background: var(--ink); box-shadow: 10px 10px 0 rgba(184, 224, 241, 0.9); color: #d7dcde; transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); transform-style: preserve-3d; transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 360ms ease; will-change: transform; animation: gateway-arrive 620ms 80ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.gateway-visual.is-tilting { box-shadow: 13px 15px 0 rgba(184, 224, 241, 0.84); transition-duration: 140ms; transition-timing-function: linear; }
.gateway-topline { padding-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #333d40; font-size: 11px; font-weight: 700; }
.gateway-status { display: inline-flex; align-items: center; gap: 7px; color: #e0ba7d; }
.gateway-status::before { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; content: ""; }
.gateway-status[data-state="online"] { color: #8ed7a8; }
.gateway-status[data-state="offline"] { color: #ee9696; }
.endpoint { margin-top: 22px; }
.endpoint-method { color: #9fcfe4; font-size: 12px; font-weight: 750; }
.endpoint-copy { width: 100%; min-height: 68px; margin-top: 8px; padding: 12px 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid #3b474a; border-radius: var(--radius-sm); background: #151b1d; color: var(--surface); text-align: left; transition: border-color 180ms ease-out, background 180ms ease-out; }
.endpoint-copy:hover { border-color: #8ac8e3; background: #1b2325; }
.endpoint-copy code { min-width: 0; color: var(--surface); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; font-weight: 700; line-height: 1.45; }
.copy-action { min-width: 51px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; color: #9fcfe4; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; font-weight: 700; }
.copy-action svg { width: 16px; height: 16px; flex: 0 0 auto; }
.check-icon { display: none; }
.endpoint-copy.is-copied { border-color: #65bd84; background: #17221b; }
.endpoint-copy.is-copied .copy-action { color: #8ed7a8; }
.endpoint-copy.is-copied .copy-icon { display: none; }
.endpoint-copy.is-copied .check-icon { display: block; }
.copy-feedback { min-height: 16px; margin: 6px 0 -2px; color: #8ed7a8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 700; text-align: right; }
.gateway-flow { margin-top: 8px; padding: 11px 12px; display: grid; grid-template-columns: auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto; align-items: center; gap: 8px; border: 1px solid #303b3e; border-radius: var(--radius-sm); background: #151b1d; }
.flow-step { display: inline-flex; align-items: center; gap: 6px; color: #89969b; font-size: 9px; font-weight: 750; white-space: nowrap; }
.flow-step::before { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #556267; content: ""; }
.flow-step-active { color: #b9dff0; }
.flow-step-active::before { background: #8ac8e3; box-shadow: 0 0 0 3px rgba(138, 200, 227, 0.12); animation: route-pulse 2.4s ease-in-out infinite; }
.flow-line { height: 1px; background: #3b474a; }
.gateway-bottom { margin-top: 16px; padding-top: 18px; border-top: 1px solid #333d40; }
.gateway-facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gateway-fact { min-width: 0; padding-left: 12px; display: grid; gap: 7px; border-left: 1px solid #333d40; font-size: 11px; line-height: 1.4; }
.gateway-fact:first-child { padding-left: 0; border-left: 0; }
.gateway-fact dt { color: #7f8b90; font-size: 10px; }
.gateway-fact dd { min-width: 0; margin: 0; overflow: hidden; color: #d7dcde; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.capability-band { padding-block: 10px 0; background: rgba(244, 246, 247, 0.68); }
.format-inner p { margin: 0 0 7px; color: var(--brand-strong); font-size: 10px; font-weight: 800; }
.format-inner h2 { margin: 0; font-size: 24px; line-height: 1.25; }
.capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.capability { min-width: 0; min-height: 108px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.72); box-shadow: 0 1px 2px rgba(16, 20, 22, 0.03); }
.capability-index { display: flex; align-items: center; gap: 5px; color: var(--brand-strong); font-size: 10px; font-weight: 800; }
.capability h2 { margin: 10px 0 5px; font-size: 15px; line-height: 1.25; }
.capability p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.format-band { padding-block: 12px 18px; background: rgba(244, 246, 247, 0.68); }
.format-inner { min-height: 116px; padding: 18px; display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: 32px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.72); box-shadow: 0 1px 2px rgba(16, 20, 22, 0.03); }
.format-inner code { min-width: 0; padding: 16px 18px; border-left: 4px solid var(--brand-strong); border-radius: var(--radius-sm); background: var(--canvas); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.6; }
.format-inner code strong { color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); background: rgba(244, 246, 247, 0.88); color: var(--muted); }
.footer-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.footer-inner > span:first-child { color: var(--ink); font-weight: 750; }

@keyframes reveal-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gateway-arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes ambient-danmaku-scroll { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 100%)); } }
@keyframes status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.48; } }
@keyframes live-breathe { 0%, 100% { box-shadow: 0 0 0 4px var(--success-soft); } 50% { box-shadow: 0 0 0 7px rgba(220, 238, 227, 0.32); } }
@keyframes route-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(138, 200, 227, 0.12); } 50% { box-shadow: 0 0 0 5px rgba(138, 200, 227, 0.03); } }

@media (max-width: 900px) {
  :root { --page-space: 24px; }
  main { grid-template-rows: auto auto auto; }
  .hero-inner { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-block: 48px; }
  h1 { font-size: 48px; }
  .hero-slogan { font-size: 21px; }
  .gateway-visual { padding: 20px; }
  .copy-label { display: none; }
  .copy-action { min-width: 16px; }
}

@media (max-width: 720px) {
  :root { --page-space: 18px; }
  .site-header, .header-inner { min-height: 64px; }
  .header-action { padding-inline: 14px; }
  .hero-inner { display: contents; }
  main { display: flex; flex-direction: column; }
  .hero { display: contents; }
  .hero-copy { order: 1; width: 100%; max-width: 360px; margin-inline: auto; padding: 30px 0 0; text-align: center; }
  .eyebrow { justify-content: center; width: 100%; margin-bottom: 18px; font-size: 11px; }
  h1 { font-size: 44px; line-height: 1.05; }
  .hero-slogan { max-width: 320px; margin: 16px auto 0; font-size: 22px; line-height: 1.35; }
  .hero-description { max-width: 320px; margin: 12px auto 0; font-size: 16px; line-height: 1.65; }
  .hero-actions { width: 100%; max-width: 276px; margin: 26px auto 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 10px; }
  .button { min-width: 0; padding-inline: 16px; }
  .model-line { display: none; }
  .gateway-visual { order: 3; width: calc(100% - (var(--page-space) * 2)); max-width: 330px; margin: 24px auto 36px; justify-self: center; padding: 20px; box-shadow: 7px 7px 0 rgba(184, 224, 241, 0.9); }
  .capability-band { order: 2; padding-block: 26px 0; background: transparent; }
  .capability-grid { max-width: 360px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .capability { min-height: 82px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 0; background: rgba(255, 255, 255, 0.76); box-shadow: 0 2px 8px rgba(16, 20, 22, 0.045); }
  .capability-index { justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(184, 224, 241, 0.44); line-height: 1; }
  .capability-number { font-size: 10px; }
  .capability-code, .capability p { display: none; }
  .capability h2 { margin: 0; font-size: 13px; line-height: 1.3; text-align: center; white-space: nowrap; }
  .format-band { order: 4; padding-block: 0 24px; background: rgba(244, 246, 247, 0.68); }
  .format-inner { width: calc(100% - (var(--page-space) * 2)); max-width: 330px; min-height: 0; padding: 18px; grid-template-columns: 1fr; gap: 16px; }
  .format-inner h2 { font-size: 20px; }
  .format-inner code { padding: 13px 14px; font-size: 11px; }
  .site-footer { border-top: 0; }
  .footer-inner { min-height: 92px; padding-block: 12px; flex-direction: column; justify-content: center; gap: 2px; }
}

@media (max-width: 390px) {
  .brand-meta { display: none; }
  .admin-login { padding-inline: 9px; }
  .header-action { width: 40px; padding: 0; }
  .header-action #header-status-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  h1 { font-size: 42px; }
  .gateway-fact { padding-left: 8px; }
  .gateway-fact dt { font-size: 9px; }
  .gateway-fact dd { font-size: 10px; }
  .endpoint-copy code { font-size: 11px; }
}

@media (max-width: 340px) {
  .header-action { padding-inline: 11px; }
  .brand { gap: 9px; }
  .gateway-visual { padding: 18px; }
  .flow-step { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ambient-danmaku { display: none; }
}
