:root{
  --bg: #ffffff;
  --text: #0b0f18;
  --muted: #5b6475;
  --line: rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow2: 0 14px 50px rgba(15, 23, 42, 0.10);

  --primary: #111827;
  --primaryText: #ffffff;

  --radius: 18px;
  --radius2: 22px;
  --container: 1120px;
  --font-mono: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", "Courier New", monospace;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(900px 600px at 70% 25%, rgba(17,24,39,0.04), rgba(255,255,255,0) 60%),
              radial-gradient(700px 500px at 20% 10%, rgba(17,24,39,0.03), rgba(255,255,255,0) 60%),
              var(--bg);
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; text-underline-offset: 4px; }

/* Global code typography: keep macOS-like monospace fallback order */
code, pre, kbd, samp, tt{
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.page{
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* Nav */
.nav{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.nav__inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}
.nav__toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}
.nav__toggle:hover{ background: rgba(17,24,39,0.06); }
.nav__toggle-bar{
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1){
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2){
  opacity: 0;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3){
  transform: translateY(-7px) rotate(-45deg);
}
.nav__menu-wrap{
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.brand__logo{
  height: 36px;
  width: auto;
}

.nav__links{
  margin-left: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}
.nav__links > a,
.nav__links > .nav__dropdown{
  min-width: 80px;
  text-align: center;
}
.nav__links a{ padding: 8px 6px; border-radius: 10px; white-space: nowrap; display: inline-block; text-align: center; }
.nav__links a:hover{ background: rgba(17,24,39,0.04); text-decoration: none; }
html[lang="zh-CN"] .nav__links a,
html[lang="zh-CN"] .nav__dropbtn{ letter-spacing: 0.15em; }

.nav__actions{
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav__github{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
}
.nav__github:hover{ background: rgba(17,24,39,0.04); text-decoration: none; }
.nav__external{
  font-size: 14px;
  opacity: 0.7;
}
.lang-toggle{
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  margin-right: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lang-toggle__track{
  display: flex;
  align-items: center;
  width: 56px;
  height: 28px;
  border-radius: 14px;
  background: rgba(17,24,39,0.10);
  position: relative;
  transition: background 0.3s;
}
.lang-toggle:hover .lang-toggle__track{ background: rgba(17,24,39,0.16); }
.lang-toggle__label{
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 28px;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
  pointer-events: none;
  user-select: none;
}
.lang-toggle__label--zh{ color: #fff; }
.lang-toggle__label--en{ color: var(--muted); }
.lang-toggle--en .lang-toggle__label--zh{ color: var(--muted); }
.lang-toggle--en .lang-toggle__label--en{ color: #fff; }
.lang-toggle__thumb{
  position: absolute;
  left: 2px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--primary);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.lang-toggle--en .lang-toggle__thumb{
  transform: translateX(28px);
}

/* Dropdown */
.nav__dropdown{ position: relative; }
.nav__dropbtn{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
}
.nav__dropbtn:hover{
  background: rgba(17,24,39,0.04);
}
.nav__chev{
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.85;
  transition: transform 0.2s ease;
  vertical-align: middle;
}
.nav__dropdown:hover .nav__chev{
  transform: rotate(180deg);
}
.nav__menu{
  position: absolute;
  top: 42px;
  left: 0;
  min-width: 300px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  display: none;
}
.nav__menuitem{
  display: block !important;
  padding: 12px 14px;
  border-radius: 10px;
  color: #1f2937;
  text-decoration: none;
  text-align: left !important;
  letter-spacing: normal !important;
}
.nav__menuitem:hover{ background: rgba(0,0,0,0.05); text-decoration: none; }
.nav__menuitem-title{
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  text-align: left;
}
.nav__menuitem-desc{
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  text-align: left;
}
.nav__dropdown:hover .nav__menu{ display: block; }

/* Hero */
.hero{
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 34px;
  align-items: center;
  padding: 44px 0 26px;
}
.pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.7);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}
.pill__dot{ opacity: 0.6; }
.pill__link{
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(17,24,39,0.06);
  text-decoration: none !important;
}

.h1{
  margin: 18px 0 10px;
  font-size: 58px;
  line-height: 1.35;
  letter-spacing: -0.04em;
}
.hero__heading{
  margin: 18px 0 10px;
  letter-spacing: -0.04em;
}
.hero__title-main{
  display: block;
  font-size: 72px;
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 20px;
}
.hero__title-sub{
  display: block;
  font-size: 40px;
  line-height: 1.25;
  font-weight: 700;
}
.lead{
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 54ch;
}

.cta{
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none !important;
  user-select: none;
  font-weight: 600;
}
.btn--xl{ padding: 13px 18px; }
.btn--primary{
  background: var(--primary);
  color: var(--primaryText);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 12px 30px rgba(17,24,39,0.18);
}
.btn--primary:hover{ filter: brightness(1.02); transform: translateY(-1px); }
.btn--ghost{
  background: rgba(255,255,255,0.6);
  color: var(--text);
}
.btn--ghost:hover{ background: rgba(17,24,39,0.04); }

/* Code card */
.codecard{
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,0.85);
  box-shadow: var(--shadow2);
  overflow: hidden;
}
.codecard__topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.traffic{ display: flex; gap: 8px; padding-left: 6px; }
.dot{
  width: 11px; height: 11px; border-radius: 999px;
  display: inline-block;
  background: #d1d5db;
}
.dot--red{ background: #ff5f57; }
.dot--yellow{ background: #febc2e; }
.dot--green{ background: #28c840; }

.copy{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}
.copy:hover{ background: rgba(17,24,39,0.03); }
.copy__icon{ font-size: 14px; }

.code{
  margin: 0;
  padding: 18px 18px 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  overflow: auto;
  background: linear-gradient(to bottom, rgba(248,250,252,0.9), rgba(255,255,255,0.9));
}
.code code{ white-space: pre; }
.kw{ color: #1f3a8a; font-weight: 700; }
.str{ color: #b42318; }
.hi{ color: #0f766e; font-weight: 700; }
.cm{ color: #6b7280; }
.num{ color: #059669; }

.codecard__hint{
  padding: 12px 18px 16px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  background: rgba(255,255,255,0.6);
}
.mono{
  font-family: var(--font-mono);
}

/* Overview image */
.overview{
  margin-top: 48px;
  padding: 0;
}
.overview__title{
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}
.overview__img{
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow2);
}

/* Community Members */
.community{
  margin-top: 56px;
  padding-bottom: 40px;
}
.community.is-hidden{
  display: none;
}
.community__title{
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}
.community__scroll{
  position: relative;
  overflow: hidden;
  margin: 0 -20px;
}
.community__scroll::before,
.community__scroll::after{
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.community__scroll::before{
  left: 0;
  background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
}
.community__scroll::after{
  right: 0;
  background: linear-gradient(to left, var(--bg) 0%, transparent 100%);
}
@keyframes community-scroll{
  0%{ transform: translateX(0); }
  100%{ transform: translateX(-50%); }
}
.community__track{
  display: flex;
  gap: 20px;
  padding: 0 20px;
  width: max-content;
  animation: community-scroll 25s linear infinite;
}
.community__item{
  flex-shrink: 0;
  width: 160px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #fff;
  border: 2px dashed rgba(15, 23, 42, 0.15);
  border-radius: 12px;
}
.community__item img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Logos */
.logos{
  margin-top: 34px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 34px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0.78;
}
.logos img{
  height: 28px;
  width: auto;
  filter: grayscale(100%);
}

/* Footer */
.footer{
  border-top: 1px solid var(--line);
  padding: 22px 20px;
  color: var(--muted);
}
.footer__inner{
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.sep{ opacity: 0.5; }

/* Responsive */
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; gap: 18px; padding-top: 26px; }
  .h1{ font-size: 46px; }
  .hero__title-main{ font-size: 56px; }
  .hero__title-sub{ font-size: 32px; }
}
@media (max-width: 768px){
  html, body{ overflow-x: hidden; }
  .nav__toggle{ display: flex; margin-left: auto; }
  .nav__menu-wrap{
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    z-index: 40;
  }
  .nav--open .nav__menu-wrap{ display: flex; }
  .nav__links{
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    margin-left: 0;
    width: 100%;
    gap: 4px;
  }
  .nav__links > a{
    display: block;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    border-radius: 10px;
  }
  .nav__dropdown{
    position: static;
    width: 100%;
  }
  .nav__dropdown .nav__dropbtn{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    border-radius: 10px;
  }
  .nav__dropdown .nav__menu{
    position: static;
    min-width: auto;
    box-shadow: none;
    padding: 8px 0 8px 16px;
    margin-top: 4px;
    margin-bottom: 8px;
    border-left: 2px solid var(--line);
    display: none;
  }
  .nav__dropdown.is-open .nav__menu{ display: block; }
  .nav__dropdown.is-open .nav__chev{ transform: rotate(180deg); }
  .nav__actions{
    margin-left: 0;
    width: 100%;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 8px;
  }
  .nav__inner{ padding: 12px 16px; flex-wrap: wrap; }
  .page{ padding: 20px 16px 48px; }
  .hero{ padding-top: 20px; gap: 24px; }
  .hero__left{ min-width: 0; width: 100%; }
  .hero__right{ min-width: 0; width: 100%; }
  .cta{ flex-direction: column; margin-top: 20px; width: 100%; max-width: 100%; gap: 10px; }
  .cta .btn{ width: 100%; max-width: 100%; box-sizing: border-box; }
  .btn--xl{ width: 100%; max-width: 100%; justify-content: center; box-sizing: border-box; }
  .codecard{ max-width: 100%; overflow: hidden; }
  .codecard .code{ font-size: 12px; padding: 14px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .overview{ margin-top: 32px; }
  .overview__title{ font-size: 20px; margin-bottom: 16px; }
  .footer{ padding: 18px 16px; }
  .footer__inner{ justify-content: center; }
}
@media (max-width: 520px){
  .h1{ font-size: 32px; }
  .hero__title-main{ font-size: 38px; }
  .hero__title-sub{ font-size: 22px; }
  .brand__logo{ height: 30px; }
}
