:root {
  color-scheme: light;
  --page: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --soft: #eef3fb;
  --ink: #101520;
  --text: #151b2d;
  --muted: #667287;
  --line: #dce5f0;
  --line-strong: #cbd7e6;
  --primary: #6957ff;
  --primary-strong: #5140dc;
  --cyan: #03a9d9;
  --green: #00b886;
  --orange: #ff7a1a;
  --pink: #ec4899;
  --amber: #f5b329;
  --shadow: 0 28px 74px rgba(17, 25, 40, 0.15);
  --tight-shadow: 0 16px 38px rgba(17, 25, 40, 0.12);
  --sidebar-width: 178px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(3, 169, 217, 0.08) 0 18%, transparent 18% 100%),
    linear-gradient(160deg, transparent 0 62%, rgba(245, 179, 41, 0.1) 62% 76%, transparent 76%),
    linear-gradient(180deg, #f9fbff 0%, #eef5fb 56%, #ffffff 56%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 58px 0 auto var(--sidebar-width);
  height: 1px;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(3, 169, 217, 0.38), rgba(255, 122, 26, 0.28), transparent);
  animation: scanline 4s ease-in-out infinite;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

body.dark-mode {
  --page: #101522;
  --surface: rgba(19, 25, 38, 0.9);
  --surface-solid: #171e2d;
  --soft: #222b3d;
  --ink: #f7f9ff;
  --text: #f7f9ff;
  --muted: #aab5c6;
  --line: #30394c;
  --line-strong: #3d475a;
  background:
    linear-gradient(115deg, rgba(3, 169, 217, 0.11) 0 18%, transparent 18% 100%),
    linear-gradient(160deg, transparent 0 62%, rgba(255, 122, 26, 0.12) 62% 76%, transparent 76%),
    linear-gradient(180deg, #101522 0%, #121a28 56%, #0e1420 56%);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient span {
  position: absolute;
  left: -12vw;
  width: 46vw;
  height: 2px;
  border-radius: 0;
  opacity: 0.28;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  animation: sweep 8s linear infinite;
}

.ambient span:nth-child(1) {
  top: 22%;
  color: var(--cyan);
}

.ambient span:nth-child(2) {
  top: 45%;
  color: var(--primary);
  animation-delay: -2.8s;
}

.ambient span:nth-child(3) {
  top: 68%;
  color: var(--orange);
  animation-delay: -5.4s;
}

@keyframes sweep {
  from {
    transform: translateX(-20vw) rotate(-8deg);
  }
  to {
    transform: translateX(138vw) rotate(-8deg);
  }
}

@keyframes scanline {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  50% {
    transform: translateY(210px);
    opacity: 0.12;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(430px, 1fr) auto;
  align-items: center;
  min-height: 58px;
  padding: 0 22px 0 30px;
  border-bottom: 1px solid rgba(210, 221, 234, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

body.dark-mode .site-header {
  background: rgba(16, 21, 34, 0.84);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  text-decoration: none;
}

.brand-symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #172034, #6957ff 58%, #03a9d9);
  color: #fff;
  box-shadow: 0 12px 28px rgba(81, 64, 220, 0.24);
}

.brand-symbol::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 5px;
}

.brand-symbol svg {
  width: 18px;
  height: 18px;
}

.brand strong {
  display: block;
  overflow: hidden;
  max-width: 188px;
  font-size: 20px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong span {
  color: var(--primary);
}

.brand small {
  display: block;
  overflow: hidden;
  max-width: 188px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-nav,
.header-actions {
  display: flex;
  align-items: center;
}

.top-nav {
  justify-content: center;
  gap: 10px;
}

.nav-item {
  position: relative;
}

.nav-trigger,
.header-action,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 14px;
}

.nav-trigger:hover,
.nav-trigger.active,
.nav-item.open .nav-trigger,
.header-action:hover {
  color: var(--primary-strong);
  background: rgba(105, 87, 255, 0.09);
}

.nav-trigger svg,
.header-action svg,
.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 90;
  display: none;
  grid-template-columns: 1fr;
  min-width: 246px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.nav-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}

.nav-item:hover .nav-menu,
.nav-item:focus-within .nav-menu,
.nav-item.open .nav-menu {
  display: grid;
}

.nav-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.nav-menu button svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--tool-color, var(--primary));
}

.nav-menu button:hover {
  background: var(--soft);
  color: var(--primary-strong);
}

.header-actions {
  justify-content: flex-end;
  gap: 4px;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface-solid);
}

.theme-toggle strong {
  min-width: 38px;
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.quick-entry {
  position: fixed;
  top: 76px;
  right: 30px;
  z-index: 30;
  width: 320px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--tight-shadow);
  backdrop-filter: blur(18px);
}

.quick-entry[hidden] {
  display: none;
}

.quick-close,
.popover-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--muted);
}

.quick-entry p,
.quick-entry h2,
.quick-entry span {
  display: block;
  margin: 0;
}

.quick-entry p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quick-entry h2 {
  margin-top: 8px;
  font-size: 26px;
}

.quick-entry > span {
  margin-top: 12px;
  color: var(--muted);
}

#quickActions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

#quickActions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 800;
}

#quickActions button:hover {
  border-color: rgba(105, 87, 255, 0.45);
  color: var(--primary-strong);
}

.home-mode::before {
  left: 0;
}

.home-mode .tool-sidebar,
.home-mode .hero-tool,
.home-mode .result-section,
.home-mode .quick-entry,
.tool-mode .landing-home {
  display: none;
}

.landing-home {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(560px, 1.1fr);
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
  min-height: calc(100vh - 58px);
  padding: 72px max(6vw, 56px) 88px;
}

.landing-copy {
  min-width: 0;
  width: min(600px, 100%);
  justify-self: end;
}

.landing-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 16px;
  border: 1px solid rgba(105, 87, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--primary-strong);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.landing-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 4.2vw, 64px);
  line-height: 1.05;
}

.landing-summary {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
}

.landing-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 16px 26px;
  margin-top: 34px;
}

.landing-points span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tool-color, var(--primary));
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.landing-points span:nth-child(1) {
  color: #9b83ff;
}

.landing-points span:nth-child(2) {
  color: #f4bd16;
}

.landing-points span:nth-child(3) {
  color: #2fca91;
}

.landing-points span:nth-child(4) {
  color: var(--orange);
}

.landing-points i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.home-picker {
  min-width: 0;
  width: min(720px, 100%);
  justify-self: start;
}

.home-picker h2 {
  margin: 0 0 24px;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 40px);
  text-align: center;
}

.ai-console {
  display: grid;
  gap: 16px;
}

.ai-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.ai-console-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
}

.ai-console-head svg {
  width: 17px;
  height: 17px;
}

.ai-console-head strong {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-upload-preview {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  border: 1px solid rgba(105, 87, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(105, 87, 255, 0.14), rgba(3, 169, 217, 0.1), rgba(0, 184, 134, 0.1)),
    rgba(255, 255, 255, 0.78);
  box-shadow: var(--tight-shadow);
  padding: 18px;
}

body.dark-mode .ai-upload-preview {
  background:
    linear-gradient(135deg, rgba(105, 87, 255, 0.18), rgba(3, 169, 217, 0.12), rgba(0, 184, 134, 0.12)),
    rgba(23, 30, 45, 0.82);
}

.ai-upload-preview div {
  min-width: 0;
}

.ai-upload-preview strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
}

.ai-upload-preview p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.ai-upload-preview button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ai-flow-grid button {
  display: grid;
  justify-items: start;
  gap: 7px;
  min-width: 0;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 14px;
  text-align: left;
  box-shadow: 0 10px 28px rgba(17, 25, 40, 0.08);
}

.ai-flow-grid button:hover {
  border-color: rgba(105, 87, 255, 0.36);
  transform: translateY(-1px);
}

.ai-flow-grid svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.ai-flow-grid span {
  font-weight: 900;
}

.ai-flow-grid small {
  color: var(--muted);
  line-height: 1.45;
}

.browser-stack,
.local-engine-panel {
  min-width: 0;
}

.browser-stack {
  margin-top: 2px;
}

.local-engine-panel {
  margin-top: 14px;
}

.engine-panel-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(105, 87, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(105, 87, 255, 0.08), rgba(3, 169, 217, 0.08)),
    var(--surface);
  padding: 14px;
}

body.dark-mode .engine-panel-card {
  background:
    linear-gradient(135deg, rgba(105, 87, 255, 0.14), rgba(3, 169, 217, 0.1)),
    rgba(23, 30, 45, 0.82);
}

.engine-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.engine-panel-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-panel-head strong {
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(0, 184, 134, 0.12);
  color: var(--green);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.engine-panel-card p,
.engine-panel-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.engine-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.engine-chip i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.engine-chip em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.engine-chip.is-ready {
  border-color: rgba(0, 184, 134, 0.25);
  color: var(--green);
}

.engine-chip.is-muted {
  color: var(--muted);
  opacity: 0.78;
}

.home-picker-shell {
  overflow: hidden;
  min-height: 346px;
  border: 1px solid rgba(105, 87, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(105, 87, 255, 0.12), rgba(3, 169, 217, 0.1), rgba(236, 72, 153, 0.08)),
    rgba(255, 255, 255, 0.68);
  box-shadow: var(--tight-shadow);
}

body.dark-mode .home-picker-shell {
  background:
    linear-gradient(135deg, rgba(105, 87, 255, 0.16), rgba(3, 169, 217, 0.12), rgba(236, 72, 153, 0.1)),
    rgba(23, 30, 45, 0.8);
}

.home-picker-top {
  display: grid;
  grid-template-columns: 1fr minmax(170px, 230px);
  align-items: end;
  border-bottom: 1px solid rgba(105, 87, 255, 0.18);
}

.home-tabs {
  display: flex;
  align-items: end;
  min-width: 0;
}

.home-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 92px;
  min-height: 52px;
  border: 0;
  border-right: 1px solid rgba(105, 87, 255, 0.16);
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-weight: 900;
}

.home-tabs button.active {
  background: rgba(255, 255, 255, 0.64);
  color: var(--primary);
  box-shadow: inset 0 2px 0 rgba(105, 87, 255, 0.45);
}

.home-tabs button span {
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: currentColor;
}

.home-tabs button:nth-child(2) span {
  color: var(--cyan);
}

.home-tabs button:nth-child(3) span {
  color: var(--pink);
}

.home-tabs button:nth-child(4) span {
  color: #9b83ff;
}

.home-search {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border-left: 1px solid rgba(105, 87, 255, 0.16);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
}

.home-search svg {
  width: 18px;
  height: 18px;
}

.home-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.home-search span {
  border-radius: 6px;
  background: rgba(21, 27, 45, 0.08);
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  align-content: start;
  gap: 12px;
  min-height: 292px;
  padding: 24px;
}

.home-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  border: 1px solid rgba(17, 25, 40, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  box-shadow: inset 0 -1px 0 rgba(17, 25, 40, 0.06);
  font-weight: 900;
}

.home-tool:hover {
  border-color: rgba(105, 87, 255, 0.34);
  background: rgba(255, 255, 255, 0.84);
  transform: translateY(-1px);
}

.home-tool svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--tool-color, var(--primary));
}

.home-tool span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-sidebar {
  position: fixed;
  z-index: 45;
  top: 58px;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

body.dark-mode .tool-sidebar {
  background: rgba(16, 21, 34, 0.9);
}

.sidebar-scroll {
  height: 100%;
  overflow: auto;
  padding: 16px 8px 26px;
}

.sidebar-group {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.sidebar-title {
  margin: 0 0 4px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.sidebar-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
}

.sidebar-tool svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--tool-color, var(--primary));
}

.sidebar-tool span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-tool:hover,
.sidebar-tool.active {
  background: rgba(105, 87, 255, 0.1);
  color: var(--primary-strong);
  font-weight: 900;
}

.sidebar-tool.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.page {
  margin-left: 0;
}

.tool-mode .page {
  margin-left: var(--sidebar-width);
}

.hero-tool {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1fr);
  align-items: center;
  gap: clamp(34px, 5vw, 76px);
  min-height: calc(100vh - 58px);
  padding: 72px max(5vw, 44px) 78px;
}

.tool-intro {
  justify-self: end;
  min-width: 0;
  width: min(560px, 100%);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}

.badges span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid rgba(203, 215, 230, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  padding: 0 9px;
  font-size: 13px;
  font-weight: 800;
}

body.dark-mode .badges span {
  background: rgba(23, 30, 45, 0.64);
}

.badges svg {
  width: 15px;
  height: 15px;
}

.badges span:nth-child(1) svg {
  color: var(--primary);
}

.badges span:nth-child(2) svg {
  color: var(--green);
}

.badges span:nth-child(3) svg {
  color: var(--cyan);
}

.badges span:nth-child(4) svg {
  color: var(--orange);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-bubble {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 243, 251, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(3, 169, 217, 0.08) 10px 12px);
  color: var(--primary);
  box-shadow: var(--tight-shadow);
  overflow: hidden;
}

body.dark-mode .icon-bubble {
  background:
    linear-gradient(180deg, rgba(23, 30, 45, 0.9), rgba(34, 43, 61, 0.88)),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(3, 169, 217, 0.12) 10px 12px);
}

.icon-bubble::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid currentColor;
  border-radius: 5px;
  opacity: 0.22;
  animation: iconFocus 2.4s ease-in-out infinite;
}

.icon-bubble svg {
  position: relative;
  width: 34px;
  height: 34px;
  z-index: 1;
}

@keyframes iconFocus {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.14;
  }
  50% {
    transform: scale(1);
    opacity: 0.32;
  }
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

.tool-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 4.4vw, 66px);
  line-height: 1;
}

.lead {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.52;
}

.creator-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 28px;
}

.creator-rail span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

body.dark-mode .creator-rail span {
  background: rgba(23, 30, 45, 0.72);
}

.creator-rail svg {
  width: 16px;
  height: 16px;
}

.creator-rail span:nth-child(1) svg {
  color: var(--orange);
}

.creator-rail span:nth-child(2) svg {
  color: var(--cyan);
}

.creator-rail span:nth-child(3) svg {
  color: var(--green);
}

.upload-card,
.result-panel,
.steps-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.upload-card {
  justify-self: start;
  width: min(560px, 100%);
  min-width: 0;
  overflow: hidden;
  padding: 28px;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
  border: 1.5px dashed #cbd7e6;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(238, 243, 251, 0.6)),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(105, 87, 255, 0.04) 28px 29px);
  text-align: center;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

body.dark-mode .dropzone {
  background:
    linear-gradient(180deg, rgba(23, 30, 45, 0.78), rgba(34, 43, 61, 0.56)),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(3, 169, 217, 0.06) 28px 29px);
}

.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(105, 87, 255, 0.08);
  transform: translateY(-2px);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.drop-inner {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px;
}

.upload-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--primary);
  background: var(--surface-solid);
  animation: uploadBeat 2.6s ease-in-out infinite;
}

.upload-orb::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 2px;
  background: currentColor;
  opacity: 0.2;
}

.upload-orb svg {
  width: 32px;
  height: 32px;
}

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

.drop-inner strong {
  font-size: 18px;
}

.drop-inner span:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.url-tool {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.url-tool > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.url-tool > span::before,
.url-tool > span::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.url-tool div {
  display: grid;
  grid-template-columns: 1fr 82px;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
}

.url-tool input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  text-overflow: ellipsis;
}

.url-tool button {
  min-height: 42px;
  border: 0;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
}

.file-row span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  white-space: nowrap;
}

.file-row small {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.setting {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.setting label {
  font-size: 13px;
  font-weight: 900;
}

.setting input,
.setting select,
.setting textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  padding: 0 12px;
}

.setting textarea {
  min-height: 110px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.5;
}

.setting-wide {
  grid-column: 1 / -1;
}

.setting-check {
  align-content: center;
  grid-template-columns: 20px 1fr;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  padding: 10px 12px;
}

.setting-check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--primary);
}

.setting-check span {
  font-size: 13px;
  font-weight: 900;
}

.setting small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 900;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 30px rgba(105, 87, 255, 0.22);
}

.primary-button:hover {
  background: var(--primary-strong);
}

.ghost-button {
  background: var(--surface-solid);
  border-color: var(--line);
  color: var(--text);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.result-section {
  display: grid;
  gap: 42px;
  padding: 66px max(6vw, 42px) 90px;
  background: #fff;
}

body.dark-mode .result-section {
  background: #0f1521;
}

.result-panel {
  display: grid;
  width: min(920px, 100%);
  justify-self: center;
  gap: 16px;
  padding: 22px;
}

.status-card,
.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 4px 16px;
  border-bottom: 1px solid var(--line);
}

.status-card h2 {
  margin: 0;
}

#engineStatus {
  color: var(--muted);
  white-space: nowrap;
}

.progress-area {
  display: grid;
  gap: 12px;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf4;
}

body.dark-mode .progress-bar {
  background: #242e40;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--green), var(--orange));
  transition: width 0.2s ease;
}

#logOutput {
  min-height: 190px;
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #10151c;
  color: #d9f4e7;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.download-card {
  padding: 14px 0 0;
  border-bottom: 0;
}

.download-card strong,
.download-card span {
  display: block;
  overflow: hidden;
  max-width: min(62vw, 560px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-card span {
  color: var(--muted);
  margin-top: 4px;
}

.preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1117;
}

.preview-card video,
.preview-card img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.preview-card audio {
  width: 100%;
  padding: 16px;
}

.steps-panel {
  width: min(980px, 100%);
  justify-self: center;
  padding: 30px;
  text-align: center;
  box-shadow: none;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(3, 169, 217, 0.1);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

.steps-panel h2 {
  margin: 20px 0 34px;
  font-size: clamp(32px, 3.8vw, 46px);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.steps div {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.steps strong {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 14px 30px rgba(105, 87, 255, 0.2);
}

.steps div:nth-child(2) strong {
  background: var(--green);
}

.steps div:nth-child(3) strong {
  background: var(--orange);
}

.steps h3,
.steps p {
  margin: 0;
}

.steps p {
  color: var(--muted);
  line-height: 1.65;
}

.popover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start end;
  padding: 76px 34px;
  background: rgba(15, 23, 42, 0.18);
}

.popover[hidden] {
  display: none;
}

.popover-card {
  position: relative;
  width: min(380px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.popover-card h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.popover-card p {
  color: var(--muted);
  line-height: 1.7;
}

.popover-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.popover-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 900;
}

.popover-actions button:hover {
  border-color: rgba(105, 87, 255, 0.55);
  color: var(--primary-strong);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  padding: 24px 18px 30px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary-strong);
}

@media (max-width: 1220px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 18px;
  }

  .top-nav,
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .tool-sidebar {
    top: 132px;
  }

  .hero-tool {
    grid-template-columns: 1fr;
  }

  .tool-intro {
    justify-self: start;
  }

  .quick-entry {
    display: none;
  }

  .landing-home {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 56px max(6vw, 28px) 72px;
  }

  .landing-copy {
    width: min(760px, 100%);
    justify-self: center;
  }

  .home-picker {
    width: min(780px, 100%);
    justify-self: center;
  }
}

@media (max-width: 820px) {
  body::before {
    left: 0;
  }

  .tool-sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 14px;
  }

  .sidebar-group {
    min-width: 170px;
    border-bottom: 0;
    margin: 0;
    padding: 0;
  }

  .page {
    margin-left: 0;
  }

  .hero-tool,
  .result-section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .settings,
  .steps,
  .creator-rail {
    grid-template-columns: 1fr;
  }

  .landing-home {
    min-height: auto;
    padding: 42px 18px 72px;
  }

  .landing-copy h1 {
    margin-top: 0;
    font-size: clamp(40px, 10vw, 64px);
  }

  .landing-points {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 28px;
  }

  .landing-points span {
    font-size: 17px;
  }

  .landing-summary {
    font-size: 17px;
  }

  .ai-upload-preview {
    grid-template-columns: 58px 1fr;
  }

  .ai-upload-preview button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ai-flow-grid {
    grid-template-columns: 1fr;
  }

  .home-picker h2 {
    margin-bottom: 18px;
    font-size: 30px;
    text-align: left;
  }

  .home-picker-top {
    grid-template-columns: 1fr;
  }

  .home-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .home-tabs::-webkit-scrollbar {
    display: none;
  }

  .home-tabs button {
    min-width: 88px;
    flex: 0 0 auto;
  }

  .home-search {
    border-top: 1px solid rgba(105, 87, 255, 0.16);
    border-left: 0;
  }

  .home-tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    min-height: 362px;
    padding: 16px;
  }

  .home-tool {
    min-height: 58px;
    gap: 7px;
    padding: 0 8px;
    font-size: 15px;
  }

  .home-tool svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 560px) {
  body {
    background:
      linear-gradient(115deg, rgba(3, 169, 217, 0.08) 0 28%, transparent 28% 100%),
      linear-gradient(160deg, transparent 0 66%, rgba(245, 179, 41, 0.1) 66% 78%, transparent 78%),
      linear-gradient(180deg, #f9fbff 0%, #eef5fb 52%, #ffffff 52%);
  }

  .top-nav,
  .header-actions {
    display: none;
  }

  .site-header {
    display: flex;
    min-height: 62px;
    justify-content: space-between;
    padding: 10px 14px;
  }

  .tool-intro h1 {
    font-size: 38px;
    line-height: 1.04;
  }

  .title-row,
  .status-card,
  .download-card,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-card,
  .result-panel,
  .steps-panel {
    padding: 16px;
  }

  .brand-symbol {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    max-width: 168px;
    font-size: 22px;
  }

  .brand small {
    max-width: 168px;
    font-size: 11px;
  }

  .landing-home {
    gap: 26px;
    padding: 28px 14px 48px;
  }

  .landing-copy,
  .home-picker,
  .tool-intro,
  .upload-card {
    width: 100%;
    justify-self: stretch;
  }

  .landing-copy h1 {
    font-size: clamp(34px, 10.4vw, 44px);
    line-height: 1.08;
  }

  .landing-points {
    grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 10px 14px;
    margin-top: 22px;
  }

  .landing-points span {
    gap: 7px;
    font-size: 14px;
  }

  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .landing-actions .primary-button,
  .landing-actions .ghost-button {
    width: 100%;
  }

  .ai-console-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-upload-preview {
    grid-template-columns: 1fr;
    justify-items: stretch;
    padding: 16px;
  }

  .ai-upload-preview .upload-orb {
    justify-self: start;
  }

  .home-picker h2 {
    margin-bottom: 14px;
    font-size: 24px;
    text-align: center;
  }

  .home-picker-shell {
    border-radius: 8px;
    min-height: 0;
  }

  .home-tabs button {
    min-width: 74px;
    min-height: 48px;
    gap: 7px;
    padding: 0 8px;
    font-size: 14px;
  }

  .home-tabs button span {
    height: 20px;
  }

  .home-search {
    min-height: 48px;
  }

  .home-search span {
    display: none;
  }

  .home-tool-grid {
    gap: 9px;
    min-height: 0;
    padding: 12px;
  }

  .home-tool {
    min-height: 54px;
    flex-direction: column;
    gap: 5px;
    padding: 7px 5px;
    font-size: 13px;
    line-height: 1.15;
  }

  .home-tool span {
    white-space: normal;
  }

  .hero-tool {
    gap: 22px;
    min-height: auto;
    padding: 28px 14px 38px;
  }

  .tool-intro {
    text-align: center;
  }

  .badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
  }

  .badges span {
    justify-content: center;
    min-height: 34px;
    padding: 0 8px;
    font-size: 13px;
  }

  .title-row {
    gap: 10px;
  }

  .icon-bubble {
    width: 64px;
    height: 64px;
    align-self: center;
  }

  .icon-bubble svg {
    width: 30px;
    height: 30px;
  }

  .lead {
    margin-top: 14px;
    font-size: 18px;
  }

  .creator-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
  }

  .creator-rail span {
    min-height: 38px;
    font-size: 13px;
  }

  .dropzone {
    min-height: 188px;
  }

  .upload-orb {
    width: 58px;
    height: 58px;
  }

  .result-section {
    gap: 26px;
    padding-top: 34px;
    padding-bottom: 54px;
  }

  .site-footer {
    padding: 20px 14px 28px;
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body::before {
    display: none;
  }

  .site-header {
    width: 100%;
    grid-template-columns: 1fr;
    min-height: 62px;
    padding: 10px 14px;
  }

  .top-nav,
  .header-actions,
  .tool-mode .tool-sidebar {
    display: none;
  }

  .brand-symbol {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    max-width: 168px;
    font-size: 22px;
  }

  .brand small {
    max-width: 168px;
    font-size: 11px;
  }

  .page,
  .tool-mode .page {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .hero-tool {
    display: flex;
    width: 100%;
    max-width: 100vw;
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    overflow: hidden;
    padding: 24px 14px 42px;
  }

  .tool-intro,
  .upload-card {
    width: 100%;
    max-width: 100%;
    justify-self: auto;
    margin: 0;
  }

  .tool-intro {
    text-align: left;
  }

  .badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }

  .badges span {
    justify-content: center;
    min-width: 0;
    min-height: 34px;
    padding: 0 8px;
    font-size: 13px;
  }

  .title-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .title-row > div {
    min-width: 0;
  }

  .icon-bubble {
    width: 58px;
    height: 58px;
  }

  .icon-bubble svg {
    width: 28px;
    height: 28px;
  }

  .tool-intro h1 {
    font-size: clamp(32px, 9vw, 40px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .lead {
    margin-top: 12px;
    font-size: 17px;
    line-height: 1.45;
  }

  .creator-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
  }

  .creator-rail span {
    min-width: 0;
    min-height: 38px;
    font-size: 13px;
  }

  .upload-card {
    padding: 14px;
  }

  .dropzone {
    min-height: 180px;
  }

  .drop-inner {
    padding: 16px 12px;
  }

  .drop-inner strong {
    font-size: 18px;
    line-height: 1.25;
  }

  .url-tool div {
    grid-template-columns: 1fr;
  }

  .url-tool input {
    min-height: 42px;
  }

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

  .result-section {
    gap: 24px;
    padding: 32px 14px 54px;
  }
}
