@font-face {
    font-family: 'MyCustomFont';
    src: url('../font/AlpEkran.woff2') format('woff2'),
         url('../font/AlpEkran.woff') format('woff'),
         url('../font/AlpEkran.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --background-dark: #1a1f35;
    --text-color: #ffffff;
    --border-radius: 12px;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--background-dark), #2a3149);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header {
    text-align: center;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
}

h1 {
    font-size: 1.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

.language-switch {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.lang-pair {
    display: flex;
    align-items: center;
    gap: 15px;
}

.switch-arrow {
    color: var(--text-color);
    font-size: 20px;
    opacity: 0.8;
    margin: 0 5px;
}

.select-group {
    position: relative;
    width: 140px;
}

.lang-select {
    width: 100%;
    padding: 12px 35px 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    appearance: none;
    -webkit-appearance: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.lang-select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03);
}

.lang-select:not(:disabled):hover {
    background: rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.lang-select:not(:disabled):focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.3);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.2);
    background: rgba(52, 152, 219, 0.1);
}

/* 下拉选项样式 */
.lang-select option {
    background-color: #2a3149;
    color: #ffffff;
    padding: 10px;
}

/* 选中状态的选项 */
.lang-select option:checked {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: #ffffff;
}

/* 鼠标悬停在选项上的样式 */
.lang-select option:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    font-size: 12px;
    transition: all 0.3s ease;
}

.lang-select:not(:disabled):hover + .select-arrow {
    color: rgba(255, 255, 255, 0.9);
}

/* 适配深色主题 */
@media (prefers-color-scheme: dark) {
    .lang-select option {
        background-color: #1a1f35;
    }
}

/* 确保选项文字清晰可见 */
.lang-select, .lang-select option {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.translator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.input-section, .output-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 25px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.textarea-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
    padding: 0 5px;
}

.input-section .textarea-header {
    justify-content: space-between;
}

textarea, .result-area {
    width: 100%;
    height: 450px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.6;
    resize: none;
}

textarea {
    outline: none;
    transition: all 0.3s ease;
}

textarea:focus {
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.2);
    background: rgba(0, 0, 0, 0.25);
}

.result-area {
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
    padding: 0 5px;
}

button {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.copy-btn {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.2);
}

.copy-btn:hover {
    background: rgba(46, 204, 113, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.2);
}

.clear-btn {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.2);
}

.clear-btn:hover {
    background: rgba(231, 76, 60, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}

footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-color);
    padding: 12px 25px;
    border-radius: 50px;
    display: none;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

/* RTL 支持 */
.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'MyCustomFont', sans-serif;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.3);
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.4);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        padding: 20px;
    }

    textarea, .result-area {
        height: 400px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .translator {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .lang-pair {
        flex-direction: column;
        gap: 10px;
    }

    .switch-arrow {
        transform: rotate(90deg);
    }

    .select-group {
        width: 100%;
        max-width: 200px;
    }

    h1 {
        font-size: 2em;
    }

    textarea, .result-area {
        height: 300px;
        padding: 15px;
    }

    .textarea-header {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.translator > div {
    animation: fadeIn 0.5s ease-out;
} 