/* ================================================================
   菜刀客在线工具页 · heic-preview.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 上传区 ---- */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 36px 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: 44px;
    margin-bottom: 10px;
}

.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;
}

.file-ico {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: linear-gradient(135deg, #eef2ff 0%, #f3e8ff 100%);
    border: 1px solid #c7d2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.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 {
    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;
}

/* ---- 列表占位 ---- */
.panel-hint {
    font-size: 12px;
    color: #9ca3af;
}

.thumbs-count {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

/* ---- 灯箱（点击放大 + 滚轮缩放） ---- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 18, 0.78);
}

.lb-card {
    position: relative;
    width: min(92vw, 1100px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.lb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.lb-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-close {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.lb-close:hover {
    background: #eef2ff;
    color: #4338ca;
}

.lb-view {
    position: relative;
    flex: 1;
    min-height: 300px;
    background: #15161a;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.lb-view.dragging {
    cursor: grabbing;
}

#lbCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.lb-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 12px;
    border-radius: 14px;
    pointer-events: none;
    white-space: nowrap;
}

.lb-foot {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 600px) {
    .lb-hint {
        white-space: normal;
        text-align: center;
        width: 80%;
    }
}

/* ---- 信息列表：数值用中性深色而非强调红 ---- */
.heic-info .item-value {
    color: #334155;
}

.heic-info .item-value.total {
    color: #4338ca;
}

/* ---- 多文件分组缩略图网格 ---- */
.file-group {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

.file-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.file-group-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.file-group-meta {
    font-size: 12px;
    color: #9ca3af;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.file-group-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.heic-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    align-items: start;
}

.thumb-card {
    width: 100%;
    height: 288px;
}

.thumb-card {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thumb-card:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.thumb-card.thumb-active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.thumb-card.thumb-failed {
    opacity: 0.55;
}

.thumb-canvas {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
    background: repeating-conic-gradient(#e9eaee 0% 25%, #ffffff 0% 50%) 0 0 / 14px 14px;
}

.thumb-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #fff;
    border-top: 1px solid #f3f4f6;
    font-size: 12px;
}

.thumb-idx {
    font-weight: 600;
    color: #374151;
    font-variant-numeric: tabular-nums;
}

.thumb-dim {
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

.thumb-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 11px;
    color: #fff;
    background: rgba(55, 65, 81, 0.78);
    padding: 2px 8px;
    border-radius: 10px;
}

.thumb-active .thumb-idx {
    color: #4338ca;
}

.thumbs-count {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

.preview-tag {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

/* ---- 导出方式浅色卡片 ---- */
.radio-group .radio-card {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-weight: 600;
    text-shadow: none;
    transition: all 0.2s ease;
}

.radio-group .radio-card:nth-of-type(1) {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border-color: #bfdbfe;
}

.radio-group .radio-card:nth-of-type(2) {
    background: linear-gradient(135deg, #fef3c7 0%, #ffedd5 100%);
    border-color: #fde68a;
}

.radio-group .radio-card input {
    accent-color: #667eea;
}

.radio-group .radio-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.10);
}

.radio-group .radio-card:has(input:checked) {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.35);
    background: linear-gradient(135deg, #bfdbfe 0%, #c7d2fe 100%);
}

.radio-group .radio-card:nth-of-type(2):has(input:checked) {
    background: linear-gradient(135deg, #fde68a 0%, #fed7aa 100%);
}

/* ---- 提示位置 ---- */
.panel-header {
    justify-content: flex-start;
}

.panel-header .panel-hint {
    margin-left: 10px;
}

.panel-header .panel-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* ---- 按钮禁用态 ---- */
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 600px) {
    #previewCanvas {
        width: 100%;
        height: auto;
    }

    .upload-area {
        padding: 24px 12px;
    }
}