/* ================================================================
   菜刀客在线工具页 · rounded-image.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 隐私提示条 ---- */
.privacy-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 15px;
    text-align: center;
    justify-content: center;
}

.privacy-notice .icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ---- 上传区 ---- */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #eef2ff;
}

.upload-area .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area .upload-text {
    color: #6b7280;
    font-size: 14px;
}

.upload-area .upload-text strong {
    color: #667eea;
}

.upload-area .upload-tip {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

/* ---- 文件信息卡片 ---- */
.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.info-card .thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #fff;
}

.info-card .meta {
    flex: 1;
    min-width: 0;
}

.info-card .name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-card .dims,
.info-card .size {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.btn-remove {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.btn-remove:hover {
    color: #dc2626;
}

/* ---- 圆角滑杆 ---- */
.param-row {
    width: 100%;
}

.param-row input[type="range"] {
    width: 100%;
    accent-color: #667eea;
    cursor: pointer;
}

.param-row input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.val {
    font-weight: 600;
    color: #667eea;
    font-variant-numeric: tabular-nums;
}

.param-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

/* ---- 圆形头像 ---- */
.circle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.circle-row .btn {
    padding: 7px 16px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.circle-row .btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.circle-row .btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.circle-tip {
    font-size: 12px;
    color: #9ca3af;
}

/* ---- 格式/背景 ---- */
.tip {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.color-row input[type="color"] {
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    background: #fff;
}

.color-hex {
    font-size: 13px;
    color: #6b7280;
    font-family: monospace;
}

.bg-swatches {
    display: flex;
    gap: 6px;
}

.bg-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.bg-chip:hover {
    border-color: #667eea;
}

.bg-chip.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* ---- 预览对比 ---- */
.preview-compare {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.preview-box {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}

.preview-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 4px;
    border-radius: 6px;
}

.preview-img-wrap.preview-bg {
    background: #fff;
    border: 1px solid #e5e7eb;
}

.preview-img-wrap img,
.preview-img-wrap canvas {
    max-width: 100%;
    max-height: 280px;
    border-radius: 4px;
}

.preview-arrow {
    font-size: 24px;
    color: #667eea;
    font-weight: bold;
    flex-shrink: 0;
}

/* ---- 结果统计 ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.stats-card {
    text-align: center;
    padding: 8px;
    background: #f0f4ff;
    border-radius: 6px;
    border: 1px solid #e0e7ff;
}

.stats-card .label {
    font-size: 11px;
    color: #6b7280;
}

.stats-card .value {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* ---- 全屏预览弹窗 ---- */
.preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.preview-modal.show {
    display: flex;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.modal-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.15s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

@media (max-width: 600px) {
    .preview-compare {
        flex-direction: column;
    }
    .preview-arrow {
        transform: rotate(90deg);
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}