* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    background: #F2F7FA;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: #111;
}

.container {
    width: 100%;
    height: 100vh;
    margin: 0;
    background: #F2F7FA;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.header {
    background: #6A8BAC;
    color: white;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.header-content {
    padding: 20px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 5px;
    font-weight: 600;
}

.header p {
    opacity: 0.95;
    font-size: 0.95em;
}

.header-tabs {
    display: flex;
    background: rgba(255,255,255,0.1);
    padding: 0 30px;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-size: 15px;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.tab-btn.active {
    color: white;
    border-bottom-color: white;
    font-weight: 600;
}

.tab-icon {
    font-size: 18px;
}

/* 内容区域 */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.tab-content {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content.active {
    display: block;
}

/* 工作流容器 */
.workflow-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.workflow-step {
    background: white;
    border-radius: 8px;
    padding: 25px;
    border: 1px solid #7A5F44;
    transition: border-color 0.3s;
}

.workflow-step:hover {
    border-color: #8AABCC;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #7A5F44;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #6A8BAC;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(106, 139, 172, 0.5);
}

.step-header h2 {
    margin: 0;
    font-size: 1.4em;
    color: #111;
    font-weight: 600;
}

.step-content {
    padding-left: 55px;
}

/* 输入模式标签页 */
.input-mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #7A5F44;
}

.mode-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #666;
    transition: all 0.3s;
    font-weight: 500;
}

.mode-tab:hover {
    color: #6A8BAC;
    background: #F2F7FA;
}

.mode-tab.active {
    color: #6A8BAC;
    border-bottom-color: #6A8BAC;
    font-weight: 600;
}

.mode-tab .mode-icon {
    font-size: 18px;
}

/* 文件上传区域 */
.input-section {
    margin-top: 20px;
}

.file-upload-area {
    border: 2px dashed #7A5F44;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #F2F7FA;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #7A9BBC;
    background: #E8F1F7;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.upload-icon {
    font-size: 48px;
}

.upload-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.upload-text strong {
    font-size: 18px;
    color: #6A8BAC;
}

.upload-text span {
    font-size: 14px;
    color: #666;
}

.upload-hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.file-list {
    margin-top: 20px;
    display: none;
}

.file-list.active {
    display: block;
}

.file-item {
    padding: 15px;
    background: #F2F7FA;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #6A8BAC;
}

.file-item span {
    flex: 1;
    color: #111;
    font-weight: 500;
}

.file-item button {
    padding: 6px 15px;
    background: #B53A2A;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.file-item button:hover {
    background: #B53A2A;
}

/* 文本输入区域 */
.text-input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-label {
    font-weight: 600;
    color: #111;
    font-size: 14px;
}

.text-input-area textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #7A5F44;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.text-input-area textarea:focus {
    outline: none;
    border-color: #7A9BBC;
}

.input-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 配置组 */
.config-group {
    margin-bottom: 20px;
}

.config-header-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #F2F7FA;
    border-left: 4px solid #6A8BAC;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #6A8BAC;
}

.hint-icon {
    font-size: 16px;
}

.hint-text {
    font-weight: 500;
}

/* 文件配置列表 */
.file-config-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-empty-hint {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    background: #F2F7FA;
    border-radius: 8px;
}

.file-config-item {
    padding: 15px;
    background: #F2F7FA;
    border-radius: 8px;
    border-left: 4px solid #6A8BAC;
}

.file-config-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #7A5F44;
}

.file-config-name {
    font-weight: 600;
    color: #111;
    flex: 1;
}

.file-config-format {
    color: #999;
    font-size: 12px;
}

.btn-remove-file {
    padding: 4px 10px;
    background: #B53A2A;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    line-height: 1;
}

.btn-remove-file:hover {
    background: #B53A2A;
}

.file-config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.config-select,
.config-input {
    padding: 12px;
    border: 2px solid #7A5F44;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.config-select:focus,
.config-input:focus {
    outline: none;
    border-color: #7A9BBC;
}

.input-hint-small {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 字段多选框组 */
.field-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    border: 2px solid #7A5F44;
    border-radius: 8px;
    background: #F2F7FA;
    max-height: 200px;
    overflow-y: auto;
    transition: border-color 0.3s;
}

.field-checkbox-group:focus-within {
    border-color: #7A9BBC;
}

.field-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #7A5F44;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    font-size: 14px;
}

.field-checkbox-label:hover {
    background: #E8F1F7;
    border-color: #7A9BBC;
}

.field-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6A8BAC;
}

.field-checkbox-label input[type="checkbox"]:checked + span {
    color: #6A8BAC;
    font-weight: 600;
}

.field-checkbox-label:has(input:checked) {
    background: #E8F1F7;
    border-color: #7A9BBC;
}

/* 语言多选框组 */
.lang-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border: 2px solid #7A5F44;
    border-radius: 8px;
    background: #F2F7FA;
    transition: border-color 0.3s;
}

.lang-checkbox-group:focus-within {
    border-color: #7A9BBC;
}

.lang-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #7A5F44;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    font-size: 14px;
}

.lang-checkbox-label:hover {
    background: #E8F1F7;
    border-color: #7A9BBC;
}

.lang-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6A8BAC;
}

.lang-checkbox-label input[type="checkbox"]:checked + span {
    color: #6A8BAC;
    font-weight: 600;
}

.lang-checkbox-label:has(input:checked) {
    background: #E8F1F7;
    border-color: #7A9BBC;
}

/* 处理按钮 */
.btn-process {
    width: 100%;
    padding: 18px 30px;
    background: #6A8BAC;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s;
    box-shadow: 0 3px 10px rgba(106, 139, 172, 0.5);
}

.btn-process:hover {
    background: #6A8BAC;
    box-shadow: 0 5px 15px rgba(106, 139, 172, 0.6);
}

.btn-process:active {
    transform: translateY(0);
}

.btn-process:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.process-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.process-status.loading {
    display: block;
    background: #F2F7FA;
    color: #6A8BAC;
    text-align: left;
    contain: layout style paint; /* 限制影响范围，防止动画影响其他元素 */
}

.process-status.loading .loading-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    position: relative;
    z-index: 1;
    isolation: isolate; /* 创建新的层叠上下文 */
}

.process-status.error {
    display: block;
    background: #E8F1F7;
    color: #B53A2A;
}

/* 结果容器 */
.result-container {
    min-height: 100px;
    display: none;
}

.result-container.active {
    display: block;
}

.result-box {
    padding: 20px;
    border-radius: 10px;
    background: #F2F7FA;
}

.result-box.success {
    background: #E8F1F7;
    border-left: 4px solid #938F4C;
}

.result-box.error {
    background: #E8F1F7;
    border-left: 4px solid #DD6B4F;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 20px;
    background: white;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #7A5F44;
}

.stat-card .number {
    font-size: 2.5em;
    font-weight: bold;
    color: #6A8BAC;
    margin-bottom: 5px;
}

.stat-card .label {
    color: #666;
    font-size: 14px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #7A5F44;
}

.result-table th,
.result-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #7A5F44;
}

.result-table th {
    background: #F2F7FA;
    font-weight: 600;
    color: #111;
}

.result-table tr:hover {
    background: #F2F7FA;
}

.result-table tr:last-child td {
    border-bottom: none;
}

/* 搜索页面 */
.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    border: 1px solid #7A5F44;
}

.search-title {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #111;
    text-align: center;
}

.search-form {
    margin-bottom: 25px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #7A5F44;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #7A9BBC;
}

.btn-search {
    padding: 15px 30px;
    background: #6A8BAC;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(106, 139, 172, 0.5);
}

.btn-search:hover {
    background: #6A8BAC;
    box-shadow: 0 5px 12px rgba(106, 139, 172, 0.6);
    transform: translateY(-1px);
}

.search-options {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.search-results {
    margin-top: 25px;
    min-height: 50px;
}

.search-result-item {
    padding: 15px;
    background: #F2F7FA;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #6A8BAC;
}

.search-result-item strong {
    color: #6A8BAC;
    font-size: 16px;
}

.search-result-item span {
    display: block;
    margin-top: 5px;
    color: #666;
}

/* 翻译表单卡片 */
.translation-form-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #7A5F44;
}

.form-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #7A5F44;
    width: 100%;
    box-sizing: border-box;
}

.form-id {
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-id strong {
    color: #6A8BAC;
    font-size: 18px;
}

.btn-copy-id {
    padding: 4px 10px;
    background: #6A8BAC;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-copy-id:hover {
    background: #7A9BBC;
}

.btn-copy-id:active {
    transform: translateY(0);
}

.form-source {
    font-size: 14px;
    color: #999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.source-text-label {
    font-size: 13px;
    color: #999;
    font-weight: 600;
}

.source-text-content {
    color: #111;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    padding: 10px;
    background: #F2F7FA;
    border-radius: 6px;
    border-left: 3px solid #8AABCC;
    max-width: 100%;
    overflow: visible;
}

.form-source .btn-delete-text {
    align-self: flex-start;
    margin-top: 5px;
}

.translation-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.translation-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #111;
    font-size: 14px;
}

.lang-flag {
    font-size: 20px;
}

.lang-name {
    color: #555;
}

.btn-translate {
    padding: 6px 12px;
    background: #6A8BAC;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-translate:hover {
    background: #7A9BBC;
}

.btn-translate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-translate-exists {
    background: #B53A2A;
}

.btn-translate-exists:hover {
    background: #B53A2A;
}

.translation-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #7A5F44;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    text-align: left;
}

.translation-input:focus {
    outline: none;
    border-color: #7A9BBC;
}

.translation-input:disabled {
    background: #F2F7FA;
    cursor: not-allowed;
}

.field-status {
    font-size: 12px;
    color: #C54A3A;
    margin-top: 5px;
}

.field-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
    font-style: italic;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 2px solid #7A5F44;
}

.btn-save {
    padding: 10px 20px;
    background: #B53A2A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-save:hover {
    background: #B53A2A;
}

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon-small {
    font-size: 14px;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #7A5F44;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
    font-weight: 500;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #938F4C;
    color: #938F4C;
}

.notification.error {
    border-left: 4px solid #DD6B4F;
    color: #B53A2A;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #7A5F44;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0; /* 防止被压缩 */
    position: relative;
    z-index: 2;
    transform-origin: center;
    isolation: isolate; /* 创建独立的层叠上下文 */
    will-change: transform; /* 优化动画性能 */
}

/* 加载包装器（修复旋转动画问题） */
.loading-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading-text {
    flex: 1;
    text-align: left;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    transform: none !important;
    animation: none !important;
    isolation: isolate; /* 创建独立的层叠上下文 */
    will-change: auto; /* 明确不进行变换 */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 设置面板 */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.settings-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    border: 1px solid #7A5F44;
}

.settings-title {
    font-size: 24px;
    color: #111;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #7A5F44;
}

.settings-group {
    margin-bottom: 30px;
}

.settings-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
}

.settings-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #7A5F44;
}

.btn-save-settings,
.btn-reset-settings {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-save-settings {
    background: #6A8BAC;
    color: white;
}

.btn-save-settings:hover {
    background: #7A9BBC;
}

.btn-reset-settings {
    background: #F2F7FA;
    color: #666;
    border: 1px solid #7A5F44;
}

.btn-reset-settings:hover {
    background: #E8F1F7;
}

/* 批量翻译功能 */
.danger-zone {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #E8F1F7;
}

.danger-title {
    color: #B93A26 !important;
}

.danger-warning {
    background: #F2F7FA;
    border-left: 4px solid #E67762;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.danger-warning p {
    margin: 8px 0;
    color: #B53A2A;
    font-size: 14px;
    line-height: 1.6;
}

.danger-warning strong {
    color: #981A0A;
}

.btn-batch-translate {
    padding: 14px 28px;
    background: #B53A2A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
    width: 100%;
    justify-content: center;
}

.btn-batch-translate:hover {
    background: #A82A18;
}

.btn-batch-translate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.batch-translate-result {
    margin-top: 20px;
    min-height: 50px;
}

.batch-translate-status {
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.batch-translate-status.success {
    background: #E8F1F7;
    color: #B53A2A;
    border-left: 4px solid #938F4C;
}

.batch-translate-status.error {
    background: #E8F1F7;
    color: #B53A2A;
    border-left: 4px solid #DD6B4F;
}

.batch-stats {
    margin-top: 10px;
    display: flex;
    gap: 20px;
    font-weight: 600;
}

/* 文本预览界面 */
.preview-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.preview-title {
    font-size: 24px;
    color: #111;
    margin: 0;
}

.preview-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.preview-search-input {
    padding: 10px 15px;
    border: 2px solid #7A5F44;
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
    transition: border-color 0.3s;
}

.preview-search-input:focus {
    outline: none;
    border-color: #7A9BBC;
}

.btn-refresh-preview {
    padding: 10px 20px;
    background: #6A8BAC;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(106, 139, 172, 0.5);
}

.btn-refresh-preview:hover {
    background: #7A9BBC;
    box-shadow: 0 5px 12px rgba(106, 139, 172, 0.6);
    transform: translateY(-1px);
}

.btn-refresh-preview:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-download-csv {
    padding: 10px 20px;
    background: #B53A2A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(197, 74, 58, 0.5);
}

.btn-download-csv:hover {
    background: #B53A2A;
    box-shadow: 0 5px 12px rgba(197, 74, 58, 0.6);
    transform: translateY(-1px);
}

.btn-download-csv:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-download-csv.downloading {
    background: #7A9BBC;
    animation: pulse 1.5s ease-in-out infinite;
}

.btn-download-csv.downloading .btn-icon {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 下载提示Toast样式 */
.download-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

.download-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.download-toast.success {
    border-left: 4px solid #E67762;
}

.download-toast.error {
    border-left: 4px solid #DD6B4F;
}

.download-toast .toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.download-toast.success .toast-icon {
    background: #E8F1F7;
    color: #938F4C;
}

.download-toast.error .toast-icon {
    background: #E8F1F7;
    color: #B53A2A;
}

.download-toast .toast-message {
    flex: 1;
    font-size: 14px;
    color: #111;
    line-height: 1.5;
}

.preview-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #F2F7FA;
    border-radius: 8px;
}

.btn-page {
    padding: 8px 16px;
    background: white;
    border: 2px solid #7A5F44;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-page:hover:not(:disabled) {
    border-color: #7A9BBC;
    color: #6A8BAC;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-jump-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
}

.page-jump-label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.page-jump-input {
    width: 70px;
    padding: 6px 10px;
    border: 2px solid #7A5F44;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s;
    background: white;
}

.page-jump-input:focus {
    outline: none;
    border-color: #7A9BBC;
    box-shadow: 0 0 0 3px rgba(106, 139, 172, 0.2);
}

.page-jump-input::-webkit-inner-spin-button,
.page-jump-input::-webkit-outer-spin-button {
    opacity: 1;
    height: 20px;
}

.preview-pagination-bottom {
    margin-top: 30px;
    margin-bottom: 20px;
}

#previewPageInfo {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.preview-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chinese-field {
    background: #F2F7FA;
    border-left: 4px solid #6A8BAC;
    padding: 15px;
    border-radius: 8px;
}

.chinese-input {
    font-weight: 600;
    font-size: 15px;
    border-color: #8AABCC !important;
}

/* 预览紧凑视图 */
.preview-compact-view {
    padding: 15px;
}

.chinese-field.compact {
    background: #F2F7FA;
    border-left: 4px solid #6A8BAC;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 0;
}

.chinese-text-preview {
    padding: 12px;
    background: white;
    border-radius: 6px;
    color: #111;
    font-size: 15px;
    line-height: 1.6;
    margin-top: 10px;
    min-height: 40px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 简化预览样式 - 提高密度 */
.preview-item-compact {
    background: white;
    border: 1px solid #7A5F44;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.preview-item-compact:hover {
    border-color: #7A9BBC;
}

.preview-item-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.preview-item-id {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-item-id strong {
    color: #111;
    font-size: 14px;
}

.preview-item-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.chinese-text-compact {
    flex: 1;
    color: #111;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: none;
    overflow: visible;
}

.btn-copy-id-small,
.btn-edit-toggle-small {
    padding: 4px 8px;
    background: #F2F7FA;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-copy-id-small:hover,
.btn-edit-toggle-small:hover {
    background: #6A8BAC;
    color: white;
}

.preview-item-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 8px;
}

.translation-count {
    font-size: 12px;
    color: #B53A2A;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 10px;
    background: #E8F1F7;
    border-radius: 12px;
}

.translation-count.empty {
    background: #F2F7FA;
    color: #B53A2A;
}

.btn-delete-text {
    padding: 6px 12px;
    background: #B53A2A;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s;
    margin-left: auto;
}

.btn-delete-text:hover {
    background: #A82A18;
}

.expand-langs-section {
    margin: 15px 0;
    width: 100%;
    grid-column: 1 / -1; /* 占据整行 */
}

.btn-expand-langs {
    padding: 10px 20px;
    background: #F2F7FA;
    color: #666;
    border: 2px dashed #7A5F44;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    width: 100%;
    justify-content: center;
}

.btn-expand-langs:hover {
    background: #E8F1F7;
    border-color: #7A9BBC;
    color: #6A8BAC;
}

.more-langs-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #7A5F44;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* 确保展开的语言字段和默认字段使用相同的样式 */
.more-langs-container .translation-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.translation-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #E8F1F7;
    color: #B53A2A;
}

.translation-badge.empty {
    background: #F2F7FA;
    color: #B53A2A;
}

.btn-edit-toggle {
    padding: 8px 16px;
    background: #6A8BAC;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-edit-toggle:hover {
    background: #7A9BBC;
}

.preview-expanded-view {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-cancel-edit {
    padding: 10px 20px;
    background: #F2F7FA;
    color: #666;
    border: 1px solid #7A5F44;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-cancel-edit:hover {
    background: #E8F1F7;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.error-message {
    padding: 20px;
    background: #E8F1F7;
    color: #B53A2A;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #DD6B4F;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content {
        padding: 15px;
    }
    
    .workflow-step {
        padding: 15px;
    }
    
    .step-content {
        padding-left: 0;
    }
    
    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .config-row {
        grid-template-columns: 1fr;
    }
    
    .input-mode-selector {
        grid-template-columns: 1fr;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .btn-search {
        width: 100%;
        justify-content: center;
    }
}
