/* ======================================================================
 *  heic-to-jpg.css · HEIC 转 JPG（苹果照片本地批量转换）
 *  视觉：浅灰白纸感 + 苹果绿；卡片式缩略图预览，体积涨跌用箭头标色
 *  作用域：.tsk.heic（前缀 heic-）
 * ====================================================================== */

.tsk.heic {
    --tsk-bg: #f5f7f6;
    --tsk-bg-2: #eaf1ed;
    --tsk-card: #ffffff;
    --tsk-card-2: #f4f8f5;
    --tsk-ink: #17261f;
    --tsk-sub: #52665c;
    --tsk-faint: #86988e;
    --tsk-line: #e1eae4;
    --tsk-line-2: #edf3ef;
    --tsk-brand: #34c759;
    --tsk-brand-2: #0f9e6a;
    --tsk-brand-soft: #e6f8ec;
    --tsk-brand-ink: #12854c;
    --tsk-accent: #ff9f0a;
    --tsk-ok: #12854c;
    --tsk-ok-soft: #e6f8ec;
    --tsk-warn: #b86b00;
    --tsk-warn-soft: #fff4e0;
    --tsk-bad: #d93636;
    --tsk-bad-soft: #fdecec;
    --tsk-info: #0a84a6;
    --tsk-info-soft: #e5f6fa;
    --tsk-shadow-sm: 0 1px 2px rgba(23, 38, 31, .05), 0 6px 16px rgba(23, 38, 31, .05);
    --tsk-shadow: 0 2px 6px rgba(23, 38, 31, .07), 0 18px 44px rgba(23, 38, 31, .08);
    --tsk-shadow-lg: 0 6px 16px rgba(23, 38, 31, .09), 0 32px 72px rgba(23, 38, 31, .14);
    --tsk-r: 16px;
    --tsk-r-sm: 10px;
    background: linear-gradient(180deg, #f6faf7 0%, #f2f5f3 46%, #f5f7f6 100%);
}

:root[data-theme="dark"] .tsk.heic {
    --tsk-bg: #0e1512;
    --tsk-bg-2: #131c17;
    --tsk-card: #17211c;
    --tsk-card-2: #1c2822;
    --tsk-ink: #e8f1ec;
    --tsk-sub: #a2b5aa;
    --tsk-faint: #7b8d84;
    --tsk-line: #26352e;
    --tsk-line-2: #1e2a24;
    --tsk-brand: #4dd97a;
    --tsk-brand-2: #2fd39a;
    --tsk-brand-soft: rgba(77, 217, 122, .14);
    --tsk-brand-ink: #74e69c;
    --tsk-accent: #ffb84d;
    --tsk-ok: #4dd97a;
    --tsk-ok-soft: rgba(77, 217, 122, .14);
    --tsk-warn: #ffc857;
    --tsk-warn-soft: rgba(255, 200, 87, .14);
    --tsk-bad: #ff7b7b;
    --tsk-bad-soft: rgba(255, 123, 123, .14);
    --tsk-info: #4fc8e4;
    --tsk-info-soft: rgba(79, 200, 228, .14);
    --tsk-shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 16px rgba(0, 0, 0, .3);
    --tsk-shadow: 0 2px 6px rgba(0, 0, 0, .55), 0 18px 44px rgba(0, 0, 0, .4);
    --tsk-shadow-lg: 0 6px 16px rgba(0, 0, 0, .6), 0 32px 72px rgba(0, 0, 0, .5);
    background: #0e1512;
}

/* ---------- 1. 首屏等高栅格 ---------- */
.heic-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 394px;
    gap: 30px;
    padding: 30px 0 24px;
    align-items: stretch;
}
.heic-hero-l {
    display: flex;
    flex-direction: column;
}
.heic-hero-l > .tsk-hs {
    flex: 1 1 auto;
}
@media (max-width: 900px) {
    .heic-hero {
        grid-template-columns: 1fr;
    }
}
.heic-hero-r {
    min-width: 0;
}

/* ---------- 2. 首屏小细节 ---------- */
.heic .tsk-kicker {
    background: #e6f8ec;
    color: #12854c;
}
.heic .tsk-h1 em,
.heic .tsk-h1 b {
    color: #12854c;
}
.heic .tsk-chips span {
    background: rgba(255, 255, 255, .86);
    border-color: #dfeae2;
}

/* ---------- 3. 转换台面板 ---------- */
.heic-panel {
    background: var(--tsk-card);
    border: 1px solid var(--tsk-line);
    border-radius: 20px;
    box-shadow: var(--tsk-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.heic-panel-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(120deg, #34c759, #0f9e6a);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}
.heic-panel-hd i {
    font: 700 10.5px/1 var(--tsk-num);
    letter-spacing: .14em;
    opacity: .88;
}
.heic-panel-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1 1 auto;
}

/* 拖拽区：仿相册胶片边 */
.heic-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 26px 18px;
    border: 2px dashed #b9dcc8;
    border-radius: 16px;
    background: repeating-linear-gradient(135deg, #f7fbf8 0 12px, #f2f8f4 12px 24px);
    cursor: pointer;
    text-align: center;
    transition: border-color .16s, background .16s, transform .16s;
}
.heic-drop:hover,
.heic-drop.over {
    border-color: #34c759;
    background: #eefaf2;
    transform: translateY(-1px);
}
.heic-drop-ic {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #34c759, #0f9e6a);
    color: #fff;
    font: 800 13px/1 var(--tsk-num);
    letter-spacing: .1em;
    box-shadow: 0 10px 20px rgba(15, 158, 106, .26);
}
.heic-drop b {
    font-size: 14px;
    color: var(--tsk-ink);
}
.heic-drop small {
    font-size: 11.5px;
    color: var(--tsk-faint);
    line-height: 1.6;
}

/* 三格统计 */
.heic-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.heic-meta div {
    background: var(--tsk-card-2);
    border: 1px solid var(--tsk-line);
    border-radius: 11px;
    padding: 9px 10px;
    text-align: center;
}
.heic-meta span {
    display: block;
    font-size: 11px;
    color: var(--tsk-faint);
}
.heic-meta b {
    display: block;
    margin-top: 3px;
    font: 800 15px/1.4 var(--tsk-num);
    color: var(--tsk-ink);
    font-variant-numeric: tabular-nums;
}

/* 质量滑杆 */
.heic-field {
    display: block;
}
.heic-field label,
.heic-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tsk-sub);
    margin-bottom: 8px;
}
.heic-field label b {
    font: 800 13px/1 var(--tsk-num);
    color: var(--tsk-brand-ink);
}
.heic-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: linear-gradient(90deg, #a9e8bf, #34c759);
    outline: none;
}
.heic-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #34c759;
    box-shadow: 0 2px 8px rgba(15, 158, 106, .3);
    cursor: pointer;
}
.heic-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #34c759;
    cursor: pointer;
}
.heic-range-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 11px;
    color: var(--tsk-faint);
}

/* 格式切换 */
.heic-fmt {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}
.heic-fmt button {
    border: 1.5px solid var(--tsk-line);
    background: var(--tsk-card-2);
    color: var(--tsk-sub);
    border-radius: 10px;
    padding: 9px 0;
    font: 700 12.5px/1.3 var(--tsk-font);
    cursor: pointer;
    transition: .15s;
}
.heic-fmt button:hover {
    border-color: #34c759;
    color: var(--tsk-brand-ink);
}
.heic-fmt button.on {
    background: #12854c;
    border-color: #12854c;
    color: #fff;
    box-shadow: 0 6px 14px rgba(18, 133, 76, .28);
}
:root[data-theme="dark"] .heic-fmt button.on {
    color: #0e1512;
}

/* 提示与进度 */
.heic-err {
    border: 1px solid #f3c2c2;
    background: var(--tsk-bad-soft);
    color: var(--tsk-bad);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12.5px;
    line-height: 1.65;
    font-weight: 600;
}
.heic-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.heic-prog-bar {
    height: 7px;
    border-radius: 99px;
    background: var(--tsk-line-2);
    overflow: hidden;
}
.heic-prog-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #34c759, #0f9e6a);
    transition: width .25s ease;
}
.heic-progress span {
    font: 600 11.5px/1.5 var(--tsk-num);
    color: var(--tsk-faint);
}

/* 按钮组 */
.heic-acts {
    display: flex;
    gap: 9px;
    margin-top: auto;
}
.heic-acts .tsk-btn {
    flex: 1 1 auto;
}
.heic-acts .heic-ghost {
    flex: 0 0 auto;
    padding: 10px 16px;
}
.heic-acts .tsk-btn:disabled {
    opacity: .48;
    cursor: not-allowed;
    box-shadow: none;
}
.heic-foot {
    font-size: 11.5px;
    color: var(--tsk-faint);
    line-height: 1.65;
    text-align: center;
}

/* ---------- 4. 结果区 ---------- */
.heic-result {
    margin-top: 6px;
    background: var(--tsk-card);
    border: 1px solid var(--tsk-line);
    border-radius: 20px;
    box-shadow: var(--tsk-shadow-sm);
    padding: 18px 20px 20px;
}
.heic-result-hd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--tsk-line);
}
.heic-stat {
    min-width: 84px;
    padding: 4px 12px 4px 0;
    border-right: 1px solid var(--tsk-line-2);
}
.heic-stat b {
    display: block;
    font: 800 18px/1.3 var(--tsk-num);
    color: var(--tsk-ink);
    font-variant-numeric: tabular-nums;
}
.heic-stat span {
    font-size: 11.5px;
    color: var(--tsk-faint);
}
.heic-result-acts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

/* 缩略图卡片 */
.heic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.heic-card {
    border: 1px solid var(--tsk-line);
    border-radius: 14px;
    background: var(--tsk-card-2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: heic-in .28s ease both;
}
@keyframes heic-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
.heic-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background:
        linear-gradient(45deg, #e8efeb 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(-45deg, #e8efeb 25%, transparent 25%) 0 8px / 16px 16px,
        #f3f7f4;
    overflow: hidden;
}
.heic-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.heic-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 3px 8px;
    border-radius: 99px;
    background: rgba(18, 133, 76, .88);
    color: #fff;
    font: 700 10.5px/1.5 var(--tsk-num);
    letter-spacing: .04em;
    backdrop-filter: blur(4px);
}
.heic-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.heic-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tsk-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.heic-dims {
    font: 600 11px/1.4 var(--tsk-num);
    color: var(--tsk-faint);
}
.heic-size-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    color: var(--tsk-sub);
}
.heic-delta {
    font: 800 12px/1 var(--tsk-num);
    padding: 3px 8px;
    border-radius: 99px;
}
.heic-delta.up {
    color: var(--tsk-warn);
    background: var(--tsk-warn-soft);
}
.heic-delta.down {
    color: var(--tsk-ok);
    background: var(--tsk-ok-soft);
}
.heic-delta.flat {
    color: var(--tsk-faint);
    background: var(--tsk-line-2);
}
.heic-body .tsk-btn {
    width: 100%;
    padding: 8px 0;
    font-size: 12.5px;
    margin-top: 2px;
}
.heic-fail {
    border: 1px dashed #f0b6b6;
    border-radius: 14px;
    background: var(--tsk-bad-soft);
    padding: 14px;
    font-size: 12px;
    color: var(--tsk-bad);
    line-height: 1.7;
}
.heic-warn {
    margin-top: 14px;
    padding: 10px 13px;
    border-radius: 10px;
    background: var(--tsk-warn-soft);
    color: var(--tsk-warn);
    font-size: 12.5px;
    line-height: 1.7;
}

/* ---------- 5. 对比表 ---------- */
.heic-sec-sub {
    margin-left: auto;
    font-size: 12px;
    color: var(--tsk-faint);
}
.heic-compare {
    background: var(--tsk-card);
    border: 1px solid var(--tsk-line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--tsk-shadow-sm);
}
.heic-compare-hd,
.heic-compare-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 96px;
    gap: 12px;
    padding: 12px 18px;
    align-items: center;
}
.heic-compare-hd {
    background: linear-gradient(120deg, #eaf7ef, #f4fbf6);
    font-size: 12.5px;
    font-weight: 800;
    color: var(--tsk-brand-ink);
    letter-spacing: .02em;
}
:root[data-theme="dark"] .heic-compare-hd {
    background: #1b2a22;
    color: var(--tsk-brand-ink);
}
.heic-compare-row {
    border-top: 1px solid var(--tsk-line-2);
    font-size: 13px;
    color: var(--tsk-sub);
}
.heic-compare-row > span:first-child {
    font-weight: 700;
    color: var(--tsk-ink);
}
.heic-tag {
    justify-self: start;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--tsk-brand-soft);
    color: var(--tsk-brand-ink);
    font-size: 11.5px;
    font-weight: 700;
}

/* ---------- 6. 建议卡 ---------- */
.heic-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}
.heic-tip {
    display: flex;
    gap: 12px;
    padding: 15px 16px;
    border: 1px solid var(--tsk-line);
    border-left: 3px solid #34c759;
    border-radius: 12px;
    background: var(--tsk-card);
    box-shadow: var(--tsk-shadow-sm);
}
.heic-tip > span {
    font: 800 18px/1 var(--tsk-num);
    color: var(--tsk-brand-ink);
    opacity: .55;
    padding-top: 2px;
}
.heic-tip b {
    display: block;
    font-size: 13.5px;
    margin-bottom: 3px;
}
.heic-tip p {
    font-size: 12.5px;
    color: var(--tsk-sub);
    line-height: 1.75;
}

/* ---------- 6.1 使用场景 ---------- */
.heic-scenes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
    gap: 12px;
}
.heic-scene {
    position: relative;
    padding: 17px 17px 16px 20px;
    border: 1px solid var(--tsk-line);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--tsk-card), var(--tsk-card-2));
    box-shadow: var(--tsk-shadow-sm);
    overflow: hidden;
}
.heic-scene::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #34c759, #0f9e6a);
}
.heic-scene b {
    display: block;
    font-size: 13.5px;
    margin-bottom: 5px;
}
.heic-scene p {
    font-size: 12.5px;
    color: var(--tsk-sub);
    line-height: 1.78;
}

/* ---------- 7. 响应式 ---------- */
@media (max-width: 1080px) {
    .heic-compare-hd,
    .heic-compare-row {
        grid-template-columns: 100px minmax(0, 1fr) 84px;
        gap: 9px;
        padding: 11px 13px;
    }
}
@media (max-width: 760px) {
    .heic-meta {
        grid-template-columns: 1fr;
    }
    .heic-result-hd {
        align-items: stretch;
    }
    .heic-stat {
        min-width: 0;
        border-right: 0;
    }
    .heic-result-acts {
        margin-left: 0;
        width: 100%;
    }
    .heic-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
@media (max-width: 620px) {
    .heic-compare-row {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }
    .heic-compare-hd {
        display: none;
    }
    .heic-fmt {
        grid-template-columns: 1fr;
    }
}

/* ---------- 8. 深色微调 ---------- */
:root[data-theme="dark"] .heic-drop {
    background: repeating-linear-gradient(135deg, #151d18 0 12px, #131b16 12px 24px);
    border-color: #2d4a3b;
}
:root[data-theme="dark"] .heic-drop:hover,
:root[data-theme="dark"] .heic-drop.over {
    background: #14261c;
}
:root[data-theme="dark"] .heic-thumb {
    background:
        linear-gradient(45deg, #1a2620 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(-45deg, #1a2620 25%, transparent 25%) 0 8px / 16px 16px,
        #131c17;
}
:root[data-theme="dark"] .heic .tsk-chips span {
    background: #17211c;
    border-color: #26352e;
}

/* ---------- 9. 打印与减少动效 ---------- */
@media print {
    .heic-panel,
    .heic-result-acts,
    .heic-body .tsk-btn {
        display: none;
    }
    .heic-card {
        break-inside: avoid;
    }
}
@media (prefers-reduced-motion: reduce) {
    .heic-card {
        animation: none;
    }
    .heic-prog-bar i {
        transition: none;
    }
}
