:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #e4e9f1;
  --line-strong: #d8e0ec;
  --text: #172033;
  --muted: #64748b;
  --brand: #1677ff;
  --brand-strong: #0f5fd6;
  --brand-soft: rgba(22, 119, 255, 0.08);
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.04);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "SF Pro Display",
    "SF Pro Text",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
}

.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(216, 224, 236, 0.95);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.nav-link {
  position: relative;
  color: var(--muted);
  transition: color 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1rem;
  height: 2px;
  border-radius: 9999px;
  background: var(--brand);
}

.header-auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.5rem;
}

.auth-pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.62rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.auth-pill-button:hover {
  transform: translateY(-1px);
}

.auth-pill-button:active {
  transform: translateY(0);
}

.auth-pill-button:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.2);
  outline-offset: 3px;
}

.auth-pill-button--secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.auth-pill-button--primary {
  border: 1px solid transparent;
  background: linear-gradient(180deg, #3e9cff 0%, #1677ff 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(22, 119, 255, 0.22);
}

.auth-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(22, 119, 255, 0.1);
  background: rgba(240, 247, 255, 0.96);
  padding: 0.68rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
}

.auth-status-chip::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-modal.is-open {
  display: flex;
}

.auth-modal.is-open .auth-dialog {
  animation: authDialogEnter 220ms ease-out both;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
}

.auth-dialog {
  position: relative;
  width: 100%;
  max-width: 29rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 247, 255, 0.94));
  padding: 1.5rem;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.auth-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.05);
  color: #475569;
  cursor: pointer;
}

.auth-view-switch {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.05);
}

.auth-view-button {
  border: none;
  background: transparent;
  border-radius: 9999px;
  padding: 0.72rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.auth-view-button.is-active {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.auth-submode-switch {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.05);
}

.auth-submode-button {
  border: none;
  background: transparent;
  border-radius: 9999px;
  padding: 0.68rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.auth-submode-button.is-active {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.auth-demo-card {
  border-radius: 1.35rem;
  border: 1px solid rgba(22, 119, 255, 0.12);
  background: linear-gradient(180deg, rgba(240, 247, 255, 0.96), rgba(231, 241, 255, 0.92));
  padding: 1rem 1.05rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.45rem;
}

.auth-field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.auth-field-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1rem;
}

.auth-field-meta--end {
  justify-content: flex-end;
}

.auth-input {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.95rem 1rem;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.auth-input:focus {
  border-color: rgba(22, 119, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.1);
  background: #ffffff;
}

.auth-error {
  min-height: 1.3rem;
  font-size: 0.85rem;
  color: #dc2626;
}

.auth-helper-text {
  min-height: 1.1rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #64748b;
}

.auth-inline-link {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
}

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

.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  z-index: 100;
  transform: translateX(-50%) translateY(1rem);
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  padding: 0.9rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mobile-auth-group {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.mobile-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mobile-panel {
  display: none;
}

.mobile-panel.is-open {
  display: block;
}

.doc-layout {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

.doc-sidebar {
  display: none;
  min-width: 0;
}

.doc-sidebar-inner {
  position: sticky;
  top: 5.7rem;
  max-height: calc(100vh - 6.8rem);
  overflow: auto;
  padding: 0.35rem 0.85rem 0.5rem 0;
  border-right: 1px solid var(--line);
}

.doc-nav-block {
  padding-right: 0.85rem;
}

.doc-nav-block + .doc-nav-block {
  margin-top: 1rem;
}

.doc-nav-link {
  display: block;
  position: relative;
  margin: 0.15rem 0;
  padding: 0.62rem 0.85rem 0.62rem 1rem;
  border-radius: 0.72rem;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--muted);
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.doc-nav-link:hover {
  transform: translateX(1px);
  background: #eef5ff;
  color: var(--text);
}

.doc-nav-link:active {
  transform: translateX(0);
}

.doc-nav-link:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.16);
  outline-offset: 2px;
}

.doc-nav-link.is-current,
.doc-nav-link[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}

.doc-nav-link.is-current::before,
.doc-nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.72rem;
  bottom: 0.72rem;
  width: 2px;
  border-radius: 9999px;
  background: var(--brand);
}

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

.doc-breadcrumb {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: #7b8798;
}

.doc-breadcrumb a {
  color: #7b8798;
  transition: color 160ms ease;
}

.doc-breadcrumb a:hover {
  color: var(--text);
}

.doc-article {
  max-width: 860px;
  padding: 0 0 3.5rem;
}

.doc-article h1 {
  margin-top: 1rem;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
  color: var(--text);
}

.doc-article h3 {
  color: var(--text);
}

.doc-article p {
  font-size: 1rem;
  line-height: 1.82;
  color: var(--muted);
}

.doc-article ul,
.doc-article ol {
  color: var(--muted);
}

.doc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--surface);
  padding: 0.48rem 0.82rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5b6a7d;
}

.doc-section + .doc-section {
  margin-top: 2.5rem;
  padding-top: 2.35rem;
  border-top: 1px solid var(--line);
}

.doc-section h2 {
  font-size: 1.48rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--text);
}

.doc-section p {
  margin-top: 0.9rem;
}

.doc-inline-grid {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
}

.doc-list {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
}

.doc-quick-card,
.step-card,
.faq-card,
.doc-list-item,
.callout,
.warning-panel {
  display: block;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.doc-quick-card,
.faq-card,
.doc-list-item,
.callout,
.warning-panel {
  padding: 1.12rem 1.15rem;
}

.step-card {
  padding: 1.12rem 1.15rem;
  background: var(--surface);
}

.doc-quick-card:hover,
.step-card:hover,
.faq-card:hover,
.doc-list-item:hover {
  transform: translateY(-1px);
  border-color: #c7d8f2;
  box-shadow: var(--shadow);
}

.doc-quick-card:active,
.step-card:active,
.faq-card:active,
.doc-list-item:active {
  transform: translateY(0);
}

.doc-quick-card:focus-visible,
.step-card:focus-visible,
.faq-card:focus-visible,
.doc-list-item:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.16);
  outline-offset: 3px;
}

@keyframes authDialogEnter {
  from {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.callout {
  border-color: rgba(22, 119, 255, 0.18);
  background: linear-gradient(180deg, rgba(22, 119, 255, 0.06), rgba(22, 119, 255, 0.02));
}

.warning-panel {
  border-color: rgba(245, 158, 11, 0.22);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.03));
}

.doc-quick-card p,
.step-card p,
.faq-card p,
.doc-list-item p,
.callout p,
.warning-panel p {
  margin-top: 0.55rem;
  font-size: 0.95rem;
  line-height: 1.74;
}

.doc-list-item-head {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.doc-list-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #8a96a8;
  text-transform: uppercase;
}

.doc-list-title {
  font-size: 1.12rem;
  font-weight: 650;
  color: var(--text);
}

.doc-list-cta,
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand);
}

.doc-list-cta:hover,
.source-link:hover {
  color: var(--brand-strong);
}

@media (min-width: 768px) {
  .doc-inline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .doc-layout {
    gap: 1.1rem;
  }

  .doc-sidebar {
    display: block;
  }

  .doc-sidebar-inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    border-right: 0;
  }

  .doc-nav-block {
    display: flex;
    gap: 0.7rem;
    overflow-x: auto;
    padding: 0.95rem;
    border: 1px solid rgba(216, 224, 236, 0.9);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .doc-nav-block::-webkit-scrollbar {
    height: 6px;
  }

  .doc-nav-block::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 9999px;
  }

  .doc-nav-block + .doc-nav-block {
    margin-top: 0.75rem;
  }

  .doc-nav-link {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.72rem 0.95rem;
    white-space: nowrap;
    border: 1px solid transparent;
    background: #f8fbff;
  }

  .doc-nav-link:hover {
    transform: translateY(-1px);
  }

  .doc-nav-link.is-current::before,
  .doc-nav-link[aria-current="page"]::before {
    display: none;
  }

  .header-auth-actions {
    display: none;
  }

  .auth-dialog {
    padding: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .doc-layout {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    gap: 2rem;
  }

  .doc-sidebar {
    display: block;
  }

  .doc-list-item-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* Visual calm pass: align documentation pages with the quieter product UI. */
:root {
  --bg: #f6f8fb;
  --surface-soft: #f8fafc;
  --line: #e5eaf1;
  --text: #172033;
  --muted: #667085;
  --brand-strong: #1459c7;
  --brand-soft: rgba(22, 119, 255, 0.07);
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  background: linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
}

h1,
h2,
h3,
.doc-list-title {
  letter-spacing: 0 !important;
}

.auth-pill-button--primary {
  background: #1677ff;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.18);
}

.auth-pill-button--secondary,
.auth-status-chip,
.doc-nav-block,
.doc-quick-card,
.step-card,
.faq-card,
.doc-list-item,
.callout,
.warning-panel {
  border-color: rgba(226, 232, 240, 0.86);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.035);
}

.doc-nav-link:hover,
.doc-quick-card:hover,
.step-card:hover,
.faq-card:hover,
.doc-list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
}

.doc-nav-link.is-current,
.doc-nav-link[aria-current="page"] {
  color: #1459c7;
  background: #eef5ff;
}

.doc-article h1 {
  font-size: 2.1rem;
  line-height: 1.16;
}

.auth-dialog {
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

@media (min-width: 768px) {
  .doc-article h1 {
    font-size: 2.35rem;
  }
}

/* Reading experience polish: premium documentation without sacrificing density. */
.doc-sidebar-inner {
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.74);
  padding: 0.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(14px);
}

.doc-nav-block {
  padding-right: 0;
}

.doc-nav-link {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
}

.doc-article h1 {
  text-wrap: balance;
}

.doc-section h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.doc-section h2::before {
  content: "";
  flex: 0 0 auto;
  width: 0.3rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: linear-gradient(180deg, #59a7ff, #1677ff);
  box-shadow: 0 5px 12px rgba(22, 119, 255, 0.18);
}

.doc-badge {
  border-color: rgba(22, 119, 255, 0.12);
  color: #526176;
  background: rgba(248, 251, 255, 0.94);
}

.doc-quick-card,
.step-card,
.faq-card,
.doc-list-item,
.callout,
.warning-panel {
  border-radius: 1.25rem;
}

.doc-quick-card,
.step-card {
  position: relative;
  overflow: hidden;
}

.doc-quick-card::after,
.step-card::after {
  content: "";
  position: absolute;
  right: -2rem;
  top: -2rem;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: rgba(22, 119, 255, 0.04);
  pointer-events: none;
}

@media (max-width: 1023px) {
  .doc-sidebar-inner {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
  }
}

@media (max-width: 639px) {
  .doc-article h1 {
    font-size: 2rem;
  }

  .doc-section + .doc-section {
    margin-top: 2.15rem;
    padding-top: 2rem;
  }
}
