:root {
  color-scheme: dark;
  --canvas: #111722;
  --panel: #182130;
  --input: #141e2b;
  --line: #3a4a60;
  --text: #f1f5fc;
  --muted: #a8b7cc;
  --accent: #b4dcff;
  --danger: #ffb5b6;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
::selection { color: #10233b; background: var(--accent); }
.frame { width: min(100% - 40px, 660px); margin-inline: auto; }
.topbar { border-bottom: 1px solid #2c384b; background: #151e2b; }
.identity { min-height: 58px; display: flex; align-items: center; gap: 10px; font-weight: 640; }
.edition { color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; font-size: .85rem; font-weight: 400; }
.workspace { padding: clamp(32px, 7vh, 74px) 0 56px; }
h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.65rem); line-height: 1.15; letter-spacing: -.025em; }
p { margin: 0; }
.introduction { margin-top: 12px; color: var(--muted); }
.panel { margin-top: 26px; padding: clamp(18px, 5vw, 28px); border: 1px solid #2f3d52; border-radius: 12px; background: var(--panel); }
fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
fieldset:disabled { opacity: .7; }
.field-title { display: block; margin-bottom: 8px; font-weight: 650; }
.file-picker { position: relative; min-height: 76px; padding: 12px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; border: 1px dashed #647992; border-radius: 8px; background: var(--input); }
.file-picker:is(:hover, .dragging) { border-color: var(--accent); background: #1d3045; }
.file-picker svg { color: var(--accent); }
.file-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
#file-details, .help { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.browse { padding: 6px 9px; border-radius: 4px; background: #253449; color: var(--text); font-size: .88rem; }
input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker:focus-within, :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.help { margin-top: 8px; }
.output-label { margin-top: 20px; }
select { width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid #63748e; border-radius: 6px; background: var(--input); color: var(--text); font: inherit; }
.actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 9px 16px; border: 1px solid transparent; border-radius: 6px; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.primary { background: var(--accent); color: #10233b; }
.primary:not(:disabled):hover { background: #d5eaff; }
.secondary { background: transparent; color: var(--text); border-color: #65758f; }
.primary:disabled { background: #293a51; color: #afbed1; cursor: not-allowed; }
.privacy { margin-top: 12px; }
#status:not(:empty) { margin-top: 15px; }
#status[data-state="error"] { color: var(--danger); }
.result { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; }
.result-copy { overflow-wrap: anywhere; }
#result-name { font-weight: 650; }
#result-size, .warnings { margin-top: 3px; }
.warnings { grid-column: 1 / -1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

@media (max-width: 480px) {
  .frame { width: calc(100% - 32px); }
  .workspace { padding-top: 29px; }
  .panel { margin-top: 20px; }
  .actions > *, .result .primary { flex: 1 0 100%; width: 100%; }
  .result { grid-template-columns: minmax(0, 1fr); }
}
