:root {
  color-scheme: light;
  --ink: #143247;
  --muted: #456277;
  --link: #07658f;
  --accent: #36b9ed;
  --accent-hover: #6bcdf5;
  --line: #d5e6f2;
  --wash: #edf7ff;
  --canvas: #f7fbff;
  --gutter: clamp(1.2rem, 4.2vw, 4rem);
  --header-height: 4.35rem;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.65;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-padding-top: var(--header-height); }
body { margin: 0; color: var(--ink); background: var(--canvas); }
p, h1, h2, h3, figure { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; }
a { color: var(--link); text-underline-offset: .22em; }
:where(a, button, summary):focus-visible { outline: 3px solid #1684b9; outline-offset: 4px; border-radius: .35rem; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  padding: .6rem .9rem;
  background: white;
  transform: translateY(calc(-100% - 1.5rem));
}
.skip-link:focus { transform: translateY(0); }

.wrap { width: min(73rem, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.site-header, .site-footer { background: white; }
.site-header { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.header-inner { min-height: calc(var(--header-height) - 1px); }

.brand {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  color: var(--ink);
  font-weight: 730;
  text-decoration: none;
  white-space: nowrap;
}
nav { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(.7rem, 2.25vw, 1.8rem); }
nav a { color: var(--muted); font-size: .94rem; font-weight: 620; text-decoration: none; }
nav a:hover { color: var(--link); text-decoration: underline; }
nav a[aria-current] { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; }
.source-link { padding: .3rem .75rem; border: 1px solid var(--line); border-radius: .7rem; color: var(--ink); }

.hero {
  display: grid;
  place-items: center;
  padding-block: clamp(3rem, 6.9vw, 6rem);
  background: radial-gradient(ellipse 30rem 24rem at center, #eaf5ff, transparent 82%);
}
.hero-copy { text-align: center; }
.hero-mark {
  inline-size: clamp(5.8rem, 10vw, 7.25rem);
  block-size: auto;
  margin: 0 auto 1.2rem;
  padding: .68rem;
  border: 1px solid #cfe5f4;
  border-radius: 1.65rem;
  background: #fff;
  box-shadow: 0 13px 34px #23597b15;
}
.descriptor { color: var(--link); font-weight: 690; }
h1 {
  margin-block: .55rem 1.05rem;
  color: #0f2d43;
  font-size: clamp(3.15rem, 6.2vw, 5.65rem);
  font-weight: 790;
  line-height: 1.14;
  letter-spacing: -.022em;
}
.summary { max-width: 35rem; margin-inline: auto; color: var(--muted); font-size: clamp(1.04rem, 1.8vw, 1.27rem); text-wrap: pretty; }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem; margin-block: 1.55rem .75rem; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  min-height: 2.8rem;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-radius: .66rem;
  text-align: center;
  text-decoration: none;
  font-weight: 660;
}
.primary { background: var(--accent); color: #0c2f44; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: white; color: var(--ink); border-color: #cbe1ef; }
.secondary:hover { border-color: #90bdd6; background: var(--wash); }
.compatibility, .package-platform, .preview-label { color: var(--muted); font-size: .875rem; }

h2 { font-size: clamp(1.67rem, 3.65vw, 2.45rem); font-weight: 750; line-height: 1.23; letter-spacing: -.022em; }
h3 { font-size: 1.17rem; line-height: 1.4; }
.feature-section {
  display: grid;
  align-content: center;
  padding-block: clamp(2.45rem, 5.15vw, 4.4rem);
  background: white;
  border-block: 1px solid var(--line);
}
.feature-showcase {
  display: grid;
  gap: clamp(.7rem, 2.1vw, 1.35rem);
  margin-top: 1.5rem;
}
.feature-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: .35rem;
  padding: .49rem;
  border: 1px solid var(--line);
  border-radius: .95rem;
  background: #f4faff;
}
.feature-tabs button {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .52rem .66rem;
  border: 1px solid transparent;
  border-radius: .67rem;
  background: transparent;
  color: var(--ink);
  text-align: start;
  font-weight: 640;
  line-height: 1.35;
  cursor: pointer;
}
.feature-tabs button:hover { background: #eaf6ff; }
.feature-tabs button[aria-selected="true"] {
  border-color: #bcdaee;
  background: #fff;
  color: var(--link);
  box-shadow: 0 2px 6px #1d5e8410;
}
.feature-icon {
  display: grid;
  place-items: center;
  inline-size: 2.3rem;
  block-size: 2.3rem;
  border-radius: .62rem;
  background: #e5f3fe;
  color: #1376a3;
}
.feature-glyph { font-weight: 700; }
.feature-icon i, .feature-search { display: block; position: relative; }
.feature-search { inline-size: .85rem; block-size: .85rem; border: 1.7px solid currentColor; border-radius: 50%; }
.feature-search::after {
  content: "";
  position: absolute;
  inline-size: .4rem;
  block-size: 1.7px;
  top: .62rem;
  left: .57rem;
  background: currentColor;
  transform: rotate(45deg);
}
.feature-note, .feature-book { width: .9rem; height: 1.08rem; border: 1.5px solid; border-radius: 3px; }
.feature-note::after, .feature-book::after {
  content: "";
  position: absolute;
  width: .44rem;
  height: 1.3px;
  top: .31rem;
  left: .14rem;
  background: currentColor;
  box-shadow: 0 .25rem 0 currentColor;
}
.feature-book { border-left-width: 3px; }
.feature-cursor {
  width: 1.1rem;
  height: 1.28rem;
  background: currentColor;
  clip-path: polygon(15% 4%, 90% 64%, 56% 66%, 70% 91%, 52% 98%, 38% 72%, 15% 89%);
}
.feature-repeat { width: 1.12rem; height: 1.12rem; border: 1.6px solid; border-right-color: transparent; border-radius: 50%; }
.feature-repeat::after {
  content: "";
  position: absolute;
  top: -.08rem;
  right: -.05rem;
  width: .38rem;
  height: .45rem;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: rotate(42deg);
}
.feature-tabs .feature-icon { flex: none; }
.feature-tabs button[aria-selected="true"] .feature-icon { background: #dcefff; }

.feature-preview {
  display: grid;
  min-width: 0;
  padding: clamp(.68rem, 1.7vw, 1.17rem);
  border: 1px solid #cde6f5;
  border-radius: 1.18rem;
  background: linear-gradient(142deg, #edf8ff, #e5f1fc);
}
.app-window {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
  border: 1px solid #cfe2ef;
  border-radius: .82rem;
  background: white;
  box-shadow: 0 8px 27px #23597b17;
}
.app-bar, .app-brand, .word-header { display: flex; align-items: center; }
.app-bar {
  justify-content: space-between;
  gap: .5rem;
  padding: .62rem .91rem;
  border-bottom: 1px solid #ddeaf4;
  background: #fcfeff;
}
.app-brand { gap: .36rem; font-size: .875rem; font-weight: 720; }
.preview-label { font-weight: 630; }
.demo-panel { display: grid; grid-template-rows: 1fr auto; min-width: 0; }
.demo-panel:focus-visible { outline: 3px solid #1684b9; outline-offset: -3px; }
.demo-panel:not([hidden]) ~ .demo-panel:not([hidden]) { border-top: 1px solid var(--line); }
.demo-view, .demo-main {
  min-width: 0;
  padding: clamp(1rem, 2.6vw, 1.85rem);
}
.demo-view { min-block-size: 18.2rem; }
.demo-view h3 { font-size: clamp(1.25rem, 2.25vw, 1.64rem); font-weight: 725; }
.demo-view .demo-word {
  font-size: clamp(2.12rem, 4.2vw, 3.1rem);
  line-height: 1.13;
  letter-spacing: -.035em;
}
.word-header { justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.preview-chip, .preview-related span {
  padding: .23rem .48rem;
  border-radius: .4rem;
  background: var(--wash);
  color: var(--link);
  font-size: .875rem;
}
.preview-chip { font-weight: 645; }
.lookup-view { display: grid; grid-template-columns: minmax(7.4rem, .41fr) minmax(0, 1fr); padding: 0; }
.demo-sidebar {
  display: flex;
  flex-direction: column;
  padding: .88rem .7rem;
  border-right: 1px solid #e0edf6;
  background: #f8fcff;
}
.preview-query {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  min-width: 0;
  margin-block: .34rem .81rem;
  padding: .38rem .46rem;
  border: 1px solid #abd5ec;
  border-radius: .38rem;
  background: white;
}
.preview-query .feature-search { color: var(--link); flex: none; margin-right: .24rem; }
.list-label { margin-bottom: .27rem; }
.preview-current, .preview-row { padding: .31rem .43rem; font-size: .875rem; }
.preview-current { border-radius: .35rem; background: var(--wash); }
.definition-block {
  margin-top: .86rem;
  padding-top: .74rem;
  border-top: 1px solid #dfeaf3;
}
.glosses {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: .5rem;
  margin: .35rem 0 0;
}
.glosses dt { color: var(--muted); }
.glosses dd { margin: 0; }
.preview-related { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.sample-block {
  margin-top: .72rem;
  padding: .64rem .79rem;
  border-radius: .55rem;
  background: var(--wash);
  color: #25516a;
}
.sample-block p + p { margin-top: .19rem; }
mark { padding: .04em .13em; border-radius: .22em; background: #d5effc; color: #0d5378; }
.reading-sample {
  margin-top: .98rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .62rem;
  background: #f8fcff;
}
.demo-hover-target { display: inline-block; padding: .02em .22em; border: 0; border-radius: .25em; background: #d5effc; color: #0d5378; cursor: pointer; }
.demo-hover-target:hover, .demo-hover-target[aria-expanded="true"] { background: #c1e8fa; }
.hover-card {
  width: fit-content;
  margin-top: .85rem;
  padding: .52rem .68rem;
  border: 1px solid #c8def0;
  border-radius: .57rem;
  background: white;
  box-shadow: 0 3px 12px #25597b14;
}
.hover-card strong { font-size: 1.1rem; }
.demo-wordbook { border-collapse: collapse; width: 100%; margin-top: .81rem; text-align: start; }
.demo-wordbook th, .demo-wordbook td { padding: .46rem .58rem; border-bottom: 1px solid #e6eff6; text-align: start; }
.demo-wordbook th { color: var(--muted); font-weight: 650; }
.demo-wordbook td:first-child { color: var(--link); font-weight: 650; }
.review-word { font-size: clamp(1.65rem, 3.1vw, 2.1rem); font-weight: 680; margin-top: .64rem; }
.review-collapse, .review-answer[open] .review-expand { display: none; }
.review-answer[open] .review-collapse { display: inline; }
.demo-caption {
  padding: .68rem clamp(1rem, 2.6vw, 1.85rem);
  border-top: 1px solid #e0edf6;
  background: #f7fbff;
  color: var(--muted);
  text-wrap: pretty;
}

.packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.85rem, 2.1vw, 1.65rem); }
.packages p, .quark p { color: var(--muted); margin-top: .45rem; text-wrap: pretty; }

.download-screen { display: grid; grid-template-rows: 1fr auto; }
.download-section { align-self: center; padding-block: clamp(2rem, 5vh, 4rem); }
.download-heading, .quark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .7rem 1.2rem;
}
.download-heading .compatibility { margin-top: .35rem; }
.quark {
  margin-top: 1.2rem;
  padding: 1rem clamp(1rem, 2.4vw, 1.55rem);
  border: 1px solid #c7e5f7;
  border-radius: .88rem;
  background: #e8f6ff;
}
.packages { margin: .9rem 0 0; padding: 0; list-style: none; }
.packages li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
  padding: 1.04rem;
  border: 1px solid var(--line);
  border-radius: .88rem;
  background: white;
}
.packages p { margin: 0; }
.packages h3 + p { margin-bottom: .5rem; }
.packages .button { margin-top: auto; }
.packages .button span { color: var(--muted); font-size: .85rem; font-weight: 580; }
.install-help { margin-top: 1.15rem; color: var(--muted); }
.install-help details { padding: .7rem 0; border-block: 1px solid var(--line); }
.install-help details p { margin-top: .4rem; }
.install-help > p { margin-top: .8rem; }
summary { cursor: pointer; color: var(--link); font-weight: 650; }

.site-footer { padding-block: 1.4rem 1.6rem; border-top: 1px solid var(--line); }
.footer-inner { flex-wrap: wrap; }
.footer-inner p { margin-top: .25rem; color: var(--muted); font-size: .9rem; }
.redirect { padding-block: 4rem; }
.redirect h1 { font-size: clamp(2rem, 6vw, 3.6rem); }

@media (prefers-reduced-motion: no-preference) {
  .screen[data-enter-from="below"] { --enter-offset: 15px; }
  .screen[data-enter-from="above"] { --enter-offset: -15px; }
  .screen[data-enter-from] > :is(.hero-copy, .wrap) { animation: enter-screen .56s cubic-bezier(.2,.75,.19,1) both; }
  .demo-panel:not([hidden]) .demo-view, details[open] > :is(p, dl), .hover-card:not([hidden]) { animation: enter .27s cubic-bezier(.2,.75,.19,1) both; }
  .button, .feature-tabs button { transition: background-color .18s, border-color .18s, box-shadow .18s, transform .18s; }
  .button:active, .feature-tabs button:active { transform: scale(.98); }
  @keyframes enter {
    from { opacity: .48; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes enter-screen {
    from { opacity: .62; transform: translateY(var(--enter-offset)); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (min-width: 55rem) and (min-height: 44rem) and (pointer: fine) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; scroll-snap-type: y proximity; }
  html.section-moving { scroll-snap-type: none; }
  .screen { min-block-size: calc(100vh - var(--header-height)); scroll-snap-align: start; }
  .button:hover { transform: translateY(-2px); box-shadow: 0 5px 12px #245c7c15; }
}

@media (min-width: 47rem) and (pointer: fine) {
  .feature-showcase.with-tabs { grid-template-columns: minmax(12.85rem, .31fr) minmax(0, 1fr); }
  .feature-tabs { grid-template-columns: 1fr; }
}

@media (max-width: 46.99rem), (pointer: coarse) {
  :root { --header-height: 3.65rem; --gutter: clamp(1rem, 4.5vw, 2rem); }
  html { overflow-anchor: none; }
  .header-inner, .footer-inner, .feature-section > .wrap, .download-section { max-width: 40rem; }
  .header-inner { gap: .45rem; }
  .header-inner .brand { gap: .38rem; }
  .header-inner .brand img { width: 1.95rem; height: 1.95rem; }
  .header-inner nav { gap: .12rem; flex-wrap: nowrap; }
  .header-inner nav a { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; font-size: .85rem; }
  .header-inner .source-link { margin-inline-start: .18rem; min-height: 2.4rem; padding: .25rem .46rem; }
  .hero {
    width: 100%;
    padding: clamp(2.9rem, 10vw, 4.6rem) var(--gutter) clamp(2.75rem, 9vw, 4rem);
    background: radial-gradient(ellipse 84% 75% at 50% 32%, #e1f2ff 0%, #f7fbff 100%);
  }
  .hero-copy { width: min(100%, 25rem); }
  .hero-mark { inline-size: 5.2rem; margin-bottom: .85rem; border-radius: 1.3rem; }
  .descriptor { font-size: .91rem; }
  h1 { font-size: clamp(2.52rem, 10vw, 4rem); margin-block: .34rem .7rem; }
  .summary { max-width: 22em; font-size: .98rem; }
  .hero-actions { display: grid; grid-template-columns: 1.25fr 1fr; margin-block: 1.3rem .75rem; }
  .hero-actions .button { padding-inline: .45rem; }
  .feature-section { padding-block: 2.15rem 2.55rem; }
  .feature-showcase { margin-top: 1rem; gap: .7rem; }
  .feature-tabs { gap: .28rem; padding: .35rem; background: #f2f8fc; }
  .feature-tabs button { gap: .46rem; padding: .45rem; font-size: .88rem; min-height: 2.75rem; }
  .feature-tabs .feature-icon { inline-size: 1.85rem; block-size: 1.85rem; }
  .feature-preview { padding: .52rem; border-radius: .95rem; }
  .app-window { box-shadow: 0 4px 16px #23597b12; }
  .app-bar { padding: .52rem .72rem; }
  .app-bar .preview-label { font-size: .78rem; }
  .with-tabs .demo-panel { grid-area: 2 / 1; }
  /* Reserve the tallest panel's space so tapping a tab does not move the download section. */
  .with-tabs .demo-panel[hidden] { display: grid !important; visibility: hidden; }
  .demo-view { min-block-size: 14rem; }
  .demo-caption { font-size: .875rem; }
  .download-section { padding-block: 2.3rem 2.5rem; }
  .quark { margin-top: .95rem; }
  .packages { grid-template-columns: 1fr; gap: .66rem; }
  .packages li { padding: .92rem 1rem; gap: .2rem; }
  .packages h3 + p { margin-bottom: .49rem; }
  .quark .button, .packages .button { width: 100%; }
  .footer-inner { gap: .72rem; }
  .footer-inner nav { width: 100%; gap: .4rem 1rem; }
  .footer-inner nav a { padding-block: .38rem; }
}

@media (max-width: 35rem) {
  .lookup-view { grid-template-columns: minmax(0, 1fr); }
  .demo-sidebar { display: none; }
}

@media (max-width: 22rem) {
  .hero-actions .button { font-size: .9rem; }
  .feature-tabs button { gap: .33rem; padding-inline: .33rem; font-size: .82rem; }
}
