:root {
  color-scheme: light;
  --paper: #ffffff;
  --ceramic: #f5f5f7;
  --ink: #1d1d1f;
  --secondary: #6e6e73;
  --line: rgba(0,0,0,.08);
  --blue: #0071e3;
  --ease: cubic-bezier(.2,.7,.25,1);
  --quick: 140ms;
  --slide: 220ms;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box }
body,h1,h2,p,dl,dd { margin: 0 }
[hidden] { display: none !important }
a { color: inherit; text-decoration: none }
button,select,input { color: inherit; font: inherit }
button,select,summary,input[type=range] { cursor: pointer }
button { border: 0 }
button:disabled { cursor: default }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px }
.shell { width: min(1040px, calc(100% - 80px)); margin: auto }
header,footer,.section-head,.result-head,.activity-line,.quality-line { display: flex; align-items: center; justify-content: space-between; gap: 16px }
header { height: 62px; border-bottom: 1px solid var(--line) }
header a, footer a { display: inline-flex; align-items: center; min-height: 44px }
.back { font-size: 15px; font-weight: 500 }
.signature { font-size: 17px; font-weight: 600; letter-spacing: -.035em }
.intro { padding: clamp(44px,6vw,84px) 0 40px }
h1,h2,.drop h2,dd { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif }
h1 { font-size: clamp(48px,5.8vw,76px); line-height: 1.1; letter-spacing: -.055em; font-weight: 650 }
.intro p { margin-top: 14px; color: var(--secondary); font-size: clamp(16px,1.5vw,20px) }
.bench { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(284px,1fr); gap: clamp(32px,5vw,64px); align-items: stretch }
.input-side,fieldset,#settings { min-width: 0 }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 380px; padding: 36px 24px 42px; text-align: center;
  border-radius: 26px; background: var(--ceramic); overflow: hidden;
  transition: background-color var(--quick), box-shadow var(--quick);
}
.drop.drag { background: #eef5fc; box-shadow: inset 0 0 0 2px var(--blue) }
.folio { display: block; width: min(226px,80%); margin: 0 auto 14px; overflow: visible; pointer-events: none }
.folio > g { transform-box: view-box; transform-origin: 50% 70%; transition: transform var(--slide) var(--ease) }
.sheet-back { transform: translate(-8px,-5px) rotate(-14deg) }
.sheet-mid { transform: translate(4px,-5px) rotate(8deg) }
.sheet-face { transform: rotate(-4deg); filter: drop-shadow(0 2px 2px rgba(20,25,30,.12)) }
.drag .folio > g,.has-file .folio > g { transform: rotate(0deg) }
.folio .file-face { display: none }
.has-file .file-face { display: initial }
#file-ext { font: 600 23px -apple-system,BlinkMacSystemFont,sans-serif; fill: #58646b }
.folio .sound,.drop:not([data-media=video]) .film { display: none }
.drop[data-media=audio] .sound { display: initial }
.drop h2 { max-width: 100%; font-size: clamp(23px,2.5vw,31px); line-height: 1.3; letter-spacing: -.035em; overflow-wrap: anywhere }
.has-file #filename { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.formats,#fileinfo { margin-top: 8px; color: var(--secondary); font-size: 14px; font-variant-numeric: tabular-nums }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 24px; border-radius: 999px; font-size: 16px; font-weight: 500; transition: background-color var(--quick),transform var(--quick) var(--ease) }
.primary { color: #fff; background: var(--blue) }
.button:active:not(:disabled) { transform: scale(.975) }
#pick { margin-top: 24px }
.has-file #pick { background: #fff; color: var(--blue) }
#settings { align-self: center }
.section-head { margin-bottom: 16px }
h2 { font-size: 23px; font-weight: 600; letter-spacing: -.025em; line-height: 1.3 }
.notation,#elapsed,#reading { font-size: 14px; color: var(--secondary); font-variant-numeric: tabular-nums }
fieldset { margin: 0; padding: 0; border: 0 }
.types,.seg { position: relative; isolation: isolate; display: flex; padding: 3px; background: var(--ceramic); border-radius: 13px }
.types { margin-bottom: 10px }
.types::before,.seg::before { content: ""; position: absolute; inset: 3px auto 3px 3px; z-index: -1; background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.14); transition: transform var(--slide) var(--ease) }
.types::before { width: calc((100% - 6px)/3) }
.types:has([data-kind=audio][aria-pressed=true])::before { transform: translateX(100%) }
.types:has([data-kind=image][aria-pressed=true])::before { transform: translateX(200%) }
.seg::before { width: calc((100% - 6px) / var(--count, 2)); transform: translateX(calc(var(--index, 0) * 100%)) }
.types button,.seg button { flex: 1; min-width: 0; min-height: 40px; padding: 0 6px; background: transparent; border-radius: 10px; font-size: 15px; color: var(--secondary); font-weight: 500; white-space: nowrap; transition: color var(--quick) }
.seg.compact button { font-size: 13.5px; padding: 0 3px; font-variant-numeric: tabular-nums }
.types button[aria-pressed=true],.seg button[aria-checked=true] { color: var(--ink) }
.seg button:disabled { opacity: .45 }
label,.field-label { display: block; margin: 14px 0 5px; font-size: 14px; font-weight: 500 }
select,input[type=number] { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid #d2d2d7; border-radius: 10px; background: var(--paper); font-size: 16px }
select { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%236e6e73' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 15px center }
.quality-line { align-items: baseline }
.quality-line output { font-size: 14px; color: var(--secondary); font-variant-numeric: tabular-nums }
input[type=range] { width: 100%; height: 34px; margin: 0; accent-color: var(--blue) }
#start { width: 100%; margin-top: 24px }
body:has(#result:not([hidden])) #start:not(:disabled) { background: var(--ceramic); color: var(--blue) }
#start:disabled { background: #e8e8ed; color: #68686e }
#alert { padding: 14px 18px; margin-top: 24px; color: #854421; background: #fff5ee; border-radius: 12px }
#activity,#result { margin-top: 32px; padding: 24px 28px; background: var(--ceramic); border-radius: 22px }
.activity-line { flex-wrap: wrap; gap: 4px 14px }
.activity-line h2 { font-size: 18px; margin-right: auto }
#cancel { min-height: 44px; background: transparent; color: var(--blue); font-size: 15px }
.reading { display: grid; gap: 6px; margin-top: 8px }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden; appearance: none; background: #dedee3; accent-color: var(--blue) }
progress::-webkit-progress-bar { background: #dedee3 }
progress::-webkit-progress-value { border-radius: 3px; background: var(--blue); transition: width var(--slide) linear }
progress::-moz-progress-bar { background: var(--blue) }
progress:indeterminate { appearance: auto }
#result .section-head { margin-bottom: 24px }
#sizes { display: flex; gap: clamp(22px,5vw,68px); flex-wrap: wrap }
dt { color: var(--secondary); font-size: 14px }
dd { font-size: clamp(24px,3vw,38px); line-height: 1.25; letter-spacing: -.045em; font-variant-numeric: tabular-nums }
#after-size { font-weight: 600 }
#saving { margin-top: 12px; color: var(--secondary); font-size: 15px }
#download { flex: none }
#preview { margin-top: 20px; display: grid; place-items: center; border-radius: 12px; overflow: hidden }
#preview img,#preview video { display: block; max-width: 100%; max-height: 52vh; border-radius: 12px }
#preview audio { width: 100% }
details { border-bottom: 1px solid var(--line); margin-top: 12px }
summary { padding: 13px 0; font-size: 14px; color: var(--secondary) }
pre { max-height: 220px; overflow: auto; padding: 16px; background: var(--ceramic); border-radius: 10px; font: 13px/1.6 ui-monospace,monospace; white-space: pre-wrap; overflow-wrap: anywhere }
footer { margin: 48px 0 12px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--secondary); font-size: 13px }
@media (hover:hover) {
  .primary:hover:not(:disabled) { background: #0068d1 }
  .has-file #pick:hover { background: #e9edf2 }
  header a:hover,footer a:hover,#cancel:hover { text-decoration: underline; text-underline-offset: 3px }
}
@media (max-width:740px) {
  .shell { width: calc(100% - 40px); max-width: 540px }
  header { height: 52px }
  .intro { padding: 34px 0 24px }
  .intro p { margin-top: 10px }
  .bench { grid-template-columns: minmax(0,1fr); gap: 28px }
  .drop { min-height: 245px; padding: 16px 18px 22px; border-radius: 20px }
  .folio { width: 146px; margin-bottom: 6px }
  #pick { margin-top: 16px }
  .types button,.seg button { min-height: 44px }
  #activity,#result { padding: 18px; margin-top: 24px }
  .result-head { align-items: flex-start; flex-direction: column }
  footer { margin-top: 32px }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition-duration: 0s !important; animation: none !important }
  .button:active:not(:disabled) { transform: none }
}
