/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 700;
}

nav {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.nav-link {
    padding: 12px 24px;
    text-decoration: none;
    color: #666;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    background: white;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 主内容区域 */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* 翻译卡片 */
.translation-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.translation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

textarea {
    width: 100%;
    padding: 20px;
    border: 2px solid #e1e8ed;
    border-radius: 15px;
    font-size: 16px;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    background: #ffffff;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), inset 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.char-counter {
    text-align: right;
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

.language-tips {
    margin-top: 8px;
}

.language-tips small {
    color: #888;
    font-style: italic;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #ffffff;
    color: #666;
    border: 2px solid #e1e8ed;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    text-transform: none;
    letter-spacing: 0;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner .path {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* 警告消息 */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-error {
    background: #fee;
    border-color: #f44336;
    color: #c62828;
}

/* 结果卡片 */
.result-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.result-card h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.result-section {
    margin-bottom: 30px;
}

.result-section h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.text-box {
    background: #ffffff;
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #667eea;
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.8;
    min-height: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.text-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.original-text {
    border-left-color: #3498db;
}

.translation-text {
    border-left-color: #e74c3c;
}

.back-translation-text {
    border-left-color: #f39c12;
}

/* 相似度指示器 */
.similarity-indicator {
    background: #ffffff;
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.similarity-bar {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 25px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.similarity-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #feca57 50%, #48dbfb 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.similarity-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.quality-badge {
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quality-good {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.quality-fair {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
}

.quality-poor {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

/* 结果操作 */
.result-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

/* 复制按钮动画 */
.btn.copied {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

/* 占位符区域 */
.placeholder-section {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.placeholder-section p {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.placeholder-section p:first-child {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    main {
        grid-template-columns: 1fr;
    }
    
    nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-link {
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .translation-card,
    .result-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .translation-card,
    .result-card {
        padding: 15px;
    }
    
    .text-box {
        padding: 15px;
        font-size: 14px;
    }
}