/* css/image_compressor_style.css */

.compressor-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 25px;
    align-items: flex-start; /* 改为 flex-start 对齐 */
    background-color: #fff; /* 给控制区加背景 */
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.settings-panel h3 { margin: 0 0 20px 0; font-size: 1.3em; }
.settings-panel .form-group { margin-bottom: 20px; }
.settings-panel label { display: block; font-weight: 500; margin-bottom: 8px; color: #333; }
.settings-panel input, .settings-panel select { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid #ccc; font-size: 14px; transition: border-color 0.3s, box-shadow 0.3s; }
.settings-panel input:focus, .settings-panel select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.2); }
.settings-panel input[type="range"] { padding: 0; }
.real-time-indicator { font-size: 0.7em; color: var(--primary-color); font-weight: normal; vertical-align: middle; margin-left: 5px; }

.actions-panel { text-align: center; }
/* --- 美化：按钮样式 --- */
.actions-panel .btn-main, .actions-panel .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* 图标和文字间距 */
    width: 100%; /* 按钮宽度占满 */
    padding: 15px 20px;
    margin-bottom: 15px; /* 按钮间距 */
    font-size: 1.1em;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.actions-panel .btn-main:hover, .actions-panel .btn-secondary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.15);
}
.actions-panel .btn-main:active, .actions-panel .btn-secondary:active:not(:disabled) {
     transform: translateY(-1px);
     box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.actions-panel .btn-main svg, .actions-panel .btn-secondary svg { width: 22px; height: 22px; }

.btn-main { background: linear-gradient(45deg, #0984e3 0%, #74b9ff 100%); color: white; }
.btn-secondary { background-color: #f0f2f5; color: var(--text-color-secondary); border: 1px solid var(--border-color); box-shadow: none; }
.btn-secondary:disabled { background-color: #e9ecef; color: #adb5bd; cursor: not-allowed; box-shadow: none; transform: none; }
.actions-tip { font-size: 14px; color: var(--text-color-secondary); margin-top: 10px; }

.drop-zone-area { margin-top: 20px; min-height: 200px; border: 3px dashed #d0d7e0; transition: all 0.3s ease; background-color: #f6f8fa; border-radius: var(--border-radius); }
.drop-zone-area.dragover { border-color: var(--primary-color); background-color: #eff6ff; }
.drop-zone-prompt { padding: 40px; text-align: center; color: var(--text-color-secondary); }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; padding: 20px; }
.image-card { border: 1px solid var(--border-color); border-radius: var(--border-radius); overflow: hidden; background: #fff; position: relative; display: flex; flex-direction: column; transition: box-shadow 0.3s ease; }
.image-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.image-card-preview { height: 150px; display: flex; justify-content: center; align-items: center; background: #f8f9fa; position: relative; overflow: hidden; flex-shrink: 0;}
.image-card-preview img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }

.image-card-details { padding: 10px 12px; font-size: 13px; border-top: 1px solid var(--border-color); flex-grow: 1;} /* 允许详情区域扩展 */
.image-card-details .file-name { margin: 0 0 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: 14px; }
.original-info, .compressed-info { display: block; font-size: 12px; margin-top: 4px; }
.original-info { color: var(--text-color-secondary); }
.compressed-info { display: flex; justify-content: space-between; align-items: center; }
.compressed-info .size { font-weight: bold; }
.compressed-info .reduction { font-weight: bold; color: var(--success-color); }
.error-message { font-weight: bold; color: var(--danger-color); font-size: 12px; }

.progress-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.8); display: flex; justify-content: center; align-items: center; z-index: 5; }
.spinner { width: 32px; height: 32px; border: 3px solid rgba(0,0,0,0.1); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- 核心修改：卡片独立按钮样式 --- */
.image-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10; /* 确保在最上层 */
}
.card-action-btn {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%; /* 圆形按钮 */
    cursor: pointer;
    width: 28px; /* 固定宽高 */
    height: 28px;
    display: inline-flex; /* 使SVG居中 */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}
.image-card:hover .card-action-btn { opacity: 1; }
.card-action-btn:hover { background-color: rgba(0, 0, 0, 0.8); }
.card-action-btn svg { width: 16px; height: 16px; }

/* 区分下载和删除按钮 */
.download-single-btn { /* 可选样式 */ }
.delete-single-btn { /* 可选样式, 比如悬停变红 */ }
.delete-single-btn:hover { background-color: var(--danger-color); }


.lightbox { position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.9); display: flex; justify-content: center; align-items: center; }
.lightbox-content { margin: auto; display: block; max-width: 90%; max-height: 85%; }
.lightbox-close { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; }
.lightbox-caption { text-align: center; color: #ccc; padding: 10px 0; position: absolute; bottom: 15px; width: 100%; }

@media (max-width: 768px) {
    .compressor-controls { grid-template-columns: 1fr; }
}