:root {
  color-scheme: light;
  --page: #f4f7f6;
  --paper: #ffffff;
  --ink: #182623;
  --muted: #465b55;
  --subtle: #596d66;
  --line: #d0ddd8;
  --accent: #1c6b5b;
  --accent-soft: #dcefe9;
  --night: #203b34;
  --focus: #2568d8;
  font-family: "Avenir Next", "SF Pro Text", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--page); color: var(--ink); line-height: 1.55; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
code { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 10; padding: 8px 12px; background: var(--night); color: white; }
.skip-link:focus { top: 12px; }

.topbar { border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar-inner { max-width: 1220px; height: 76px; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 6px; font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 16px; font-weight: 800; letter-spacing: -.025em; white-space: nowrap; }
.brand span { color: var(--accent); }
.access-note { border: 1px solid var(--line); border-radius: 100px; padding: 5px 12px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }

.layout { max-width: 1220px; margin: auto; padding: 66px 32px 100px; }
.intro { max-width: 900px; margin-bottom: 62px; }
.intro h1 { margin: 0; font-size: clamp(42px, 5.5vw, 76px); letter-spacing: -.035em; line-height: 1.14; font-weight: 800; }
.intro h1 em { color: var(--accent); font-style: normal; }
.intro > p { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: 16px; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr); gap: 20px; align-items: stretch; }
.converter { padding: 32px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-heading h2, .process h2, .history h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.section-heading > span { color: var(--subtle); font-size: 12px; font-weight: 700; white-space: nowrap; }
.preview-note { margin: -8px 0 20px; padding: 11px 13px; border: 1px solid #dfd8bf; border-radius: 8px; background: #fbf8ea; color: #605331; font-size: 13px; }
.file-drop { min-height: 142px; border: 1.5px dashed #a9beb5; border-radius: 12px; display: flex; align-items: center; gap: 16px; padding: 24px; background: #f5f9f7; transition: border-color .18s, background-color .18s; cursor: pointer; }
.file-drop:hover, .file-drop.is-dragging { border-color: var(--accent); background: #edf8f3; }
.file-drop:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop-copy { min-width: 0; display: grid; gap: 4px; flex: 1; }
.file-drop-copy strong { font-size: 18px; overflow-wrap: anywhere; }
.file-drop-copy small { color: var(--subtle); font-size: 13px; }
.file-action { border: 1px solid var(--line); border-radius: 8px; padding: 9px 13px; background: var(--paper); font-size: 12px; font-weight: 700; white-space: nowrap; }
.name-field { display: grid; gap: 9px; margin-top: 24px; font-size: 13px; font-weight: 750; }
.name-field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 15px; }
.name-field input::placeholder { color: #767168; }
.name-field input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.consent { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; margin-top: 23px; color: var(--muted); font-size: 13px; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.form-feedback { min-height: 22px; margin: 20px 0 10px; color: var(--muted); font-size: 13px; }
.form-feedback.is-error { color: #a52d23; }
.submit { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; padding: 0 18px; border: 0; border-radius: 9px; background: var(--night); color: white; font-weight: 800; transition: background-color .18s; }
.submit:hover:not(:disabled) { background: var(--accent); }
.submit:disabled { opacity: .48; }

.process { padding: 32px; border-radius: 16px; background: var(--night); color: #f7fcf9; }
.process h2 { margin-bottom: 26px; }
.process ol { list-style: none; padding: 0; margin: 0; }
.process li { display: grid; grid-template-columns: 25px 1fr; gap: 12px; padding: 18px 0; border-top: 1px solid #51685f; }
.process li > span { color: #8bd1b4; font-family: "SFMono-Regular", Menlo, monospace; font-size: 13px; }
.process strong { font-size: 15px; }
.process li p, .process-footnote { margin: 6px 0 0; color: #d4e2dc; font-size: 13px; }
.process-footnote { border-top: 1px solid #51685f; padding-top: 20px; margin-top: 10px; }

.history { margin-top: 80px; }
.history-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.history-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.refresh, .download { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 9px 14px; color: var(--ink); font-size: 12px; font-weight: 750; white-space: nowrap; }
.refresh:hover, .download:hover { border-color: var(--accent); color: var(--accent); }
.history-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.empty { margin: 0; padding: 34px; color: var(--subtle); font-size: 14px; }
.history-item { display: grid; grid-template-columns: minmax(180px, 1fr) 120px minmax(130px, .8fr) auto; gap: 18px; align-items: center; padding: 20px 24px; border-top: 1px solid var(--line); }
.history-item:first-child { border-top: 0; }
.history-name { min-width: 0; }
.history-name strong, .history-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-name strong { font-size: 14px; }
.history-name small, .history-meta { color: var(--subtle); font-size: 12px; }
.history-state { width: max-content; padding: 4px 9px; border-radius: 100px; background: #eee8df; color: var(--muted); font-size: 11px; font-weight: 800; }
.history-state.is-succeeded { background: #e2f3e8; color: #176c3b; }
.history-state.is-failed { background: #fbe7e2; color: #a52d23; }
.history-meta { min-width: 0; overflow-wrap: anywhere; }
footer { max-width: 1220px; margin: 0 auto; padding: 24px 32px 36px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--subtle); font-size: 12px; }

@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; }
  .process { display: block; }
  .history-item { grid-template-columns: minmax(160px, 1fr) 110px auto; }
  .history-meta { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .topbar-inner { height: 64px; padding: 0 18px; }
  .layout { padding: 45px 18px 70px; }
  .intro { margin-bottom: 38px; }
  .intro h1 { font-size: clamp(39px, 10vw, 54px); }
  .intro > p { font-size: 14px; }
  .converter, .process { padding: 22px; }
  .section-heading h2, .process h2, .history h2 { font-size: 21px; }
  .file-drop { padding: 18px; flex-wrap: wrap; }
  .file-action { margin-left: auto; }
  .history { margin-top: 60px; }
  .history-heading { align-items: start; }
  .history-item { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 17px; }
  .history-name { grid-column: 1; }
  .history-state { grid-column: 2; grid-row: 1; }
  .history-meta { grid-column: 1 / -1; grid-row: 2; }
  .download { grid-column: 1 / -1; grid-row: 3; text-align: center; }
  footer { padding: 24px 18px 34px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; } }
