:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --blue: #2563eb;
  --green: #15803d;
  --red: #b91c1c;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

button, input, select {
  font: inherit;
}

button, select {
  cursor: pointer;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.top-nav a,
.site-footer a {
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
}

.top-nav a:hover,
.site-footer a:hover {
  color: #111827;
}

.header-label {
  padding-left: 20px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
}

.page-intro {
  padding: 56px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.intro-copy {
  max-width: 760px;
  margin: 16px 0 18px;
  color: #4b5563;
  font-size: 17px;
}

.trust-points {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: #4b5563;
  font-size: 13px;
}

.trust-points i {
  margin-right: 5px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.tool-section {
  padding-bottom: 56px;
}

.upload-panel {
  min-height: 260px;
  padding: 30px 20px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  transition: border-color .15s, background .15s;
}

.upload-panel.drag-over {
  border-color: var(--blue);
  background: #eff6ff;
}

.upload-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: #eef2f7;
  display: grid;
  place-items: center;
}

.upload-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #374151;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-panel h2 {
  margin: 0 0 2px;
  font-size: 18px;
}

.upload-panel p {
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.button {
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s;
}

.button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.button-primary {
  background: #111827;
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: #293548;
}

.button-secondary {
  border-color: #d1d5db;
  background: #fff;
  color: #111827;
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  background: #f3f4f6;
}

.button-quiet {
  border-color: var(--line);
  background: transparent;
  color: #4b5563;
}

.choose-button,
.add-more-button {
  cursor: pointer;
}

.format-note {
  margin: 12px 0 0 !important;
  font-size: 12px !important;
}

.privacy-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin: 16px 0 24px;
  border: 1px solid #dcfce7;
  border-radius: 11px;
  background: #f0fdf4;
}

.privacy-icon {
  color: #15803d;
  font-size: 18px;
}

.privacy-note p {
  margin: 0;
  color: #365744;
  font-size: 13px;
}

.privacy-note strong {
  color: #14532d;
}

.settings-panel,
.queue-panel,
.process-panel {
  padding: 22px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2,
.content-section h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.4fr) minmax(160px, .8fr);
  gap: 18px;
  margin-top: 20px;
}

.setting-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #374151;
  font-size: 12px;
  font-weight: 650;
}

.setting-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 30px 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.setting-field input[type="range"] {
  width: 100%;
  margin: 8px 0 2px;
  accent-color: var(--blue);
}

.setting-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.setting-field span strong {
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.setting-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
}

.setting-field.is-disabled {
  opacity: .48;
}

.queue-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.queue-tools .button {
  min-height: 36px;
  padding: 7px 12px;
}

.empty-queue {
  padding: 24px 10px;
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
}

.image-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  margin-top: 14px;
  padding: 2px 6px 2px 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.image-list:empty {
  display: none;
}

.queue-item {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.thumb {
  width: 58px;
  height: 54px;
  border-radius: 7px;
  background: #f3f4f6;
  object-fit: cover;
}

.queue-item-main {
  min-width: 0;
}

.file-name {
  display: block;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.item-status {
  color: #6b7280;
  font-size: 11px;
  white-space: nowrap;
}

.item-status.completed {
  color: var(--green);
}

.item-status.error {
  color: var(--red);
}

.item-status.processing {
  color: #1d4ed8;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.remove-item,
.download-item {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-size: 17px;
}

.remove-item:hover {
  background: #fef2f2;
  color: var(--red);
}

.download-item:hover:not(:disabled) {
  background: #eff6ff;
  color: #1d4ed8;
}

.download-item:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.process-panel {
  background: #fafafa;
}

.process-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.status-copy {
  display: grid;
  gap: 2px;
}

.status-copy strong {
  font-size: 14px;
}

.status-copy span,
.engine-note {
  color: var(--muted);
  font-size: 12px;
}

.status-percent {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 7px;
  margin: 12px 0 15px;
  overflow: hidden;
  border-radius: 20px;
  background: #e5e7eb;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 20px;
  background: var(--blue);
  transition: width .2s;
}

.process-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.engine-note {
  margin: 12px 0 0;
}

.content-section {
  padding: 10px 0 60px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.content-grid p,
.content-grid li,
.faq-section p {
  color: #4b5563;
  font-size: 14px;
}

.content-grid ol,
.content-grid ul {
  padding-left: 20px;
}

.content-grid li {
  padding: 4px 0;
}

.faq-section {
  max-width: 860px;
}

.faq-section h2 {
  margin-bottom: 12px;
}

.faq-section details {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.faq-section summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.faq-section p {
  margin: 8px 0 2px;
}

.related-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f9fafb;
}

.related-inner {
  padding: 30px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.related-inner h2 {
  margin: 0 0 5px;
  font-size: 20px;
  letter-spacing: -.02em;
}

.related-inner p:not(.eyebrow) {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
}

.related-inner .eyebrow {
  margin-bottom: 5px;
}

.site-footer {
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  color: #9ca3af;
  font-size: 12px;
}

.footer-inner nav {
  display: flex;
  gap: 18px;
}

.site-footer a {
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 20;
  bottom: 22px;
  left: 50%;
  max-width: min(90vw, 520px);
  padding: 10px 15px;
  border-radius: 9px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 800px) {
  .header-inner {
    min-height: 0;
    padding: 12px 0;
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  .top-nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 18px;
  }

  .header-label {
    margin-left: auto;
    padding-left: 12px;
  }

  .page-intro {
    padding: 40px 0 24px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .trust-points {
    gap: 8px 16px;
  }

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

  .quality-setting {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .settings-panel,
  .queue-panel,
  .process-panel {
    padding: 16px;
  }

  .queue-heading {
    display: block;
  }

  .queue-tools {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .related-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .related-inner .button {
    width: 100%;
  }

  .image-list {
    display: flex;
    height: 116px;
    max-height: 116px;
    padding: 2px 2px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
    gap: 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .queue-item {
    flex: 0 0 280px;
    min-height: 82px;
    align-self: stretch;
    scroll-snap-align: start;
  }
}

@media (max-width: 520px) {
  .container,
  .header-inner {
    width: calc(100% - 28px);
  }

  .brand-logo {
    width: 155px;
  }

  .header-label {
    font-size: 10px;
  }

  .top-nav a {
    font-size: 12px;
  }

  .page-intro h1 {
    font-size: 34px;
  }

  .upload-panel {
    min-height: 235px;
    padding: 24px 14px;
  }

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

  .quality-setting {
    grid-column: auto;
  }

  .queue-tools {
    gap: 6px;
  }

  .queue-item {
    flex-basis: 258px;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .thumb {
    width: 48px;
    height: 48px;
  }

  .item-status {
    grid-column: 2;
    grid-row: 2;
  }

  .item-actions {
    grid-column: 3;
    grid-row: 1 / 3;
    flex-direction: column;
  }

  .file-meta {
    font-size: 10px;
  }

  .process-actions .button {
    flex: 1;
  }

  .result-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-inner nav {
    flex-wrap: wrap;
  }
}
