:root {
  --ink: #172026;
  --muted: #5f6b73;
  --line: #d8dee4;
  --paper: #f7fafc;
  --panel: #ffffff;
  --teal: #167d7f;
  --blue: #2563eb;
  --amber: #b76e00;
  --success: #247a3f;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, p, a, strong, input, button, span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
}

nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 44px;
}

.toolbench {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: 26px;
  align-items: stretch;
  padding: 44px 0 34px;
}

.intro {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.quick-links, .demo-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.quick-links a, .demo-links a, .template-grid a, .download, button, .tool-card a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.quick-links a:nth-child(2), .demo-links a:nth-child(2), .template-grid article:nth-child(even) a {
  background: var(--blue);
}

.compressor {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 18px 46px rgba(23, 32, 38, 0.08);
}

.dropzone {
  min-height: 132px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed #9ab7bd;
  border-radius: 8px;
  background: #eef7f7;
  color: var(--teal);
  cursor: pointer;
  text-align: center;
}

.dropzone.is-dragging {
  border-color: var(--blue);
  background: #e9f0ff;
  color: var(--blue);
}

.dropzone span {
  font-size: 22px;
  font-weight: 900;
}

.dropzone strong {
  color: var(--muted);
  font-size: 14px;
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.preset-row button {
  width: auto;
  min-height: 36px;
  padding: 8px 12px;
  background: #eef3f8;
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 13px;
}

.controls label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input[type="number"], input[type="range"], input[type="text"], select {
  width: 100%;
  min-width: 0;
}

input[type="number"], input[type="text"], select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}

button {
  width: 100%;
  cursor: pointer;
  font: inherit;
}

.result {
  min-height: 68px;
  display: block;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  line-height: 1.55;
  background: #fbfdff;
}

.result.success {
  color: var(--success);
}

.result.warn {
  color: var(--amber);
}

.download {
  width: 100%;
  margin-top: 12px;
  background: var(--blue);
}

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

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.preview-box {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.preview-box img {
  width: 100%;
  max-height: 180px;
  border-radius: 6px;
  object-fit: contain;
  background: #eef3f8;
}

.section-block {
  border-top: 1px solid var(--line);
  padding: 34px 0 6px;
}

.breadcrumb {
  display: inline-flex;
  margin-top: 24px;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.content-page {
  padding: 34px 0 40px;
}

.content-page .lede {
  max-width: 760px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: start;
  margin-top: 24px;
}

.info-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.download-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.download-strip a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.download-strip a:nth-child(even) {
  background: var(--blue);
}

.mini-note {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.section-head {
  max-width: 760px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.18;
}

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

.template-grid, .roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tool-card {
  min-width: 0;
}

.tool-card a {
  width: 100%;
  margin-top: 14px;
}

.file-tool {
  max-width: 780px;
}

.file-tool textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  resize: vertical;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

article h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

article p, .roadmap-grid span {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.roadmap-grid article {
  display: grid;
  gap: 10px;
}

.roadmap-grid strong {
  color: var(--ink);
  font-size: 18px;
}

.compact {
  padding-bottom: 24px;
}

.demos {
  padding-bottom: 38px;
}

@media (max-width: 920px) {
  .toolbench {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }

  .template-grid, .roadmap-grid, .controls, .tool-grid {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: 31px;
    line-height: 1.16;
    max-width: 100%;
    word-break: break-all;
  }

  .compressor,
  .dropzone,
  .section-block,
  article {
    max-width: 100%;
  }
}

@media (max-width: 620px) {
  .topbar {
    width: min(350px, calc(100% - 40px));
    margin-left: 20px;
    margin-right: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  nav {
    justify-content: flex-start;
  }

  main {
    width: min(350px, calc(100% - 40px));
    margin-left: 20px;
    margin-right: auto;
  }

  .toolbench {
    padding-top: 24px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.24;
  }

  .lede {
    font-size: 16px;
    word-break: break-all;
  }

  .quick-links a,
  .demo-links a,
  .template-grid a,
  .download-strip a {
    flex: 1 1 100%;
  }

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