:root {
  --font-zh: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Space Grotesk", var(--font-zh);
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --bg: #f3f6f4;
  --bg-2: #eef2f0;
  --paper: #ffffff;
  --ink: #0c1411;
  --ink-soft: #4d5b55;
  --ink-mute: #87948d;
  --line: #e4eae7;
  --line-2: #d4ddd8;
  --accent: #0c9e76;
  --accent-strong: #0a7e5e;
  --accent-bright: #1fd6a0;
  --accent-wash: #e6f6f0;
  --red: #b42318;
  --amber: #a86500;
  --shadow-sm: 0 1px 2px rgba(12,20,17,.05), 0 1px 1px rgba(12,20,17,.04);
  --shadow: 0 4px 20px -6px rgba(12,20,17,.10), 0 2px 6px -2px rgba(12,20,17,.06);
  --shadow-lg: 0 24px 60px -20px rgba(12,20,17,.22), 0 8px 24px -10px rgba(12,20,17,.12);
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --maxw: 1200px;
  --gut: clamp(20px, 5vw, 64px);
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-zh);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg), transparent 6%);
  backdrop-filter: saturate(1.4) blur(14px);
}

.nav-in {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.logo {
  width: 30px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2.5px;
  padding: 4px;
  border-radius: 8px;
  background: var(--ink);
}

.logo i {
  border-radius: 1.5px;
  background: #fff;
}

.logo i:nth-child(1),
.logo i:nth-child(4) {
  background: var(--accent-bright);
}

.brand b span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: .95rem;
  font-weight: 500;
}

.nav-links a:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.nav .btn {
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: .98rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background .18s, box-shadow .18s, color .18s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: #1b2520;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.btn-ghost:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.demo-shell {
  position: relative;
  min-height: calc(100vh - 72px);
  overflow: hidden;
  padding-block: clamp(48px, 7vw, 96px);
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(120% 80% at 70% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(120% 80% at 70% 0%, #000 0%, transparent 62%);
  opacity: .62;
}

.demo-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background:
    linear-gradient(135deg, var(--accent) 0 50%, transparent 50% 100%),
    var(--accent-bright);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5);
}

h1,
h2 {
  line-height: 1.12;
  letter-spacing: -.02em;
}

.demo-copy h1 {
  max-width: 11ch;
  margin-top: 22px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 700;
}

.lead {
  max-width: 40rem;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.75;
}

.hero-note {
  display: grid;
  gap: 4px;
  max-width: 40rem;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--paper), transparent 12%);
  color: var(--ink-mute);
  box-shadow: var(--shadow-sm);
}

.hero-note b {
  color: var(--ink);
  font-weight: 700;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.stat {
  min-width: 130px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.stat .v {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.stat .v .u {
  color: var(--accent);
}

.stat .k {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: .78rem;
}

.tool-panel {
  width: 100%;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--paper), transparent 2%);
  box-shadow: var(--shadow-lg);
}

.tool-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.tool-kicker {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
}

.tool-head h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
}

.form {
  display: grid;
  gap: 14px;
}

.upload {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 14px;
  min-height: 112px;
  padding: 16px;
  border: 1.5px dashed color-mix(in oklab, var(--accent), var(--line) 40%);
  border-radius: var(--r);
  background: var(--accent-wash);
  cursor: pointer;
}

.upload input {
  grid-column: 1 / -1;
  width: 100%;
  color: var(--ink-soft);
  font-size: .86rem;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 54px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .86rem;
  font-weight: 700;
}

.upload-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
}

.upload-copy span,
.field span {
  color: var(--ink-soft);
  font-size: .86rem;
  font-weight: 600;
}

.upload-copy strong {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.field {
  display: grid;
  gap: 8px;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-mono);
}

.field input:focus {
  outline: 2px solid color-mix(in oklab, var(--accent), transparent 72%);
  border-color: var(--accent);
}

.action {
  width: 100%;
  border-radius: var(--r-sm);
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.status {
  min-height: 46px;
  margin-top: 18px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfdfc;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent), transparent 84%);
}

.status.busy .dot {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(168,101,0,.12);
}

.status.error .dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(180,35,24,.12);
}

.progress {
  width: 100%;
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  transition: width 180ms ease;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.metrics div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfdfc;
}

.metrics dt {
  margin-bottom: 6px;
  color: var(--ink-mute);
  font-size: .75rem;
}

.metrics dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
}

.download {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 18px -8px color-mix(in oklab, var(--accent), transparent 25%);
}

.download:hover {
  background: var(--accent-strong);
}

.download.disabled {
  pointer-events: none;
  opacity: .42;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .demo-layout {
    grid-template-columns: 1fr;
  }

  .demo-copy h1 {
    max-width: 12ch;
  }
}

@media (max-width: 560px) {
  .nav-in {
    height: 64px;
  }

  .nav .btn {
    display: none;
  }

  .demo-shell {
    padding-block: 28px;
  }

  .tool-panel {
    padding: 18px;
    border-radius: var(--r);
  }

  .tool-head {
    display: grid;
    gap: 4px;
  }

  .upload {
    grid-template-columns: 1fr;
  }

  .upload input {
    grid-column: auto;
  }

  .metrics {
    grid-template-columns: 1fr;
  }
}
