:root {
    --ink: #172033;
    --muted: #667085;
    --line: #e3e7ef;
    --soft: #f7f8fc;
    --primary: #5b5ce2;
    --primary-dark: #4849c7;
    --primary-soft: #efefff;
    --success: #16865c;
    --danger: #d14343;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: #fafbfe;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, select, input { font: inherit; }
button, .drop-zone { cursor: pointer; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.converter-page { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 54px; }

.hero { text-align: center; max-width: 760px; margin: 0 auto 32px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 13px; color: var(--primary); font-size: 14px; font-weight: 700; letter-spacing: .03em; }
.eyebrow svg { width: 18px; height: 18px; }
.hero h1 { margin: 0; color: #151b2c; font-size: clamp(34px, 5vw, 52px); line-height: 1.14; letter-spacing: -.045em; font-weight: 750; }
.hero p { max-width: 650px; margin: 18px auto 16px; color: #596274; font-size: 16px; line-height: 1.75; }
.format-row { display: flex; justify-content: center; align-items: center; gap: 12px; color: #7b8395; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.format-row i { width: 3px; height: 3px; border-radius: 50%; background: #c8cdd8; }

.workspace { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 55px rgba(35, 45, 80, .08); }
.settings-bar { display: grid; grid-template-columns: 180px minmax(260px, 1fr) 250px; align-items: center; gap: 32px; padding: 22px 28px; border-bottom: 1px solid var(--line); background: #fff; }
.field-group > label, .quality-label label { display: block; margin-bottom: 8px; font-size: 12px; color: #6b7280; font-weight: 650; }
.select-wrap { position: relative; }
.select-wrap select { width: 100%; height: 42px; padding: 0 40px 0 14px; appearance: none; color: #252b3a; background: #fff; border: 1px solid #d7dce6; border-radius: 9px; outline: none; font-weight: 650; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.select-wrap select:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,92,226,.14); }
.select-wrap svg { position: absolute; right: 12px; top: 11px; width: 18px; pointer-events: none; color: #7e8797; }
.quality-label { display: flex; justify-content: space-between; align-items: center; }
.quality-label output { color: var(--primary); font-size: 13px; font-weight: 750; }
.quality-group input { width: 100%; height: 4px; margin: 8px 0 5px; accent-color: var(--primary); cursor: pointer; }
.range-hints { display: flex; justify-content: space-between; color: #9aa1af; font-size: 10px; }
.privacy-note { display: flex; align-items: center; gap: 11px; color: #788091; font-size: 12px; line-height: 1.5; }
.privacy-note svg { flex: 0 0 auto; color: var(--success); width: 25px; height: 25px; }
.privacy-note strong { display: block; color: #384152; font-size: 13px; }

.drop-zone { margin: 28px; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px; text-align: center; border: 1.5px dashed #c8cedd; border-radius: 14px; background: #fbfbfe; outline: none; transition: border-color .2s, background-color .2s, box-shadow .2s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: #f8f8ff; }
.drop-zone:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91,92,226,.14); }
.upload-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 16px; color: var(--primary); border-radius: 16px; background: var(--primary-soft); }
.upload-icon svg { width: 27px; height: 27px; }
.drop-zone h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.01em; }
.drop-zone p { margin: 0 0 15px; color: #8a92a2; font-size: 14px; }
.drop-zone p span { color: var(--primary); font-weight: 700; }
.drop-zone small { color: #9aa1af; font-size: 11px; }

.queue { padding: 26px 28px 28px; }
.queue-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.queue-head > div { display: flex; align-items: baseline; gap: 9px; }
.queue-head h2 { margin: 0; font-size: 16px; }
.queue-head span { color: #939baa; font-size: 12px; }
.text-button { padding: 7px 0; color: #7a8291; border: 0; background: transparent; font-size: 12px; transition: color .2s; }
.text-button:hover { color: var(--danger); }
.text-button:focus-visible, .icon-button:focus-visible, .secondary-button:focus-visible, .primary-button:focus-visible { outline: 3px solid rgba(91,92,226,.22); outline-offset: 2px; }
.file-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.file-item { min-height: 74px; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto 36px 36px; align-items: center; gap: 13px; padding: 10px 12px; border: 1px solid #e6e9f0; border-radius: 11px; background: #fff; }
.thumb-wrap { position: relative; width: 54px; height: 54px; }
.thumb { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 8px; background: #eef0f5; }
.format-badge { position: absolute; right: -4px; bottom: -4px; padding: 2px 4px; color: #fff; background: #596174; border: 2px solid #fff; border-radius: 5px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.file-meta { min-width: 0; }
.file-name { display: block; overflow: hidden; color: #303747; font-size: 13px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.file-detail, .result-meta { color: #969dab; font-size: 10px; }
.status-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: #8a92a1; font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #c4c9d3; }
.file-item.processing .status-dot { background: var(--primary); animation: pulse 1s infinite; }
.file-item.done .status-dot { background: var(--success); }
.file-item.done .status-text { color: var(--success); }
.file-item.error .status-dot { background: var(--danger); }
.file-item.error .status-text { color: var(--danger); }
.result-meta { min-width: 90px; text-align: right; }
.result-meta span { display: block; }
.saving { margin-top: 3px; color: var(--success); font-weight: 650; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: #7d8595; border: 0; border-radius: 8px; background: transparent; transition: color .2s, background-color .2s; }
.icon-button:hover { color: var(--primary); background: var(--primary-soft); }
.remove-button:hover { color: var(--danger); background: #fff1f1; }
.icon-button svg { width: 17px; height: 17px; }
.queue-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.secondary-button, .primary-button { height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 9px; font-size: 13px; font-weight: 700; transition: background-color .2s, border-color .2s, opacity .2s; }
.secondary-button { color: #596173; border: 1px solid #d9dee8; background: #fff; }
.secondary-button:hover { border-color: #bfc5d1; background: #fafbfc; }
.primary-button { min-width: 150px; color: #fff; border: 1px solid var(--primary); background: var(--primary); }
.primary-button:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .55; }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }

.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; padding: 30px 34px 0; }
.feature-strip > div { display: flex; align-items: flex-start; gap: 11px; color: #858d9c; font-size: 11px; line-height: 1.55; }
.feature-strip svg { flex: 0 0 auto; width: 21px; height: 21px; color: #7678dd; }
.feature-strip strong { display: block; margin-bottom: 1px; color: #424a5b; font-size: 12px; }
.browser-note { min-height: 18px; margin: 15px 0 0; text-align: center; color: #8a92a1; font-size: 11px; }
.guide-section { margin-top: 36px; padding: 34px 36px 36px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.guide-intro { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); align-items: center; gap: 46px; }
.guide-kicker { display: block; margin-bottom: 8px; color: var(--primary); font-size: 11px; font-weight: 750; letter-spacing: .12em; }
.guide-heading h2 { margin: 0; color: #202738; font-size: 24px; line-height: 1.35; letter-spacing: -.025em; }
.guide-heading > p { margin: 9px 0 0; color: #6a7383; font-size: 13px; line-height: 1.75; }
.guide-heading > p strong { color: #4d55c7; font-weight: 700; }
.guide-figure { overflow: hidden; margin: 0; background: #f3f4fb; border: 1px solid #e5e8f1; border-radius: 12px; }
.guide-figure img { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.guide-figure figcaption { padding: 8px 12px; color: #858d9d; background: #fafbfe; border-top: 1px solid #e8ebf2; font-size: 10px; line-height: 1.5; }
.guide-content { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 54px; margin-top: 30px; }
.guide-content h3 { margin: 0 0 18px; color: #343c4d; font-size: 14px; }
.guide-steps ol { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.guide-steps li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 13px; }
.step-number { width: 34px; height: 34px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 9px; font-size: 10px; font-weight: 800; }
.guide-steps strong { display: block; margin: 1px 0 4px; color: #3f4758; font-size: 13px; }
.guide-steps p, .format-guide dd, .guide-tip p { margin: 0; color: #7a8392; font-size: 11px; line-height: 1.7; }
.format-guide dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.format-guide dl > div { min-height: 92px; padding: 13px 14px; background: #f8f9fc; border: 1px solid #eceef3; border-radius: 10px; }
.format-guide dt { margin-bottom: 5px; color: #4d55c7; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.format-guide dd { margin: 0; }
.guide-tip { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; padding: 10px 12px; color: #7779d7; background: #f8f8ff; border-radius: 9px; }
.guide-tip svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }
.tool-footer { position: relative; overflow: hidden; color: #cbd5e1; background-color: #0f172a; background-image: radial-gradient(circle at 16% -25%, rgba(14, 165, 233, 0.16), transparent 42%), radial-gradient(circle at 92% 120%, rgba(34, 197, 94, 0.08), transparent 32%), linear-gradient(180deg, #0f172a 0%, #111827 100%); border-top: 1px solid rgba(56, 189, 248, 0.22); }
.tool-footer::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #38bdf8 25%, #22c55e 58%, transparent 88%); opacity: .8; }
.tool-footer-main, .tool-footer-bottom { width: min(100% - 2rem, 64rem); margin: 0 auto; box-sizing: border-box; }
.tool-footer-main { display: flex; align-items: center; justify-content: space-between; gap: 3rem; padding: 2.25rem 0 2rem; }
.tool-footer-brand { min-width: 0; }
.tool-footer-logo { display: inline-flex; align-items: center; gap: .75rem; color: #fff; font-size: 1.125rem; font-weight: 650; letter-spacing: .01em; }
.tool-footer-logo:hover { color: #fff; }
.tool-footer-logo-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; color: #7c3aed; background: #fff; border-radius: .625rem; box-shadow: 0 8px 24px rgba(15, 23, 42, .25); }
.tool-footer-logo-icon svg { width: 22px; height: 22px; }
.tool-footer-brand p { max-width: 28rem; margin: .75rem 0 0; color: #94a3b8; font-size: .875rem; line-height: 1.7; }
.tool-footer-links { display: flex; align-items: center; gap: .625rem; flex: 0 0 auto; }
.tool-footer-links a { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; min-height: 2.625rem; padding: 0 .875rem; color: #e2e8f0; font-size: .8125rem; font-weight: 500; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: .625rem; transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease; }
.tool-footer-links a:hover { color: #fff; background: rgba(129, 140, 248, .18); border-color: rgba(165, 180, 252, .42); transform: translateY(-1px); }
.tool-footer-links svg { width: 16px; height: 16px; }
.tool-footer-bottom { display: flex; align-items: center; gap: .75rem; min-height: 3.5rem; color: #64748b; font-size: .75rem; border-top: 1px solid rgba(148, 163, 184, .13); }
.tool-footer-divider { width: 1px; height: .75rem; background: rgba(148, 163, 184, .25); }
.tool-footer-status { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; color: #94a3b8; }
.tool-footer-status i { width: .4rem; height: .4rem; background: #34d399; border-radius: 50%; box-shadow: 0 0 0 3px rgba(52, 211, 153, .12); }
.tool-footer a:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 4px; border-radius: 2px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: min(420px, calc(100% - 32px)); padding: 11px 16px; color: #fff; background: #252b3a; border-radius: 9px; box-shadow: 0 10px 28px rgba(0,0,0,.18); font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 780px) {
    .converter-page { width: min(100% - 24px, 680px); padding-top: 35px; }
    .hero { margin-bottom: 25px; }
    .hero h1 br { display: none; }
    .settings-bar { grid-template-columns: 1fr 1.6fr; gap: 22px; padding: 20px; }
    .privacy-note { grid-column: 1 / -1; padding-top: 2px; }
    .drop-zone { margin: 20px; min-height: 260px; }
    .queue { padding: 22px 20px; }
    .feature-strip { gap: 18px; padding-inline: 10px; }
    .guide-section { padding: 30px; }
    .guide-intro { grid-template-columns: 1fr; gap: 24px; }
    .guide-content { grid-template-columns: 1fr; gap: 32px; }
    .tool-footer-main { align-items: flex-start; flex-direction: column; gap: 1.5rem; padding: 2rem 0 1.75rem; }
    .tool-footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
    .tool-footer-links a { padding: 0 .5rem; }
    .tool-footer-bottom { flex-wrap: wrap; gap: .35rem .625rem; padding: .875rem 0; }
    .tool-footer-status { width: 100%; margin: .25rem 0 0; }
}

@media (max-width: 560px) {
    .converter-page { width: calc(100% - 20px); padding-top: 28px; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 14px; }
    .settings-bar { grid-template-columns: 1fr; gap: 18px; }
    .privacy-note { grid-column: auto; }
    .drop-zone { min-height: 245px; margin: 14px; padding: 24px 14px; }
    .file-item { grid-template-columns: 48px minmax(0, 1fr) 34px; gap: 10px; }
    .thumb-wrap { width: 48px; height: 48px; }
    .result-meta { grid-column: 2; text-align: left; }
    .download-button { grid-column: 3; grid-row: 1; }
    .remove-button { grid-column: 3; grid-row: 2; }
    .queue-actions { flex-direction: column-reverse; }
    .secondary-button, .primary-button { width: 100%; }
    .feature-strip { grid-template-columns: 1fr; gap: 16px; padding: 24px 18px 0; }
    .guide-section { margin-top: 28px; padding: 25px 20px; }
    .guide-heading h2 { font-size: 21px; }
    .format-guide dl { grid-template-columns: 1fr; }
    .format-guide dl > div { min-height: 0; }
}

@media (max-width: 420px) {
    .tool-footer-links { grid-template-columns: 1fr; gap: .5rem; }
    .tool-footer-links a { justify-content: space-between; padding: 0 .875rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .tool-footer-links a { transition: none; transform: none; }
}
