:root {
  color-scheme: light;
  --bg: #f3f4f8;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.90);
  --ink: #17181c;
  --muted: #6b707c;
  --soft: #9aa1ad;
  --line: rgba(52, 58, 70, 0.13);
  --line-strong: rgba(52, 58, 70, 0.22);
  --blue: #1c6bff;
  --blue-dark: #1254d6;
  --mint: #20c7a8;
  --lavender: #8576ff;
  --coral: #ff7a66;
  --shadow: 0 28px 90px rgba(37, 43, 57, 0.14);
  --soft-shadow: 0 16px 40px rgba(37, 43, 57, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Inter, "SF Pro Display", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(28, 107, 255, 0.14), transparent 34%),
    linear-gradient(245deg, rgba(32, 199, 168, 0.15), transparent 36%),
    linear-gradient(20deg, rgba(255, 122, 102, 0.10), transparent 30%),
    var(--bg);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  padding: 10px 14px;
  border-radius: 4px;
  color: #ffffff;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus-visible {
  transform: none;
}

button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}

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

button {
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:not(:disabled):active {
  transform: scale(0.98);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(1480px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 28px;
}

.masthead,
.hero-card,
.column {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(1.22);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px 18px;
  border-radius: 28px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 13px;
}

.identity-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.1)),
    conic-gradient(from 160deg, var(--blue), var(--mint), var(--coral), var(--lavender), var(--blue));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 14px 30px rgba(28, 107, 255, 0.25);
}

h1 {
  font-size: 26px;
  font-weight: 780;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 13px;
}

.privacy-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(32, 199, 168, 0.16);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: end;
  min-height: 186px;
  padding: 26px;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto 28px -72px auto;
  width: 320px;
  height: 160px;
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.2)),
    linear-gradient(90deg, rgba(28, 107, 255, 0.20), rgba(32, 199, 168, 0.20));
  transform: rotate(-8deg);
}

.hero-card h2 {
  max-width: 850px;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: clamp(34px, 4.2vw, 66px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-card p {
  max-width: 760px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hero-metrics div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.70);
}

.hero-metrics span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 26px;
  font-weight: 780;
}

.hero-metrics small,
.section-head p,
.drop-zone small,
.setting-card p,
.field span,
.check,
.details,
.status,
.empty p {
  color: var(--muted);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(320px, 1.08fr) minmax(280px, 1fr);
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 16px;
  padding: 18px;
  border-radius: 30px;
}

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

h3 {
  font-size: 21px;
  font-weight: 760;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 190px;
  padding: 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.50);
  text-align: center;
  cursor: pointer;
}

.drop-zone.is-over {
  border-color: rgba(28, 107, 255, 0.72);
  background: rgba(242, 247, 255, 0.90);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-glyph {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--blue), #7fc7ff);
  box-shadow: 0 18px 34px rgba(28, 107, 255, 0.27);
}

.upload-glyph::before,
.upload-glyph::after,
.upload-glyph span {
  content: "";
  position: absolute;
  left: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.upload-glyph::before {
  top: 18px;
  width: 19px;
  height: 3px;
  border-radius: 4px;
}

.upload-glyph::after {
  top: 18px;
  width: 3px;
  height: 22px;
  border-radius: 4px;
}

.upload-glyph span {
  bottom: 15px;
  width: 24px;
  height: 3px;
  border-radius: 4px;
}

.drop-zone strong {
  font-size: 19px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 760;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.setting-card,
.action-card,
.process-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.56)),
    rgba(255, 255, 255, 0.60);
  box-shadow: var(--soft-shadow);
}

.quality-card {
  background:
    linear-gradient(135deg, rgba(28, 107, 255, 0.14), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.68);
}

.card-title {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.card-title p {
  margin-top: 3px;
  font-size: 12px;
}

.card-title output {
  color: var(--blue);
  font-weight: 780;
}

.setting-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 10px 22px rgba(37, 43, 57, 0.12);
}

.setting-icon.tone {
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, 0.72) 45% 55%, transparent 56%),
    linear-gradient(135deg, var(--blue), #76c8ff);
}

.setting-icon.crop {
  background:
    linear-gradient(90deg, transparent 32%, rgba(255, 255, 255, 0.72) 33% 39%, transparent 40%),
    linear-gradient(0deg, transparent 58%, rgba(255, 255, 255, 0.72) 59% 65%, transparent 66%),
    linear-gradient(135deg, var(--mint), #7ce6cb);
}

.setting-icon.format {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0 36%, transparent 37%),
    linear-gradient(135deg, var(--lavender), #b3a8ff);
}

.setting-icon.rotate {
  background:
    radial-gradient(circle at 58% 42%, rgba(255, 255, 255, 0.80) 0 11%, transparent 12%),
    conic-gradient(from 225deg, transparent 0 22%, rgba(255, 255, 255, 0.78) 22% 26%, transparent 26% 48%, rgba(255, 255, 255, 0.78) 48% 52%, transparent 52% 74%, rgba(255, 255, 255, 0.78) 74% 78%, transparent 78% 100%),
    linear-gradient(135deg, var(--coral), #ffb07d);
}

select,
.field input {
  width: 100%;
  height: 45px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

select:focus-visible,
.field input:focus-visible {
  border-color: rgba(28, 107, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(28, 107, 255, 0.12);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.transform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.field span,
.check {
  font-size: 13px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.check input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.check:hover {
  border-color: rgba(28, 107, 255, 0.26);
  background: rgba(255, 255, 255, 0.92);
}

.action-card {
  margin-top: auto;
}

.process-head,
.failure-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.process-head strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 760;
}

.process-count {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 20px;
  font-weight: 780;
}

.process-bar {
  overflow: hidden;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(28, 107, 255, 0.10);
}

.process-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--mint));
  transition: width 180ms ease;
}

.process-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.failure-summary {
  display: grid;
  gap: 10px;
}

.failure-summary[hidden] {
  display: none;
}

.failure-summary-head strong {
  font-size: 14px;
  font-weight: 760;
}

.text-button.small {
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.failure-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding-right: 2px;
}

.failure-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.failure-name {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 720;
}

.failure-reason {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.primary,
.secondary,
.text-button,
.download,
.remove {
  border: 0;
  cursor: pointer;
}

.primary,
.secondary {
  min-height: 48px;
  border-radius: 16px;
  font-weight: 760;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #5aa8ff);
  box-shadow: 0 16px 34px rgba(28, 107, 255, 0.28);
}

.primary:hover {
  background: linear-gradient(135deg, var(--blue-dark), #3e90f2);
}

.secondary {
  color: var(--blue);
  background: rgba(28, 107, 255, 0.10);
}

.secondary:hover {
  background: rgba(28, 107, 255, 0.15);
}

.text-button {
  min-width: 58px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(28, 107, 255, 0.08);
}

.text-button:hover {
  background: rgba(28, 107, 255, 0.13);
}

.primary:disabled,
.secondary:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.empty {
  display: grid;
  place-items: center;
  gap: 16px;
  flex: 1;
  min-height: 260px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.empty.compact {
  flex: 0;
  min-height: 80px;
}

.empty.is-hidden {
  display: none;
}

.empty-preview {
  position: relative;
  width: min(250px, 58vw);
  height: 150px;
}

.empty-preview span {
  position: absolute;
  border: 1px solid rgba(52, 58, 70, 0.10);
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff, #e8edf7);
  box-shadow: var(--soft-shadow);
}

.empty-preview span:nth-child(1) {
  inset: 18px 80px 20px 16px;
}

.empty-preview span:nth-child(2) {
  inset: 0 38px 38px 66px;
}

.empty-preview span:nth-child(3) {
  inset: 34px 8px 8px 126px;
}

.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-content: start;
  overflow: auto;
  padding-right: 2px;
}

.output-list {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(37, 43, 57, 0.08);
}

.thumb-wrap {
  position: relative;
}

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e8ebf1;
}

.remove {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(37, 43, 57, 0.16);
}

.meta {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.name {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 740;
}

.details,
.status {
  font-size: 12px;
  line-height: 1.45;
}

.status {
  min-height: 18px;
}

.download {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 14px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 740;
}

.download.is-ready {
  display: flex;
}

@media (max-width: 1160px) {
  .hero-card,
  .workbench {
    grid-template-columns: 1fr;
  }

  .column {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .app {
    width: min(calc(100% - 20px), 1480px);
    padding: 12px 0 20px;
  }

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

  .hero-card,
  .column {
    border-radius: 24px;
    padding: 16px;
  }

  .hero-card h2 {
    font-size: 34px;
  }

  .hero-metrics,
  .size-grid,
  .transform-grid {
    grid-template-columns: 1fr;
  }

  .card-title {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .card-title output {
    grid-column: 1 / -1;
  }

  .process-head {
    grid-template-columns: 1fr;
  }

  .process-count {
    justify-self: start;
  }
}
