:root {
  --text: #f6f4ed;
  --muted: #aeb8b0;
  --line: rgba(246, 244, 237, 0.18);
  --glass: rgba(22, 28, 25, 0.62);
  --green: #63e6ae;
  --amber: #ffbc66;
  --cyan: #7ddfff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
  background:
    linear-gradient(130deg, rgba(99, 230, 174, 0.14), transparent 34%),
    linear-gradient(225deg, rgba(255, 188, 102, 0.12), transparent 42%),
    linear-gradient(180deg, #070908 0%, #111711 52%, #090d0b 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 0 1px,
      transparent 1px 92px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px 92px
    );
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 82%);
  animation: grid-drift 28s linear infinite;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.26;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 34%, rgba(125, 223, 255, 0.08) 34% 35%, transparent 35% 100%),
    linear-gradient(76deg, transparent 0 56%, rgba(99, 230, 174, 0.09) 56% 57%, transparent 57% 100%),
    linear-gradient(156deg, transparent 0 70%, rgba(255, 188, 102, 0.08) 70% 71%, transparent 71% 100%);
  filter: blur(1px);
}

.page-shell {
  display: grid;
  width: min(1020px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 124px;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--green);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  color: rgba(246, 244, 237, 0.84);
  font-size: 0.82rem;
  font-weight: 690;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(99, 230, 174, 0.13);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.workspace {
  display: grid;
  align-items: center;
  padding: 44px 0;
}

.download-panel {
  position: relative;
  overflow: hidden;
  width: min(100%, 860px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 54px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    var(--glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(1.35);
}

.download-panel::before,
.dock::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.18), transparent 34%, rgba(255, 255, 255, 0.08) 70%, transparent);
  opacity: 0.46;
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 10ch;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  font-weight: 850;
  line-height: 0.94;
}

.download-form {
  position: relative;
  z-index: 1;
  margin-top: 34px;
}

.field {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: rgba(246, 244, 237, 0.76);
  font-size: 0.86rem;
  font-weight: 720;
}

.field input {
  width: 100%;
  min-height: 64px;
  min-width: 0;
  padding: 0 18px;
  color: var(--text);
  background: rgba(4, 7, 6, 0.5);
  border: 1px solid rgba(246, 244, 237, 0.15);
  border-radius: 8px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus {
  border-color: rgba(99, 230, 174, 0.72);
  box-shadow: 0 0 0 4px rgba(99, 230, 174, 0.12);
}

.field input::placeholder {
  color: rgba(246, 244, 237, 0.38);
}

.progress-panel {
  margin-top: 18px;
  padding: 14px 16px;
  color: rgba(246, 244, 237, 0.82);
  background: rgba(4, 7, 6, 0.38);
  border: 1px solid rgba(246, 244, 237, 0.13);
  border-radius: 8px;
}

.progress-panel[hidden] {
  display: none;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

#progressText {
  flex: 0 0 auto;
  font-weight: 760;
}

#progressMeta {
  min-width: 0;
  color: rgba(246, 244, 237, 0.62);
  font-weight: 640;
  overflow-wrap: anywhere;
  text-align: right;
}

.progress-track {
  position: relative;
  overflow: hidden;
  height: 10px;
  margin-top: 12px;
  background: rgba(246, 244, 237, 0.12);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--amber));
  border-radius: inherit;
  box-shadow: 0 0 20px rgba(99, 230, 174, 0.26);
  transition: width 140ms ease;
}

.progress-panel.is-indeterminate .progress-track span {
  width: 42%;
  animation: progress-scan 1.15s ease-in-out infinite;
}

.progress-panel.is-complete .progress-track span {
  width: 100%;
  background: linear-gradient(90deg, var(--green), #b8f7d5);
}

.progress-panel.is-error .progress-track span {
  width: 100%;
  background: linear-gradient(90deg, #ff7a7a, var(--amber));
}

.dock {
  position: fixed;
  right: 50%;
  bottom: 24px;
  z-index: 10;
  display: grid;
  width: min(220px, calc(100% - 32px));
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
    rgba(18, 24, 21, 0.72);
  border: 1px solid rgba(246, 244, 237, 0.2);
  border-radius: 28px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(28px) saturate(1.45);
  transform: translateX(50%);
}

.dock-item {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  min-height: 68px;
  place-content: center;
  align-items: center;
  padding: 8px 18px;
  color: #06120d;
  background: linear-gradient(135deg, var(--green), var(--amber));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(99, 230, 174, 0.2);
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.dock-item span {
  max-width: 100%;
  font-size: 0.82rem;
  font-weight: 820;
  white-space: nowrap;
}

.dock-item:hover {
  filter: brightness(1.05);
  box-shadow: 0 18px 38px rgba(99, 230, 174, 0.26);
  transform: translateY(-6px);
}

.dock-item:disabled {
  cursor: wait;
  filter: saturate(0.84) brightness(0.9);
  box-shadow: 0 14px 32px rgba(99, 230, 174, 0.14);
}

.dock-item:disabled:hover {
  transform: none;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 122px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 720;
  background: rgba(20, 27, 24, 0.86);
  border: 1px solid rgba(246, 244, 237, 0.18);
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.38);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(22px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  animation: reveal-up 700ms ease both;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

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

@keyframes grid-drift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 92px 0, 0 92px;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes progress-scan {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(260%);
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
    padding-bottom: 116px;
  }

  .topbar {
    min-height: 48px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .status-pill {
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .workspace {
    padding: 26px 0;
  }

  h1 {
    max-width: 7ch;
    font-size: clamp(2.8rem, 17vw, 4.7rem);
  }

  .field input {
    min-height: 58px;
  }

  .progress-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  #progressMeta {
    text-align: left;
  }

  .dock {
    bottom: 14px;
    width: min(190px, calc(100% - 32px));
    padding: 8px;
    border-radius: 22px;
  }

  .dock-item {
    min-height: 62px;
    border-radius: 15px;
  }

  .dock-item:hover {
    transform: translateY(-3px);
  }
}

@media (min-width: 701px) and (max-height: 700px) {
  .page-shell {
    padding-bottom: 32px;
  }

  .dock {
    position: static;
    right: auto;
    bottom: auto;
    margin: 0 auto 20px;
    transform: none;
  }

  .dock-item:hover {
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
