:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --ink: #15202e;
  --muted: #607084;
  --line: #dbe3ec;
  --accent: #0e7c66;
  --accent-strong: #08634f;
  --accent-soft: #dff4ee;
  --warn: #b34141;
  --ok: #16885f;
  --shadow: 0 18px 50px rgba(31, 45, 61, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(14, 124, 102, 0.08), transparent 280px),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.workspace {
  background: var(--surface);
  border: 1px solid rgba(219, 227, 236, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.topbar,
.result-panel,
.progress-meta,
.file-summary,
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: min(154px, 38vw);
  height: auto;
  margin: 0;
  mix-blend-mode: multiply;
}

.brand-copy {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 16px;
}

.brand-title-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.06;
  letter-spacing: 0;
  white-space: nowrap;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.version-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  padding: 6px;
  border: 1px solid rgba(219, 227, 236, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(21, 32, 46, 0.08);
  backdrop-filter: blur(10px);
}

body[data-app-view="settings"] .topbar,
body[data-app-view="users"] .topbar,
body[data-app-view="help"] .topbar {
  display: none;
}

.topbar-icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.topbar-icon-button svg {
  width: 20px;
  height: 20px;
  transition:
    transform 0.25s ease,
    color 0.2s ease;
}

.topbar-icon-button:hover,
.topbar-icon-button:focus-visible,
.topbar-icon-button.is-ready {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.topbar-icon-button:active {
  transform: translateY(2px) scale(0.94);
  box-shadow: inset 0 2px 7px rgba(21, 32, 46, 0.16);
}

.topbar-icon-button:hover svg,
.topbar-icon-button:focus-visible svg {
  transform: translateY(-1px);
}

button svg,
.download-button svg,
.block-heading svg {
  width: 18px;
  height: 18px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  margin-top: 28px;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  margin-top: 24px;
  padding: 6px;
  border-radius: 8px;
  background: var(--surface-2);
}

.tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.is-active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 8px 20px rgba(31, 45, 61, 0.08);
}

.drop-panel,
.controls {
  min-width: 0;
}

.drop-zone {
  width: 100%;
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 32px;
  border: 2px dashed #aac5d4;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(14, 124, 102, 0.08), rgba(218, 113, 63, 0.08)),
    #f9fbfd;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background-color: #f4fbf8;
  transform: translateY(-1px);
}

.drop-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 12px 28px rgba(14, 124, 102, 0.16);
}

.drop-icon svg {
  width: 34px;
  height: 34px;
}

.drop-title {
  display: block;
  font-size: 22px;
  font-weight: 800;
}

.drop-subtitle,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.file-summary {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.file-name {
  margin-bottom: 4px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.preview-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 8px;
  background: #111820;
}

.preview {
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  background: #111820;
}

.drop-panel .preview,
.burned-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.burned-preview {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.subtitle-style-preview {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 82%;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  transform: translateY(-50%);
}

.subtitle-style-controls {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.subtitle-style-controls .field-stack {
  gap: 12px;
}

.subtitle-style-controls .block-heading {
  margin-bottom: 10px;
}

.controls {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.control-block,
.control-row,
.primary-button,
.progress-panel {
  margin-bottom: 18px;
}

.block-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.block-heading svg {
  color: var(--accent);
}

.preset-grid {
  display: grid;
  gap: 10px;
}

.preset {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.preset input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preset span {
  font-weight: 800;
}

.preset small {
  color: var(--muted);
}

.preset.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.control-row label:first-child {
  color: var(--muted);
  font-weight: 700;
}

.quick-language-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quick-language-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.quick-language-head svg {
  width: 18px;
  height: 18px;
}

.quick-language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-language-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.quick-language-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-language-grid select {
  width: 100%;
}

select,
.range-wrap {
  width: 190px;
}

select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.range-wrap {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 10px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

output {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.primary-button,
.download-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.primary-button:active,
.download-button:active,
.icon-button:active,
.auth-tab:active,
.tab:active,
.preset:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: inset 0 2px 8px rgba(21, 32, 46, 0.14);
}

.settings-button {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.settings-button > i:first-child,
.settings-button > svg:first-child {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.settings-button span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-button strong {
  font-size: 18px;
  font-weight: 900;
}

.settings-button small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.settings-button > i:last-child,
.settings-button > svg:last-child {
  color: var(--muted);
}

.settings-sheet {
  margin: 0 0 14px;
}

.settings-card {
  width: 100%;
  max-height: min(620px, calc(100vh - 180px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  box-shadow: none;
}

.settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.settings-card-body {
  overflow: auto;
  padding: 16px;
  overscroll-behavior: contain;
}

.settings-card-body .control-row:last-child,
.settings-card-body .api-settings:last-child {
  margin-bottom: 0;
}

.settings-page {
  margin-top: 28px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.auth-panel {
  width: min(560px, 100%);
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(14, 124, 102, 0.08), transparent 160px),
    #fbfcfe;
  box-shadow: 0 18px 50px rgba(31, 45, 61, 0.14);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand h1 {
  font-size: 28px;
}

.auth-brand p:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.auth-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.auth-benefits span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(14, 124, 102, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.auth-benefits svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.auth-tab {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(21, 32, 46, 0.08);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.auth-form input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(14, 124, 102, 0.12);
}

.auth-form label,
.field-stack label {
  display: grid;
  gap: 7px;
}

.auth-form label span,
.field-stack label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.auth-message {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
}

.auth-message.is-error {
  background: #fff0f0;
  color: var(--warn);
}

.auth-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
}

.topbar-actions .auth-summary {
  width: auto;
}

#currentUserName {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-page-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.settings-page-head h2 {
  font-size: 28px;
}

.settings-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding-top: 22px;
}

.user-management-grid {
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
}

.settings-section {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.settings-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.settings-section-head > i,
.settings-section-head > svg {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.settings-section .download-button {
  width: fit-content;
}

.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 22px;
  align-items: center;
  padding: 24px 0 22px;
  border-bottom: 1px solid var(--line);
}

.help-hero h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.12;
}

.help-hero p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.8;
}

.help-demo-card {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(14, 124, 102, 0.14), transparent 55%),
    #f8fbfd;
}

.help-phone {
  width: min(210px, 72%);
  padding: 14px;
  border: 2px solid rgba(21, 32, 46, 0.18);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(21, 32, 46, 0.13);
}

.help-phone-top,
.help-phone-tabs,
.help-phone-video,
.help-phone-caption {
  border-radius: 8px;
}

.help-phone-top {
  height: 16px;
  width: 42%;
  margin: 0 auto 12px;
  background: var(--line);
}

.help-phone-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.help-phone-tabs span {
  height: 30px;
  background: var(--surface-2);
}

.help-phone-tabs span:first-child {
  background: var(--accent-soft);
  border: 1px solid rgba(14, 124, 102, 0.24);
}

.help-phone-video {
  height: 118px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px dashed #a8bdcf;
  background: #f5faf9;
  color: var(--accent);
}

.help-phone-video svg {
  width: 36px;
  height: 36px;
}

.help-phone-caption {
  min-height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.help-play-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.help-play-badge svg {
  width: 16px;
  height: 16px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-top: 22px;
}

.help-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.help-card-visual {
  min-height: 190px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #eef5f8;
}

.help-card-body h3 {
  margin: 0 0 10px;
  font-size: 21px;
}

.help-card-body ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}

.mock-drop,
.mock-button,
.mock-language,
.mock-progress,
.mock-result,
.mock-settings {
  border: 1px solid rgba(168, 189, 207, 0.8);
  border-radius: 8px;
  background: #fff;
}

.mock-drop {
  min-height: 154px;
  display: grid;
  place-items: center;
  gap: 8px;
  border-style: dashed;
  color: var(--accent);
  text-align: center;
}

.mock-drop svg {
  width: 42px;
  height: 42px;
}

.mock-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mock-tabs span,
.mock-result span,
.mock-settings span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mock-tabs .is-on {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.mock-tabs svg,
.mock-settings svg,
.mock-button svg,
.mock-progress svg {
  width: 16px;
  height: 16px;
}

.mock-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.mock-language {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.mock-language label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mock-language span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mock-language strong {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.mock-language > svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.mock-settings,
.mock-result {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.mock-settings span {
  justify-content: flex-start;
  background: var(--surface-2);
}

.mock-progress {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.mock-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 900;
}

.mock-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.mock-progress-track span {
  display: block;
  width: 68%;
  height: 100%;
  background: var(--accent);
}

.mock-progress button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.mock-result strong {
  font-size: 16px;
}

.mock-result span {
  justify-content: flex-start;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.compact-section-head {
  margin-bottom: 12px;
}

.create-user-form {
  display: grid;
  gap: 12px;
}

.create-user-form label {
  display: grid;
  gap: 7px;
}

.create-user-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.create-user-form input,
.create-user-form select {
  width: 100%;
  min-height: 42px;
}

.user-management-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.user-management-head strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
}

.user-management-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.user-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.user-stats div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.user-stats strong {
  font-size: 20px;
  line-height: 1;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-main {
  min-width: 0;
}

.user-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.user-row strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.user-badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.user-badge.is-approved,
.user-badge.is-admin {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.user-badge.is-pending {
  background: #fff7df;
  color: #9a6700;
}

.user-badge.is-disabled {
  background: #fff0f0;
  color: var(--warn);
}

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.user-meta span {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-actions button,
.user-actions select {
  min-height: 34px;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #aab7c4;
}

.icon-button {
  min-width: 74px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.progress-panel {
  margin: 24px 0 0;
}

.progress-meta {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.stop-task-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(179, 65, 65, 0.28);
  border-radius: 8px;
  background: #fff0f0;
  color: var(--warn);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.stop-task-button:hover,
.stop-task-button:focus-visible {
  background: #ffe3e3;
  outline: none;
}

.stop-task-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.progress-track {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #da713f);
  transition: width 0.2s ease;
}

.progress-panel.is-working .progress-bar {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0.28) 75%, transparent 75%, transparent),
    linear-gradient(90deg, var(--accent), #da713f);
  background-size: 24px 24px, 100% 100%;
  animation: progress-stripes 0.9s linear infinite;
}

.progress-panel.is-working #statusText::after {
  display: inline-block;
  width: 1.4em;
  content: "";
  animation: status-dots 1.2s steps(4, end) infinite;
}

.floating-status {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  width: min(430px, calc(100% - 28px));
  min-height: 56px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(21, 32, 46, 0.94);
  color: #fff;
  box-shadow: 0 16px 38px rgba(21, 32, 46, 0.3);
  backdrop-filter: blur(14px);
}

.floating-spinner {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.floating-spinner svg {
  width: 22px;
  height: 22px;
  animation: spin 0.9s linear infinite;
}

.floating-status-text {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-progress-text {
  color: #a7f3d0;
  font-size: 15px;
  font-weight: 900;
}

.floating-stop-task {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #fff0f0;
  color: var(--warn);
  cursor: pointer;
}

.floating-stop-task:hover,
.floating-stop-task:focus-visible {
  background: #ffe3e3;
  outline: none;
}

.floating-stop-task:disabled {
  cursor: wait;
  opacity: 0.72;
}

.result-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: 8px;
  background: #f8fbf7;
  border: 1px solid #cfe7d6;
  flex-wrap: wrap;
}

.resume-panel {
  margin-top: 18px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #cfe7d6;
  border-radius: 8px;
  background: #f8fbf7;
}

.resume-panel h2 {
  margin: 0;
}

.resume-panel .result-note {
  margin-top: 8px;
}

.subtitle-result {
  margin-top: 24px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}

.subtitle-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.subtitle-head h2 {
  margin: 0;
  font-size: 24px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.download-button.secondary {
  background: var(--accent);
}

.download-button.danger {
  background: var(--warn);
  color: #fff;
}

.subtitle-result textarea {
  width: 100%;
  min-height: 260px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  background: var(--surface);
  color: var(--ink);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", "Microsoft YaHei Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.audio-preview {
  width: 100%;
  margin-top: 16px;
}

.burned-preview {
  margin-top: 16px;
}

.result-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.task-steps {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.task-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
}

.task-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #fff;
}

.task-copy {
  display: grid;
  gap: 2px;
}

.task-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.task-copy small {
  color: var(--muted);
  font-size: 12px;
}

.task-step.is-active .task-dot {
  border-color: var(--accent);
  background: var(--accent);
  animation: task-pulse 1.1s ease-in-out infinite;
}

.task-step.is-done .task-dot {
  border-color: var(--ok);
  background: var(--ok);
}

.task-step.is-warning .task-dot {
  border-color: #e09b2d;
  background: #e09b2d;
}

@keyframes progress-stripes {
  to {
    background-position: 24px 0, 0 0;
  }
}

@keyframes status-dots {
  0% {
    content: "";
  }

  25% {
    content: ".";
  }

  50% {
    content: "..";
  }

  75%,
  100% {
    content: "...";
  }
}

@keyframes task-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(14, 124, 102, 0.35);
  }

  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 6px rgba(14, 124, 102, 0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-panel.is-working .progress-bar,
  .progress-panel.is-working #statusText::after,
  .task-step.is-active .task-dot,
  .floating-spinner svg {
    animation: none;
  }
}

.ocr-options {
  margin-bottom: 18px;
  padding-top: 2px;
}

.api-settings {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.notification-settings {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.api-settings summary,
.advanced-settings summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.api-settings summary svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.api-settings-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
}

.field-stack {
  display: grid;
  gap: 12px;
  padding: 0 12px 14px;
}

.field-stack label {
  display: grid;
  gap: 6px;
}

.field-stack label span,
.advanced-settings summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-stack input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.field-stack input[type="color"] {
  height: 44px;
  padding: 4px;
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.advanced-settings {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 4px 10px 10px;
  background: #fbfcfe;
}

.advanced-settings[open] {
  display: grid;
  gap: 10px;
}

.setting-switch {
  display: flex !important;
  grid-template-columns: none !important;
}

.result-panel h2 {
  margin: 0;
  font-size: 24px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 12px;
  flex: 1;
  max-width: 460px;
}

.stats div {
  display: grid;
  gap: 4px;
}

.stats span {
  color: var(--muted);
  font-size: 13px;
}

.stats strong {
  font-size: 20px;
}

.download-button {
  min-height: 44px;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.download-button:disabled {
  cursor: not-allowed;
  background: #aab7c4;
  color: #fff;
}

.error-box {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 700;
}

.error-box.is-error {
  background: #fff0f0;
  color: var(--warn);
}

.error-box.is-notice {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.error-box.is-success {
  background: #ecfdf3;
  color: #067647;
}

.completion-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(21, 32, 46, 0.38);
  backdrop-filter: blur(8px);
}

.completion-card {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 22px 22px;
  border: 1px solid rgba(219, 227, 236, 0.9);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(21, 32, 46, 0.24);
  text-align: center;
}

.completion-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.completion-close:active {
  transform: translateY(2px) scale(0.94);
}

.completion-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.completion-icon svg {
  width: 30px;
  height: 30px;
}

.completion-card h2 {
  font-size: 26px;
}

.completion-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}

.completion-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.update-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  width: min(420px, calc(100% - 28px));
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateX(-50%);
  padding: 10px 12px 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 36px rgba(21, 32, 46, 0.28);
  font-weight: 850;
}

.update-toast button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  white-space: nowrap;
}

.update-toast .ghost-update {
  background: rgba(255, 255, 255, 0.14);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 880px) {
  .shell {
    width: min(100% - 20px, 680px);
    padding: 16px 0;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    margin-left: 0;
    border-radius: 28px;
  }

  .brand-lockup {
    gap: 12px;
  }

  .brand-logo {
    width: min(112px, 32vw);
  }

  .brand-copy {
    margin-top: 12px;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .settings-page-grid,
  .user-management-grid {
    grid-template-columns: 1fr;
  }

  .help-hero,
  .help-grid,
  .help-card {
    grid-template-columns: 1fr;
  }

  .help-hero {
    padding-top: 18px;
  }

  .help-card {
    padding: 14px;
  }

  .help-card-visual {
    min-height: 150px;
  }

  .settings-section {
    padding: 16px;
  }

  .settings-section .download-button {
    width: 100%;
  }

  .drop-zone {
    min-height: 280px;
  }

  .stats {
    max-width: none;
    width: 100%;
  }

  .download-button {
    width: 100%;
  }

  .tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tab {
    justify-content: center;
  }

  .auth-summary {
    width: 100%;
    justify-content: flex-end;
  }

  .user-stats {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
  }

  .user-management-head {
    display: grid;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: stretch;
  }

  .user-actions button,
  .user-actions select {
    flex: 1 1 140px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 28px;
  }

  .brand-logo {
    width: min(88px, 28vw);
  }

  .brand-copy {
    margin-top: 6px;
  }

  .brand-title-line {
    gap: 8px;
  }

  .version-line {
    font-size: 12px;
  }

  .auth-panel {
    padding: 20px;
  }

  .auth-page {
    align-items: start;
    padding-top: 92px;
  }

  .auth-brand {
    align-items: flex-start;
  }

  .user-stats {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
    gap: 5px;
  }

  .user-stats div {
    min-height: 52px;
    padding: 7px 5px;
  }

  .user-stats span {
    font-size: 10px;
  }

  .user-stats strong {
    font-size: 18px;
  }

  .control-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  select,
  .range-wrap {
    width: 100%;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .result-actions,
  .resume-panel,
  .result-actions .download-button {
    width: 100%;
  }

  .resume-panel {
    align-items: stretch;
    flex-direction: column;
  }
}
