:root {
    color-scheme: light;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #252525;
    background: #f5f5f9;
    line-height: 1.55;
    --muted: #595961;
    --line: #e1e1e7;
    --accent: #e5322d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; }

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(32px, 8vw, 88px) 24px 64px;
}

header { text-align: center; margin-bottom: 30px; }
h1 { margin: 0; color: #33333b; font-size: 42px; line-height: 52px; font-weight: 600; }
.subtitle {
    max-width: 800px;
    margin: 8px auto 0;
    color: #47474f;
    font-size: 22px;
    line-height: 32px;
}
h2 { margin: 24px 0 8px; font-size: 16px; }

button {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--accent);
    background: white;
    cursor: pointer;
}

button:hover:not(:disabled) { background: #fff2f1; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.drop-zone {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 44px;
    border: 1px dashed transparent;
    border-radius: 12px;
}

.drop-zone[data-dragging] { background: #fff2f1; border-color: var(--accent); }
.drop-zone p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

#choose, .primary { background: var(--accent); color: white; border-color: transparent; }
#choose:hover:not(:disabled), .primary:hover:not(:disabled) { background: #bd060a; }
#choose { min-width: min(330px, 100%); min-height: 80px; padding: 18px 24px; font-size: 24px; line-height: 28px; font-weight: 600; border-radius: 12px; }
#start { display: block; width: min(330px, 100%); margin-inline: auto; padding-block: 12px; }
main:not(:has(#overview:not([hidden]))) #start { display: none; }
main:not(:has(#overview:not([hidden]))) #conversion { max-width: 760px; margin-inline: auto; }

.workspace { max-width: 760px; margin-inline: auto; }

main:has(#overview:not([hidden])) .drop-zone {
    max-width: none;
    margin: 0;
    padding: 14px;
    border-color: var(--line);
}

main:has(#overview:not([hidden])) .drop-zone[data-dragging] { border-color: var(--accent); }
main:has(#overview:not([hidden])) #choose { min-width: 0; min-height: 0; padding: 8px 16px; font-size: 15px; line-height: 22px; }

table {
    width: 100%;
    border-spacing: 0;
    font-size: 14px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}

th, td { padding: 10px; text-align: left; }
th { color: var(--muted); font-weight: 600; }
td { border-top: 1px solid var(--line); vertical-align: top; }
td:first-child { overflow-wrap: anywhere; width: 100%; }
td:not(:first-child), th:not(:first-child) { white-space: nowrap; }
td button { padding: 2px 6px; border-color: transparent; }
.source-note { display: block; margin-top: 3px; color: #795110; font-size: 13px; }

#conversion { min-width: 0; margin-top: 20px; }

.notice, #result {
    padding: 10px 12px;
    margin: 12px 0;
    border-radius: 8px;
    background: #fff4d9;
    color: #69470f;
    overflow-wrap: anywhere;
}

#result { background: #edf6ef; color: #245235; }
#result[data-error] { background: #fceaea; color: #8c2828; }

.progress-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
progress { display: block; width: 100%; height: 12px; margin: 9px 0 14px; accent-color: var(--accent); }

details { margin-top: 12px; }
summary { cursor: pointer; color: var(--accent); font-size: 14px; width: fit-content; }
.log-list {
    margin: 8px 0 0;
    max-height: 254px;
    overflow: auto;
    list-style: none;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}
.log-list li + li { margin-top: 4px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 500px) {
    main { padding-inline: 14px; }
    h1 { font-size: 26px; line-height: 36px; }
    .subtitle { font-size: 16px; line-height: 22px; }
    th, td { padding-inline: 5px; }
    table { font-size: 12px; }
    td button { font-size: 12px; }
}
