:root {
  --ink: #181a20;
  --muted: #686d78;
  --line: #dfe2e8;
  --surface: #ffffff;
  --canvas: #f5f6f8;
  --red: #e83b46;
  --red-dark: #c92b36;
  --red-soft: #fff0f1;
  --green: #16856a;
  --green-soft: #e8f7f2;
  --yellow: #ffcb45;
  --shadow: 0 14px 40px rgba(19, 25, 38, 0.1);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }

button { cursor: pointer; }

a { color: inherit; }

button:focus-visible, .dropzone:focus-visible, .mode-option:has(input:focus-visible) {
  outline: 3px solid rgba(232, 59, 70, 0.25);
  outline-offset: 3px;
}

.app-header {
  height: 68px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 750;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--red);
  border-radius: 7px;
}

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

.privacy-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4e555f;
  font-size: 13px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

main { min-height: calc(100vh - 116px); }

.tool-band {
  width: min(100%, 1020px);
  margin: 0 auto;
  padding: 54px 24px 44px;
}

.tool-heading { text-align: center; margin-bottom: 28px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}

.tool-heading h1 {
  margin: 0;
  font-size: 52px;
  line-height: 1.1;
  font-weight: 820;
}

.tool-heading > p:last-child {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.workspace {
  position: relative;
  width: min(100%, 760px);
  min-height: 390px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.view { min-height: 336px; }

.dropzone {
  height: 336px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #cfd3da;
  border-radius: 6px;
  background: #fafbfc;
  transition: border-color 150ms ease, background 150ms ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--red);
  background: var(--red-soft);
}

.upload-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  color: var(--red);
  border-radius: 50%;
  background: var(--red-soft);
}

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

.primary-button, .compress-button, .download-button {
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: white;
  background: var(--red);
  font-weight: 760;
  transition: background 150ms ease, transform 150ms ease;
}

.primary-button { min-width: 168px; height: 50px; padding: 0 22px; }

.primary-button:hover, .compress-button:hover, .download-button:hover { background: var(--red-dark); }
.primary-button:active, .compress-button:active, .download-button:active { transform: translateY(1px); }

.primary-button svg, .compress-button svg, .download-button svg { width: 19px; height: 19px; }

.dropzone p { margin: 18px 0 6px; color: #4e535d; font-weight: 650; }
.dropzone > span { color: #9398a2; font-size: 13px; }

.view-options { display: flex; flex-direction: column; }

.file-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbfc;
}

.pdf-badge {
  width: 44px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--red);
  border-radius: 5px;
  background: var(--red-soft);
}

.pdf-badge svg { width: 23px; height: 23px; }

.file-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-meta span { color: var(--muted); font-size: 13px; }

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: #727782;
  background: transparent;
}

.icon-button:hover { color: var(--ink); background: #eceef2; }
.icon-button svg { width: 19px; height: 19px; }

.compression-fieldset { margin: 25px 0 20px; padding: 0; border: 0; }
.compression-fieldset legend { margin-bottom: 12px; font-size: 14px; font-weight: 760; }

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

.mode-option {
  position: relative;
  min-height: 138px;
  padding: 16px 35px 15px 14px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.mode-option:hover { border-color: #b8bdc6; }
.mode-option.selected { border: 2px solid var(--red); padding: 15px 34px 14px 13px; background: #fffafb; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }

.mode-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--green);
  border-radius: 6px;
  background: var(--green-soft);
}

.mode-icon.strong { color: #8a5b00; background: #fff5d9; }
.mode-icon.basic { color: #2f68aa; background: #edf4ff; }
.mode-icon svg { width: 18px; height: 18px; }

.mode-copy { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.mode-copy > span:last-child { color: var(--muted); font-size: 12px; line-height: 1.45; }

.mode-title { font-size: 13px; font-weight: 780; }
.mode-title b {
  margin-left: 5px;
  padding: 3px 5px;
  color: var(--red-dark);
  border-radius: 4px;
  background: var(--red-soft);
  font-size: 10px;
}

.check-icon { position: absolute; top: 14px; right: 13px; width: 18px; height: 18px; color: transparent; }
.mode-option.selected .check-icon { color: var(--red); }

.compress-button { width: 100%; height: 52px; margin-top: auto; }

.view-processing, .view-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.processing-visual { height: 88px; display: grid; place-items: center; }

.document-stack { position: relative; width: 66px; height: 72px; }
.document-stack span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid #ffadb2;
  border-radius: 5px;
  background: white;
}
.document-stack span:nth-child(1) { transform: rotate(-8deg) translate(-8px, 2px); }
.document-stack span:nth-child(2) { transform: rotate(8deg) translate(8px, 2px); }
.document-stack span:nth-child(3) { color: var(--red); border: 2px solid var(--red); }
.document-stack svg { width: 28px; height: 28px; }

.view-processing h2, .view-result h2 { margin: 20px 0 8px; font-size: 22px; }
.view-processing p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

.progress-track { width: min(100%, 450px); height: 8px; overflow: hidden; border-radius: 4px; background: #eceef1; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width 350ms ease; }
.view-processing > strong { margin-top: 10px; color: var(--red); font-size: 13px; }

.cancel-button {
  height: 34px;
  margin-top: 12px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  color: #737985;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}
.cancel-button:hover { color: var(--ink); }
.cancel-button svg { width: 15px; height: 15px; }

.success-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 8px var(--green-soft);
}
.success-icon svg { width: 31px; height: 31px; stroke-width: 3; }

.result-kicker { margin: 22px 0 0; color: var(--green); font-size: 12px; font-weight: 800; }
.view-result h2 { margin-top: 6px; }
.result-meta { margin: 0; color: var(--muted); font-size: 12px; }

.size-comparison {
  width: min(100%, 520px);
  min-height: 82px;
  margin: 14px 0 22px;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: 1fr 24px 1fr auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.size-comparison > div:not(.saving-pill) { display: flex; flex-direction: column; gap: 4px; }
.size-comparison span { color: var(--muted); font-size: 12px; }
.size-comparison strong { font-size: 18px; }
.size-comparison > svg { width: 18px; height: 18px; color: #a5a9b1; }

.saving-pill { padding: 7px 9px; color: var(--green); border-radius: 5px; background: var(--green-soft); font-size: 12px; font-weight: 800; white-space: nowrap; }

.download-button { width: min(100%, 330px); height: 52px; }
.text-button { margin-top: 13px; padding: 8px; border: 0; color: #555b66; background: transparent; font-size: 13px; font-weight: 650; }
.text-button:hover { color: var(--red); }
.result-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }

.error-banner {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 20px;
  min-height: 44px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #97252d;
  border: 1px solid #ffc5c8;
  border-radius: 6px;
  background: #fff0f1;
  font-size: 13px;
}
.error-banner svg { width: 18px; height: 18px; flex: 0 0 auto; }

footer {
  min-height: 48px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7b8089;
  font-size: 12px;
}

footer a { text-underline-offset: 3px; }
footer span { display: inline-flex; align-items: center; gap: 7px; }
footer svg { width: 15px; height: 15px; color: var(--green); }

[hidden] { display: none !important; }

@media (max-width: 700px) {
  .app-header { height: 60px; padding: 0 16px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; }
  .privacy-status { font-size: 0; }
  .privacy-status .status-dot { display: block; }
  main { min-height: calc(100vh - 104px); }
  .tool-band { padding: 36px 14px 28px; }
  .tool-heading { margin-bottom: 20px; }
  .tool-heading h1 { font-size: 36px; }
  .tool-heading > p:last-child { max-width: 320px; font-size: 14px; }
  .workspace { min-height: 450px; padding: 16px; }
  .view { min-height: 416px; }
  .dropzone { height: 416px; }
  .mode-selector { grid-template-columns: 1fr; }
  .mode-option { min-height: 96px; }
  .error-banner { left: 16px; right: 16px; bottom: 16px; }
  .size-comparison { grid-template-columns: 1fr 18px 1fr; gap: 8px; padding: 14px 4px; }
  .saving-pill { grid-column: 1 / -1; justify-self: center; }
  footer { padding: 0 16px; justify-content: center; }
  footer span:last-child { display: none; }
}

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