:root {
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    --primary-950: #1e1b4b;
    
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-200: #bbf7d0;
    --success-300: #86efac;
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;
    --success-800: #166534;
    --success-900: #14532d;
    
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-200: #fde68a;
    --warning-300: #fcd34d;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --warning-900: #78350f;
    
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-200: #fecaca;
    --danger-300: #fca5a5;
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    --danger-800: #991b1b;
    --danger-900: #7f1d1d;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gray-950: #030712;
    
    --background: #ffffff;
    --background-secondary: #f8fafc;
    --background-tertiary: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .lang-switch {
    margin-left: 0;
    margin-right: auto;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600), var(--primary-700));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid var(--primary-300);
    background: var(--surface);
    color: var(--primary-600);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-base);
}

.refresh-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.refresh-icon {
    font-size: 16px;
    transition: transform var(--transition-base);
}

.refresh-btn:hover .refresh-icon {
    transform: rotate(180deg);
}

header h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 28px;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    font-weight: 600;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

nav a:hover {
    color: var(--primary-600);
    transform: translateY(-2px);
}

nav a:hover::before {
    opacity: 0.1;
}

nav a.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: var(--text-inverse);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

nav a.active::before {
    opacity: 1;
}

.lang-switch {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-xs);
}

.lang-switch .lang-option {
    padding: 8px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transform: none !important;
}

.lang-switch .lang-option::before {
    display: none !important;
}

.lang-switch .lang-option:hover {
    background: var(--primary-50);
    color: var(--primary-700);
    box-shadow: none;
    transform: none !important;
}

.lang-switch .lang-option.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
    transform: none !important;
}

@media (max-width: 768px) {
    .lang-switch {
        margin-left: 0;
    }
}

main {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    min-height: auto-fit;
    position: relative;
}

main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-200), transparent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 18px;
}

.stat-card {
    background: linear-gradient(135deg, var(--background-secondary) 0%, var(--background-tertiary) 100%);
    padding: 8px;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600), var(--primary-700));
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card h3 {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.stat-number {
    color: var(--primary-600);
    font-weight: 700;
    font-size: 18px;
}

.stat-number.error {
    color: var(--danger-600);
}

.daily-sentence {
    background: linear-gradient(135deg, var(--success-50) 0%, var(--success-100) 100%);
    padding: 40px;
    border-radius: var(--radius-2xl);
    margin-bottom: 48px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--success-200);
    position: relative;
    overflow: hidden;
}

.daily-sentence::before {
    content: '"';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 80px;
    color: var(--success-200);
    font-family: Georgia, serif;
    line-height: 1;
    opacity: 0.5;
}

.daily-sentence h3 {
    color: var(--success-700);
    margin-bottom: 28px;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sentence-content {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1;
}

.source-text {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 24px;
    line-height: 1.8;
    font-weight: 500;
}

.target-text {
    color: var(--primary-600);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.8;
    direction: rtl;
}

.weather-info {
    background: linear-gradient(135deg, var(--warning-50) 0%, var(--warning-100) 100%);
    padding: 20px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--warning-200);
}

.weather-info h3 {
    color: var(--warning-700);
    margin-bottom: 28px;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.weather-content {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.weather-temp {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.weather-desc {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

.weather-details {
    display: flex;
    gap: 32px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.translate-container {
    max-width: 960px;
    margin: 0 auto;
}

.translate-section {
    margin-bottom: 40px;
}

.translate-section h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.translate-textarea {
    width: 100%;
    min-height: 240px;
    padding: 24px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-family: var(--font-sans);
    resize: vertical;
    transition: all var(--transition-base);
    background: var(--background-secondary);
    line-height: 1.6;
}

.translate-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-lg);
    background: var(--surface);
}

.translate-textarea[readonly] {
    background: var(--background-tertiary);
    cursor: not-allowed;
    opacity: 0.7;
}

.char-count {
    text-align: right;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.char-count.error {
    color: var(--danger-600);
}

.translate-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
    padding: 28px;
    background: linear-gradient(135deg, var(--background-secondary) 0%, var(--background-tertiary) 100%);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.api-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.api-selector label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.api-selector select {
    padding: 12px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 14px;
    min-width: 240px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 600;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.api-selector select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.translate-info {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, var(--warning-50) 0%, var(--warning-100) 100%);
    border-radius: var(--radius-xl);
    border-left: 4px solid var(--warning-500);
    box-shadow: var(--shadow-sm);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    color: var(--primary-600);
    font-weight: 700;
    font-size: 14px;
}

.info-item.warning {
    border-left: 3px solid var(--danger-600);
    padding-left: 16px;
}

.translate-tips {
    background: linear-gradient(135deg, var(--success-50) 0%, var(--success-100) 100%);
    padding: 36px;
    border-radius: var(--radius-2xl);
    margin-top: 48px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--success-200);
}

.translate-tips h3 {
    color: var(--success-700);
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.translate-tips ul {
    list-style: none;
    padding-left: 0;
}

.translate-tips li {
    padding: 16px 0;
    color: var(--success-800);
    position: relative;
    padding-left: 40px;
    font-weight: 600;
    font-size: 15px;
}

.translate-tips li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-600);
    font-weight: 800;
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-100);
    border-radius: var(--radius-full);
}

.btn {
    padding: 14px 40px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled::before {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: var(--text-inverse);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gray-400) 0%, var(--gray-500) 100%);
    color: var(--text-inverse);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: var(--text-inverse);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-500) 0%, var(--danger-600) 100%);
    color: var(--text-inverse);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

footer {
    text-align: center;
    padding: 48px 24px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 500;
    margin-top: 48px;
}

@media (max-width: 1024px) {
    .container {
        padding: 20px;
    }
    
    main {
        padding: 40px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .translate-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .api-selector {
        margin-top: 20px;
    }
    
    nav {
        flex-direction: column;
        gap: 8px;
    }
    
    nav a {
        text-align: center;
        padding: 14px 20px;
    }
    
    header {
        padding: 24px;
    }
    
    header h1 {
        font-size: 28px;
    }
    
    main {
        padding: 32px;
    }
    
    .stat-value {
        font-size: 36px;
    }
    
    .translate-textarea {
        min-height: 200px;
        padding: 20px;
    }
    
    .btn {
        padding: 14px 32px;
        font-size: 14px;
    }
    
    .daily-sentence,
    .weather-info,
    .translate-tips {
        padding: 28px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    nav a {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    main {
        padding: 24px;
    }
    
    .stat-card {
        padding: 24px;
    }
    
    .stat-value {
        font-size: 32px;
    }
    
    .translate-textarea {
        min-height: 180px;
        padding: 16px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 13px;
    }
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-full);
    border: 2px solid var(--background-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
}

::-webkit-scrollbar-corner {
    background: var(--background-secondary);
}

@supports (backdrop-filter: blur(20px)) {
    header {
        background: rgba(255, 255, 255, 0.85);
    }
}

@supports not (backdrop-filter: blur(20px)) {
    header {
        background: rgba(255, 255, 255, 0.98);
    }
}

.translate-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.translate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-light);
}

.translate-title h2 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.translate-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

.translate-stats {
    display: flex;
    gap: 16px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-200);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 20px;
}

.stat-text {
    color: var(--primary-700);
    font-weight: 700;
    font-size: 14px;
}

.translate-content {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.translate-box {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.translate-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--background-secondary), var(--background-tertiary));
    border-bottom: 1px solid var(--border-light);
}

.translate-box-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 16px;
}

.lang-icon {
    font-size: 24px;
}

.translate-box-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid var(--border-light);
}

.icon-btn:hover {
    background: var(--primary-50);
    color: var(--primary-600);
    border-color: var(--primary-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-btn svg {
    transition: transform var(--transition-base);
}

.icon-btn:hover svg {
    transform: scale(1.1);
}

.translate-box textarea {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 24px;
    font-size: 16px;
    font-family: var(--font-sans);
    line-height: 1.8;
    resize: none;
    background: var(--surface);
    color: var(--text-primary);
    min-height: 200px;
}

.translate-box textarea:focus {
    outline: none;
}

.translate-box textarea::placeholder {
    color: var(--text-tertiary);
}

.translate-box-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--background-secondary);
    border-top: 1px solid var(--border-light);
}

.char-count {
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
}

.char-count span {
    color: var(--primary-600);
    font-weight: 700;
}

.translate-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--success-500);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.translate-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: var(--text-inverse);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: var(--shadow-xl);
}

.swap-btn svg {
    transition: transform var(--transition-base);
}

.translate-meta {
    display: flex;
    gap: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.meta-value {
    color: var(--text-primary);
    font-weight: 700;
}

.meta-item svg {
    color: var(--primary-500);
}

.translate-controls {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 40px;
    padding: 32px;
    background: linear-gradient(135deg, var(--background-secondary), var(--background-tertiary));
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.control-label {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.api-selector-wrapper {
    position: relative;
    flex: 1;
}

.api-select {
    width: 100%;
    padding: 14px 48px 14px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
}

.api-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.api-select-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.btn-large {
    padding: 16px 48px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-large svg {
    transition: transform var(--transition-base);
}

.btn-large:hover svg {
    transform: translateX(4px);
}

.translate-progress {
    margin-bottom: 40px;
    padding: 32px;
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--primary-200);
}

.progress-bar {
    height: 8px;
    background: var(--primary-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-full);
    width: 0%;
    transition: width var(--transition-base);
    animation: shimmer 2s infinite;
}

.progress-text {
    text-align: center;
    color: var(--primary-700);
    font-weight: 700;
    font-size: 16px;
}

.translate-result {
    margin-bottom: 40px;
    padding: 32px;
    background: linear-gradient(135deg, var(--success-50), var(--success-100));
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--success-200);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--success-700);
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-title svg {
    color: var(--success-600);
}

.result-content {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.translate-tips {
    padding: 40px;
    background: linear-gradient(135deg, var(--background-secondary), var(--background-tertiary));
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.tips-header svg {
    color: var(--primary-500);
}

.tips-header h3 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 800;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.tip-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.tip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.tip-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.tip-content h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tip-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-light);
}

.page-title h2 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

.projects-section {
    margin-bottom: 40px;
}

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

.section-header h3 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
}

.section-actions {
    display: flex;
    gap: 8px;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.projects-list .loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    font-size: 16px;
    font-weight: 500;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--background-secondary), var(--background-tertiary));
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
}

.close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid var(--border-light);
}

.close-btn:hover {
    background: var(--danger-50);
    color: var(--danger-600);
    border-color: var(--danger-300);
    transform: rotate(90deg);
    box-shadow: var(--shadow-md);
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding: 24px;
    background: var(--background-secondary);
    border-top: 1px solid var(--border-light);
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.form-group label svg {
    color: var(--primary-500);
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-family: var(--font-sans);
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.dictionary-section {
    margin-bottom: 40px;
}

.search-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.search-bar input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-family: var(--font-sans);
    background: var(--surface);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-bar select {
    padding: 12px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.dictionary-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dictionary-list .loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    font-size: 16px;
    font-weight: 500;
}

.dictionary-list .empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    font-size: 16px;
    font-weight: 500;
}

.dictionary-entry {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-base);
}

.dictionary-entry:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.dictionary-entry.selected {
    border-color: var(--primary-500);
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
}

.dictionary-entry.error-row {
    border-left: 4px solid var(--danger-500);
}

.entry-number {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--primary-500);
    color: var(--text-inverse);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

.entry-content {
    padding: 20px;
}

.entry-source,
.entry-target {
    margin-bottom: 16px;
}

.entry-source .label,
.entry-target .label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.entry-source .text,
.entry-target .text {
    display: block;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
}

.entry-target .text {
    direction: rtl;
}

.entry-target .text.quality-high {
    color: var(--success-600);
}

.entry-target .text.quality-medium {
    color: var(--warning-600);
}

.entry-target .text.quality-low {
    color: var(--danger-600);
}

.entry-meta {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    background: var(--background-secondary);
    border-top: 1px solid var(--border-light);
}

.entry-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.entry-meta .quality {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.entry-meta .quality.quality-high {
    background: var(--success-100);
    color: var(--success-700);
}

.entry-meta .quality.quality-medium {
    background: var(--warning-100);
    color: var(--warning-700);
}

.entry-meta .quality.quality-low {
    background: var(--danger-100);
    color: var(--danger-700);
}

.entry-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: var(--background-secondary);
    border-top: 1px solid var(--border-light);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid var(--border-light);
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--primary-50);
    color: var(--primary-600);
    border-color: var(--primary-300);
    transform: scale(1.1);
}

.btn-icon.btn-edit:hover {
    background: var(--primary-100);
    color: var(--primary-700);
}

.btn-icon.btn-delete:hover {
    background: var(--danger-50);
    color: var(--danger-600);
    border-color: var(--danger-300);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.error {
    background: var(--danger-500);
    color: var(--text-inverse);
}

@media (max-width: 1024px) {
    .translate-content {
        grid-template-columns: 1fr;
    }
    
    .translate-divider {
        display: none;
    }
    
    .tips-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .translate-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .translate-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .translate-box textarea {
        min-height: 180px;
        padding: 20px;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .translate-title h2 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .translate-title h2 {
        font-size: 24px;
    }
    
    .translate-box textarea {
        min-height: 160px;
        padding: 16px;
        font-size: 15px;
    }
    
    .stat-badge {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
    }
    
    .btn-large {
        padding: 14px 32px;
        font-size: 14px;
    }
    
    .tip-card {
        padding: 20px;
    }
}
