@font-face {
    font-family: "MOMIKA MiSans";
    font-style: normal;
    font-weight: 400;
    src: url("./fonts/MiSans-Normal.ttf") format("truetype");
    font-display: swap;
}

:root {
    /* 工具页变量：与主页面的搜索栏和 Dock 使用同一套 Liquid Glass 质感。 */
    --accent: #0a84ff;
    --text: #111113;
    --muted: #6e6e73;
    --glass-control:
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.98) 0%, rgba(253, 252, 250, 0.98) 58%, #ffffff 100%),
        linear-gradient(180deg, #ffffff 0%, #fbfaf8 52%, #ffffff 100%);
    --glass-control-strong:
        radial-gradient(ellipse at 50% 50%, #ffffff 0%, rgba(253, 252, 250, 0.98) 58%, #ffffff 100%),
        linear-gradient(180deg, #ffffff 0%, #fcfbfa 52%, #ffffff 100%);
    --glass-highlight: inset 0 8px 18px rgba(219, 219, 219, 0.22), inset 0 -10px 18px rgba(255, 255, 255, 0.96), inset 10px 0 18px rgba(255, 255, 255, 0.72), inset -10px 0 18px rgba(255, 255, 255, 0.72);
    --recessed-edge: inset 0 0 0 2px rgba(224, 224, 224, 0.48), inset 0 2px 4px rgba(238, 238, 238, 0.78);
    --warm-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 42px rgba(232, 221, 211, 0.42);
    --warm-shadow-strong: 0 1px 0 rgba(255, 255, 255, 0.92), 0 22px 52px rgba(232, 221, 211, 0.46);
    --control-height: 46px;
    --control-radius: 999px;
    --font-main: "MOMIKA MiSans", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: var(--font-main) !important;
    font-weight: 400 !important;
    font-style: normal !important;
    font-synthesis: none;
}

html,
body {
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    margin: 0;
    overflow: hidden;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.page-scrollbar {
    position: fixed;
    top: 12px;
    right: 6px;
    bottom: 12px;
    z-index: 10;
    width: 4px;
    opacity: 0;
    pointer-events: none;
    transition: width 160ms ease, opacity 160ms ease;
}

.page-scrollbar.is-visible {
    opacity: 0.5;
    pointer-events: auto;
}

.page-scrollbar:hover,
.page-scrollbar.is-dragging {
    width: 8px;
    opacity: 0.9;
}

.page-scrollbar span {
    display: block;
    width: 100%;
    min-height: 34px;
    cursor: grab;
    background: rgba(17, 17, 19, 0.28);
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(18, 34, 62, 0.18);
}

body {
    color: var(--text);
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
}

button,
input,
select {
    font: inherit;
}

.native-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.native-file-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.file-picker-control {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: var(--control-height);
    padding: 6px 14px 6px 8px;
    overflow: hidden;
    background: var(--glass-control);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--control-radius);
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow);
    backdrop-filter: blur(24px) saturate(145%) brightness(1.04);
    transition: background 180ms ease, box-shadow 180ms ease;
}

.file-picker-control::before,
.select-button::before,
.number-control::before,
.check-field::before,
input[type="range"]::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    content: "";
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 34%, rgba(255, 255, 255, 0.36));
    border-radius: inherit;
    opacity: 0.84;
}

.file-picker-button {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 15px 0 12px;
    color: rgba(17, 17, 19, 0.78);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.82);
    border: 0;
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 10px 22px rgba(232, 221, 211, 0.34);
    transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.file-picker-button::before {
    display: block;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    content: "";
    background: currentColor;
    opacity: 0.72;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='M5 17v1.6A2.4 2.4 0 0 0 7.4 21h9.2A2.4 2.4 0 0 0 19 18.6V17'/%3E%3C/svg%3E") center / contain no-repeat;
}

.file-picker-button:hover,
.file-picker-button:focus-visible {
    color: rgba(10, 132, 255, 0.9);
    background: rgba(255, 255, 255, 0.96);
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.98),
        0 14px 28px rgba(232, 221, 211, 0.46);
    transform: translateY(-1px);
}

.file-picker-status {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    color: rgba(17, 17, 19, 0.56);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select {
    position: relative;
    width: 100%;
}

.select-button {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: var(--control-height);
    padding: 6px 8px 6px 16px;
    overflow: hidden;
    color: rgba(17, 17, 19, 0.86);
    cursor: pointer;
    background: var(--glass-control);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--control-radius);
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow);
    backdrop-filter: blur(24px) saturate(145%) brightness(1.04);
    transition: background 180ms ease, box-shadow 180ms ease, color 160ms ease;
}

.select-value {
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-caret {
    position: relative;
    z-index: 1;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 8px 18px rgba(232, 221, 211, 0.32);
    transition: background 160ms ease, box-shadow 160ms ease, transform 180ms ease;
}

.select-caret::before {
    display: block;
    width: 15px;
    height: 15px;
    content: "";
    background: rgba(17, 17, 19, 0.48);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.custom-select.is-open .select-caret {
    transform: rotate(180deg);
}

.select-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 40;
    display: grid;
    gap: 4px;
    max-height: 260px;
    overflow: auto;
    padding: 8px;
    opacity: 0;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.96);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 22px;
    box-shadow:
        var(--glass-highlight),
        0 28px 78px rgba(49, 45, 40, 0.18),
        0 10px 28px rgba(49, 45, 40, 0.1);
    backdrop-filter: blur(26px) saturate(150%) brightness(1.04);
    transform: translateY(-6px) scale(0.98);
    transform-origin: top;
    transition: opacity 160ms ease, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-select.is-open .select-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.select-option {
    min-height: 34px;
    padding: 0 10px;
    color: rgba(17, 17, 19, 0.82);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 12px;
    text-align: left;
    transition: background 150ms ease, color 150ms ease;
}

.select-option:hover,
.select-option:focus-visible,
.select-option.is-selected {
    color: rgba(10, 94, 180, 0.94);
    background: rgba(246, 244, 241, 0.92);
    outline: none;
}

/* tools-shell：所有转换工具的滚动容器。 */
.tools-shell {
    width: min(100%, 1080px);
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 clamp(24px, 4vw, 52px) 40px;
}

/* tool-tabs：顶部工具胶囊组，点击后切换下面的工具面板。 */
.tool-tabs {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0 18px;
    background: linear-gradient(180deg, rgba(251, 252, 255, 0.9), rgba(251, 252, 255, 0));
    backdrop-filter: blur(10px);
}

.tool-tab {
    min-height: 38px;
    padding: 0 15px;
    color: rgba(17, 17, 19, 0.68);
    cursor: pointer;
    background: var(--glass-control);
    border: 0;
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 14px 34px rgba(18, 34, 62, 0.14);
    backdrop-filter: blur(24px) saturate(190%);
    transition: color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.tool-tab:hover,
.tool-tab:focus-visible,
.tool-tab.is-active {
    color: rgba(0, 104, 208, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), 0 22px 54px rgba(18, 34, 62, 0.2);
    outline: none;
    transform: translateY(-2px);
}

/* tool-panel：单个转换功能的卡片，默认隐藏，选中后淡入。 */
.tool-panel {
    display: none;
    grid-template-columns: minmax(320px, 0.92fr) minmax(320px, 1fr);
    gap: 24px;
    align-items: start;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 28px;
    box-shadow: none;
    backdrop-filter: none;
}

.tool-panel.is-active {
    display: grid;
}

.panel-head {
    display: none;
    margin: 0;
}

.panel-head h1 {
    margin: 0;
    color: rgba(17, 17, 19, 0.92);
    font-size: 22px;
    line-height: 1.2;
}

.panel-head p,
.capability-note {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

/* field-grid：每个工具的参数网格，移动端自动单列。 */
.field-grid {
    display: grid;
    grid-column: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 30px;
    margin: 18px 0 0;
}

label {
    display: grid;
    gap: 8px;
    min-width: 0;
    color: rgba(17, 17, 19, 0.62);
    font-size: 13px;
    line-height: 1.25;
}

.file-field.is-wide,
.check-field {
    grid-column: 1 / -1;
}

.source-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: end;
}

.source-row.is-wide,
.source-table.is-wide {
    grid-column: 1 / -1;
}

.source-table {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 18px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.94),
        0 18px 46px rgba(18, 34, 62, 0.12);
}

.source-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.source-table th,
.source-table td {
    height: 40px;
    padding: 0 12px;
    overflow: hidden;
    color: rgba(17, 17, 19, 0.72);
    font-size: 12px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid rgba(17, 17, 19, 0.06);
}

.source-table th {
    color: rgba(17, 17, 19, 0.48);
    background: rgba(248, 249, 250, 0.62);
}

.source-table tr:last-child td {
    border-bottom: 0;
}

.source-table-empty td {
    color: rgba(17, 17, 19, 0.38);
    text-align: center;
}

.source-table-name {
    width: 42%;
}

.source-table-source {
    width: 22%;
}

.source-table-size {
    width: 18%;
}

.source-table-action {
    width: 72px;
}

.source-remove {
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    color: rgba(17, 17, 19, 0.48);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.82);
    border: 0;
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 8px 18px rgba(18, 34, 62, 0.08);
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.source-remove::before {
    width: 14px;
    height: 14px;
    content: "";
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.source-remove:hover,
.source-remove:focus-visible {
    color: rgba(188, 54, 45, 0.9);
    background: rgba(255, 255, 255, 0.96);
    outline: none;
    transform: translateY(-1px);
}

input,
select {
    width: 100%;
    min-height: var(--control-height);
    padding: 0 16px;
    color: var(--text);
    background: var(--glass-control);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--control-radius);
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow);
    outline: none;
    transition: box-shadow 180ms ease, background 180ms ease;
    backdrop-filter: blur(24px) saturate(145%) brightness(1.04);
}

input[type="file"]::file-selector-button {
    min-height: 30px;
    margin: 5px 10px 5px 0;
    padding: 0 14px;
    color: rgba(17, 17, 19, 0.82);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(18, 34, 62, 0.1);
    transition: box-shadow 160ms ease, transform 160ms ease;
}

input[type="file"]::file-selector-button:hover {
    box-shadow: 0 16px 34px rgba(18, 34, 62, 0.16);
    transform: translateY(-1px);
}

select {
    appearance: none;
    background:
        var(--glass-control),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23565b64' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 15px 15px no-repeat;
    padding-right: 36px;
}

input:not([type="range"]):not([type="checkbox"]):hover,
select:hover,
input:not([type="range"]):not([type="checkbox"]):focus,
select:focus,
.file-picker-control:focus-within,
.custom-select:hover .select-button,
.select-button:focus-visible,
.number-control:focus-within,
.number-control:hover,
.check-field:hover,
.check-field:focus-within {
    background: var(--glass-control-strong);
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow-strong);
}

input[type="range"],
input[type="color"],
input[type="checkbox"] {
    padding: 0;
    accent-color: var(--accent);
}

input[type="color"] {
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 8px;
    cursor: pointer;
    background: var(--glass-control);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--control-radius);
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow);
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 999px;
}

input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 999px;
    box-shadow:
        inset 0 0 0 2px rgba(224, 224, 224, 0.56),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

input[type="color"]::-moz-color-swatch {
    border: 0;
    border-radius: 999px;
    box-shadow:
        inset 0 0 0 2px rgba(224, 224, 224, 0.56),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.number-control {
    position: relative;
    min-height: var(--control-height);
    overflow: hidden;
    background: var(--glass-control);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--control-radius);
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow);
    backdrop-filter: blur(24px) saturate(145%) brightness(1.04);
    transition: background 180ms ease, box-shadow 180ms ease;
}

.number-control input {
    position: relative;
    z-index: 1;
    min-height: calc(var(--control-height) - 4px);
    padding: 0 50px 0 16px;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.number-control input:hover,
.number-control input:focus {
    background: transparent;
    box-shadow: none;
}

.number-stepper {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 2;
    display: grid;
    gap: 2px;
    width: 28px;
    transform: translateY(-50%);
}

.number-step {
    position: relative;
    display: grid;
    width: 28px;
    height: 16px;
    place-items: center;
    color: rgba(17, 17, 19, 0.58);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.72);
    border: 0;
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 5px 12px rgba(232, 221, 211, 0.28);
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.number-step::before {
    display: block;
    width: 12px;
    height: 12px;
    content: "";
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 14 5-5 5 5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.number-step-down::before {
    transform: rotate(180deg);
}

.number-step:hover,
.number-step:focus-visible {
    color: rgba(10, 132, 255, 0.88);
    background: rgba(255, 255, 255, 0.96);
    outline: none;
}

.number-step:active {
    transform: scale(0.92);
}

input[type="range"] {
    --range-progress: 0%;
    --range-fill: rgba(134, 143, 152, 0.5);
    --range-track: rgba(248, 249, 250, 0.82);
    --range-track-height: 12px;
    --range-thumb-size: 36px;
    --range-ticks: radial-gradient(circle, rgba(118, 124, 130, 0.42) 1.5px, rgba(118, 124, 130, 0) 1.9px) 18px calc(50% + 18px) / 58px 4px repeat-x;
    width: 100%;
    position: relative;
    height: 58px;
    cursor: pointer;
    appearance: none;
    background:
        var(--range-ticks),
        var(--glass-control);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 24px;
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow);
    outline: none;
    backdrop-filter: blur(24px) saturate(145%) brightness(1.04);
    transition: filter 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input[type="range"]:hover,
input[type="range"]:focus {
    background:
        var(--range-ticks),
        var(--glass-control-strong);
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow-strong);
    transform: none;
}

input[type="range"]:hover,
input[type="range"].is-range-dragging {
    --range-track-height: 14px;
    filter: saturate(1.04);
}

input[type="range"]::-webkit-slider-runnable-track {
    height: var(--range-track-height);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.12) 45%, rgba(63, 70, 77, 0.18)) 0 0 / var(--range-progress) 100% no-repeat,
        linear-gradient(90deg, rgba(102, 112, 122, 0.52), rgba(164, 171, 178, 0.38)) 0 0 / var(--range-progress) 100% no-repeat,
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 247, 248, 0.64) 48%, rgba(214, 219, 224, 0.44)),
        var(--range-track);
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    box-shadow:
        inset 0 4px 8px rgba(176, 181, 187, 0.22),
        inset 0 -5px 10px rgba(255, 255, 255, 0.88),
        inset 0 0 0 1px rgba(222, 225, 228, 0.54),
        0 10px 22px rgba(214, 207, 199, 0.24);
    transition: height 160ms ease, box-shadow 180ms ease, background 160ms ease;
}

input[type="range"]::-webkit-slider-thumb {
    width: var(--range-thumb-size);
    height: var(--range-thumb-size);
    margin-top: calc((var(--range-track-height) - var(--range-thumb-size)) / 2 - 2px);
    appearance: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 247, 248, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.86),
        inset 0 -9px 14px rgba(214, 219, 224, 0.28),
        0 10px 22px rgba(47, 52, 58, 0.16),
        0 2px 6px rgba(47, 52, 58, 0.08);
    transition: background 160ms ease, box-shadow 180ms ease, opacity 160ms ease, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

input[type="range"]:hover::-webkit-slider-runnable-track,
input[type="range"].is-range-dragging::-webkit-slider-runnable-track {
    box-shadow:
        inset 0 5px 11px rgba(158, 164, 171, 0.28),
        inset 0 -6px 11px rgba(255, 255, 255, 0.94),
        inset 0 0 0 1px rgba(214, 218, 222, 0.62),
        0 13px 28px rgba(205, 198, 190, 0.3);
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(250, 251, 252, 0.94));
    box-shadow:
        inset 0 2px 5px rgba(255, 255, 255, 0.9),
        inset 0 -10px 16px rgba(206, 212, 218, 0.32),
        0 14px 30px rgba(45, 50, 56, 0.2),
        0 4px 10px rgba(45, 50, 56, 0.1);
    transform: scale(1.1);
}

input[type="range"]:active::-webkit-slider-thumb,
input[type="range"].is-range-dragging::-webkit-slider-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(243, 245, 247, 0.94));
    box-shadow:
        inset 0 2px 6px rgba(255, 255, 255, 0.94),
        inset 0 -12px 18px rgba(197, 204, 211, 0.36),
        0 18px 36px rgba(43, 48, 54, 0.24),
        0 5px 12px rgba(43, 48, 54, 0.12);
    transform: scale(1.18);
}

input[type="range"]::-moz-range-track {
    height: var(--range-track-height);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 247, 248, 0.64) 48%, rgba(214, 219, 224, 0.44)),
        var(--range-track);
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    box-shadow:
        inset 0 4px 8px rgba(176, 181, 187, 0.22),
        inset 0 -5px 10px rgba(255, 255, 255, 0.88),
        inset 0 0 0 1px rgba(222, 225, 228, 0.54),
        0 10px 22px rgba(214, 207, 199, 0.24);
}

input[type="range"]::-moz-range-progress {
    height: var(--range-track-height);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.12) 45%, rgba(63, 70, 77, 0.18)),
        linear-gradient(90deg, rgba(102, 112, 122, 0.52), rgba(164, 171, 178, 0.38)),
        var(--range-fill);
    border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
    width: var(--range-thumb-size);
    height: var(--range-thumb-size);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 247, 248, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.86),
        inset 0 -9px 14px rgba(214, 219, 224, 0.28),
        0 10px 22px rgba(47, 52, 58, 0.16),
        0 2px 6px rgba(47, 52, 58, 0.08);
    transition: background 160ms ease, box-shadow 180ms ease, opacity 160ms ease, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.1);
}

input[type="range"]:active::-moz-range-thumb,
input[type="range"].is-range-dragging::-moz-range-thumb {
    transform: scale(1.18);
}

.check-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--control-height);
    padding: 0 14px;
    overflow: hidden;
    background: var(--glass-control);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--control-radius);
    box-shadow:
        var(--glass-highlight),
        var(--recessed-edge),
        var(--warm-shadow);
    backdrop-filter: blur(24px) saturate(145%) brightness(1.04);
    transition: background 180ms ease, box-shadow 180ms ease;
}

.pending-list {
    display: grid;
    gap: 8px;
}

.pending-list[hidden] {
    display: none;
}

.pending-list.is-wide {
    grid-column: 1 / -1;
}

.pending-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 14px;
    color: rgba(17, 17, 19, 0.82);
    cursor: pointer;
    background: var(--glass-control);
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    box-shadow:
        var(--glass-highlight),
        var(--warm-shadow);
}

.pending-item::before {
    width: 18px;
    height: 18px;
    content: "";
    background: currentColor;
    opacity: 0.5;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v5h5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pending-item span {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-item small {
    color: rgba(17, 17, 19, 0.44);
    font-size: 12px;
}

.check-field input {
    position: relative;
    z-index: 1;
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    appearance: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.72);
    border: 0;
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 2px rgba(224, 224, 224, 0.66),
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 8px 18px rgba(232, 221, 211, 0.28);
}

.check-field input:checked {
    background:
        var(--accent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 10 3 3 7-7'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 10px 22px rgba(10, 132, 255, 0.22);
}

.check-field > span {
    position: relative;
    z-index: 1;
    color: rgba(17, 17, 19, 0.72);
}

.primary-action,
.download-link {
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(145deg, rgba(75, 145, 207, 0.96), rgba(86, 158, 220, 0.9));
    border: 0;
    border-radius: 999px;
    box-shadow: 0 18px 46px rgba(54, 124, 190, 0.28);
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.primary-action {
    display: inline-flex;
    grid-column: 1;
    width: fit-content;
    min-width: 156px;
}

.download-link {
    display: none;
}

.primary-action:hover,
.primary-action:focus-visible,
.download-link:hover,
.download-link:focus-visible {
    outline: none;
    filter: brightness(1.04);
    box-shadow: 0 24px 58px rgba(54, 124, 190, 0.34);
    transform: translateY(-2px);
}

.primary-action:active,
.download-link:active {
    transform: scale(0.96);
}

.primary-action:disabled {
    color: rgba(17, 17, 19, 0.36);
    cursor: not-allowed;
    background: rgba(244, 245, 246, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 10px 24px rgba(18, 34, 62, 0.08);
    transform: none;
}

/* result-grid：转换结果、下载按钮和预览缩略图输出区。 */
.result-grid {
    display: grid;
    grid-column: 2;
    grid-row: 1 / span 3;
    gap: 12px;
    min-height: 430px;
    margin-top: 0;
    align-content: start;
}

.result-grid:empty::before {
    display: grid;
    min-height: 220px;
    place-items: center;
    color: rgba(17, 17, 19, 0.42);
    content: "转换后的文件会显示在这里";
    font-size: 13px;
}

.result-folder {
    display: grid;
    gap: 8px;
}

.result-folder-title {
    position: relative;
    margin: 0;
    padding-left: 26px;
    color: rgba(17, 17, 19, 0.74);
    font-size: 14px;
    line-height: 22px;
}

.result-folder-title::before {
    position: absolute;
    top: 2px;
    left: 0;
    width: 18px;
    height: 18px;
    content: "";
    background: currentColor;
    opacity: 0.72;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7.4A2.4 2.4 0 0 1 5.4 5h4.1l2 2.4h7.1A2.4 2.4 0 0 1 21 9.8v6.8a2.4 2.4 0 0 1-2.4 2.4H5.4A2.4 2.4 0 0 1 3 16.6Z'/%3E%3Cpath d='M3 9h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.result-folder-list {
    display: grid;
    gap: 8px;
}

.result-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 62px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 26px 62px rgba(18, 34, 62, 0.16),
        0 8px 22px rgba(18, 34, 62, 0.1);
    cursor: pointer;
    border: 0;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.result-card:hover,
.result-card:focus-visible {
    background:
        radial-gradient(circle at 12% 50%, rgba(255, 255, 255, 0.98), rgba(230, 242, 254, 0.86)),
        rgba(255, 255, 255, 0.92);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        inset 0 -18px 32px rgba(126, 152, 186, 0.1),
        0 30px 72px rgba(18, 34, 62, 0.24),
        0 10px 28px rgba(18, 34, 62, 0.15);
    outline: none;
    transform: translateY(-2px);
}

.result-card img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(18, 34, 62, 0.12);
}

.result-info {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.result-info strong,
.result-info span {
    overflow-wrap: anywhere;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-info strong {
    color: rgba(17, 17, 19, 0.88);
    font-size: 14px;
}

.result-info span {
    color: rgba(17, 17, 19, 0.74);
    font-size: 12px;
}

.result-file-icon {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    color: rgba(17, 17, 19, 0.42);
    font-size: 10px;
    background: rgba(255, 255, 255, 0.74);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 10px 24px rgba(18, 34, 62, 0.1);
}

.result-card.is-error {
    color: #b42318;
}

@media (max-width: 760px) {
    .tools-shell {
        padding: 0 16px 26px;
    }

    .field-grid,
    .source-row,
    .result-card {
        grid-template-columns: 1fr;
    }

    .tool-panel.is-active {
        display: grid;
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-column: 1;
        grid-row: auto;
        min-height: 220px;
    }

    .primary-action {
        width: 100%;
    }

    .tool-panel {
        padding: 0;
    }
}
