/* Tool-page presentation. The homepage supplies the visual language;
   the existing engine continues to own media, settings and task state. */
.duoduo-tool-document { color-scheme: dark; }
.duoduo-tool-page {
  --tool-bg: #0a0e14;
  --tool-panel: #131c2d;
  --tool-surface: #192438;
  --tool-text: #f3f4f6;
  --tool-muted: #a4b2c8;
  --tool-border: #2d3b52;
  --tool-blue: #60a5fa;
  --tool-gradient: linear-gradient(135deg, #2563eb, #7c3aed);
  --color-text: #cbd5e1;
  --color-text-heading: #f3f4f6;
  --color-text-muted: #a4b2c8;
  --color-primary: #93c5fd;
  --color-primary-dark: #bfdbfe;
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--tool-text);
  background: radial-gradient(ellipse 75% 620px at 50% 0, #14213c80, transparent 90%),
    linear-gradient(135deg, #0a0e14, #0f172a 55%, #0a0e14);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.duoduo-tool-page :where(button, input, select) { font: inherit; }
.duoduo-tool-page :where(a, button, label) { -webkit-tap-highlight-color: #60a5fa30; touch-action: manipulation; }
.duoduo-tool-page :where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid #93c5fd !important;
  outline-offset: 4px;
}
.duoduo-tool-page :where(h1, h2, h3) { text-wrap: balance; scroll-margin-top: 100px; }
.duoduo-tool-page a { color: #93c5fd; text-underline-offset: 4px; }
.duoduo-tool-page a:hover { color: #bfdbfe; }
.duoduo-tool-page .tool-skip-link {
  position: fixed; top: 8px; left: 12px; z-index: 1000; transform: translateY(-150%);
  padding: 10px 18px; color: #fff; background: #1d4ed8; border-radius: 8px;
}
.duoduo-tool-page .tool-skip-link:focus { transform: translateY(0); }

/* Navigation echoes the homepage, including the brand's existing logo. */
.duoduo-tool-page .tool-header {
  position: relative; z-index: 60; background: #0a0e14e8;
  border-bottom: 1px solid #94a3b826; box-shadow: none; padding: 0;
}
.duoduo-tool-page .tool-header > .container { max-width: 1280px; padding: 0 32px; }
.duoduo-tool-page .tool-header > .container > div { min-height: 76px; gap: 28px; }
.duoduo-tool-page .tool-header a { text-decoration: none; }
.duoduo-tool-page .tool-header > .container > div > a {
  flex-shrink: 0; gap: 9px; font-size: 18px; color: #f3f4f6;
}
.duoduo-tool-page .tool-header img { width: 44px; height: 44px; filter: none; }
.duoduo-tool-page .tool-header a[href="/"] span { color: #f3f4f6; }
.duoduo-tool-page .tool-header nav { align-items: center; gap: 20px; margin: 0; }
.duoduo-tool-page .tool-header nav a {
  position: relative; padding: 24px 0; margin: 0; border-radius: 0; background: transparent;
  font-size: 14px; font-weight: 500; color: #cbd5e1; white-space: nowrap;
}
.duoduo-tool-page .tool-header nav a:hover { color: #93c5fd; background: transparent; }
.duoduo-tool-page .tool-header nav .tool-nav-current { color: #60a5fa; }
.duoduo-tool-page .tool-nav-current::after {
  content: ""; position: absolute; bottom: 12px; left: 0; right: 0; height: 2px;
  border-radius: 2px; background: var(--tool-gradient);
}
.duoduo-tool-page .tool-header nav a span { display: inline-flex; align-items: center; line-height: 1.4; margin-left: 4px; }

.duoduo-tool-page main { padding: 0; background: transparent; min-width: 0; }
.duoduo-tool-page #title {
  margin: 52px auto 12px; padding: 0 24px; font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 750; line-height: 1.3; letter-spacing: -.025em;
  color: #f3f4f6; text-shadow: none; background: none; -webkit-text-fill-color: currentColor;
}
.duoduo-tool-page main > p { margin: 12px auto 24px; padding: 0 20px; color: #a4b2c8; font-size: 13px; }
.duoduo-tool-page main > .hidden { height: 20px; }
.duoduo-tool-page main > .hidden br { display: none; }
.duoduo-tool-page main > div[class*="bg-yellow"] { background: #342a16; border-color: #705c2a; color: #fde68a; }
.duoduo-tool-page main > div[class*="bg-yellow"] span { color: #fde68a; }

/* The empty state puts the upload action at the center of the page. */
.duoduo-tool-page #video-enhancer-tool,
.duoduo-tool-page #video-enhancer-tool[data-local-video-preview="true"] {
  --local-workspace-width: min(840px, calc(100vw - 64px));
  --local-preview-size: clamp(350px, calc(100vh - 340px), 600px);
  padding: 0 0 24px; color: var(--tool-text); background: transparent;
}
.duoduo-tool-page #video-enhancer-tool #file-load-panel {
  width: var(--local-workspace-width); max-width: 840px; height: auto; min-height: 384px;
  padding: 64px 24px 60px; border: 1px dashed #49618b; border-radius: 20px;
  background: radial-gradient(ellipse at 50% 0, #233c6740, transparent 80%), #131c2dcc;
  box-shadow: 0 24px 64px #00000024; text-align: center;
  transition: border-color .2s, background-color .2s;
}
.duoduo-tool-page #video-enhancer-tool #file-load-panel:hover { border-color: #7d9ed1; }
.duoduo-tool-page #video-enhancer-tool #file-load-panel.is-dragging { border-color: #93c5fd !important; background: #1d3152 !important; }
.duoduo-tool-page .tool-upload-icon {
  display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 16px;
  border: 1px solid #527cc155; border-radius: 18px; color: #93c5fd; background: #3b82f615;
}
.duoduo-tool-page #video-enhancer-tool #file-load-panel > p:first-of-type {
  margin: 0 0 6px; font-size: 21px; font-weight: 650; line-height: 1.5; color: #f3f4f6;
}
.duoduo-tool-page #video-enhancer-tool #input-button { margin: 22px auto 16px; padding: 12px 30px; min-height: 48px; font-size: 15px; }
.duoduo-tool-page #video-enhancer-tool #local-upload-policy { margin: 0 auto !important; color: #a4b2c8 !important; font-size: 12px !important; }
.duoduo-tool-page .tool-quick-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  max-width: 840px; width: var(--local-workspace-width); padding: 26px 8px 0; margin: 0 auto; list-style: none;
}
.duoduo-tool-page .tool-quick-steps li { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.duoduo-tool-page .tool-quick-steps li > span {
  display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px;
  border: 1px solid #3b4b65; border-radius: 50%; color: #93c5fd; font-size: 12px;
}
.duoduo-tool-page .tool-quick-steps strong { font-size: 13px; color: #dce6f5; font-weight: 600; }
.duoduo-tool-page .tool-quick-steps p { margin: 3px 0 0; font-size: 12px; line-height: 1.7; color: #a4b2c8; }

/* Preview, processing, completion, and errors share the same dark surfaces. */
.duoduo-tool-page .tool-workspace-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  width: var(--local-workspace-width); margin: 18px auto;
}
.duoduo-tool-page .tool-workspace-heading h2 { margin: 0; font-size: 20px; font-weight: 650; }
.duoduo-tool-page .tool-workspace-heading a { font-size: 13px; }
.duoduo-tool-page #video-enhancer-tool > div[id],
.duoduo-tool-page #video-enhancer-tool[data-local-video-preview="true"] #start-panel {
  background-color: var(--tool-panel); border-color: var(--tool-border); color: var(--tool-text); box-shadow: none;
}
.duoduo-tool-page #video-enhancer-tool #start-panel {
  width: var(--local-workspace-width); max-width: 840px; height: auto; min-height: 0;
  padding: 24px; border-radius: 20px;
}
.duoduo-tool-page #video-enhancer-tool[data-local-video-preview="true"] #start-panel { padding: 24px; border-radius: 20px; }
.duoduo-tool-page #video-enhancer-tool[data-local-video-preview="true"] #panel-media {
  background: #0c1320; border-color: #2d3b52; border-radius: 14px;
}
.duoduo-tool-page #video-enhancer-tool[data-local-video-preview="true"] #start-panel.split-layout #preview > .output-box {
  padding: 4px 18px; background: #192438; border-color: #2d3b52; border-radius: 14px;
}
.duoduo-tool-page #video-enhancer-tool #preview .output-box { background: #192438; border-color: #2d3b52; }
.duoduo-tool-page #video-enhancer-tool #preview .output-box-row { border-color: #35435b; }
.duoduo-tool-page #video-enhancer-tool #settings-save-to-disk { background: transparent; border: 0; border-top: 1px solid #35435b; border-radius: 0; }
.duoduo-tool-page #video-enhancer-tool #preview .output-label { color: #b9c7da; }
.duoduo-tool-page #video-enhancer-tool #preview .output-dims { color: #cbd5e1; font-variant-numeric: tabular-nums; }
.duoduo-tool-page #video-enhancer-tool #preview .output-seg { background: #0c1320; border-color: #35435b; }
.duoduo-tool-page #video-enhancer-tool .output-seg-btn { color: #d0ddf0; min-height: 36px; }
.duoduo-tool-page #video-enhancer-tool .output-seg-btn:hover:not(:disabled) { background: #253b5e; color: #fff; }
.duoduo-tool-page #video-enhancer-tool .output-seg-btn.active,
.duoduo-tool-page #video-enhancer-tool .btn-check:checked + .output-seg-btn { background: #3b64d9; color: #fff; }
.duoduo-tool-page #video-enhancer-tool .btn-check:focus-visible + label { outline: 2px solid #93c5fd; outline-offset: 3px; }
.duoduo-tool-page #video-enhancer-tool .output-seg-btn:disabled { opacity: .5; cursor: not-allowed; }
.duoduo-tool-page #video-enhancer-tool .model-advanced-toggle { color: #b9c7da; }
.duoduo-tool-page #video-enhancer-tool .tooltip-trigger { background: #34445e; color: #e2e8f0; }
.duoduo-tool-page #video-enhancer-tool .tooltip-trigger::after { color: #f3f4f6; background: #24344f; border: 1px solid #50678c; }
.duoduo-tool-page #video-enhancer-tool #local-gpu-model { color: #e2e8f0; }
.duoduo-tool-page #video-enhancer-tool #local-gpu-backend { background: #34426a; color: #d2dcff; }
.duoduo-tool-page #video-enhancer-tool :is(.local-gpu-memory, #local-gpu-note, .duoduo-software-cta) { color: #a4b2c8; }
.duoduo-tool-page #video-enhancer-tool .frame-chip { border-color: #526381; background: #0a0e14; }
.duoduo-tool-page #video-enhancer-tool .frame-chip.active { border-color: #8b8cff; box-shadow: 0 0 0 2px #8b8cff66; }
.duoduo-tool-page #video-enhancer-tool :is(.btn-primary, #download),
.duoduo-tool-page .share-btn {
  min-height: 44px; border: 1px solid transparent; border-radius: 10px; color: #fff;
  background: var(--tool-gradient); box-shadow: none; font-weight: 600;
  transition: filter .2s, border-color .2s;
}
.duoduo-tool-page #video-enhancer-tool :is(.btn-primary, #download):hover:not(:disabled),
.duoduo-tool-page .share-btn:hover { filter: brightness(.94); transform: none; box-shadow: none; }
.duoduo-tool-page #video-enhancer-tool .btn-outline-primary {
  min-height: 44px; border: 1px solid #5c79ad; border-radius: 10px; color: #bfdbfe; background: #1b2b44;
}
.duoduo-tool-page #video-enhancer-tool .btn-outline-primary:hover { background: #294266; color: #fff; }
.duoduo-tool-page #video-enhancer-tool a { color: #93c5fd; }
.duoduo-tool-page #video-enhancer-tool a:hover { color: #bfdbfe; }
.duoduo-tool-page #video-enhancer-tool button:disabled { cursor: not-allowed; }
.duoduo-tool-page #video-enhancer-tool :is(.text-gray-400, .text-gray-500, .text-gray-600, .text-gray-text) { color: #b0bed2; }
.duoduo-tool-page #video-enhancer-tool .bg-gray-200 { color: #e2e8f0; background: #2c3b53; }
.duoduo-tool-page #video-enhancer-tool .bg-white { background-color: #192438; color: #e2e8f0; }
.duoduo-tool-page #video-enhancer-tool :is(.bg-yellow-50, .bg-amber-50) { color: #fde68a; background: #342a16; border-color: #705c2a; }
.duoduo-tool-page #video-enhancer-tool .text-yellow-900 { color: #fde68a; }
.duoduo-tool-page #video-enhancer-tool .progress { background-color: #2b3b55; border-radius: 8px; }
.duoduo-tool-page #video-enhancer-tool .progress-bar { background: var(--tool-gradient); }
.duoduo-tool-page #video-enhancer-tool #info { padding-top: 18px; }
.duoduo-tool-page #video-enhancer-tool #info > p { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.duoduo-tool-page #video-enhancer-tool #local-source-notice p { color: #b0bed2 !important; }
.duoduo-tool-page #video-enhancer-tool #local-output-actions [role="status"] { color: #b0bed2; }
.duoduo-tool-page #video-enhancer-tool #progress-preview-canvas { max-width: 100%; border-radius: 12px; }
.duoduo-tool-page #video-enhancer-tool #local-calculating { background: #0c1320dd; color: #e2e8f0; }

@media (min-width: 1024px) {
  .duoduo-tool-page #video-enhancer-tool #start-panel.split-layout #preview .output-box-row:not(#local-gpu-info) {
    flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
  }
  .duoduo-tool-page #video-enhancer-tool #start-panel.split-layout #preview .output-label { width: auto; text-align: left; }
  .duoduo-tool-page #video-enhancer-tool #preview .output-dims { flex-basis: 100%; }
}

/* Existing explanatory copy and links remain in place. */
.duoduo-tool-page .share-section { padding: 8px 24px 34px; background: transparent; border: 0; }
.duoduo-tool-page .share-section > p { color: #a4b2c8; font-size: 13px; }
.duoduo-tool-page .share-actions { gap: 12px; margin-top: 14px; }
.duoduo-tool-page .share-actions :is(a, button) { padding: 9px 18px; font-size: 13px; min-height: 42px; }
.duoduo-tool-page .share-actions .action-button { border-radius: 10px; box-shadow: none; transition: background-color .2s, border-color .2s; }
.duoduo-tool-page .share-actions .action-button-primary { color: #bfdbfe; background: #1e2e49; border: 1px solid #52678c; }
.duoduo-tool-page .share-actions .action-button-warm { color: #cbd5e1; background: #192438; border: 1px solid #3c4c67; }
.duoduo-tool-page .share-actions .action-button:hover { background: #2b4060; transform: none; box-shadow: none; }
.duoduo-tool-page :is(.faq-section, .steps-section) { background: transparent; padding: 44px 0; border-top: 1px solid #94a3b81a; }
.duoduo-tool-page :is(.faq-section, .steps-section) > .container { max-width: 1120px; padding: 0 24px; }
.duoduo-tool-page :is(.faq-section, .steps-section) h2 { color: #f3f4f6; font-size: 28px; line-height: 1.45; }
.duoduo-tool-page :is(.faq-section, .steps-section) p { color: #b0bed2; line-height: 1.85; }
.duoduo-tool-page :is(.faq-card, .step-card) {
  padding: 24px; border: 1px solid #2d3b52; background: #ffffff04; border-radius: 14px; box-shadow: none;
}
.duoduo-tool-page :is(.faq-card, .step-card):hover { transform: none; border-color: #52678c; box-shadow: none; }
.duoduo-tool-page :is(.faq-card, .step-card) h3 { color: #e2e8f0; }
.duoduo-tool-page .step-number { background: #283d6b; color: #bfdbfe; box-shadow: none; }
.duoduo-tool-page .model-guide { max-width: 1072px; color: #b0bed2; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.duoduo-tool-page .model-guide h2 { color: #f3f4f6; font-size: 28px; }
.duoduo-tool-page .model-guide :is(th, td) { color: #cbd5e1; background: #131c2d; border-color: #35435b; }
.duoduo-tool-page .model-guide thead th { background: #1e2e49; color: #f3f4f6; }
.duoduo-tool-page .model-guide tbody th { color: #dce6f5; }
.duoduo-tool-page .model-guide caption { color: #cbd5e1; background: #192438; }
.duoduo-tool-page .model-guide h3 { color: #e2e8f0; }
.duoduo-tool-page .model-guide .model-note { color: #a4b2c8; }
.duoduo-tool-page .model-table-scroll { border-color: #35435b; background: #131c2d; }
.duoduo-tool-page .model-guide a { color: #93c5fd; }
.duoduo-tool-page .faq-section a[style] { color: #fff !important; background: #355ec7 !important; box-shadow: none !important; transform: none !important; }
.duoduo-tool-page .fixed-favorite { right: 16px; }
.duoduo-tool-page .fixed-favorite button { background: #1e2e49; border: 1px solid #52678c; color: #dce6f5; box-shadow: none; }
.duoduo-tool-page .copy-updated { color: #a4b2c8; }
.duoduo-tool-page footer { background: #0a0e14; border-top: 1px solid #94a3b826; }
.duoduo-tool-page footer :is(a, span, .text-gray-500) { color: #a4b2c8; }
.duoduo-tool-page footer a:hover { color: #bfdbfe; }
.duoduo-tool-page :is(.fav-top-toast-inner, .share-modal-content) { background: #192438; color: #e2e8f0; border-color: #52678c; }
.duoduo-tool-page :is(.share-modal, [role="dialog"]) { overscroll-behavior: contain; }

@media (max-width: 1199px) {
  .duoduo-tool-page .tool-header > .container > div { flex-wrap: wrap; justify-content: center; gap: 0; padding-top: 10px; }
  .duoduo-tool-page .tool-header nav { justify-content: center; flex-wrap: wrap; gap: 0 24px; }
  .duoduo-tool-page .tool-header nav a { padding: 12px 0; }
  .duoduo-tool-page .tool-nav-current::after { bottom: 4px; }
}
@media (max-width: 767px) {
  .duoduo-tool-page .tool-header > .container { padding: 10px 16px 0; }
  .duoduo-tool-page .tool-header > .container > div { padding: 0; min-height: 0; }
  .duoduo-tool-page .tool-header > .container > div > a { width: 100%; justify-content: center; font-size: 17px; }
  .duoduo-tool-page .tool-header img { width: 38px; height: 38px; }
  .duoduo-tool-page .tool-header nav { gap: 0 18px; padding-top: 6px; }
  .duoduo-tool-page .tool-header nav a { padding: 10px 0; font-size: 12px; min-height: 40px; }
  .duoduo-tool-page #title { margin-top: 30px; padding: 0 18px; font-size: 28px; }
  .duoduo-tool-page main > p { margin-bottom: 20px; }
  .duoduo-tool-page #video-enhancer-tool,
  .duoduo-tool-page #video-enhancer-tool[data-local-video-preview="true"] { --local-workspace-width: calc(100vw - 32px); }
  .duoduo-tool-page #video-enhancer-tool #file-load-panel { width: calc(100% - 32px); padding: 55px 18px; min-height: 348px; border-radius: 16px; }
  .duoduo-tool-page #video-enhancer-tool #file-load-panel > p:first-of-type { font-size: 17px; }
  .duoduo-tool-page .tool-quick-steps { width: calc(100% - 40px); gap: 14px; padding: 20px 0 0; }
  .duoduo-tool-page .tool-quick-steps li { flex-direction: column; gap: 6px; }
  .duoduo-tool-page .tool-quick-steps p { font-size: 11px; }
  .duoduo-tool-page .tool-quick-steps strong { font-size: 12px; }
  .duoduo-tool-page #video-enhancer-tool #start-panel,
  .duoduo-tool-page #video-enhancer-tool[data-local-video-preview="true"] #start-panel { padding: 16px; border-radius: 16px; }
  .duoduo-tool-page #video-enhancer-tool #preview .output-box { padding: 4px 12px; }
  .duoduo-tool-page .tool-workspace-heading h2 { font-size: 18px; }
  .duoduo-tool-page .tool-workspace-heading a { font-size: 12px; }
  .duoduo-tool-page .share-section { padding-bottom: 26px; }
  .duoduo-tool-page :is(.faq-section, .steps-section) { padding: 30px 0; }
  .duoduo-tool-page :is(.faq-section, .steps-section, .model-guide) h2 { font-size: 23px; }
  .duoduo-tool-page .model-guide { margin-inline: 16px; padding-inline: 0; }
  .duoduo-tool-page .fixed-favorite { right: 10px; bottom: 18px; top: auto; transform: none; }
  .duoduo-tool-page .fixed-favorite button { width: 44px; height: 44px; padding: 10px; border-radius: 12px; }
  .duoduo-tool-page .fixed-favorite button span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .duoduo-tool-page *, .duoduo-tool-page *::before, .duoduo-tool-page *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
