/* ===== 基礎樣式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #303133;
    overflow: hidden;
}

/* ===== 表頭區域 ===== */
.header-content {
    flex-shrink: 0;
    margin-left: 20px;
    padding: 10px 0;
}

/* ===== 主內容區域 ===== */
.main-content {
    flex: 1;
    padding: 0 20px 20px 20px;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

/* ===== 內容卡片 ===== */
.content-card {
    background: white;
    border-radius: 8px;
    height: 100%;
    padding: 0;
    position: relative;
    overflow: auto;
}

/* ===== 翻譯表單 ===== */
form {
    padding: 40px 60px;
}

/* ===== 語言選擇器 ===== */
.lang-selector-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.lang-selector-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-selector-group label {
    font-size: 16px;
    color: #757575;
    font-weight: 400;
    line-height: 22px;
    white-space: nowrap;
}

.lang-selector-group select {
    min-width: 160px;
    height: 36px;
    padding: 6px 36px 6px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    color: #303133;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23909399' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.lang-selector-group select:hover {
    border-color: #c0c4cc;
}

.lang-selector-group select:focus {
    outline: none;
    border-color: #0cacff;
}

.lang-swap-btn {
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.lang-swap-btn:hover {
    border-color: #c0c4cc;
    background: #f5f7fa;
}

.lang-swap-btn:active {
    background: #ebeef5;
}

/* ===== 文件上傳區域 ===== */
.file-upload-area {
    border: 2px dashed #CEE2FD;
    background: #fbfcfd;
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 30px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-upload-area:hover {
    border-color: #4259ff;
    background: #fbfcfd;
}

.file-upload-area.dragover {
    border-color: #4259ff;
    background: #fbfcfd;
}

/* 上傳內容 */
.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 20px;
    background: #ebf3fe;
    border: 1px solid #ddeafb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.file-upload-area:hover .upload-icon {
    background: #cee2fd;
}

.upload-icon svg {
    width: 28px;
    height: 28px;
}

.upload-text {
    font-size: 18px;
    color: #002253;
    margin-bottom: 8px;
    font-weight: 400;
    line-height: 22px;
}

.upload-or {
    font-size: 18px;
    color: #002253;
    margin-bottom: 16px;
    font-weight: 400;
    line-height: 22px;
}

.browse-btn {
    display: inline-block;
    padding: 5px 16px;
    background: #ebf3fe;
    border: 1px solid #ddeafb;
    color: #002253;
    font-size: 14px;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-weight: 400;
    line-height: 22px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
    height: 33px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.browse-btn:hover {
    background: #cee2fd;
    border-color: #ddeafb;
    color: #002253;
}

.browse-btn:active {
    background: #b8d5f9;
}

.upload-hint {
    font-size: 16px;
    color: #757575;
    line-height: 22px;
    font-weight: 400;
}

/* ===== 檔案已選擇狀態 ===== */
.file-selected-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

.file-info {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border: 1px solid #e4e7ed;
    border-radius: 4px;
    padding: 12px 16px;
    width: 100%;
    gap: 12px;
}

.file-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon svg {
    width: 24px;
    height: 24px;
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    overflow: hidden;
}

.file-name-text {
    font-size: 14px;
    color: #303133;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.file-remove-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #EBF3FE;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.file-remove-btn:hover {
    background: #CEE2FD;
}

.file-type-badge {
    background: #f7f7fa;
    color: #303133;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
}

/* ===== 翻譯進度狀態 ===== */
.translation-progress-content {
    width: 100%;
    max-width: 500px;
}

.progress-label {
    font-size: 15px;
    color: #303133;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: left;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #ebeef5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0cacff 0%, #409eff 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-percent {
    font-size: 14px;
    color: #0cacff;
    font-weight: 500;
    min-width: 45px;
    text-align: right;
}

.progress-hint {
    font-size: 13px;
    color: #909399;
    text-align: center;
}

/* ===== 下載區域 ===== */
.download-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}

.download-area .download-btn {
    margin-top: 0;
}

.download-hint {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #909399;
}

/* ===== 提交按鈕 ===== */
.submit-btn {
    display: block;
    margin: 0 auto;
    padding: 5px 16px;
    background: #f0f1f1;
    border: 1px solid #ddeafb;
    color: #a1a1a1;
    font-size: 14px;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-weight: 400;
    line-height: 22px;
    text-align: center;
    border-radius: 4px;
    height: 33px;
    cursor: not-allowed;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.submit-btn:enabled {
    background: #ebf3fe;
    color: #002253;
    cursor: pointer;
    border-color: #ddeafb;
}

.submit-btn:enabled:hover {
    background: #cee2fd;
    border-color: #ddeafb;
    color: #002253;
}

.submit-btn:enabled:active {
    background: #b8d5f9;
    border-color: #ddeafb;
    color: #002253;
}

/* ===== 取消翻譯按鈕 ===== */
.cancel-btn {
    display: block;
    margin: 0 auto;
    padding: 5px 16px;
    background: #ebf3fe;
    border: 1px solid #ddeafb;
    color: #002253;
    font-size: 14px;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-weight: 400;
    line-height: 22px;
    text-align: center;
    border-radius: 4px;
    height: 33px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cancel-btn:hover {
    background: #cee2fd;
    border-color: #ddeafb;
    color: #002253;
}

.cancel-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(206, 226, 253, 0.5);
}

.cancel-btn:active {
    background: #b8d5f9;
    border-color: #ddeafb;
    color: #002253;
}

/* ===== 狀態訊息樣式 ===== */
.status {
    margin: 20px 60px 0;
    padding: 16px 20px;
    border-radius: 6px;
    display: none;
    animation: slideIn 0.3s ease;
    line-height: 1.5;
    text-align: center;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.status.success {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.status.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.status small {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    opacity: 0.9;
}

/* ===== 統計資訊樣式 ===== */
.stats-container {
    margin: 20px 60px;
}

.stats {
    font-size: 13px;
    color: #606266;
    text-align: center;
    line-height: 1.6;
    padding: 16px;
    background: #f5f7fa;
    border-radius: 6px;
}

.stats strong {
    color: #303133;
    font-weight: 500;
}

/* ===== 載入動畫 ===== */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(12, 172, 255, 0.2);
    border-top-color: #0cacff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* ===== 下載按鈕 ===== */
.download-btn {
    margin-top: 16px;
    background: #EDEFFA;
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    color: #4259FF;
    border: 1px solid #EDEFFA;
    border-radius: 8%;
    text-decoration: none;
    transition: all 0.2s;
}

.download-btn:hover {
    background: #DFE1F1;
    border-color: #DFE1F1;
}

/* ===== 響應式設計 ===== */
@media (max-width: 1024px) {
    form {
        padding: 30px 40px;
    }

    .lang-selector-wrapper {
        gap: 16px;
    }

    .lang-selector-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .lang-selector-group select {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 0 10px 10px 10px;
    }

    form {
        padding: 24px 20px;
    }

    .lang-selector-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .lang-selector-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }

    .lang-selector-group select {
        width: 100%;
    }

    .lang-swap-btn {
        align-self: center;
        transform: rotate(90deg);
    }

    .file-upload-area {
        padding: 40px 20px;
        min-height: 220px;
    }

    .status,
    .stats-container {
        margin-left: 20px;
        margin-right: 20px;
    }
}

@media (max-width: 480px) {
    form {
        padding: 20px 16px;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .upload-text {
        font-size: 15px;
    }

    .file-info {
        padding: 10px 12px;
    }

    .file-name-text {
        font-size: 13px;
    }
}