/* ============ 图片压缩 - 工具特有样式 ============ */
/* 通用样式（卡片、按钮、分隔线、info-box、empty-state等）已由 common.css 统一提供 */

/* ---- 容器 ---- */
#ty-container {
    margin-bottom: 15px;
}

/* ---- 上传区 ---- */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 40px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.upload-icon {
    font-size: 48px;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.upload-hint {
    font-size: 13px;
    color: #9ca3af;
}

/* ---- 设置分组 ---- */
.setting-group {
    margin-bottom: 16px;
}

.setting-group-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
}

/* ---- 压缩设置行（标签 + 滑块/下拉 + 值） ---- */
.control-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.control-label {
    font-size: 14px;
    color: #374151;
    flex-shrink: 0;
    min-width: 64px;
}

.range-slider {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
}

.range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #8b5cf6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    min-width: 56px;
    text-align: right;
    flex-shrink: 0;
}

.form-select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: white;
    cursor: pointer;
    outline: none;
    min-width: 120px;
}

.form-select:focus {
    border-color: #8b5cf6;
}

/* ---- 图片列表（整块，位于说明上方） ---- */
#ty-container > .images-list {
    margin-top: 15px;
}

.images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* ---- 继续添加占位卡片（与上传区风格一致） ---- */
.add-more-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 40px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.add-more-card:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.add-more-icon {
    font-size: 48px;
}

.add-more-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.add-more-hint {
    font-size: 13px;
    color: #9ca3af;
}

/* ---- 单张图片卡片 ---- */
.image-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.image-card:hover {
    border-color: #a78bfa;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.12);
}

.image-preview {
    position: relative;
    background: repeating-conic-gradient(#ccc 0% 25%, transparent 0% 50%) 50% / 16px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 12px;
}

.preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    display: block;
}

.compressed-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: #8b5cf6;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.image-info {
    padding: 12px;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- 单图滑块（尺寸/质量） ---- */
.image-sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-label {
    font-size: 12px;
    color: #6b7280;
    min-width: 40px;
    flex-shrink: 0;
}

.image-slider {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.image-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
}

.image-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.slider-value {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-align: right;
    flex-shrink: 0;
}

.slider-value-dim,
.slider-value-quality {
    width: 116px;
}

/* ---- 压缩结果 ---- */
.compress-result {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.result-item {
    font-size: 12px;
    color: #6b7280;
}

.savings {
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
}

.savings.positive {
    color: #22c55e;
}

/* ---- 单图操作按钮 ---- */
.image-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ---- 功能说明信息区 ---- */
#app > .info-section {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    #app > .info-section {
        grid-template-columns: 1fr;
    }

    .control-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .images-list {
        grid-template-columns: 1fr;
    }
}
