* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    padding: 20px;
    color: #334155;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

header {
    background: white;
    color: #0f172a;
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #0f172a;
    font-weight: 700;
}

header h1 i {
    color: #10b981;
}

.subtitle {
    opacity: 0.7;
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 400;
}

.translator-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2.5rem;
}

@media (max-width: 768px) {
    .translator-box {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

select {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

select:hover {
    border-color: #cbd5e1;
}

select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.swap-btn {
    background: white;
    color: #10b981;
    border: 2px solid #10b981;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background: #10b981;
    color: white;
    transform: rotate(180deg);
}

.text-area-container {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: border-color 0.3s;
}

.text-area-container:focus-within {
    border-color: #10b981;
}

textarea {
    width: 100%;
    height: 280px;
    padding: 20px;
    border: none;
    resize: none;
    font-size: 1.1rem;
    font-family: inherit;
    line-height: 1.6;
    color: #334155;
    background: transparent;
}

textarea::placeholder {
    color: #94a3b8;
}

textarea:focus {
    outline: none;
}

.text-counter {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.9rem;
}

.clear-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clear-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.output-section {
    display: flex;
    flex-direction: column;
}

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

.translation-header h3 {
    color: #0f172a;
    font-size: 1.3rem;
    font-weight: 600;
}

.translate-btn-container {
    margin-bottom: 1rem;
    text-align: center;
}

.translate-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.translate-btn:active {
    transform: translateY(0);
}

.translate-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.translate-btn i {
    font-size: 1.2rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.action-btn.copy {
    color: #10b981;
    border-color: #a7f3d0;
}

.action-btn.copy:hover {
    background: #f0fdf4;
    border-color: #10b981;
}

.translated-text {
    height: 280px;
    padding: 20px;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #334155;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.translation-info {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.9rem;
}

.detected-lang {
    font-weight: 500;
    color: #10b981;
}

.loading {
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 3rem 2.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .features {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
    }
}

.feature {
    text-align: center;
    padding: 2rem 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    border: 1px solid #f1f5f9;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 2.5rem;
    color: #10b981;
    margin-bottom: 1.2rem;
}

.feature h3 {
    color: #0f172a;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.feature p {
    color: #64748b;
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 2rem;
    background: white;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
}

.api-info {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.api-info i {
    color: #10b981;
}

.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: white;
    color: #0f172a;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #10b981;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-width: 350px;
    pointer-events: none;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.success {
    border-left-color: #10b981;
}

.notification.info {
    border-left-color: #3b82f6;
}

/* RTL 支持 */
.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ltr {
    direction: ltr;
    text-align: left;
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-indicator.online {
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-indicator.offline {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* 复制成功效果 */
.copy-success {
    animation: copyPulse 0.6s ease;
}

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
                               }
