.upload-zone {
    border: 2px dashed #d0d5dd;
    border-radius: 14px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    background: #fafbfc;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #2563eb;
    background: #f0f4ff;
    transform: translateY(-1px);
}

.upload-icon {
    width: 68px;
    height: 68px;
    line-height: 68px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    background: #e8f0ff;
    color: #2563eb;
    font-size: 1.9rem;
}

.upload-text {
    font-size: 0.96rem;
    color: #4b5563;
    margin-bottom: 0.35rem;
}

.upload-hint {
    font-size: 0.83rem;
    line-height: 1.7;
    color: #9ca3af;
}

.compress-panel {
    display: grid;
    gap: 1.2rem;
}

.compress-panel.is-empty .gif-notice,
.compress-panel.is-empty .result-panel {
    display: none !important;
}

.compress-panel.is-empty .control-card,
.compress-panel.is-empty .source-info {
    background: #fcfcfd;
}

.source-info {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e8eaf0;
    border-radius: 14px;
    background: #fff;
}

.source-preview img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.source-placeholder {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #d7deea;
    color: #94a3b8;
    font-size: 0.84rem;
    line-height: 1.6;
}

.source-name {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.45rem;
    word-break: break-all;
}

.source-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
    color: #6b7280;
    font-size: 0.84rem;
}

.source-note {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    color: #4b5563;
    font-size: 0.85rem;
    line-height: 1.75;
}

.gif-notice {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 0.86rem;
    line-height: 1.7;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.control-card {
    padding: 1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e8eaf0;
}

.form-label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
}

.field-row .form-label {
    margin-bottom: 0;
}

.field-value {
    color: #2563eb;
    font-size: 0.84rem;
    font-weight: 600;
}

.field-hint {
    margin-top: 0.75rem;
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.7;
}

.format-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.format-option {
    position: relative;
}

.format-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.format-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 0.72rem 1rem;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    transition: all 0.15s;
}

.format-option input:checked + .format-tag {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.range-input {
    width: 100%;
    accent-color: #2563eb;
}

.select-input {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 0.78rem 0.9rem;
    font-size: 0.88rem;
    color: #374151;
    background: #fff;
}

.result-panel {
    padding: 1rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e8eef7;
}

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.2rem;
}

.result-sub {
    font-size: 0.84rem;
    color: #6b7280;
}

.result-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.result-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.metric-card {
    padding: 0.9rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.metric-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.metric-value {
    color: #111827;
    font-size: 0.96rem;
    font-weight: 700;
}

.result-preview-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.preview-card {
    padding: 0.95rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.preview-label {
    margin-bottom: 0.65rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #374151;
}

.preview-card img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.result-note {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.84rem;
    line-height: 1.75;
}

.result-note.is-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.tool-actions .btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.tool-actions .btn-primary:disabled,
.tool-actions .btn-primary:disabled:hover {
    background: #93c5fd;
}

.format-table-wrap {
    overflow-x: auto;
}

.format-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e8eaf0;
}

.format-table th,
.format-table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    font-size: 0.88rem;
}

.format-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 700;
}

.format-table td {
    color: #4b5563;
    line-height: 1.75;
}

@media (max-width: 960px) {
    .control-grid,
    .result-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .source-info,
    .result-preview-wrap,
    .result-header {
        grid-template-columns: 1fr;
        display: grid;
    }

    .source-preview img,
    .source-placeholder {
        width: 100%;
        max-width: 220px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
}

@media (max-width: 640px) {
    .upload-zone {
        padding: 2rem 1rem;
    }

    .control-grid,
    .result-metrics {
        grid-template-columns: 1fr;
    }

    .format-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .format-tag {
        width: 100%;
        min-width: 0;
    }

    .result-actions,
    .tool-actions {
        flex-direction: column;
    }

    .result-actions .btn,
    .tool-actions .btn {
        width: 100%;
    }
}
