* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 30px;
    transition: transform 0.3s ease;
}

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

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2.5rem;
}

h2 {
    margin-bottom: 15px;
    color: #34495e;
    font-size: 1.5rem;
}

.main-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.input-section,
.display-section {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.textarea-container {
    position: relative;
    margin-bottom: 15px;
}

.textarea-container {
    position: relative;
    margin-bottom: 15px;
}

#word-input {
    width: 100%;
    min-height: 150px;
    padding: 15px 15px 15px 45px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    transition: border 0.3s;
    box-sizing: border-box;
    overflow-y: auto;
}

#word-display {
    font-size: 2.5rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}



.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    width: 35px;
    height: 100%;
    padding: 15px 5px;
    text-align: right;
    color: #999;
    font-family: monospace;
    font-size: 1rem;
    line-height: 1.6;
    pointer-events: none;
    background-color: #f0f0f0;
    border-right: 1px solid #ddd;
    border-radius: 6px 0 0 6px;
    box-sizing: border-box;
    overflow: hidden;
}


#word-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2);
}



button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}

.no-repeat-label {
    display: inline-flex;
    align-items: center;
    margin: 0 10px;
    cursor: pointer;
    position: relative;
}

#no-repeat {
    opacity: 0;
    width: 0;
    height: 0;
}

/* 自定义开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-right: 8px;
}

/* 隐藏原生复选框 */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* 开关滑块背景 */
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

/* 开关按钮 */
.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* 选中状态下的滑块背景 */
input:checked + .switch-slider {
    background-color: #3498db;
}

/* 选中状态下的按钮位置 */
input:checked + .switch-slider:before {
    transform: translateX(20px);
}

#no-repeat:focus + .switch-slider {
    box-shadow: 0 0 1px #3498db;
}

#no-repeat:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* 优化搜索按钮样式 */
#search-btn {
    background-color: #2ecc71;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(46, 204, 113, 0.3);
}

#search-btn:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(46, 204, 113, 0.4);
}

.jump-section {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-section {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.jump-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 250px;
}

.search-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 250px;
}

#search-word {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    flex: 1;
}

#search-word:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2);
}

#search-btn {
    padding: 10px 15px;
    margin-right: 0;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}

#jump-to {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    width: 100px;
}

#jump-to:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2);
}

#jump-btn {
    padding: 10px 15px;
    margin-right: 0;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(41, 128, 185, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(41, 128, 185, 0.2);
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

#word-display {
    font-size: 5rem;
    font-weight: bold;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    color: #2c3e50;
    padding: 20px;
    border-radius: 12px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    position: relative;
}

#word-display img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

#word-display:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

#word-counter {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

#random-word {
    background-color: #e74c3c;
}

#random-word:hover {
    background-color: #c0392b;
}

#load-words {
    background-color: #2ecc71;
}

#load-words:hover {
    background-color: #27ae60;
}




/* 词典查询样式 */
.dictionary-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.dict-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#dict-word {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s;
}

#dict-word:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2);
}

#lookup-btn {
    background-color: #9b59b6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(155, 89, 182, 0.2);
}

#lookup-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(155, 89, 182, 0.3);
}

#lookup-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.2);
}

#dict-result {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    min-height: 150px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
}

#dict-result .word-info {
    margin-bottom: 15px;
}

#dict-result .word {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

#dict-result .accent {
    color: #e74c3c;
    font-style: italic;
    margin-left: 10px;
}

#dict-result .mean_cn {
    margin-top: 10px;
    color: #34495e;
}

#dict-result .mean_en {
    margin-top: 5px;
    color: #7f8c8d;
    font-style: italic;
}

#dict-result .sentence {
    margin-top: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-left: 3px solid #3498db;
    border-radius: 0 4px 4px 0;
}

#dict-result .sentence_trans {
    margin-top: 5px;
    color: #27ae60;
}

#dict-result .error {
    color: #e74c3c;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dict-input-group {
        flex-direction: column;
    }

    #dict-word,
    #lookup-btn {
        width: 100%;
    }
    .main-content {
        flex-direction: column;
    }

    #word-display {
        font-size: 3.5rem;
    }

}

@media (max-width: 480px) {
    #word-display {
        font-size: 2.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    #word-display {
        font-size: 2rem;
    }

    button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}