/* 基础重置与布局 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f0f0; /* 更柔和的背景色 */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

/* 顶部导航 */
.top-actions {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 10px 20px;
}

/* 语言选择器 */
.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.language-selector select {
    height: 26px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    min-width: 100px;
}

.version-text {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}

/* 删除不需要的样式 */
.manage-buttons,
.pagination-controls {
    display: none;
}

/* 翻译网格 */
.translation-grid {
    display: grid;
    grid-template-columns: repeat(3, 400px);
    gap: 20px;
    justify-content: center;
    padding: 15px 0;
}

/* 翻译项样式优化 */
.translation-item {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    will-change: transform;
    transition: box-shadow 0.3s ease;
}

/* 空翻译项的红色边框 */
.translation-item.empty:not(:focus-within) {
    box-shadow: inset 0 0 0 2px #ff000f;
}

/* 聚焦时移除红色边框 */
.translation-item.empty:focus-within {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 优化文本框样式和性能 */
.translation-item textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    min-height: 60px;
    max-height: 300px;
    resize: vertical;
    overflow-y: auto;
    transition: border-color 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    will-change: height;
    backface-visibility: hidden;
}

.translation-item textarea:focus {
    border-color: #2962ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.1);
}

/* 按钮基础样式 */
.btn {
    height: 26px;
    padding: 0 8px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    color: white;
}

.btn-primary { background: #2962ff; } /* 更现代的蓝色 */
.btn-success { background: #388e3c; } /* 更柔和的绿色 */
.btn-danger { background: #d32f2f; } /* 更柔和的红色 */
.btn-secondary { 
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}
.btn-info { background: #00acc1; } /* 更加清新的颜色 */

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 对话框 */
.dialog {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.dialog-content {
    width: 700px;
    margin: 10vh auto 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 选项卡 */
.keys-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 5px 16px;
    color: #666;
    border-radius: 4px;
    border: none;
    background: none;
}

.tab-btn.active {
    background: #2962ff;
    color: white;
}

/* 导入预览 */
.import-preview {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    background: #f8f9fa;
}

/* 表单元素 */
textarea,
input[type="text"] {
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    width: 100%;
}

/* 通知消息 */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 2000;
    color: white;
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.3s;
}

.message.success { background: #4CAF50; }
.message.error { background: #ff9c9c; }
.message.info { background: #2196F3; }

/* 通用样式 */
.text-line {
    color: #1d1d1d;
    font-size: 12px;
    font-weight: 700;
}

.separator {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 15px;
    display: inline-block;
    vertical-align: middle;
}

/* 统计卡片样式 */
.stats-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    margin: 20px auto;
    max-width: 1000px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stats-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: #f0f4f8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-label {
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.stat-value {
    color: #2196F3;
    font-size: 12px;
    font-weight: 600;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.progress-bar .progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #2962ff);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 修改弹窗样式 */
.dialog {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.dialog-content {
    position: relative;
    width: 700px;
    margin: 10vh auto 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    height:460px;
}

.dialog-content h2 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.dialog-body {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.lang-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.lang-row input {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

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

/* 导入按钮禁用状态 */
#importSubmitBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.key-name,
.key-value {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 确保弹窗内容不会太长 */
#langRows {
    margin-bottom: 20px;
}

/* 确保弹窗内容不会太长 */
#addLangDialog .dialog-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 20px;
}

.duplicate-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.duplicate-table th,
.duplicate-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.duplicate-table th {
    background: #f5f5f5;
    font-weight: 500;
}

.confirm-message {
    margin: 20px 0;
    color: #666;
    font-weight: 500;
    text-align: center;
}

.duplicate-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}
/* 版本号文本样式 */
.version-text {
    color: #666;
    font-size: 14px;
    margin: 0 10px;
    padding-top: 5px;
}

/* 添加键值行样式 */
.key-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.key-row input {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 导入功能相关样式 */
.import-section {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 标签页和导入功能相关样式 */
.keys-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.btn-warning {
    background: #ff9800; /* 更加柔和的橙色 */
}

        /* 添加到现有样式中 */
        .dialog-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-bottom: 15px;
            border-bottom: 1px solid #eee;
            margin-bottom: 20px;
        }
        
        .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            color: #666;
            cursor: pointer;
            padding: 0;
            line-height: 1;
        }
        
        .password-input {
            position: relative;
            display: flex;
            align-items: center;
        }
        
        .password-input input {
            flex: 1;
            padding-right: 40px;
        }
        
        .toggle-password {
            position: absolute;
            right: 10px;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            color: #666;
        }
        
        .toggle-password svg {
            fill: currentColor;
        }
        
        .dialog-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #eee;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #333;
            font-weight: 500;
        }
        
        .form-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }
        
        .form-group input:focus {
            border-color: #007bff;
            outline: none;
            box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
        }

        /* 添加用户菜单样式 */
        .user-menu {
            position: relative;
            display: inline-block;
        }
        .user-menu-btn {
            background: transparent;
            border: 1px solid #ddd;
            padding: 8px 15px;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .user-menu-content {
            display: none;
            position: absolute;
            right: 0;
            top: 100%;
            background: white;
            min-width: 160px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            border-radius: 4px;
            z-index: 1000;
        }
        .user-menu-content a {
            display: block;
            padding: 8px 15px;
            text-decoration: none;
            color: #333;
        }
        .user-menu-content a:hover {
            background: #f5f5f5;
        }
        .user-menu.active .user-menu-content {
            display: block;
        }

        .login-wrapper {
            width: 100%;
            max-width: 400px;
            margin: 20px;
            perspective: 1000px;
        }

        .login-container {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            padding: 40px;
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            transform-style: preserve-3d;
            transition: transform 0.6s;
        }

        h2 {
            color: #1a1a1a;
            margin: 0 0 30px;
            text-align: center;
            font-size: 28px;
            font-weight: 600;
            letter-spacing: -0.5px;
        }

        .error {
            background: #fff2f2;
            color: #dc3545;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            border: 1px solid rgba(220, 53, 69, 0.1);
            font-size: 14px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #666;
            font-size: 14px;
        }

        .input-group {
            position: relative;
        }

        input {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid #e1e1e1;
            border-radius: 10px;
            font-size: 16px;
            transition: all 0.3s;
            background: white;
            box-sizing: border-box;
        }

        input:focus {
            border-color: #0083b0;
            outline: none;
            box-shadow: 0 0 0 4px rgba(0,131,176,0.1);
        }

        .submit-btn {
            width: 100%;
            padding: 14px;
            background: #2962ff;
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-top: 10px;
        }

        .submit-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,131,176,0.2);
        }

        .submit-btn:active {
            transform: translateY(0);
            box-shadow: none;
        }

        .links {
            margin-top: 30px;
            text-align: center;
            font-size: 14px;
            color: #666;
        }

        .links a {
            color: #0083b0;
            text-decoration: none;
            transition: color 0.3s;
        }

        .links a:hover {
            color: #00b4db;
        }

        .brand {
            text-align: center;
            margin-top: 30px;
            color: rgba(255,255,255,0.8);
            font-size: 13px;
        }

        .brand-logo {
            width: 40px;
            height: 40px;
            margin-bottom: 10px;
            fill: currentColor;
        }

/* 密码框相关样式 */
.password-input {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.password-input input {
    width: 100%;
    padding: 12px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}

.password-input input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    outline: none;
}

.password-input input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.password-input .toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-input .toggle-password:hover {
    color: #333;
}

.password-input .toggle-password:focus {
    outline: none;
}

.dialog-content .form-group {
    margin-bottom: 20px;
}

.dialog-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.dialog-content .dialog-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 修改密码对话框样式 */
#changePasswordDialog .dialog-content {
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#changePasswordDialog .dialog-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#changePasswordDialog .dialog-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

#changePasswordDialog .dialog-body {
    padding: 20px;
}

#changePasswordDialog .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#changePasswordDialog .close-btn:hover {
    background-color: #f5f5f5;
}

/* 密码框相关样式 */
.password-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.password-input input {
    width: 100%;
    padding: 12px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.password-input input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    color: #666;
}

.toggle-password:hover {
    color: #333;
}

.toggle-password svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}