:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --green: #34c759;
  --red: #ff3b30;
  --line: rgba(0,0,0,.08);
  --shadow: 0 4px 24px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.05);
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --surface: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;
    --line: rgba(255,255,255,.12);
    --shadow: 0 4px 28px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
::selection { background: rgba(0,113,227,.22); }

/* ---------- nav ---------- */
nav.glass {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(245,245,247,.72);
  border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) { nav.glass { background: rgba(0,0,0,.6); } }
.nav-inner {
  max-width: 1020px; margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.logo {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6 55%, #bf5af2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.nav-links { display: flex; gap: 26px; flex: 1; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 13.5px; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; gap: 8px; }
.pill {
  font-size: 11.5px; padding: 3.5px 10px; border-radius: 999px;
  background: rgba(120,120,128,.12); color: var(--text-2); white-space: nowrap;
}
.pill-green { background: rgba(52,199,89,.14); color: #248a3d; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  text-align: center; padding: 96px 22px 72px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); z-index: -1;
}
.hero::before { width: 560px; height: 560px; left: -160px; top: -180px; background: rgba(10,132,255,.18); }
.hero::after { width: 520px; height: 520px; right: -140px; top: -60px; background: rgba(191,90,242,.14); }
.hero h1 {
  font-size: clamp(40px, 7vw, 68px); font-weight: 700; letter-spacing: -.025em; line-height: 1.08;
}
.chips { margin-top: 30px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  box-shadow: var(--shadow);
}

/* ---------- layout ---------- */
main { max-width: 900px; margin: 0 auto; padding: 0 22px 40px; }
.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
section { margin-bottom: 64px; }
h2 { font-size: 32px; letter-spacing: -.02em; text-align: center; margin-bottom: 26px; }

/* ---------- studio ---------- */
.studio { padding: 10px 26px 30px; }
.tabs { display: flex; gap: 6px; padding: 14px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text-2);
  padding: 8px 16px; border-radius: 12px; transition: all .2s;
}
.tab.active { background: rgba(0,113,227,.1); color: var(--blue); }
.tab-note { font-weight: 400; font-size: 12px; opacity: .7; margin-left: 4px; }

.dropzone {
  border: 2px dashed rgba(120,120,128,.35); border-radius: 18px;
  padding: 56px 20px; text-align: center; cursor: pointer;
  transition: border-color .25s, background .25s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: rgba(0,113,227,.04); }
.dz-icon {
  width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  box-shadow: 0 8px 22px rgba(10,132,255,.35);
  position: relative;
}
.dz-icon::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-bottom: 12px solid #fff; transform: translateY(-8px);
}
.dz-icon::before {
  content: ""; position: absolute; left: 50%; bottom: 13px; transform: translateX(-50%);
  width: 20px; height: 2.5px; border-radius: 2px; background: #fff;
}
.dz-title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.dz-sub { font-size: 13.5px; color: var(--text-3); margin-top: 6px; }

.warning-banner {
  margin-top: 18px; padding: 14px 18px; border-radius: 14px;
  background: rgba(255,149,0,.12); color: #b25000; font-size: 14px;
}

/* ---------- workspace ---------- */
.ws-grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; margin-top: 24px; }
@media (max-width: 760px) { .ws-grid { grid-template-columns: 1fr; } }
.src-card, .cfg-card {
  border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.src-card h3, .cfg-card h3 { font-size: 14px; color: var(--text-3); font-weight: 600; margin-bottom: 12px; letter-spacing: .02em; }
.file-name { font-size: 15.5px; font-weight: 600; word-break: break-all; margin-bottom: 12px; }
.src-table { width: 100%; font-size: 13.5px; border-collapse: collapse; }
.src-table td { padding: 5.5px 0; border-top: 1px solid var(--line); }
.src-table td:first-child { color: var(--text-3); width: 74px; }
.src-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.btn-ghost {
  appearance: none; border: 1px solid var(--line); background: transparent; color: var(--blue);
  font: inherit; font-size: 13.5px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  margin-top: 16px; transition: background .2s;
}
.btn-ghost:hover { background: rgba(0,113,227,.07); }

.cfg-group { margin-bottom: 20px; }
.cfg-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; display: flex; justify-content: space-between; }
.cfg-value { color: var(--blue); font-variant-numeric: tabular-nums; }

.segmented {
  display: flex; gap: 2px; padding: 2.5px; border-radius: 11px;
  background: rgba(120,120,128,.12); flex-wrap: wrap;
}
.segmented button {
  appearance: none; border: 0; background: transparent; font: inherit; font-size: 13px;
  color: var(--text-2); padding: 7px 13px; border-radius: 9px; cursor: pointer;
  transition: all .18s; flex: 1; white-space: nowrap;
}
.segmented button.active {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.segmented button:disabled { opacity: .35; cursor: not-allowed; }
.segmented button small { display: block; font-size: 10.5px; opacity: .65; font-weight: 400; }

.quality-chips { display: flex; gap: 8px; }
.qchip {
  appearance: none; border: 1px solid var(--line); background: transparent; font: inherit;
  font-size: 13px; color: var(--text-2); padding: 7px 16px; border-radius: 999px; cursor: pointer;
  transition: all .2s;
}
.qchip.active { border-color: var(--blue); color: var(--blue); background: rgba(0,113,227,.07); font-weight: 600; }

input[type="range"] {
  width: 100%; appearance: none; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--blue) var(--fill,50%), rgba(120,120,128,.25) var(--fill,50%));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: .5px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: grab;
}

input[type="range"]:disabled { opacity: .4; }

.size-input { display: flex; align-items: center; gap: 10px; }
.size-input input {
  appearance: none; font: inherit; font-size: 15px; width: 120px;
  padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(120,120,128,.06); color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-variant-numeric: tabular-nums;
}
.size-input input:focus { border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0,113,227,.18); }
.size-unit { font-size: 13.5px; color: var(--text-3); }

.estimate { font-size: 13px; color: var(--text-3); }

/* ---------- actions / progress / result ---------- */
.action-bar { margin-top: 26px; text-align: center; display: flex; gap: 12px; justify-content: center; }
.btn-primary {
  appearance: none; border: 0; cursor: pointer; font: inherit; text-decoration: none;
  display: inline-block; background: var(--blue); color: #fff;
  font-size: 16px; font-weight: 500; padding: 12px 32px; border-radius: 999px;
  transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.progress-card { margin-top: 26px; }
.progress-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 8px; }
.progress-top span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-bar { height: 6px; border-radius: 3px; background: rgba(120,120,128,.18); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, #0a84ff, #5e5ce6);
  transition: width .3s ease;
}
.progress-sub { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-3); margin-top: 8px; font-variant-numeric: tabular-nums; }

.result-card {
  margin-top: 26px; padding: 22px; border-radius: 18px;
  display: flex; align-items: center; gap: 18px;
  background: rgba(52,199,89,.08); border: 1px solid rgba(52,199,89,.25);
}
.result-icon {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  background: var(--green); position: relative;
}
.result-icon::after {
  content: ""; position: absolute; left: 12px; top: 15px; width: 8px; height: 13px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.result-main { flex: 1; min-width: 0; }
.result-title { font-size: 16px; font-weight: 600; }
.result-save { color: #248a3d; font-size: 14px; margin-left: 8px; }
.result-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; font-variant-numeric: tabular-nums; }

.error-card {
  margin-top: 22px; padding: 16px 20px; border-radius: 14px;
  background: rgba(255,59,48,.08); border: 1px solid rgba(255,59,48,.25);
  color: var(--red); font-size: 14px;
}

/* ---------- features / compare / about ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 26px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.f-icon { font-size: 26px; margin-bottom: 12px; }
.feature h3 { font-size: 16.5px; letter-spacing: -.01em; margin-bottom: 8px; }
.feature p { font-size: 13.5px; color: var(--text-2); }

.about ul { max-width: 640px; margin: 0 auto; color: var(--text-2); font-size: 14.5px; display: grid; gap: 10px; padding: 0 20px; }
.about li { list-style: none; padding-left: 22px; position: relative; }
.about li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg,#0a84ff,#5e5ce6); }

footer {
  text-align: center; padding: 44px 22px 60px; color: var(--text-3); font-size: 12.5px; line-height: 1.9;
  border-top: 1px solid var(--line);
}
