:root {
  color-scheme: light;
  --page: #f4f6fc;
  --surface: #fff;
  --ink: #14213d;
  --muted: #526079;
  --line: #dce4f1;
  --blue: #344cc1;
  --violet: #6457b9;
  --primary: linear-gradient(115deg, #344cc1, #5255b2);
  --gutter: clamp(22px, 5.25vw, 80px);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background:
    linear-gradient(155deg, #eaf0fc, #f5f7fc 35rem),
    var(--page);
}
button, input, select { font: inherit; }
a, button, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
[hidden] { display: none !important; }
main, .header-inner, .site-footer { width: min(100% - var(--gutter) * 2, 1280px); margin-inline: auto; }
.header { background: #fcfdff; border-bottom: 1px solid var(--line); --nav-hover: #ebeffb; --nav-active: #e8eafa; --nav-ink: #38469a; }
.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.36;
  white-space: nowrap;
  transition: background .18s, border-color .18s, box-shadow .18s, color .18s;
}
.button.primary {
  background: var(--primary);
  box-shadow: 0 5px 15px #6557b33b, inset 0 1px #ffffff3d;
  border-color: #9584dc42;
  color: white;
}
.button.primary:not(:disabled):hover { box-shadow: 0 7px 20px #6757bd52, inset 0 1px #ffffff60; }
.button.primary:disabled { background: #e8eaf5; border-color: #d8ddef; color: #5e6786; box-shadow: none; }
.button.subtle, .button.outline { background: #fff; border-color: var(--line); }
.button.subtle:hover, .button.outline:not([aria-disabled="true"]):hover { background: #f1f1ff; color: var(--blue); border-color: #c6c7ee; }
.button.outline[aria-disabled="true"] { color: #606a87; background: #f3f4f9; border-color: #e3e5ef; cursor: default; }
.button.full { width: 100%; min-height: 47px; justify-content: space-between; padding: 0 15px; }
.intro-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.intro-actions .mobile-upload { display: none; }
#upload { scroll-margin-top: 18px; }
.intro h1 span { color: #564db6; background: var(--primary); background-clip: text; -webkit-text-fill-color: transparent; }
.service-status { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap; padding-block: 3px; }
.service-status i { width: 6px; height: 6px; border-radius: 50%; background: #8d738f; }
.service-status.online i { background: #6358bb; box-shadow: 0 0 0 4px #8e7ec62e; }
.notice { margin-bottom: 16px; border: 1px solid #ccc5ef; border-radius: 10px; background: #eeeafa; color: #43367b; padding: 11px 15px; line-height: 1.6; }

.workspace { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(270px, 1fr); gap: 20px; align-items: start; scroll-margin-top: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 32px #253f7110; min-width: 0; }
.upload-card, .result-card { padding: 20px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; min-height: 31px; gap: 12px; margin-bottom: 15px; }
.card-heading h2 { font-size: 19px; line-height: 1.3; letter-spacing: -.02em; font-weight: 650; margin: 0; }
.badge { display: inline-flex; align-items: center; color: #5246a7; font-size: 13px; font-weight: 550; background: #eeecfa; border-radius: 5px; padding: 5px 8px; white-space: nowrap; }
.dropzone {
  min-height: 225px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: linear-gradient(150deg, #eef2ff, #f9faff);
  border: 1px dashed #a4b2d4;
  border-radius: 12px;
  cursor: pointer;
  padding: 23px 12px;
  transition: background .18s, border-color .18s;
}
.dropzone:is(:hover, .dragging) { border-color: #6c63c6; background: #f0edfd; }
.drop-symbol {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  margin-bottom: 6px;
  background: linear-gradient(145deg, #f0f1ff, #e3e0f9);
  border: 1px solid #d7d8f2;
  color: #5046b3;
  border-radius: 13px;
  box-shadow: inset 0 1px #fff;
}
.dropzone strong { font-size: 16px; font-weight: 650; }
.dropzone span:not(.drop-symbol), .dropzone small { color: var(--muted); font-size: 13px; line-height: 1.55; }
.drawn-icon { display: inline-block; width: 14px; height: 14px; flex: none; position: relative; }
.upload-icon, .download-icon { border: 1.5px solid currentColor; border-width: 0 1.5px 1.5px; height: 7px; border-radius: 0 0 3px 3px; margin-top: 5px; }
.upload-icon::before, .download-icon::before, .upload-icon::after, .download-icon::after { content: ""; position: absolute; left: 50%; }
.upload-icon::before, .download-icon::before { width: 1.5px; height: 9px; background: currentColor; top: -7px; transform: translateX(-50%); }
.upload-icon::after, .download-icon::after { width: 5px; height: 5px; border: 1.5px solid currentColor; transform: translateX(-50%) rotate(45deg); }
.upload-icon::after { top: -7px; border-width: 1.5px 0 0 1.5px; }
.download-icon::after { top: -3px; border-width: 0 1.5px 1.5px 0; }
.file-detail { margin-top: 11px; padding: 8px; border: 1px solid #e3e1f2; background: #f6f5fc; border-radius: 8px; display: flex; gap: 9px; align-items: center; }
.file-symbol { display: grid; place-items: center; width: 30px; height: 30px; flex: none; color: var(--blue); background: #e7e8fa; border-radius: 6px; font-size: 10px; }
.file-info { flex: 1; min-width: 0; }
.file-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-info strong, .file-info small { display: block; }
.file-info small { color: var(--muted); font-size: 13px; margin-top: 2px; }
.icon-button { background: none; border: 0; border-radius: 6px; width: 38px; height: 38px; padding: 0; flex: none; color: var(--muted); font-size: 22px; }
.icon-button:hover { background: #e9e9f8; color: var(--blue); }
.upload-options { margin: 18px 0 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.upload-options label { color: var(--ink); font-size: 14px; }
.upload-options select { min-height: 42px; padding: 0 10px; background: #fafbff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.upload-note { margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.62; }
.upload-progress { margin-top: 13px; font-size: 12px; color: var(--muted); }
.upload-progress > div { display: flex; justify-content: space-between; gap: 8px; }
.upload-progress strong { color: var(--ink); font-variant-numeric: tabular-nums; }
progress { appearance: none; border: 0; overflow: hidden; background: #edeefa; border-radius: 5px; width: 100%; height: 5px; display: block; }
progress::-webkit-progress-bar { background: #edeefa; }
progress::-webkit-progress-value { border-radius: 5px; background: var(--primary); }
progress::-moz-progress-bar { border-radius: 5px; background: var(--primary); }
.upload-progress progress { margin: 9px 0 4px; }
.text-button { background: none; border: 0; color: var(--blue); padding: 6px 0; }
.text-button:hover { text-decoration: underline; }

.player { aspect-ratio: 16 / 9; background: #000; overflow: hidden; border-radius: 10px; border: 1px solid #25243d; }
.player video { display: block; width: 100%; height: 100%; background: #000; }
.player-caption { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; color: var(--muted); font-size: 13px; padding: 10px 4px 12px; }
.player-caption span { display: flex; align-items: center; justify-content: center; gap: 7px; }
.player-caption i { width: 6px; height: 6px; border-radius: 50%; background: #8c94ae; }
.player-caption span:nth-child(2) i { background: #765ac9; }
.result-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 13px; border-top: 1px solid var(--line); }
.result-info { min-width: 0; }
.result-info strong, .result-info span { display: block; }
.result-info strong { font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.result-info span { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.5; text-wrap: balance; }
.result-footer > a { flex: none; }

.history-card { margin-top: 32px; padding: 23px 25px 4px; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 8px; border-top: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 600; }
th:first-child { width: 46%; }
th:nth-child(2) { width: 16%; }
th:last-child { width: 95px; }
th:last-child, td:last-child { text-align: right; }
td:nth-child(2) { color: var(--muted); font-variant-numeric: tabular-nums; }
.job-name { display: block; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-size, .job-error { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.job-error { color: #9b3558; }
.job-stage { color: #424b69; font-size: 13px; line-height: 1.5; }
.job-stage.done { color: #5944a2; }
.job-stage.failed { color: #9b3558; }
.job-progress { max-width: 120px; margin-top: 6px; }
.row-action { min-height: 40px; padding: 0 11px; background: #eeeeff; color: #4845a5; border: 1px solid #dcdcf4; border-radius: 8px; font-size: 13px; white-space: nowrap; }
.row-action:hover { background: #e5e6ff; }
.row-action.muted { background: #f4f4f8; color: var(--muted); }
.empty-state { padding: 28px 0; color: var(--muted); }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 26px 0 34px; color: var(--muted); font-size: 13px; }
.site-footer a { color: var(--blue); white-space: nowrap; }
.site-footer a:hover { text-decoration: underline; }
.toast { position: fixed; inset: auto auto 22px 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); z-index: 10; border: 1px solid #544c86; background: #313457; color: white; border-radius: 10px; padding: 12px 17px; box-shadow: 0 9px 25px #26255829; }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); gap: 14px; }
  .upload-card, .result-card { padding: 15px; }
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .dropzone { min-height: 166px; }
  .intro-actions .mobile-upload { display: inline-flex; }
}
@media (max-width: 570px) {
  .intro-actions { justify-content: space-between; }
  .upload-options select { font-size: 16px; }
  .upload-card, .result-card { padding: 13px; }
  .card { border-radius: 12px; }
  .card-heading { margin-bottom: 10px; }
  .player-caption { padding: 9px 0; }
  .result-footer a { font-size: 13px; padding-inline: 9px; }
  .history-card { margin-top: 23px; padding-inline: 13px; }
  th, td { padding-inline: 3px; }
  th:nth-child(2), td:nth-child(2) { display: none; }
  th:first-child { width: 46%; }
  th:last-child { width: 65px; }
  .row-action { padding-inline: 5px; }
  .site-footer { flex-wrap: wrap; gap: 10px; }
}
@media (max-width: 355px) {
  :root { --gutter: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
