:root {
  color-scheme: light;
  --paper: #f6f5f0;
  --surface: #fffefa;
  --ink: #272f2b;
  --muted: #6d756e;
  --line: #dedfd5;
  --teal: #2d645b;
  --teal-hover: #214c45;
  --teal-soft: #eaf0e9;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }
button, input, select, progress, video, img, fieldset { max-width: 100%; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
svg { flex-shrink: 0; }
.page-width { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 10; min-height: 44px; padding: 10px 18px; border-radius: 8px; background: var(--teal); color: white; }
.skip-link:focus { top: 10px; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 84px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 650; letter-spacing: .035em; }
.brand-mark { display: grid; place-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--teal); color: var(--surface); font: 600 25px/1 Georgia, serif; letter-spacing: -.08em; padding-right: 3px; }
.brand-caption { display: none; font-weight: 400; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.site-header nav { display: flex; align-items: center; gap: 16px; }
.site-header nav a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: var(--muted); font-size: 12px; }
.site-header nav a:hover { color: var(--teal); }
.intro { display: flex; align-items: flex-start; flex-direction: column; gap: 20px; padding-block: 36px 28px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--muted); }
.eyebrow span { margin-inline: 7px; color: #a7aca3; }
h1 { margin-top: 9px; font-size: clamp(32px, 5vw, 46px); font-weight: 620; line-height: 1.25; letter-spacing: -.045em; }
.title-dot { color: var(--teal); margin-left: 4px; }
.intro-copy { margin-top: 13px; font-size: 14px; color: var(--muted); }
.local-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--teal); }
.privacy-note { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; margin-bottom: 22px; border: 1px solid #dbe3d9; border-radius: 11px; background: var(--teal-soft); color: #526450; font-size: 12px; line-height: 1.8; }
.privacy-note strong { font-weight: 650; color: #365245; }
.note-dot { flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--teal); margin-top: 8px; }

.workbench { display: grid; gap: 18px; scroll-margin-top: 20px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; box-shadow: 0 3px 8px rgb(32 48 36 / 2%); }
.source-panel { display: flex; flex-direction: column; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.step-number { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: var(--teal); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
h2 { font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: -.02em; }
.section-caption { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.drop-zone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 292px; padding: 28px 12px; border: 1px dashed #b6c4b7; border-radius: 12px; background: #f6f8f2; text-align: center; cursor: pointer; transition: background-color .15s, border-color .15s; }
.drop-zone:hover, .drop-zone.dragging, .drop-zone.dragover, .drop-zone.drag-over, .drop-zone.is-dragover { border-color: var(--teal); background: #edf3e9; }
.drop-zone:focus-within { outline: 3px solid var(--teal); outline-offset: 4px; }
#file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-illustration { display: grid; place-items: center; margin-bottom: 9px; color: #698374; }
.drop-title { font-size: 17px; font-weight: 550; letter-spacing: -.02em; }
.drop-description { font-size: 12px; color: var(--muted); }
.file-trigger { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 18px; margin-block: 14px 8px; padding: 8px 19px; background: var(--surface); border: 1px solid #c7d1c4; border-radius: 8px; color: var(--teal); font-size: 13px; font-weight: 600; box-shadow: 0 2px 2px rgb(32 48 36 / 3%); }
.drop-support { color: var(--muted); font-size: 11px; line-height: 1.9; }
.file-info { margin-block: 12px 16px; min-width: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
#video { display: block; width: 100%; max-height: 420px; border-radius: 10px; background: #202722; object-fit: contain; }
.source-footer { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 13px 22px; }
.source-footer p { flex: 1 1 150px; color: var(--muted); font-size: 12px; }
.source-footer .button { flex-shrink: 0; padding-inline: 0; }
.small-advice { margin-top: auto; padding: 16px 0 0; border-top: 1px solid var(--line); }
.advice-label { display: inline-block; margin-bottom: 6px; color: #6c7869; font-size: 11px; letter-spacing: .09em; }
.small-advice p { color: var(--muted); font-size: 12px; line-height: 1.9; }

fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.settings-help { margin-top: -5px; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
.label-unit { color: var(--muted); font-size: 11px; font-weight: 400; }
input[type="number"], select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 11px; border: 1px solid #cdd2c7; border-radius: 8px; background: #fffefa; color: var(--ink); font-size: 14px; line-height: 1.4; }
input[type="number"] { font-variant-numeric: tabular-nums; }
select { padding-right: 6px; cursor: pointer; text-overflow: ellipsis; }
input:disabled, select:disabled { background: #f5f5ef; border-color: #e0e1d8; color: #83887f; opacity: 1; -webkit-text-fill-color: #83887f; }
.field-help { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.85; overflow-wrap: anywhere; }
.settings-divider { height: 1px; margin-block: 21px; background: var(--line); }
.field-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; font-size: 13px; font-weight: 600; }
.field-unit { color: var(--muted); font-size: 11px; font-weight: 400; }
.time-grid, .options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 14px; }
.time-grid label { font-weight: 400; }
.time-button { min-height: 44px; padding: 6px 0; border: 0; background: none; color: var(--teal); font-size: 11px; text-align: left; }
.time-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.time-button:disabled { color: #8b9187; }
.clip-preview { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: -3px; }
#duration { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; min-width: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 550; line-height: 1.5; text-align: center; transition: background-color .15s, border-color .15s; cursor: pointer; }
.button-primary { background: var(--teal); border-color: var(--teal); color: #fffefa; }
.button-primary:hover:not(:disabled) { background: var(--teal-hover); border-color: var(--teal-hover); }
.button-primary:disabled { background: #dce3d9; border-color: #dce3d9; color: #737f70; }
.button-secondary { background: var(--surface); border-color: #cdd2c7; color: var(--teal); }
.button-secondary:hover:not(:disabled) { background: var(--teal-soft); }
.button-quiet { padding-inline: 8px; color: var(--teal); background: none; font-size: 11px; }
.button-quiet:hover:not(:disabled) { color: var(--teal-hover); background: #f3f6ef; }
.button-quiet:disabled { color: #8b9187; }
.convert-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
#convert { flex: 1 1 180px; min-height: 48px; justify-content: space-between; padding-inline: 18px; }
.generation-note { margin-top: 9px; text-align: center; color: var(--muted); font-size: 11px; }
.progress-area { padding-top: 20px; }
#progress { display: block; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 8px; accent-color: var(--teal); background: #e8ece3; }
#progress::-webkit-progress-bar { border-radius: 8px; background: #e8ece3; }
#progress::-webkit-progress-value { border-radius: 8px; background: var(--teal); }
#progress::-moz-progress-bar { border-radius: 8px; background: var(--teal); }
#status { margin-top: 10px; color: var(--teal); font-size: 12px; overflow-wrap: anywhere; }
.error-message { margin-top: 16px; padding: 12px 14px; border: 1px solid #e5c9ba; border-radius: 8px; background: #fff2eb; color: #884a34; font-size: 12px; overflow-wrap: anywhere; }

.result-panel { margin-top: 22px; }
.result-body { display: grid; align-items: center; gap: 24px; }
.result-preview { display: grid; place-items: center; min-width: 0; min-height: 240px; padding: 24px; border-radius: 10px; border: 1px solid #e5e6dc; background: #eff0e9; }
#result-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 480px; object-fit: contain; }
.result-details { min-width: 0; }
.result-info { margin-top: 8px; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.result-note { margin-top: 12px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 22px 14px; }

.guide { padding-block: 36px 42px; }
.guide-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 22px; }
.guide-heading h2 { font-size: 15px; }
.guide-heading > p { color: var(--muted); font-size: 11px; }
.guide-grid { display: grid; gap: 22px; }
.guide-grid article { min-width: 0; padding-left: 16px; border-left: 1px solid #cfd5c9; }
.guide-index { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.guide-grid h3 { margin-block: 7px; font-size: 13px; font-weight: 600; }
.guide-grid p { color: var(--muted); font-size: 12px; line-height: 1.9; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding-block: 21px 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.site-footer span { margin-inline: 5px; }

@media (min-width: 540px) {
  .page-width { width: min(1120px, calc(100% - 64px)); }
  .brand-caption { display: inline; }
  .site-header nav { gap: 24px; }
  .site-header nav a { font-size: 13px; }
  .panel { padding: 26px; }
  .intro { flex-direction: row; align-items: center; justify-content: space-between; padding-block: 44px 32px; }
  .intro-copy { font-size: 15px; }
  .local-badge { flex-shrink: 0; }
  .drop-zone { min-height: 320px; }
  .time-grid, .options-grid { column-gap: 16px; }
  .result-body { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 30px; }
}
@media (min-width: 860px) {
  .site-header { min-height: 90px; }
  .intro { padding-block: 48px 34px; }
  .workbench { grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
  .panel { padding: 28px; }
  .section-heading { margin-bottom: 24px; }
  .drop-zone { min-height: 360px; }
  .source-footer { padding-bottom: 30px; }
  .small-advice { padding-bottom: 4px; }
  .guide { padding-block: 42px 48px; }
  .guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Keep the default flow quiet; advanced controls are opt-in. */
.page-width { width: min(840px, calc(100% - 32px)); }
.workbench { grid-template-columns: minmax(0, 1fr); }
.drop-zone { min-height: 210px; }
.auto-summary { color: var(--teal); margin-bottom: 14px; font-size: 13px; overflow-wrap: anywhere; }
.result-note[data-warning="true"] { color: #884a34; padding: 12px; background: #fff2eb; border-radius: 8px; }
.advanced { border-block: 1px solid var(--line); }
.advanced > summary { min-height: 48px; padding: 12px 0; color: var(--ink); cursor: pointer; font-weight: 550; }
.advanced > summary span { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 10px; }
.advanced[open] > summary { margin-bottom: 20px; }
.advanced[open] { padding-bottom: 20px; }
.source-panel:has(video:not([hidden])) .drop-zone { min-height: 74px; padding: 12px; flex-direction: row; gap: 12px; }
.source-panel:has(video:not([hidden])) .drop-zone .upload-illustration,
.source-panel:has(video:not([hidden])) .drop-zone .drop-description,
.source-panel:has(video:not([hidden])) .drop-zone .drop-support { display: none; }
.source-panel:has(video:not([hidden])) .file-trigger { margin: 0; }
#ratio { width: 100%; min-height: 44px; margin: 0; accent-color: var(--teal); cursor: pointer; }
#ratio-value { display: block; color: var(--teal); font-size: 12px; font-variant-numeric: tabular-nums; }
#estimate-size { color: var(--ink); font-weight: 600; }
.ratio-field { grid-column: 1 / -1; }
#video { max-height: 320px; }
@media (max-width: 539px) { input[type="number"], select { font-size: 16px; } }
