/* ================================================================
   菜刀客在线工具页 · image-compressor.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 上传面板（占满整行，置于双栏上方） ---- */
.upload-panel {
    margin-bottom: 15px;
}

.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbff;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #667eea;
    background: #eef2ff;
}

.upload-zone .icon {
    font-size: 40px;
}

.upload-text {
    font-size: 14px;
    color: #374151;
    margin: 12px 0;
}

.upload-zone .btn-primary {
    pointer-events: none;
}

.upload-tip {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

/* ---- 待压缩文件列表 ---- */
.file-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow: auto;
    margin-top: 12px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
}

.file-chip .fc-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-chip .fc-size {
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.file-chip .fc-remove {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
}

.file-chip .fc-remove:hover {
    color: #dc2626;
}

/* ---- 质量滑杆 ---- */
.quality-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.quality-row b {
    color: #667eea;
    font-variant-numeric: tabular-nums;
}

input[type="range"].quality-range {
    width: 100%;
    accent-color: #667eea;
    cursor: pointer;
}

/* ---- 结果卡片网格 ---- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.img-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.img-card .thumb {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: #f9fafb;
    border-bottom: 1px solid #f0f1f3;
}

.img-card .info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.img-card .name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.img-card .dims {
    font-size: 12px;
    color: #6b7280;
}

.img-card .sizes {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.img-card .sizes .old {
    color: #9ca3af;
    text-decoration: line-through;
}

.img-card .sizes .new {
    color: #16a34a;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.img-card .ratio {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.img-card .ratio.bad {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.img-card .card-actions {
    display: flex;
    gap: 8px;
}

.img-card .card-actions .btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
}

/* ---- SEO 文字区 ---- */
.seo-article {
    padding: 4px 2px 0;
}

.seo-article h2 {
    font-size: 16px;
    color: #374151;
    margin: 14px 0 8px;
}

.seo-article h2:first-child {
    margin-top: 0;
}

.seo-article p {
    font-size: 13px;
    line-height: 1.9;
    color: #4b5563;
}

.seo-article ul {
    margin: 6px 0 0 18px;
    font-size: 13px;
    line-height: 2;
    color: #4b5563;
}

/* ---- hero 中保存百分比等长文本换行 ---- */
.hero-result .amount {
    word-break: break-all;
}