/* ==========================================================================
   图片压缩 · 格式转换 · 柔光工作台
   淡暖纸白 + 单一鼠尾草绿点缀
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeede7;
  --ink: #24231f;
  --ink-2: #56544c;
  --muted: #6b685d;
  --line: #e7e5dc;
  --line-strong: #d9d6ca;
  --accent: #5f7c61;
  --accent-deep: #42584a;
  --accent-soft: #e6ece1;
  --ok: #4f9d6b;
  --danger: #b0594b;

  --shadow-sm: 0 1px 2px rgba(36, 35, 31, 0.05), 0 4px 12px rgba(36, 35, 31, 0.05);
  --shadow-md: 0 2px 6px rgba(36, 35, 31, 0.05), 0 16px 40px rgba(36, 35, 31, 0.1);

  --radius: 18px;
  --font-display: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.garden {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 640px at 82% -8%, rgba(95, 124, 97, 0.1), transparent 62%),
    radial-gradient(820px 560px at 2% 16%, rgba(95, 124, 97, 0.07), transparent 60%),
    radial-gradient(960px 720px at 92% 104%, rgba(95, 124, 97, 0.09), transparent 66%);
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }

.brand__mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand__mark svg { width: 36px; height: 36px; display: block; }

.brand__word { display: flex; flex-direction: column; line-height: 1.15; }

.brand__word strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__word small {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.topbar__meta { display: flex; align-items: center; gap: 22px; }

.back { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 0.15s ease; }
.back:hover { color: var(--accent-deep); }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(79, 157, 107, 0.14);
}

/* --------------------------------------------------------------------------
   主区
   -------------------------------------------------------------------------- */
.main {
  flex: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.hero { max-width: 760px; margin-bottom: 36px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.eyebrow__rule { width: 34px; height: 2px; background: var(--accent); border-radius: 1px; }

.hero__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(25px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

.hero__dot { color: var(--accent); }

.hero__lead { margin: 0; font-size: 16px; line-height: 1.7; color: var(--ink-2); max-width: 640px; }
.hero__lead strong { color: var(--accent-deep); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr; } }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-deep);
  line-height: 1.1;
}

.stat__value--mono { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.02em; }

.stat__label { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   面板
   -------------------------------------------------------------------------- */
.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 44px;
}
@media (max-width: 820px) { .tools { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel__title {
  margin: 0;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.panel__body { padding: 20px; }

/* 上传区 */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 220px;
  padding: 28px 20px;
  text-align: center;
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.18s ease;
}

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

.dropzone__icon { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.dropzone__title { margin: 4px 0 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; }

.dropzone__hint { margin: 0; font-size: 12.5px; color: var(--muted); }

/* 选项 */
.option { margin-bottom: 22px; }
.option:last-child { margin-bottom: 0; }

.option__label { display: block; font-size: 13px; color: var(--ink); margin-bottom: 10px; }
.option__label em { font-style: normal; font-family: var(--font-mono); color: var(--accent-deep); margin-left: 8px; }

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}

.segmented button {
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
  transition: all 0.15s ease;
}

.segmented button.is-active { background: var(--accent); color: #fff; }
.segmented button:not(.is-active):hover { color: var(--accent-deep); }

.range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 4px;
  background: var(--line-strong);
  outline: none;
  margin: 6px 0 4px;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.range.is-disabled { opacity: 0.4; pointer-events: none; }

.field__control {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.field__control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(95, 124, 97, 0.14); }

.field__control input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.field__unit { padding: 0 14px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); border-left: 1px solid var(--line); }

.hint { font-size: 12px; line-height: 1.7; color: var(--muted); border-left: 3px solid var(--line-strong); padding-left: 10px; margin: 10px 0 0; }

/* --------------------------------------------------------------------------
   结果区
   -------------------------------------------------------------------------- */
.results__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }

.section-kicker { margin: 0 0 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; }

.results__head h2 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 700; }

.results__actions { display: flex; gap: 10px; }

.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  transition: all 0.15s ease;
}

.btn:hover { background: var(--accent-deep); }

.btn--ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }

.result-list { display: grid; grid-template-columns: 1fr; gap: 14px; }

.result-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.result-card__thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.result-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-card__thumb .ph { font-family: var(--font-mono); font-size: 22px; color: var(--muted); }

.result-card__body { flex: 1; min-width: 0; }

.result-card__name { font-weight: 600; font-size: 14px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.result-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.result-card__arrow { color: var(--line-strong); }
.result-card__meta strong { color: var(--accent-deep); font-weight: 500; }

.result-card__ratio {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.result-card__ratio--up { background: rgba(176, 89, 75, 0.1); color: var(--danger); }

.result-card__actions { display: flex; gap: 8px; flex-shrink: 0; }

.result-card__actions .btn { padding: 8px 14px; font-size: 12.5px; }

@media (max-width: 600px) {
  .result-card { flex-wrap: wrap; }
  .result-card__actions { width: 100%; justify-content: flex-end; }
}

.empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty__title { margin: 0 0 8px; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.empty__text { margin: 0; font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 600px) { .footer { flex-direction: column; align-items: flex-start; } }

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