/* ========== 图片翻译专业版 ========== */

.itpro-page {
    width: 100%;
    min-width: 0;
}

.ai-tool-main:has(.itpro-page) .ai-tool-header {
    display: none;
}

.itpro-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Hero */
.itpro-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a 0%, #273548 48%, #1a56db 100%);
    color: #fff;
    box-shadow: 0 8px 28px rgb(26 86 219 / 22%);
}

.itpro-hero-main {
    flex: 1;
    min-width: 240px;
}

.itpro-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.itpro-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.itpro-badge--pro {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
}

.itpro-badge--engine {
    background: rgb(255 255 255 / 14%);
    border: 1px solid rgb(255 255 255 / 22%);
    font-weight: 600;
}

.itpro-hero-title {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.itpro-hero-desc {
    margin: 0 0 14px;
    max-width: 560px;
    font-size: 14px;
    line-height: 1.7;
    color: rgb(255 255 255 / 82%);
}

.itpro-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.itpro-hero-tags span {
    padding: 4px 10px;
    background: rgb(255 255 255 / 10%);
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 6px;
    font-size: 12px;
}

.itpro-tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: center;
}

.itpro-tool-link {
    padding: 7px 14px;
    background: rgb(255 255 255 / 12%);
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 8px;
    font-size: 13px;
    color: #fff;
    text-decoration: none;
    transition: background .15s;
}

.itpro-tool-link:hover {
    background: rgb(255 255 255 / 22%);
    color: #fff;
    text-decoration: none;
}

/* 语言栏容器（复用 texttranslate 语种样式） */
.itpro-lang-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 16px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgb(15 23 42 / 4%);
    min-width: 0;
    overflow: visible;
}

.itpro-lang-wrap .texttranslate-lang-bar {
    flex: 1;
    min-width: 0;
    border-bottom: none;
    border-radius: 12px 0 0 12px;
}

.itpro-point-badge {
    margin-left: auto;
    padding: 6px 14px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 999px;
    font-size: 13px;
    color: #92400e;
    flex-shrink: 0;
}

.itpro-point-badge strong {
    color: #b45309;
}

@media (max-width: 768px) {
    .itpro-lang-wrap {
        flex-wrap: wrap;
        padding: 8px 12px 10px;
    }

    .itpro-lang-wrap .texttranslate-lang-bar {
        flex: 1 1 100%;
        border-radius: 8px;
    }

    .itpro-point-badge {
        margin-left: 0;
    }
}

/* 主卡片 */
.itpro-card {
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgb(15 23 42 / 5%);
}

.itpro-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e8edf5;
}

.itpro-card-badge {
    display: inline-block;
    padding: 3px 10px;
    margin-right: 8px;
    background: linear-gradient(90deg, #1a56db, #6366f1);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.itpro-card-tip {
    font-size: 12px;
    color: #94a3b8;
}

.itpro-steps {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 12px;
    color: #94a3b8;
}

.itpro-step {
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.itpro-step.is-active {
    color: #1a56db;
    font-weight: 700;
    background: #eef4ff;
}

.itpro-step-divider {
    width: 20px;
    height: 1px;
    background: #cbd5e1;
}

.itpro-card-body {
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: 420px;
}

.itpro-card-left {
    padding: 20px;
    border-right: 1px solid #e8edf5;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.itpro-card-right {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fafbfc;
    min-height: 380px;
}

/* 上传区 */
.itpro-upload {
    flex: 1;
    min-height: 200px;
}

.itpro-upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    padding: 24px 16px;
    margin: 0;
    border: 2px dashed #c7d7f5;
    border-radius: 12px;
    background: #f8fbff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}

.itpro-upload-inner:hover,
.itpro-upload-inner.is-dragover {
    border-color: #1a56db;
    background: #eef4ff;
}

.itpro-upload-icon {
    color: #1a56db;
    margin-bottom: 12px;
    opacity: .85;
}

.itpro-upload-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.itpro-upload-desc {
    margin: 0 0 16px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.5;
}

.itpro-upload-btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: #1a56db;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

.itpro-file-preview {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.itpro-file-preview img {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    background: #f1f5f9;
}

.itpro-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
}

.itpro-file-name {
    margin: 0;
    font-size: 13px;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.itpro-file-remove {
    flex-shrink: 0;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
}

.itpro-file-remove:hover {
    color: #ef4444;
    border-color: #fecaca;
}

.itpro-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #1a56db, #4f46e5);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}

.itpro-submit-btn:hover:not(:disabled) {
    opacity: .92;
}

.itpro-submit-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.itpro-submit-btn.is-loading .itpro-submit-text {
    display: none;
}

.itpro-submit-btn.is-loading .itpro-submit-loading {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

.itpro-submit-tip {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
    text-align: center;
}

.itpro-spin {
    animation: itpro-spin .8s linear infinite;
}

@keyframes itpro-spin {
    to { transform: rotate(360deg); }
}

/* 右侧预览 */
.itpro-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #94a3b8;
}

.itpro-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: .7;
}

.itpro-empty-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
}

.itpro-empty-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.itpro-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
}

.itpro-compare-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.itpro-compare-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.itpro-compare-col img {
    width: 100%;
    max-height: min(50vh, 360px);
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.itpro-compare-result {
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px dashed #c7d7f5;
    border-radius: 8px;
}

.itpro-compare-result.is-loading::after {
    content: 'AI 翻译中…';
    position: absolute;
    font-size: 13px;
    color: #1a56db;
}

.itpro-compare-result.is-loading img {
    opacity: .3;
}

.itpro-progress {
    padding: 12px 0;
}

.itpro-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.itpro-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #1a56db, #6366f1);
    border-radius: 999px;
    transition: width .4s ease;
}

.itpro-progress-fill.is-indeterminate {
    width: 40% !important;
    animation: itpro-indeterminate 1.4s ease-in-out infinite;
}

@keyframes itpro-indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.itpro-progress-text {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    text-align: center;
}

.itpro-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 4px;
}

/* 按钮 */
.itpro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .15s, color .15s;
}

.itpro-btn--primary {
    background: #1a56db;
    color: #fff;
}

.itpro-btn--primary:hover {
    background: #1e40af;
    color: #fff;
    text-decoration: none;
}

.itpro-btn--ghost {
    background: #fff;
    border: 1px solid #d1d9e6;
    color: #475569;
}

.itpro-btn--ghost:hover {
    background: #f8fafc;
    color: #1a56db;
    text-decoration: none;
}

.itpro-btn--sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* 历史列表 */
.itpro-history {
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 14px;
    padding: 18px 20px 20px;
    box-shadow: 0 2px 12px rgb(15 23 42 / 5%);
}

.itpro-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.itpro-history-head-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.itpro-history-sub {
    font-size: 12px;
    color: #94a3b8;
}

.itpro-history-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}

.itpro-history-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: 10px;
    margin-bottom: 12px;
}

.itpro-history-login p {
    margin: 0;
    font-size: 13px;
    color: #854d0e;
}

.itpro-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.itpro-history-empty,
.itpro-history-loading {
    padding: 32px;
    text-align: center;
    font-size: 14px;
    color: #94a3b8;
}

.itpro-history-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
}

.itpro-history-page-info {
    font-size: 13px;
    color: #64748b;
    min-width: 88px;
    text-align: center;
}

.itpro-record {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    background: #fafbfc;
    transition: border-color .15s, box-shadow .15s;
    cursor: pointer;
}

.itpro-record:hover {
    border-color: #c7d7f5;
    box-shadow: 0 2px 8px rgb(26 86 219 / 8%);
}

.itpro-record.is-active {
    border-color: #1a56db;
    background: #eef4ff;
}

.itpro-record-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
}

.itpro-record-body {
    min-width: 0;
}

.itpro-record-name {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.itpro-record-meta {
    margin: 0 0 4px;
    font-size: 12px;
    color: #64748b;
}

.itpro-record-time {
    margin: 0;
    font-size: 11px;
    color: #94a3b8;
}

.itpro-record-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.itpro-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.itpro-status--pending,
.itpro-status--processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.itpro-status--done {
    background: #dcfce7;
    color: #15803d;
}

.itpro-status--failed {
    background: #fee2e2;
    color: #b91c1c;
}

.itpro-record-actions {
    display: flex;
    gap: 6px;
}

.itpro-record-actions .itpro-btn {
    padding: 4px 10px;
    font-size: 11px;
}

/* Toast */
.itpro-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: rgb(15 23 42 / 92%);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}

.itpro-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 960px) {
    .itpro-card-body {
        grid-template-columns: 1fr;
    }

    .itpro-card-left {
        border-right: none;
        border-bottom: 1px solid #e8edf5;
    }

    .itpro-compare {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .itpro-hero {
        flex-direction: column;
        padding: 18px;
    }

    .itpro-lang-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .itpro-lang-swap {
        align-self: center;
    }

    .itpro-point-badge {
        margin-left: 0;
    }

    .itpro-record {
        grid-template-columns: 56px 1fr;
        grid-template-rows: auto auto;
    }

    .itpro-record-thumb {
        width: 56px;
        height: 56px;
    }

    .itpro-record-side {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
