/* ============================================================
   Clash Official Site (clashguanwang.com) — clean light airy aesthetic
   ============================================================ */

:root {
  --bg: #f7f9fd;
  --bg-soft: #eef2fa;
  --panel: #ffffff;
  --line: #e4eaf5;
  --text: #12203a;
  --text-dim: #55657f;
  --text-faint: #8494ad;
  --cyan: #0891b2;
  --cyan-bright: #06b6d4;
  --violet: #7c3aed;
  --green: #059669;
  --amber: #d97706;
  --grad: linear-gradient(120deg, var(--cyan-bright), var(--violet));
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(18, 32, 58, 0.06), 0 4px 14px rgba(18, 32, 58, 0.05);
  --shadow-lg: 0 12px 40px rgba(18, 32, 58, 0.12);
  --font-sans: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-sans);
  background: var(--bg) url("../img/grid-bg.svg") repeat;
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
code { overflow-wrap: break-word; word-break: break-word; }

button, a { -webkit-tap-highlight-color: transparent; }
button:focus, a:focus { outline: none; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}

.container { width: min(1160px, 92%); margin: 0 auto; }

.section { padding: 96px 0; }
.section--tight { padding-top: 0; }

.section__tag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.25em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section__tag::before { content: "// "; color: var(--text-faint); }

.section__title {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 18px;
}

.section__desc { color: var(--text-dim); max-width: 620px; margin-bottom: 42px; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.btn--primary {
  background: var(--grad);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.28);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(124, 58, 237, 0.38); }
.btn--outline {
  border: 1.5px solid var(--line);
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.btn--outline:hover { border-color: var(--cyan); color: var(--cyan); }
.btn--ghost {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
  background: var(--panel);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--text); }

.link-arrow {
  display: inline-block;
  margin-top: 26px;
  font-weight: 700;
  color: var(--violet);
  border-bottom: 1px dashed transparent;
}
.link-arrow:hover { border-bottom-color: var(--violet); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(18, 32, 58, 0.06); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  min-width: 0;
  flex-shrink: 1;
}
.nav__brand img { flex-shrink: 0; }
.nav__brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.nav__brand em { font-style: normal; color: var(--cyan); font-family: var(--font-mono); font-size: 1rem; }

.nav__links { display: flex; gap: 32px; font-weight: 500; }
.nav__links a { color: var(--text-dim); position: relative; padding: 6px 0; transition: color 0.2s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

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

/* Language dropdown */
.lang { position: relative; }
.lang__btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-dim);
  padding: 9px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.lang__btn:hover { border-color: var(--cyan); color: var(--text); }
.lang__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-lg);
}
.lang.is-open .lang__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang__menu li { padding: 0; }
.lang__menu li a {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
}
.lang__menu li a:hover { background: var(--bg-soft); color: var(--text); }
.lang__menu li a.is-active { color: var(--violet); font-weight: 700; cursor: default; }

/* Burger (mobile) */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav__burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 90px 0 0; overflow: hidden; }

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}
.hero__glow--1 { width: 480px; height: 480px; background: rgba(6, 182, 212, 0.16); top: -140px; left: -120px; }
.hero__glow--2 { width: 520px; height: 520px; background: rgba(124, 58, 237, 0.14); top: 60px; right: -160px; }

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 28px;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.7rem);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
}

.hero__sub { color: var(--text-dim); font-size: 1.07rem; max-width: 520px; margin-bottom: 36px; }

.hero__cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 44px; }

.hero__meta {
  display: flex;
  gap: 44px;
  list-style: none;
  color: var(--text-faint);
  font-size: 0.88rem;
}
.hero__meta strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text);
}

.hero__visual { position: relative; }
.hero__visual > img {
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(18, 32, 58, 0.16), 0 0 0 1px var(--line);
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* Scrolling keyword ticker */
.hero__ticker {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  white-space: nowrap;
  padding: 14px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.hero__ticker-track {
  display: inline-flex;
  gap: 34px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  animation: ticker 36s linear infinite;
}
.hero__ticker-track span:nth-child(even) { color: var(--cyan); opacity: 0.55; }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Topology / how it works ---------- */
.topology__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.topology__visual > img {
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.topology h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 18px;
}
.topology__copy > p:not(.section__tag) { color: var(--text-dim); }

.topology__list { list-style: none; margin-top: 30px; display: grid; gap: 20px; }
.topology__list li { display: flex; gap: 16px; align-items: flex-start; }
.topology__list strong { display: block; font-size: 1.02rem; }
.topology__list span { color: var(--text-faint); font-size: 0.92rem; }

.mark {
  flex-shrink: 0;
  width: 12px; height: 12px;
  margin-top: 8px;
  border-radius: 3px;
  transform: rotate(45deg);
}
.mark--violet { background: var(--violet); }
.mark--green { background: #10b981; }
.mark--amber { background: #f59e0b; }

/* ---------- Features ---------- */
.features { background: linear-gradient(180deg, transparent, rgba(238, 242, 250, 0.9) 22%, rgba(238, 242, 250, 0.9) 78%, transparent); }

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 48px;
}

.card {
  padding: 32px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(8, 145, 178, 0.45);
  box-shadow: var(--shadow-lg);
}
.card img { margin-bottom: 20px; }
.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card p { color: var(--text-dim); font-size: 0.94rem; }

/* ---------- Stats band ---------- */
.stats { padding: 76px 0 60px; text-align: center; }

.stats__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.stats__item {
  padding: 30px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.stats__item strong {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats__item span { color: var(--text-faint); font-size: 0.9rem; }

.stats__note { margin-top: 26px; color: var(--text-faint); font-size: 0.85rem; }
.stats__note a { color: var(--violet); font-family: var(--font-mono); }

/* ---------- Downloads ---------- */
.download__banner {
  position: relative;
  margin-bottom: 40px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.download__banner img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}
.download__banner figcaption {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

.download__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.dl-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 30px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.dl-card:hover { transform: translateY(-6px); border-color: var(--violet); box-shadow: var(--shadow-lg); }
.dl-card img { margin-bottom: 12px; }
.dl-card h3 { font-size: 1.2rem; }
.dl-card span { color: var(--text-faint); font-size: 0.85rem; }
.dl-card em {
  margin-top: 12px;
  font-style: normal;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--cyan);
}

.dl-card--cli { background: #f4f7fd; border-style: dashed; }
.dl-card--cli h3 { font-family: var(--font-mono); color: var(--green); }
.dl-card--cli code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 8px 0;
  word-break: break-all;
}

/* ---------- CTA ---------- */
.cta__box {
  text-align: center;
  padding: 72px 32px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel) url("../img/photos/cta-waves.webp") center / cover no-repeat;
  box-shadow: var(--shadow-sm);
}
.cta__box > img { margin: 0 auto 24px; }
.cta__box h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 900; margin-bottom: 12px; }
.cta__box p { color: var(--text-dim); margin-bottom: 34px; }
.cta__actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: #eef2f9;
  padding: 64px 0 0;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 48px;
}

.footer__brand p { color: var(--text-faint); font-size: 0.9rem; margin: 16px 0; max-width: 300px; }

.footer__col h4 {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer__col a { display: block; color: var(--text-dim); font-size: 0.94rem; padding: 5px 0; }
.footer__col a:hover { color: var(--violet); }

.footer__langs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer__langs a { display: inline-block; }
.footer__langs a.is-active { color: var(--violet); font-weight: 700; }

.footer__legal-links {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
}
.footer__legal-link {
  color: var(--text-faint);
  font-size: 0.82rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.footer__legal-link:hover { color: var(--violet); text-decoration-color: currentColor; }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 22px 0;
  border-top: 1px solid #dde4f0;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
.mobile-br { display: none; }

@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 60px; }
  .hero__visual { max-width: 640px; margin: 0 auto; }
  .topology__inner { grid-template-columns: 1fr; gap: 48px; }
  .topology__visual { max-width: 540px; margin: 0 auto; }
  .features__grid { grid-template-columns: repeat(2, 1fr); }
  .download__grid { grid-template-columns: repeat(2, 1fr); }
  .stats__inner { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .section { padding: 68px 0; }
  .mobile-br { display: inline; }

  .nav__links {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--panel);
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--line);
    padding: 12px 6%;
    /* Offset must exceed menu height plus the 72px top inset */
    transform: translateY(calc(-100% - 80px));
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
    z-index: 90;
  }
  .nav__links.is-open { transform: translateY(0); visibility: visible; }
  .nav__links a { padding: 15px 0; border-bottom: 1px solid var(--bg-soft); }
  .nav__links a.is-active::after { display: none; }

  .nav__burger { display: flex; }
  .lang__btn { padding: 8px 10px; font-size: 0.8rem; }
  .nav__brand { font-size: 1.1rem; }
  .nav__brand em { font-size: 0.85rem; }

  .hero { padding-top: 56px; }
  .hero__meta { gap: 26px; flex-wrap: wrap; }
  .hero__cta .btn { flex: 1 1 100%; justify-content: center; }
  .hero__ticker { margin-top: 56px; }

  .features__grid, .download__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .footer__bottom { flex-direction: column; text-align: center; }
}

/* Below this width even a short language label plus the brand wordmark can
   collide, so the lang switcher drops to an icon-only button. The dropdown
   itself still lists every language's full name. */
@media (max-width: 380px) {
  .lang__btn-label { display: none; }
  .lang__btn { padding: 8px; gap: 4px; }
  .nav__brand { font-size: 1rem; }
  .nav__brand em { font-size: 0.78rem; }
}

/* On the very narrowest phones, drop the translated subtitle entirely
   rather than truncating it mid-word — "Clash" alone stays legible and
   on brand in every language. */
@media (max-width: 340px) {
  .nav__brand em { display: none; }
}

/* ============================================================
   Platform download detail pages
   ============================================================ */

.breadcrumb {
  padding: 20px 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--violet); }
.breadcrumb .sep { margin: 0 8px; color: var(--line); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

.platform-hero {
  position: relative;
  overflow: hidden;
  padding: 24px 0 64px;
  text-align: center;
}

.platform-hero h1 {
  position: relative;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 16px;
}

.platform-hero .lead {
  position: relative;
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto 30px;
}

.platform-hero__meta {
  position: relative;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.platform-hero__cta {
  position: relative;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 8px;
}

.option-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 26px 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.option-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.option-card--rec::before { opacity: 1; }
.option-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--cyan); }
.option-card:hover::before { opacity: 1; }

.option-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.option-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(124, 58, 237, 0.14));
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.1);
}
.option-card__icon img { width: 28px; height: 28px; }

.option-card__icon--logo {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
}
.option-card__icon--logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.error-404 {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}
.error-404__code {
  font-family: var(--font-mono);
  font-size: clamp(64px, 14vw, 140px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-404 h1 { margin: 12px 0 8px; font-size: 1.6rem; }
.error-404 p { color: var(--text-dim); max-width: 480px; margin: 0 auto 28px; }
.error-404 .btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.option-card > h3 { font-size: 1.16rem; margin-top: 2px; }

.option-card__site {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: -6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
  width: fit-content;
}
.option-card__site:hover { text-decoration: underline; }

.option-card__badge {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  white-space: nowrap;
  margin-top: 4px;
}
.option-card__badge--rec { background: rgba(6, 182, 212, 0.12); color: var(--cyan); }

.option-card p.desc { color: var(--text-dim); font-size: 0.9rem; flex: 1; }

.option-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: 600;
}
.option-card__meta span {
  background: var(--bg-soft);
  padding: 5px 11px;
  border-radius: 8px;
}

.option-card .btn { justify-content: center; width: 100%; margin-top: 4px; }
.option-card .btn--outline {
  background: var(--bg-soft);
  border-color: transparent;
  box-shadow: none;
}
.option-card .btn--outline:hover { background: rgba(6, 182, 212, 0.1); border-color: var(--cyan); color: var(--cyan); }

.option-card__badge--source { background: rgba(124, 58, 237, 0.1); color: var(--violet); }
.option-card__badge--warn { background: rgba(217, 119, 6, 0.12); color: #b45309; }

.option-card--deprecated { opacity: 0.82; }
.option-card--deprecated:hover { opacity: 1; }

.option-card__links { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.option-card__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 11px;
  background: var(--bg-soft);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}
.option-card__link span.fmt { color: var(--text-faint); font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem; }
.option-card__link svg { flex-shrink: 0; opacity: 0.45; transition: opacity 0.2s ease, transform 0.2s ease; }
.option-card__link:hover { background: rgba(6, 182, 212, 0.1); color: var(--cyan); }
.option-card__link:hover svg { opacity: 1; transform: translateY(2px); }

.steps { display: grid; gap: 16px; margin-top: 8px; }

.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.step__num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-mono);
}

.step h3 { font-size: 1.03rem; margin-bottom: 6px; }
.step p { color: var(--text-dim); font-size: 0.92rem; }
.step code {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--violet);
  word-break: break-all;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(6, 182, 212, 0.07);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 28px;
}
.notice strong { color: var(--cyan); }

.faq { display: grid; gap: 12px; margin-top: 8px; }

.faq details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 24px;
  box-shadow: var(--shadow-sm);
}

.faq summary {
  cursor: pointer;
  padding: 18px 0;
  font-weight: 700;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-faint);
  flex-shrink: 0;
}
.faq details[open] summary::after { content: "\2212"; }
.faq p { color: var(--text-dim); font-size: 0.92rem; padding-bottom: 20px; margin-top: -6px; }

/* Platform tab switcher */
.platform-tabs {
  position: relative;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.platform-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.platform-tab img { width: 22px; height: 22px; }
.platform-tab:hover { border-color: var(--cyan); color: var(--text); transform: translateY(-2px); }
.platform-tab.is-active {
  border: 1.5px solid transparent;
  background: var(--grad) padding-box, var(--grad) border-box;
  color: #fff;
  box-shadow: 0 10px 20px -6px rgba(124, 58, 237, 0.45);
}
.platform-tab.is-active img { filter: brightness(0) invert(1); }

.platform-panel { display: none; }
.platform-panel.is-active { display: block; animation: panelFadeIn 0.35s ease; }

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.platform-panel + .platform-panel { margin-top: 0; }

.platform-panel__head { margin-bottom: 36px; }
.platform-panel__head h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 900;
  margin-bottom: 14px;
}
.platform-panel__head h2 img { width: 38px; height: 38px; }
.platform-panel__head .lead { color: var(--text-dim); max-width: 620px; margin-bottom: 26px; font-size: 1rem; }
.platform-panel__head .platform-hero__meta,
.platform-panel__head .platform-hero__cta { justify-content: flex-start; }

.panel-heading {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 52px 0 20px;
}
.platform-panel__head + .panel-heading,
.option-grid + .panel-heading,
.notice + .panel-heading { margin-top: 52px; }

@media (max-width: 720px) {
  .option-grid { grid-template-columns: 1fr; }
  .step { padding: 20px; }
  .platform-hero { padding: 12px 0 48px; }
  .platform-tabs { gap: 8px; }
  .platform-tab { padding: 10px 14px; font-size: 0.85rem; }
  .platform-tab img { width: 18px; height: 18px; }
}

/* ---------- Blog ---------- */
.blog-hero { padding: 64px 0 8px; text-align: center; }
.blog-hero .section__tag { justify-content: center; display: flex; }
.blog-hero h1 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 900;
  margin: 14px 0 16px;
}
.blog-hero .lead {
  max-width: 640px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 1.05rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 48px 0 96px;
}
.blog-card { display: flex; flex-direction: column; }
.blog-card__tag {
  align-self: flex-start;
  font-family: var(--font-sans);
  color: var(--violet);
  background: rgba(124, 58, 237, 0.08);
  border-color: transparent;
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 16px;
}
.blog-card h3 { font-size: 1.22rem; line-height: 1.45; margin-bottom: 12px; transition: color 0.2s; }
.blog-card:hover h3 { color: var(--violet); }
.blog-card p { flex-grow: 1; margin-bottom: 18px; }
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  margin-bottom: 16px;
}
.blog-card .link-arrow { margin-top: 0; }
.blog-card:hover .link-arrow { border-bottom-color: var(--violet); }

@media (max-width: 860px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* ---------- Tutorial article ---------- */
.tutorial-content { max-width: 800px; margin: 0 auto; }

.article-head { margin: 48px 0 40px; }
.article-head .section__tag { margin-bottom: 16px; }
.article-head h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 18px;
}
.article-head .lead { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 0; }

.doc-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  margin-bottom: 28px;
}
.doc-switcher a {
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.doc-switcher a:hover { color: var(--text); }
.doc-switcher a.is-active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px -6px rgba(124, 58, 237, 0.45);
}
@media (max-width: 480px) {
  .doc-switcher { width: 100%; }
  .doc-switcher a { flex: 1; text-align: center; padding: 9px 8px; }
}

.tutorial-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.tutorial-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.tutorial-nav a:hover {
  color: #fff;
  border-color: transparent;
  background: var(--grad);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -6px rgba(124, 58, 237, 0.4);
}

.article-body { padding-bottom: 20px; }

.article-body h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight: 900;
  margin: 64px 0 18px;
  scroll-margin-top: 100px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.article-body > h2:first-child { margin-top: 0; }
.article-body h2::before {
  content: "";
  width: 6px;
  height: 26px;
  border-radius: 4px;
  background: var(--grad);
  flex-shrink: 0;
}
.article-body h3 {
  font-size: 1.18rem;
  font-weight: 800;
  margin: 32px 0 12px;
  scroll-margin-top: 100px;
}
.article-body p {
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 1.02rem;
}
.article-body ul, .article-body ol {
  margin: 0 0 18px 1.3em;
  color: var(--text-dim);
}
.article-body li { margin-bottom: 8px; }
.article-body li::marker { color: var(--cyan); }
.article-body strong { color: var(--text); font-weight: 700; }
.article-body code {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--violet);
}
.article-body pre {
  background: #101a2e;
  color: #d7e3f4;
  border-radius: 14px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 18px 0 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  box-shadow: var(--shadow-sm);
}
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body .notice { margin: 6px 0 24px; }
.article-body .faq { margin-top: 4px; }
.article-body .steps { margin-top: 8px; }

.table-scroll {
  margin: 18px 0 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.doc-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--panel);
}
.doc-table th, .doc-table td {
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc-table th {
  background: var(--bg-soft);
  color: var(--text-faint);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}
.doc-table td { color: var(--text-dim); }
.doc-table td code, .doc-table th code {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--violet);
  white-space: nowrap;
}
.doc-table tr:last-child td { border-bottom: none; }

@media (max-width: 640px) {
  .doc-table { font-size: 0.85rem; min-width: 480px; }
  .doc-table th, .doc-table td { padding: 10px 12px; }
}
.example-block { margin-top: 8px; }
.example-block summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--violet);
  margin-bottom: 14px;
  list-style: none;
}
.example-block summary::-webkit-details-marker { display: none; }
.example-block summary::before { content: "▸"; transition: transform 0.2s ease; }
.example-block[open] summary::before { transform: rotate(90deg); }

.article-cta {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.article-cta p { color: var(--text-dim); margin: 0; max-width: 380px; }
.article-cta .btns { display: flex; gap: 12px; flex-wrap: wrap; }

.article-cta--download {
  margin-top: 56px;
  padding: 36px 40px;
  border-top: none;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.article-cta--download__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  max-width: none;
}
.article-cta--download p { max-width: 420px; }

@media (max-width: 640px) {
  .article-cta--download { padding: 28px 24px; }
}

/* ---------- Floating download widget ---------- */
.dl-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 230px;
  padding: 18px 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: dlFloatIn 0.5s ease 0.5s both;
}
.dl-float.is-hidden { display: none; }
.dl-float__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--bg-soft);
  color: var(--text-faint);
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
}
.dl-float__close:hover { color: var(--text); }
.dl-float__text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 12px;
  padding-right: 16px;
  line-height: 1.5;
}
.dl-float__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: 0 8px 18px -6px rgba(124, 58, 237, 0.4);
}
@keyframes dlFloatIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
  .dl-float { right: 14px; bottom: 14px; width: 190px; padding: 14px 14px 16px; }
  .dl-float__text { font-size: 0.82rem; }
}

@media (max-width: 560px) {
  .tutorial-nav { gap: 8px; }
  .tutorial-nav a { padding: 8px 14px; font-size: 0.82rem; }
}
