:root {
  color-scheme: light;
  --paper: #f8f4ef;
  --card: rgba(255,255,255,.88);
  --ink: #2f2926;
  --muted: #786e68;
  --line: #e9dfd7;
  --wine: #783e4a;
  --wine-dark: #5b2d37;
  --rose: #ead5d6;
  --green: #607a69;
  --shadow: 0 20px 60px rgba(78,54,43,.10);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(211,176,178,.33), transparent 28rem),
    linear-gradient(180deg, #fbf8f4 0%, var(--paper) 100%);
}
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell { width: min(100% - 32px, 640px); margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 0 max(50px, env(safe-area-inset-bottom)); }
.brand { display: flex; align-items: center; gap: 12px; margin: 4px 2px 28px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: white; background: var(--wine); font-family: Georgia, serif; font-size: 24px; box-shadow: 0 8px 25px rgba(120,62,74,.24); }
.brand h1 { margin: -2px 0 0; font: 500 24px/1.1 Georgia, "Songti SC", serif; letter-spacing: -.02em; }
.eyebrow, .kicker { margin: 0; color: var(--wine); font-size: 11px; line-height: 1.4; font-weight: 750; letter-spacing: .15em; }
.brand .eyebrow { font-size: 9px; }
.brand .text-button { margin-left: auto; }
.card { padding: 26px 22px; border: 1px solid rgba(255,255,255,.9); border-radius: 26px; background: var(--card); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.card h2 { margin: 8px 0 10px; font: 500 clamp(27px, 7vw, 36px)/1.15 Georgia, "Songti SC", serif; letter-spacing: -.035em; }
.intro, .status-detail { color: var(--muted); line-height: 1.65; }
.status-detail { white-space: pre-line; }
.stack { display: grid; gap: 16px; margin-top: 24px; }
label { color: var(--muted); font-size: 13px; font-weight: 650; }
input, textarea { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: rgba(255,255,255,.92); outline: none; transition: border-color .2s, box-shadow .2s; }
input { height: 50px; padding: 0 14px; }
textarea { resize: vertical; min-height: 92px; padding: 13px 14px; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(120,62,74,.1); }
.file-picker { min-height: 110px; margin: 22px 0 18px; padding: 20px; border: 1.5px dashed #d6c0bd; border-radius: 20px; display: flex; align-items: center; gap: 16px; background: #fffaf7; cursor: pointer; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-picker strong, .file-picker small { display: block; color: var(--ink); }
.file-picker strong { font-size: 17px; }
.file-picker small { margin-top: 4px; color: var(--muted); font-weight: 450; }
.picker-plus { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; color: var(--wine); background: var(--rose); font-size: 26px; font-weight: 400; }
.thought-label { display: block; margin-top: 6px; color: var(--ink); }
.thought-label span { color: var(--muted); font-weight: 450; }
.primary, .secondary { width: 100%; min-height: 52px; border-radius: 16px; border: 0; font-weight: 730; cursor: pointer; }
.primary { margin-top: 18px; color: white; background: var(--wine); box-shadow: 0 10px 24px rgba(120,62,74,.2); }
.primary:hover { background: var(--wine-dark); }
.primary:disabled { opacity: .42; box-shadow: none; cursor: default; }
.secondary { margin-top: 10px; color: var(--wine); border: 1px solid #d9c4c3; background: transparent; }
.text-button { padding: 8px; border: 0; color: var(--wine); background: transparent; cursor: pointer; font-weight: 650; }
.file-list { display: grid; gap: 10px; }
.file-row { padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.8); }
.file-head, .progress-meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.file-size, .file-state { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.progress-track { height: 6px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #eee5df; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--wine); transition: width .25s ease; }
.file-retry { margin-top: 8px; padding: 5px 0; border: 0; color: var(--wine); background: transparent; font-size: 12px; font-weight: 700; }
.progress-card { text-align: center; }
.status-orb { width: 72px; height: 72px; margin: 2px auto 18px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg,#eedbda,#e1c0c4); }
.status-orb span { width: 22px; height: 22px; border: 3px solid rgba(120,62,74,.25); border-top-color: var(--wine); border-radius: 50%; animation: spin 1s linear infinite; }
.status-orb.complete { background: #dce8df; }
.status-orb.complete span { border: 0; animation: none; }
.status-orb.complete span::after { content: "✓"; color: var(--green); font-size: 28px; font-weight: 800; }
.overall { margin: 22px 0 14px; text-align: left; }
.progress-meta { margin-top: 7px; color: var(--muted); font-size: 12px; }
.compact { text-align: left; }
.final-card { text-align: center; }
.video-frame { margin: 20px auto 6px; overflow: hidden; border-radius: 20px; background: #1c1918; aspect-ratio: 9/16; max-height: 62vh; }
.video-frame video { width: 100%; height: 100%; object-fit: contain; }
.history { margin-top: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin: 0; font: 500 22px/1.2 Georgia, "Songti SC", serif; }
.history-list { display: grid; gap: 10px; margin-top: 12px; }
.history-item { width: 100%; padding: 15px 16px; border: 1px solid var(--line); border-radius: 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; color: var(--ink); background: rgba(255,255,255,.65); cursor: pointer; }
.history-item strong, .history-item small { display: block; }
.history-item small { margin-top: 4px; color: var(--muted); }
.status-chip { flex: 0 0 auto; padding: 6px 9px; border-radius: 99px; color: var(--wine); background: var(--rose); font-size: 11px; font-weight: 700; }
.error { min-height: 1em; margin: 10px 0 0; color: #a03d3d; font-size: 13px; line-height: 1.5; }
.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 700px) {
  .shell { padding-top: 42px; }
  .card { padding: 34px; }
  .video-frame { max-width: 340px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; } }
