/* ==========================================================================
   在线压缩网站  —  design tokens shared with ztwresume.bond
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrainsmono-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-italic-latin.woff2") format("woff2");
}

:root {
  --background: #fff;
  --foreground: #0a0a0a;
  --card: #fff;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --border: #e5e5e5;
  --ring: #a1a1a1;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --danger: #b42318;
  --ok: #15803d;
  --radius: 0.625rem;

  --font-sans: Inter, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  --font-serif: Newsreader, "Songti SC", "Source Han Serif SC", Georgia, serif;

  --wrap: 1140px;
}

body.dark {
  --background: #1a1a1a;
  --foreground: #e8e8e8;
  --card: #141414;
  --muted: #262626;
  --muted-foreground: #a1a1a1;
  --border: rgba(255, 255, 255, 0.12);
  --ring: #737373;
  --primary: #e8e8e8;
  --primary-foreground: #171717;
  --danger: #f97066;
  --ok: #4ade80;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s, color 0.3s;
}

::selection { background: color-mix(in oklab, var(--foreground) 18%, transparent); }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--muted);
}

a { color: inherit; }

button, input, select { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--background) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-side { display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  white-space: nowrap;
}
.pill-warn { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, transparent); }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.6;
}
.dot-check { background: var(--ok); opacity: 1; }
.pill-warn .dot-check { background: var(--danger); }

.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.icon-btn:hover { border-color: var(--ring); }
.icon-btn:active { transform: scale(0.94); }

.i-sun, .i-moon {
  display: block; width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.i-sun {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M6.3 17.7l-1.4 1.4M19.1 4.9l-1.4 1.4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M6.3 17.7l-1.4 1.4M19.1 4.9l-1.4 1.4'/%3E%3C/svg%3E");
}
.i-moon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E");
}
body:not(.dark) .i-moon { display: none; }
body.dark .i-sun { display: none; }

/* ------------------------------------------------------------------ shell */

.shell {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px 72px;
}

.hero { padding: 44px 0 26px; max-width: 720px; }

.hero-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.015em;
}

.hero-sub {
  margin: 0 0 18px;
  color: var(--muted-foreground);
  font-size: 15px;
}
.hero-sub b { color: var(--foreground); }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted-foreground);
}
.hero-facts .k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 7px;
  opacity: 0.7;
}

/* ------------------------------------------------------------------- tabs */

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
  margin-bottom: 22px;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted-foreground);
  transition: background-color 0.2s, color 0.2s;
}
.tab:hover { color: var(--foreground); }
.tab.is-active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.panel { display: none; }
.panel.is-active { display: block; }

/* -------------------------------------------------------------- dropzone */

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 46px 24px;
  border-radius: 16px;
  border: 1.5px dashed var(--border);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
}
.drop:hover { border-color: var(--ring); }
.drop:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.drop.is-over {
  border-color: var(--foreground);
  background: var(--muted);
  transform: scale(1.004);
}

.drop-icon {
  width: 40px; height: 40px;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}
.drop-icon svg { width: 100%; height: 100%; }

.drop-title { margin: 0; font-size: 15px; font-weight: 500; }
.drop-hint { margin: 0; font-size: 12.5px; color: var(--muted-foreground); }

/* ---------------------------------------------------------------- options */

.opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px 22px;
  margin: 22px 0 0;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
}

.opt label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}

.opt select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--background);
  cursor: pointer;
}
.opt select:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }

.opt input[type="range"] {
  width: 100%;
  margin: 8px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.opt output {
  font-family: var(--font-mono);
  color: var(--foreground);
  text-transform: none;
  letter-spacing: 0;
}

.opt-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: color-mix(in oklab, var(--muted-foreground) 85%, transparent);
}

/* ---------------------------------------------------------------- actions */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
}

.actions-note {
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  margin-left: auto;
}

.btn {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s, background-color 0.2s, opacity 0.2s, transform 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--ring); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { opacity: 0.88; }

/* --------------------------------------------------------------- progress */

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
}

.bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--foreground);
  border-radius: 999px;
  transition: width 0.18s linear;
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-foreground);
  min-width: 118px;
  text-align: right;
}

/* ------------------------------------------------------------ file card */

.filecard {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}
.fc-thumb {
  width: 96px; height: 56px;
  flex: none;
  border-radius: 8px;
  background: var(--muted);
  overflow: hidden;
}
.fc-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-body { min-width: 0; flex: 1; }
.fc-name {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-foreground);
}

/* --------------------------------------------------------------- results */

.results { margin-top: 18px; display: grid; gap: 12px; }

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}

.card-thumb {
  width: 64px; height: 64px;
  flex: none;
  border-radius: 9px;
  object-fit: cover;
  background: var(--muted);
  display: block;
}

.card-body { min-width: 0; flex: 1; }

.card-name {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted-foreground);
}
.card-meta .sep { opacity: 0.45; padding: 0 6px; }
.card-meta .save { color: var(--ok); }
.card-meta .grow { color: var(--danger); }

.card-side { display: flex; align-items: center; gap: 8px; flex: none; }

.dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--background);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.dl:hover { border-color: var(--ring); }
.dl:active { transform: scale(0.97); }

.card-error .card-meta { color: var(--danger); }

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  z-index: 60;
  max-width: min(92vw, 520px);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.13);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ----------------------------------------------------------------- notes */

.notes { margin-top: 64px; }

.notes-title {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.notes-grid article {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}
.notes-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.notes-grid p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted-foreground);
}

/* ------------------------------------------------------------------ foot */

.foot {
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.foot-sep { opacity: 0.5; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 640px) {
  .shell { padding: 0 16px 56px; }
  .topbar-inner { padding: 10px 16px; }
  .hero { padding: 30px 0 20px; }
  .drop { padding: 34px 18px; }
  .opts { padding: 16px; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 7px 8px; text-align: center; }
  .actions-note { margin-left: 0; width: 100%; }
  .card { flex-wrap: wrap; }
  .card-side { width: 100%; }
  .dl { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .topbar, .tabs, .actions, .notes, .foot, .toast { display: none; }
}
