/* AI 邮件翻译页 */

.email-trans-page {
    width: 100%;
    min-width: 0;
}

.ai-tool-main:has(.email-trans-page) .ai-tool-header {
    display: none;
}

.ai-tool-page:has(.email-trans-page) .ai-tool-sidebar {
    position: sticky;
    top: 76px;
    align-self: flex-start;
}

.email-trans-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.email-trans-hero {
    padding: 18px 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0ea5e9 100%);
    color: #fff;
    box-shadow: 0 8px 28px rgb(14 165 233 / 20%);
}

.email-trans-hero-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.email-trans-hero-desc {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.6;
    opacity: .92;
}

.email-trans-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.email-trans-hero-tags span {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgb(255 255 255 / 14%);
    border: 1px solid rgb(255 255 255 / 20%);
}

.email-trans-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8eef5;
}

.email-trans-bar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.email-trans-bar-label {
    flex: 0 0 72px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.email-trans-chips,
.email-trans-direction {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.email-trans-chip {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #dbe4ef;
    background: #f8fafc;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all .18s;
}

.email-trans-chip:hover {
    border-color: #93c5fd;
    color: #2563eb;
}

.email-trans-chip.is-active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    font-weight: 600;
}

.email-trans-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    position: relative;
}

.email-trans-hint {
    margin-left: auto;
    font-size: 12px;
    color: #94a3b8;
}

.email-trans-hint kbd {
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 11px;
}

.email-trans-samples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.email-trans-samples-label {
    font-size: 13px;
    color: #64748b;
}

.email-trans-sample-btn {
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    background: #fff;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}

.email-trans-sample-btn:hover {
    border-color: #3b82f6;
    color: #2563eb;
}

.email-trans-panels {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    min-height: 420px;
    min-width: 0;
}

.email-trans-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8eef5;
    overflow: hidden;
}

.email-trans-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfc;
}

.email-trans-panel-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.email-trans-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.email-trans-action-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
}

.email-trans-action-btn:hover {
    background: #eff6ff;
    color: #2563eb;
}

.email-trans-field {
    padding: 12px 16px 0;
}

.email-trans-field--grow {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 12px;
    min-height: 0;
}

.email-trans-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.email-trans-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
}

.email-trans-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 12%);
}

.email-trans-textarea {
    flex: 1;
    width: 100%;
    min-height: 260px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.65;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.email-trans-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 12%);
}

.email-trans-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #eef2f7;
    background: #fafbfc;
}

.email-trans-char-count {
    font-size: 12px;
    color: #94a3b8;
}

.email-trans-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgb(37 99 235 / 30%);
    transition: opacity .2s;
}

.email-trans-btn-primary:hover:not(:disabled) {
    opacity: .92;
}

.email-trans-btn-primary:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.email-trans-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgb(255 255 255 / 35%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: email-trans-spin .7s linear infinite;
}

@keyframes email-trans-spin {
    to { transform: rotate(360deg); }
}

.email-trans-bridge {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    padding-top: 80px;
}

.email-trans-output-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    padding: 16px;
}

.email-trans-output-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #94a3b8;
    gap: 8px;
}

.email-trans-output-empty-icon {
    font-size: 36px;
    opacity: .5;
}

.email-trans-output-empty p {
    margin: 0;
    font-size: 15px;
    color: #64748b;
}

.email-trans-output-empty span {
    font-size: 13px;
}

.email-trans-output {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.email-trans-output-subject {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.email-trans-output-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin-bottom: 4px;
}

.email-trans-output-subject-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    word-break: break-word;
}

.email-trans-output-body {
    flex: 1;
    font-size: 14px;
    line-height: 1.75;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    max-height: 360px;
}

.email-trans-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.email-trans-features li {
    padding: 14px 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8eef5;
}

.email-trans-features strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.email-trans-features span {
    font-size: 12px;
    color: #64748b;
}

.email-trans-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    padding: 10px 20px;
    background: rgb(15 23 42 / 88%);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 9999;
}

.email-trans-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 960px) {
    .email-trans-panels {
        grid-template-columns: 1fr;
    }

    .email-trans-bridge {
        padding: 0;
        transform: rotate(90deg);
    }

    .email-trans-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .email-trans-features {
        grid-template-columns: 1fr;
    }

    .email-trans-bar-label {
        flex: 0 0 100%;
    }
}
