/* ===== 根作用域 ===== */
.gif-comp-tool {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===== 上传区 ===== */
.gif-comp-tool .file-input-wrapper {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gif-comp-tool .file-input-wrapper:hover {
    border-color: #4CAF50;
    background: #fafafa;
}

.gif-comp-tool .file-input-wrapper.dragover {
    border-color: #4CAF50;
    background: #e8f5e8;
}

.gif-comp-tool .file-input {
    display: none;
}

.gif-comp-tool .file-input-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.45;
}

.gif-comp-tool .file-input-text {
    font-size: 15px;
    color: #555;
}

.gif-comp-tool .file-input-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ===== 压缩级别 ===== */
.gif-comp-tool .compression-level {
    display: flex;
    gap: 14px;
    margin-bottom: 10px;
}

.gif-comp-tool .radio-option {
    display: flex;
    align-items: center;
    font-size: 13px;
    cursor: pointer;
}

.gif-comp-tool .radio-option input {
    margin-right: 5px;
    cursor: pointer;
}

/* ===== 按钮 ===== */
.gif-comp-tool .button-group {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.gif-comp-tool .button {
    flex: 1;
    padding: 8px 6px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
}

.gif-comp-tool .button:hover {
    border-color: #4CAF50;
    background: #f7f7f7;
}

.gif-comp-tool .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gif-comp-tool .button.primary {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

.gif-comp-tool .button.primary:hover {
    background: #449d48;
}

.gif-comp-tool .button.secondary {
    background: #2196F3;
    color: #fff;
    border-color: #2196F3;
}

.gif-comp-tool .button.secondary:hover {
    background: #0b7dda;
}

/* ===== 预览区 ===== */
.gif-comp-tool .preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.gif-comp-tool .preview-item {
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    padding: 8px;
    background: #fff;
    text-align: center;
    overflow: hidden;
}

.gif-comp-tool .preview-item img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 3px;
    margin-bottom: 6px;
}

/* ===== 文件名省略 ===== */
.gif-comp-tool .preview-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gif-comp-tool .preview-item-info {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* ===== 状态 ===== */
.gif-comp-tool .preview-item-status {
    font-size: 11px;
    margin-top: 4px;
    color: #999;
}

.gif-comp-tool .preview-item-status.processing {
    color: #2196F3;
}

.gif-comp-tool .preview-item-status.success {
    color: #4CAF50;
}

.gif-comp-tool .preview-item-status.error {
    color: #f44336;
}

/* ===== 下载按钮（强制白字） ===== */
.gif-comp-tool .download-link {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
    background: #2196F3;
    color: #fff !important;
    text-decoration: none;
}

.gif-comp-tool .download-link:hover {
    background: #0b7dda;
}

/* ===== 提示 ===== */
.gif-comp-tool .loading {
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 10px;
}

.gif-comp-tool .error {
    padding: 8px;
    font-size: 12px;
    background: #fff5f5;
    color: #c62828;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    margin-bottom: 10px;
}

.gif-comp-tool .file-count {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.gif-comp-tool .progress {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.gif-comp-tool .hidden {
    display: none;
}