/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-text {
    background: transparent;
    color: #666;
}

.btn-text:hover {
    color: #1890ff;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: #1890ff;
    color: white;
    font-size: 20px;
    border-radius: 50%;
}

/* 登录/注册页面 */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.logo {
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.2s;
}

.tab.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

.auth-form {
    display: block;
}

.auth-form.hidden {
    display: none;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1890ff;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.error-message {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 10px;
    min-height: 18px;
}

.auth-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 10px;
}

/* 应用页面布局 */
.app-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.logo-small {
    font-size: 18px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: #666;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

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

.sidebar-header h2 {
    font-size: 16px;
}

.project-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.project-item {
    padding: 15px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.project-item:hover {
    background: #f5f5f5;
}

.project-item.active {
    background: #e6f7ff;
    color: #1890ff;
}

.project-item h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.project-item p {
    font-size: 12px;
    color: #999;
}

/* 内容区 */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.view {
    display: block;
}

.view.hidden {
    display: none;
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
}

.empty-state h2 {
    margin-bottom: 10px;
    color: #666;
}

.empty-state p {
    color: #999;
    margin-bottom: 30px;
}

/* 项目详情 */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.project-header h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.project-header p {
    color: #666;
}

.project-actions {
    display: flex;
    gap: 10px;
}

/* 语言标签 */
.language-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 20px;
    overflow-x: auto;
}

.language-tab {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.language-tab:hover {
    border-color: #1890ff;
}

.language-tab.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* 翻译列表 */
.translation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.translation-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.translation-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.translation-key {
    font-weight: 600;
    color: #1890ff;
}

.translation-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.translation-status.pending {
    background: #fff7e6;
    color: #fa8c16;
}

.translation-status.translated {
    background: #e6f7ff;
    color: #1890ff;
}

.translation-status.approved {
    background: #f6ffed;
    color: #52c41a;
}

.translation-source {
    margin-bottom: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.translation-value {
    padding: 10px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
}

.translation-value:hover {
    border-color: #1890ff;
    background: white;
}

.translation-value.empty {
    color: #999;
    font-style: italic;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-content form {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.source-info {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 20px;
}

.source-info div {
    margin-bottom: 8px;
}

.source-info div:last-child {
    margin-bottom: 0;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 60px;
        bottom: 0;
        z-index: 100;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }

    .project-header {
        flex-direction: column;
        gap: 15px;
    }

    .project-actions {
        width: 100%;
    }

    .project-actions button {
        flex: 1;
    }
}
