:root {
    --green-950: #123b2b;
    --green-800: #1f6d4c;
    --green-700: #27845c;
    --green-500: #43b875;
    --green-200: #c9f3d9;
    --green-100: #e9f9ef;
    --mint: #f5fff8;
    --cream: #fbfff7;
    --line: rgba(28, 99, 69, 0.16);
    --text: #17392c;
    --muted: #5f756b;
    --shadow: 0 22px 60px rgba(23, 83, 58, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: "Trebuchet MS", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 14% 10%, rgba(120, 218, 154, 0.35), transparent 28rem),
        linear-gradient(135deg, #dff6df 0%, #f5fff8 48%, #d4f2dd 100%);
}

button,
a {
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:focus,
a:focus,
input:focus {
    outline: 3px solid rgba(67, 184, 117, 0.35);
    outline-offset: 3px;
}

.compress-header {
    padding: 26px 18px 8px;
}

.compress-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1120px, 100%);
    margin: 0 auto;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    background: var(--green-700);
    box-shadow: 0 12px 28px rgba(39, 132, 92, 0.24);
}

.lang-switch {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.lang-switch:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(23, 83, 58, 0.12);
}

.lang-switch img {
    display: block;
    width: 30px;
    height: 30px;
}

.hero-copy {
    width: min(1120px, 100%);
    margin: 42px auto 22px;
    padding: 0 18px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green-800);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
}

#titleContent {
    display: block;
    margin: 0;
    color: var(--green-950);
    font-size: clamp(34px, 5vw, 62px);
    font-weight: 900;
    line-height: 1.04;
}

.hero-text {
    max-width: 690px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.compress-shell {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto 42px;
}

.tool-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.upload-card,
.settings-card,
.result-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
}

.upload-card {
    min-height: 430px;
    padding: 18px;
}

.settings-card {
    padding: 22px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.step-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    height: 30px;
    border-radius: 999px;
    color: var(--green-800);
    font-size: 13px;
    font-weight: 800;
    background: var(--green-100);
}

.panel-heading h2 {
    margin: 0;
    color: var(--green-950);
    font-size: 23px;
    font-weight: 900;
}

.drop-zone {
    display: flex;
    min-height: 310px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 34px 24px;
    border: 2px dashed rgba(39, 132, 92, 0.36);
    border-radius: 18px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(245, 255, 248, 0.94), rgba(230, 249, 236, 0.7));
    cursor: pointer;
}

.drop-zone.is-dragover,
.drop-zone:hover {
    border-color: var(--green-500);
    background: #f7fff9;
}

.upload-icon {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    border-radius: 24px;
    color: #ffffff;
    font-size: 38px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
    box-shadow: 0 18px 30px rgba(43, 150, 96, 0.22);
}

.drop-title {
    margin: 0;
    color: var(--green-950);
    font-size: 25px;
    font-weight: 900;
}

.drop-help {
    max-width: 380px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.primary-btn,
.secondary-btn,
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 900;
    cursor: pointer;
}

.primary-btn,
.download-btn {
    color: #ffffff;
    background: var(--green-700);
    box-shadow: 0 12px 24px rgba(39, 132, 92, 0.22);
}

.primary-btn:hover,
.download-btn:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    background: var(--green-800);
}

.secondary-btn {
    color: var(--green-800);
    border: 1px solid rgba(39, 132, 92, 0.24);
    background: #ffffff;
}

.secondary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(23, 83, 58, 0.11);
}

.file-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--mint);
}

#fileNameDisplay {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--green-950);
    font-weight: 800;
    overflow-wrap: anywhere;
}

#uploadBtn {
    flex: 0 0 auto;
    min-width: 112px;
    white-space: nowrap;
}

.status-line {
    min-height: 24px;
    margin: 14px 4px 0;
    color: var(--green-800);
    font-weight: 800;
}

.status-line.is-error {
    color: #b63c2d;
}

.workflow-ad {
    display: none;
    min-height: 96px;
    margin-top: 12px;
    border: 1px dashed rgba(39, 132, 92, 0.22);
    border-radius: 16px;
    padding: 12px;
    background: rgba(245, 255, 248, 0.74);
}

.workflow-ad.is-visible {
    display: block;
}

.ad-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.step-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.step-item {
    min-height: 62px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    background: var(--cream);
}

.step-number {
    display: block;
    color: var(--green-700);
    font-size: 12px;
    font-weight: 900;
}

.step-text {
    display: block;
    margin-top: 4px;
    color: var(--green-950);
    font-size: 14px;
    font-weight: 800;
}

.helper-card {
    margin: 12px 0 0;
    padding: 16px;
    border-radius: 16px;
    color: var(--muted);
    background: rgba(233, 249, 239, 0.82);
    line-height: 1.7;
}

.radio-group {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.option-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-title {
    margin: 0;
    color: var(--green-950);
    font-size: 16px;
    font-weight: 900;
}

.choice-grid,
.format-grid {
    display: grid;
    gap: 10px;
}

.choice-grid {
    grid-template-columns: 1fr;
}

.format-grid {
    grid-template-columns: repeat(3, 1fr);
}

.choice-tile,
.format-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    color: var(--text);
    background: #ffffff;
    cursor: pointer;
}

.choice-tile:hover,
.format-tile:hover {
    border-color: rgba(39, 132, 92, 0.42);
    background: var(--mint);
}

.choice-tile input,
.format-tile input {
    accent-color: var(--green-700);
}

.choice-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.choice-name {
    font-weight: 900;
}

.choice-desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.range-row {
    display: grid;
    grid-template-columns: 1fr 58px;
    align-items: center;
    gap: 14px;
}

#compressionRate {
    width: 100%;
    accent-color: var(--green-700);
}

#rateDisplay {
    display: inline-flex;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--green-800);
    font-weight: 900;
    background: var(--green-100);
}

.result-card {
    display: none;
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto 34px;
    padding: 18px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.result-card.is-visible {
    display: flex;
}

.result-title {
    margin: 0;
    color: var(--green-950);
    font-size: 19px;
    font-weight: 900;
}

.result-text {
    margin: 4px 0 0;
    color: var(--muted);
}

#friend-links {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto 30px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.65);
}

#friend-links h3 {
    margin-top: 0;
    color: var(--green-950);
    font-size: 18px;
    font-weight: 900;
}

footer#footer {
    background: rgba(255, 255, 255, 0.62);
}

.compress-home-cta {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 120;
    border: 1px solid rgba(16, 111, 58, 0.1);
    border-radius: 14px;
    padding: 14px 18px;
    background: linear-gradient(180deg, #ecfff3, #dff9ea);
    box-shadow: 0 12px 30px rgba(11, 111, 58, 0.1);
}

.compress-home-cta a {
    color: var(--green-800);
    font-weight: 900;
    text-decoration: none;
}

.compress-home-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(11, 111, 58, 0.14);
}

@media (max-width: 860px) {
    .compress-header {
        padding-top: 18px;
    }

    .hero-copy {
        margin-top: 28px;
    }

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

    .upload-card {
        min-height: auto;
    }

    .drop-zone {
        min-height: 260px;
    }

    .file-summary,
    .result-card {
        align-items: stretch;
        flex-direction: column;
    }

    .format-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .compress-home-cta {
        right: 12px;
        bottom: 12px;
        left: 12px;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .compress-shell,
    .result-card,
    #friend-links {
        width: min(100% - 24px, 1120px);
    }

    .tool-panel {
        padding: 10px;
        border-radius: 18px;
    }

    .upload-card,
    .settings-card {
        padding: 14px;
        border-radius: 14px;
    }

    .step-list,
    .format-grid {
        grid-template-columns: 1fr;
    }

    .drop-title {
        font-size: 22px;
    }
}
