:root {
  --bg: #0b1020;
  --bg-soft: #121833;
  --panel: #161d3d;
  --panel-2: #1b234a;
  --line: #2a356b;
  --text: #eef1ff;
  --muted: #9aa3c7;
  --accent: #6d5efc;
  --accent-2: #38d6c8;
  --ok: #46e0a0;
  --err: #ff6b7a;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #1a2350 0%, transparent 60%),
              radial-gradient(900px 500px at 0% 0%, #1c2b56 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(960px, 92vw); margin: 0 auto; }

/* Header */
.site-header { padding: 18px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; backdrop-filter: blur(8px); background: rgba(11,16,32,.6); z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 20px; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 18px; }
.logo-text .dim { color: var(--muted); font-weight: 600; }
.badge-private { font-size: 13px; color: var(--ok); background: rgba(70,224,160,.1); border: 1px solid rgba(70,224,160,.25); padding: 5px 12px; border-radius: 999px; font-weight: 600; }

/* Hero */
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.08; margin: 0 0 16px; font-weight: 850; letter-spacing: -.02em; }
.hero .accent { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); max-width: 620px; margin: 0 auto; }
.hero .lead strong { color: var(--text); }

/* Dropzone */
.dropzone {
  margin: 12px 0 8px; border: 2px dashed var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-soft), transparent);
  padding: 48px 24px; text-align: center; cursor: pointer; transition: .18s ease;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: rgba(109,94,252,.06); }
.dropzone.drag { border-color: var(--accent-2); background: rgba(56,214,200,.08); transform: translateY(-1px); }
.dz-icon { font-size: 40px; margin-bottom: 6px; opacity: .9; }
.dz-title { font-size: 20px; font-weight: 700; margin: 4px 0; }
.dz-sub { color: var(--muted); margin: 2px 0; }
.dz-formats { color: var(--muted); font-size: 13px; margin-top: 10px; opacity: .8; }
.link-btn { background: none; border: none; color: var(--accent-2); cursor: pointer; font: inherit; font-weight: 700; text-decoration: underline; padding: 0; }

/* Panel */
.panel { margin: 20px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.file-meta { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.file-info { color: var(--muted); font-size: 13px; }
.ghost-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 8px 14px; border-radius: 10px; cursor: pointer; font: inherit; white-space: nowrap; }
.ghost-btn:hover { border-color: var(--accent); color: var(--text); }

/* Options */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.opt label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.opt label .hint { opacity: .6; font-weight: 500; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 4px; gap: 4px; width: 100%; }
.seg button { flex: 1; background: transparent; border: none; color: var(--muted); padding: 9px 8px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; transition: .15s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: linear-gradient(135deg, var(--accent), #7a6cff); color: #fff; box-shadow: 0 4px 14px rgba(109,94,252,.35); }

.target-line { color: var(--muted); font-size: 14px; margin: 18px 0 16px; min-height: 20px; }
.target-line b { color: var(--accent-2); }

/* Buttons */
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none;
  padding: 15px 20px; border-radius: 12px; font: inherit; font-weight: 800; font-size: 16px;
  cursor: pointer; text-decoration: none; transition: .15s; box-shadow: 0 8px 26px rgba(109,94,252,.35);
}
.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.primary-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Progress */
.progress-wrap { margin-top: 20px; }
.progress-label { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.progress-bar { height: 12px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s ease; border-radius: 999px; }
.progress-note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* Result */
.result { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.result-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.result-head .ok { color: var(--ok); font-weight: 800; font-size: 18px; }
.result-meta { color: var(--muted); font-size: 14px; }
.preview { margin-bottom: 16px; border-radius: 12px; overflow: hidden; background: #000; }
.preview video, .preview img { display: block; width: 100%; max-height: 460px; object-fit: contain; background: #000; }

/* Error */
.error { margin-top: 18px; background: rgba(255,107,122,.1); border: 1px solid rgba(255,107,122,.3); color: #ffd1d6; padding: 14px 16px; border-radius: 12px; font-size: 14px; }
.error b { color: var(--err); }

/* How */
.how { padding: 40px 0 10px; }
.how h2 { font-size: 24px; margin: 0 0 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card-ico { font-size: 26px; margin-bottom: 8px; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.tip { margin-top: 20px; background: rgba(56,214,200,.07); border: 1px solid rgba(56,214,200,.2); padding: 14px 16px; border-radius: 12px; color: var(--muted); font-size: 14px; }
.tip strong { color: var(--text); }

/* Footer */
.site-footer { margin-top: 50px; border-top: 1px solid var(--line); padding: 24px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.dim { color: var(--muted); opacity: .7; }

@media (max-width: 560px) {
  .file-name { max-width: 48vw; }
  .site-footer .wrap { flex-direction: column; gap: 4px; }
}
