:root {
  --bg: #f8fafc;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-2: rgba(255, 255, 255, 0.8);
  --text: rgba(15, 23, 42, 0.95);
  --muted: rgba(71, 85, 105, 0.8);
  --faint: rgba(71, 85, 105, 0.6);
  --border: rgba(203, 213, 225, 0.6);
  --brand: #3b82f6;
  --brand-2: #10b981;
  --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #10b981 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial,
    sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: linear-gradient(135deg, -60% -20%, 100% 50%, rgba(59, 130, 246, 0.08), transparent 60%),
    linear-gradient(135deg, 0% 0%, 100% 100%, rgba(139, 92, 246, 0.06), transparent 40%),
    radial-gradient(1200px 700px at 12% -10%, rgba(59, 130, 246, 0.15), transparent 55%),
    radial-gradient(900px 540px at 90% 0%, rgba(16, 185, 129, 0.1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar__inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand__mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--brand-gradient);
  color: white;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  flex: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover .brand__mark {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.brand__name {
  font-size: 17px;
  font-weight: 700;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.topbar__sep {
  width: 1px;
  height: 18px;
  background: rgba(11, 15, 25, 0.12);
}

.topbar__tag {
  color: rgba(11, 15, 25, 0.62);
  font-size: 14px;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav__link {
  padding: 8px 4px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.nav__link:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.3);
}

.nav__link.is-active {
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}

.topsearch {
  width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.topsearch:hover {
  box-shadow: var(--shadow);
  border-color: rgba(59, 130, 246, 0.3);
}

.topsearch:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.topsearch__input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.keycap {
  flex: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--faint);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  background: white;
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--brand);
  box-shadow: var(--shadow);
}

.icon-btn--gitee {
  background: rgba(233, 38, 39, 0.08);
  border-color: rgba(233, 38, 39, 0.2);
  color: rgba(233, 38, 39, 0.9);
  font-weight: 700;
  font-family: var(--sans);
}

.icon-btn--gitee:hover {
  background: rgba(233, 38, 39, 0.12);
  border-color: rgba(233, 38, 39, 0.3);
  color: rgba(233, 38, 39, 1);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.2);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--muted);
  margin: 4px auto;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.nav-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.98);
}

.nav-drawer.is-open {
  display: block;
}

.nav-drawer__inner {
  padding: 16px 0 20px;
  display: grid;
  gap: 10px;
}

.nav-drawer__link {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--muted);
  background: white;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-drawer__link:hover {
  color: var(--brand);
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.04);
  transform: translateX(4px);
}

.nav-drawer__link.is-active {
  color: white;
  border-color: var(--brand);
  background: var(--brand-gradient);
}

.hero {
  padding: 80px 0 60px;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.hero__title {
  margin: 20px 0 14px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.5px;
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
  max-width: 58ch;
}

.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: white;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn--primary {
  background: var(--brand-gradient);
  color: white;
  border: none;
}

.btn--primary:hover {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.btn--secondary {
  border-color: var(--border);
  background: white;
}

.btn--secondary:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.04);
}

.btn--tertiary {
  border-color: rgba(59, 130, 246, 0.18);
  background: rgba(59, 130, 246, 0.02);
  color: var(--text);
}

.btn--tertiary:hover {
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.06);
}

.btn--compact {
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: none;
}

.btn--compact:hover {
  transform: translateY(-1px);
}

.inline-link {
  color: var(--brand);
  font-weight: 600;
}

.inline-link:hover {
  text-decoration: underline;
}

.hero__meta {
  margin-top: 24px;
  display: grid;
  gap: 12px;
  max-width: 58ch;
}

.meta-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.meta-item:hover {
  box-shadow: var(--shadow);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateX(4px);
}

.meta-item__k {
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 2px;
}

.meta-item__v {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
}

.section {
  padding: 60px 0;
}

.section--alt {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.02), rgba(139, 92, 246, 0.02));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__title {
  margin: 0 0 24px;
  font-size: 26px;
  letter-spacing: -0.3px;
  font-weight: 700;
  color: var(--text);
}

.section__actions {
  margin-top: 24px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

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

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

.feature,
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.feature:hover,
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.2);
}

.feature__title {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--text);
}

.feature__desc,
.card__text {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.card__title {
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 17px;
  color: var(--text);
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card .pill {
  align-self: flex-start;
}

.card__list {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.card__list li + li {
  margin-top: 6px;
}

.card__actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.card--code {
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(180deg, white, rgba(248, 250, 252, 0.9));
  border: 1px solid var(--border);
}

.code {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.2);
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(248, 250, 252, 0.95);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card__hint {
  margin-top: 12px;
  color: var(--faint);
  font-size: 13px;
}

.footer {
  border-top: 1px solid rgba(11, 15, 25, 0.12);
  background: linear-gradient(180deg, rgba(246, 248, 252, 0.95), rgba(255, 255, 255, 0.98));
  padding: 32px 0 24px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
}

.footer__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__section--left {
  justify-content: flex-start;
}

.footer__section--center {
  align-items: center;
  justify-content: center;
}

.footer__section--right {
  align-items: flex-end;
  justify-content: flex-start;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.footer__brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(106, 167, 255, 1), rgba(119, 243, 212, 1));
  color: rgba(11, 15, 25, 1);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(11, 15, 25, 0.12);
}

.footer__brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}

.footer__tagline {
  color: var(--faint);
  font-size: 13px;
  line-height: 1.6;
  max-width: 400px;
}

.footer__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.footer__meta a {
  color: rgba(106, 167, 255, 0.9);
  transition: color 0.14s ease;
}

.footer__meta a:hover {
  color: rgba(106, 167, 255, 1);
  text-decoration: underline;
}

.footer__links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__link-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.footer__link {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.14s ease;
}

.footer__link:hover {
  color: var(--text);
  border-color: rgba(106, 167, 255, 0.3);
  background: rgba(106, 167, 255, 0.06);
}

.footer__social {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.footer__social-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(11, 15, 25, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  transition: all 0.14s ease;
}

.footer__social-btn:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: rgba(106, 167, 255, 0.4);
  background: rgba(106, 167, 255, 0.08);
  box-shadow: 0 4px 12px rgba(106, 167, 255, 0.15);
}

.footer__bottom {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(11, 15, 25, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--faint);
  font-size: 12px;
}

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

.docs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0 40px;
}

.docs-sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 96px);
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: white;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.docs-search {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.docs-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: white;
}

.docs-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.docs-nav {
  display: grid;
  gap: 6px;
}

.docs-nav__group {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.docs-nav__title {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.docs-nav__link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-weight: 500;
}

.docs-nav__link:hover {
  color: var(--brand);
  background: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.1);
  transform: translateX(4px);
}

.docs-nav__link.is-active {
  color: white;
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: var(--shadow);
}

.docs-content {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: white;
  padding: 28px 28px 32px;
  box-shadow: var(--shadow-sm);
}

.docs-content h1 {
  margin: 0 0 18px;
  font-size: 32px;
  letter-spacing: -0.4px;
  font-weight: 800;
  color: var(--text);
}

.docs-content h2 {
  margin: 32px 0 12px;
  font-size: 22px;
  letter-spacing: -0.3px;
  font-weight: 700;
  color: var(--text);
}

.docs-content h3 {
  margin: 20px 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.docs-content p,
.docs-content li {
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

.docs-content a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-content code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

.docs-content pre code {
  display: block;
  padding: 16px;
  border-radius: var(--radius);
  overflow: auto;
  line-height: 1.7;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  color: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.api-table th {
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(139, 92, 246, 0.9));
}

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

.api-table tr:last-child td {
  border-bottom: none;
}

.api-table tr:hover td {
  background: var(--bg);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 600;
}

@media (max-width: 980px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }
  
  /* iframe 编辑器适配 */
  .full-editor-wrapper iframe {
    height: 700px !important;
  }
  
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer__section--left,
  .footer__section--center,
  .footer__section--right {
    align-items: center;
    text-align: center;
  }
  .footer__tagline {
    max-width: 100%;
  }
  .footer__bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 820px) {
  .nav {
    display: none;
  }
  .topsearch {
    width: 100%;
    flex: 1;
  }
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    position: static;
    height: auto;
  }
  .hero {
    padding: 60px 0 40px;
  }
  .hero__title {
    font-size: clamp(32px, 5vw, 48px);
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .footer {
    padding: 28px 0 20px;
  }
  .footer__links {
    justify-content: center;
  }
  .container {
    width: min(100%, calc(100% - 32px));
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
  .hero__actions {
    flex-direction: column;
    width: 100%;
  }
  .section__actions {
    flex-direction: column;
    width: 100%;
  }
}
