:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fbfd;
  --ink: #172033;
  --muted: #69758a;
  --subtle: #95a0b2;
  --line: #e4e9f0;
  --line-strong: #d4dce7;
  --blue: #2563eb;
  --blue-deep: #1d4ed8;
  --blue-soft: #eff6ff;
  --mint: #0f9f83;
  --mint-soft: #e8f8f3;
  --amber: #b7791f;
  --amber-soft: #fff8e7;
  --danger: #c33d4d;
  --danger-soft: #fff1f3;
  --radius: 14px;
  --shadow: 0 16px 42px rgba(22, 37, 63, 0.07);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button, select, label, summary { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
button:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .23);
  outline-offset: 3px;
}

.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; padding: 3px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); box-shadow: 0 8px 18px rgba(22, 37, 63, .1);
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 9px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .01em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; margin-right: auto; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.62); }
.nav-link { min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; transition: color 160ms ease, background 160ms ease; }
.nav-link:hover:not(.is-disabled) { color: var(--ink); background: #f3f6fa; }
.nav-link.is-active { color: var(--blue); background: var(--blue-soft); }
.nav-link.is-disabled { color: var(--subtle); cursor: not-allowed; }
.privacy-note, .privacy-inline { display: inline-flex; align-items: center; gap: 7px; color: var(--mint); font-size: 12px; }
.privacy-note svg, .privacy-inline svg { width: 16px; height: 16px; }

.hero-copy {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 38px 0 30px;
}
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 10px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.hero-subtitle { margin-bottom: 0; color: var(--muted); font-size: 15px; }
.hero-stats { display: flex; gap: 10px; flex: 0 0 auto; }
.hero-stats div { min-width: 88px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.65); }
.hero-stats strong { display: block; font-size: 20px; line-height: 1; }
.hero-stats span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; padding-bottom: 22px; }
.converter-seo-copy { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 26px; align-items: center; margin: 4px 0 22px; padding: 28px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.converter-seo-copy h2 { margin: 0 0 9px; font-size: 22px; }
.converter-seo-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.converter-seo-links { display: flex; flex-wrap: wrap; gap: 8px; }
.converter-seo-links a { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 700; text-decoration: none; }
.converter-seo-links a:hover { color: var(--blue); border-color: #b6c5db; background: var(--blue-soft); }
.converter-seo-note { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px !important; }
.main-column { display: grid; gap: 18px; min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.text-button { padding: 6px 0; color: var(--muted); background: transparent; font-size: 12px; }
.text-button:not(:disabled):hover { color: var(--danger); }

.drop-zone {
  min-height: 154px; display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px; padding: 24px;
  border: 1px dashed #b9c9df; border-radius: 13px; background: var(--surface-soft); transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.drop-zone.is-dragging { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.drop-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: var(--blue); background: var(--blue-soft); }
.drop-icon svg { width: 25px; height: 25px; }
.drop-zone strong { display: block; font-size: 14px; }
.drop-zone p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.secondary-button, .primary-button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 0 14px; font-weight: 700; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.secondary-button { border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface); }
.secondary-button:hover:not(:disabled) { border-color: #aebbd0; background: #fbfcfe; transform: translateY(-1px); }
.secondary-button svg, .primary-button svg { width: 17px; height: 17px; }
.primary-button { color: white; background: var(--blue); box-shadow: 0 10px 20px rgba(37, 99, 235, .17); }
.primary-button:hover:not(:disabled) { background: var(--blue-deep); transform: translateY(-1px); box-shadow: 0 13px 24px rgba(37, 99, 235, .23); }
.compact { min-height: 34px; padding: 0 11px; font-size: 12px; }

.queue-list, .results-list { padding: 18px 20px 20px; }
.empty-queue, .empty-results { min-height: 118px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--subtle); text-align: center; }
.empty-queue svg { width: 29px; height: 29px; margin-bottom: 5px; color: #bdc8d8; }
.file-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto auto 32px; align-items: center; gap: 13px; margin-bottom: 10px; padding: 15px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; box-shadow: 0 5px 14px rgba(22, 37, 63, .045); transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.file-row:last-child { margin-bottom: 0; }
.file-row:hover { border-color: #c9d6e7; background: #ffffff; box-shadow: 0 8px 20px rgba(22, 37, 63, .08); transform: translateY(-1px); }
.file-type { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.file-cover-wrap { width: 50px; height: 50px; flex: 0 0 auto; }
.file-cover, .result-cover { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 10px; }
.file-cover-empty { display: grid; place-items: center; color: #7890b4; background: linear-gradient(145deg, #eaf1ff, #f5f8ff); }
.file-cover-empty svg { width: 22px; height: 22px; }
.file-info { min-width: 0; }
.file-name { overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.track-subtitle, .result-subtitle { overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; color: var(--muted); font-size: 11px; }
.detected-format { display: inline-flex; align-items: center; gap: 3px; color: var(--blue); }
.detected-format svg { width: 12px; height: 12px; }
.file-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.file-status.processing { color: var(--blue); }
.file-status.success { color: var(--mint); }
.file-status.error { color: var(--danger); }
.file-status.preparing { color: var(--amber); }
.file-error { flex-basis: 100%; overflow: hidden; color: var(--danger); text-overflow: ellipsis; white-space: nowrap; }
.metadata-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.metadata-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--subtle); background: #f7f9fc; font-size: 10px; line-height: 1.35; }
.metadata-badge.is-found { border-color: #bde6da; color: var(--mint); background: var(--mint-soft); }
.metadata-badge svg { width: 12px; height: 12px; }
.metadata-status { color: var(--subtle); font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.remove-file { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--subtle); background: transparent; }
.remove-file:hover { color: var(--danger); background: var(--danger-soft); }
.remove-file svg { width: 16px; height: 16px; }

.settings-panel { position: sticky; top: 16px; overflow: visible; }
.settings-heading { align-items: flex-start; }
.settings-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 700; }
.settings-badge svg { width: 14px; height: 14px; }
.settings-body { padding: 20px; }
.field-group { margin-top: 18px; }
.field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.select-control { position: relative; min-width: 0; }
.select-trigger { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--ink); background: var(--surface); text-align: left; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.select-trigger:hover { border-color: #9eacc0; background: #fcfdff; }
.select-control.is-open .select-trigger { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
.select-trigger-text { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.select-value { overflow: hidden; font-size: 13px; font-weight: 750; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.select-description { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger > svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); transition: transform 180ms ease; }
.select-control.is-open .select-trigger > svg { transform: rotate(180deg); }
.select-menu { position: absolute; top: calc(100% + 7px); right: 0; left: 0; z-index: 30; max-height: 310px; overflow-y: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 36px rgba(23, 32, 51, .16); }
.select-option { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; transition: background 140ms ease, color 140ms ease; }
.select-option:hover, .select-option:focus-visible { color: var(--blue-deep); background: var(--blue-soft); outline: none; }
.select-option[aria-selected="true"] { color: var(--blue-deep); background: #f0f5ff; }
.select-option-label { font-size: 13px; font-weight: 700; line-height: 1.3; }
.select-option-description { color: var(--muted); font-size: 11px; line-height: 1.35; }
.select-option:hover .select-option-description, .select-option:focus-visible .select-option-description, .select-option[aria-selected="true"] .select-option-description { color: #5570a5; }
.format-picker .select-trigger { min-height: 68px; padding: 11px 14px; }
.format-picker .select-value { font-size: 20px; }
.format-file-type { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.select-control.is-disabled .select-trigger { border-color: var(--line); color: var(--subtle); background: #f5f7fa; cursor: not-allowed; box-shadow: none; opacity: 1; }
.select-control.is-disabled .select-description { color: var(--subtle); }
.advanced-settings { margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.advanced-settings summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 700; list-style: none; }
.advanced-settings summary span { display: flex; flex-direction: column; gap: 3px; }
.advanced-settings summary strong { font-size: 13px; }
.advanced-settings summary small { color: var(--muted); font-size: 11px; font-weight: 450; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary svg { width: 16px; height: 16px; color: var(--muted); transition: transform 180ms ease; }
.advanced-settings[open] summary svg { transform: rotate(180deg); }
.advanced-content { padding: 0 0 18px; }
.advanced-content .field-group { margin-top: 14px; }
.remember-setting { display: flex; align-items: center; gap: 8px; margin-top: 19px; color: var(--muted); font-size: 12px; cursor: pointer; }
.remember-setting input { width: 16px; height: 16px; accent-color: var(--blue); }
.settings-footer { padding: 18px 20px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.convert-button { width: 100%; min-height: 48px; margin-top: 14px; font-size: 14px; }
.support-note { margin: 11px 0 0; color: var(--subtle); font-size: 11px; text-align: center; }

.result-placeholder-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 3px; border-radius: 10px; color: #aab6c8; background: #f1f4f8; }
.result-placeholder-icon svg { width: 18px; height: 18px; }
.empty-results strong { color: var(--muted); font-size: 13px; }
.empty-results span:last-child { font-size: 11px; }
.result-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.result-row:last-child { border-bottom: 0; }
.result-cover-wrap { width: 44px; height: 44px; }
.result-cover { border-radius: 9px; }
.result-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--mint); background: var(--mint-soft); }
.result-icon svg { width: 17px; height: 17px; }
.result-name { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.result-meta { margin-top: 3px; color: var(--muted); font-size: 11px; }
.result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.preview-result, .download-result { min-height: 34px; padding: 0 10px; font-size: 12px; }
.preview-result { color: var(--mint); background: var(--mint-soft); }
.preview-result:hover { background: #d9f3eb; }
.preview-result.is-playing { color: var(--blue); background: var(--blue-soft); }
.preview-result[disabled] svg { animation: audioflow-spin .9s linear infinite; }
@keyframes audioflow-spin { to { transform: rotate(360deg); } }
.download-result { color: var(--blue); background: var(--blue-soft); }
.download-result:hover { background: #dfeeff; }
.lyrics-result { color: #7b55b8; background: #f3edff; }
.lyrics-result:hover { background: #ebe1ff; }
.preview-result svg, .download-result svg { width: 15px; height: 15px; }
.lyrics-result svg { width: 15px; height: 15px; }
.progress-track { height: 4px; overflow: hidden; margin-top: 7px; border-radius: 10px; background: #e8edf3; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width 220ms ease; }

.footer { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 8px 0 22px; color: var(--subtle); font-size: 11px; }
.footer > * + * { position: relative; }
.footer > * + *::before { content: ""; position: absolute; top: 50%; left: -10px; width: 3px; height: 3px; border-radius: 50%; background: #c4ccd8; transform: translateY(-50%); }
.icp-link, .icp-link:hover, .icp-link:visited { color: var(--subtle); text-decoration: none; }
.privacy-consent-banner { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: min(680px, calc(100vw - 36px)); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: rgba(255,255,255,.97); box-shadow: 0 18px 50px rgba(20, 33, 53, .18); }
.privacy-consent-banner strong { display: block; margin-bottom: 3px; font-size: 13px; }.privacy-consent-banner p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }.privacy-consent-banner a { color: var(--blue); font-size: 11px; text-decoration: none; }.privacy-consent-banner a:hover { text-decoration: underline; }.privacy-consent-actions { display: flex; flex: 0 0 auto; gap: 8px; }.privacy-consent-actions button { white-space: nowrap; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(360px, calc(100vw - 44px)); padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: white; box-shadow: 0 14px 34px rgba(20, 33, 53, .14); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .app-shell { width: min(100% - 28px, 680px); }
  .hero-copy { align-items: flex-start; flex-direction: column; padding-top: 26px; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; }
  .workspace-grid { grid-template-columns: 1fr; }
  .converter-seo-copy { grid-template-columns: 1fr; padding: 22px; }
  .converter-seo-note { grid-column: auto; }
  .settings-panel { position: static; }
}

@media (max-width: 560px) {
  .topbar { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; padding: 14px 0 8px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; justify-self: start; margin: 0; }
  .privacy-note { grid-column: 2; grid-row: 1; }
  .privacy-note { font-size: 0; }
  .privacy-note svg { width: 18px; height: 18px; }
  h1 { font-size: 32px; }
  .hero-subtitle { font-size: 14px; }
  .panel-heading { padding: 15px 16px; }
  .drop-zone { min-height: 188px; flex-direction: column; margin: 16px; padding: 22px 16px; text-align: center; }
  .drop-zone .secondary-button { width: 100%; }
  .queue-list, .results-list, .settings-body, .settings-footer { padding: 16px; }
  .file-row { grid-template-columns: 42px minmax(0, 1fr) 32px; gap: 9px; padding: 13px 11px; }
  .file-cover-wrap { width: 42px; height: 42px; }
  .lookup-metadata { grid-column: 2 / 3; grid-row: 4; justify-self: start; }
  .file-status { grid-column: 2 / 3; grid-row: 3; justify-self: start; }
  .remove-file { grid-column: 3; grid-row: 1 / span 3; }
  .select-menu { max-height: 270px; }
  .result-row { grid-template-columns: 38px minmax(0, 1fr); gap: 9px; }
  .result-cover-wrap { width: 38px; height: 38px; }
  .result-actions { grid-column: 2; justify-content: flex-start; }
  .footer { flex-wrap: wrap; gap: 8px 16px; padding-bottom: 18px; }
  .privacy-consent-banner { right: 10px; bottom: 10px; width: calc(100vw - 20px); align-items: stretch; flex-direction: column; gap: 12px; padding: 14px; }.privacy-consent-actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
