/* style.css */
body {
    font-family: Arial, sans-serif;
    background-color: #f5f7fa;
    background-image: url("https://www.253874.net/asset/image/bg.jpg");
    background-repeat: repeat;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 700px;
    margin: auto;
    background: #ffffff;
    padding: 30px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.title-header {
    text-align: center;
    margin-bottom: 20px;
}

h1, h2 {
    margin: 0;
    color: #333;
}

h2 {
    color: #555;
    margin-top: 10px;
}

.content-translation {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 4px;
}

.textarea-content, 
.translation-content-text {
    flex: 1;
}

textarea, 
.translation-content-text {
    width: 100%;
    height: 220px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    resize: vertical;
    box-sizing: border-box;
}

.translation-content-text {
    background: #f8f9fa;
    overflow-y: auto;
}

select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
}

input[type="submit"] {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
}

input[type="submit"]:hover {
    background-color: #0056b3;
}

.translation-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
}

/* TTS Button Styles */
.playing svg {
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

.tts-button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.tts-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tts-button.playing .speaker-icon {
    display: none;
}

.tts-button:not(.playing) .stop-icon {
    display: none;
}

.lw-text {
    display: flex;
    justify-content: center;  /* 水平居中 */
    align-items: center;      /* 垂直居中 */
    width: 100%;              /* 占满整行宽度 */
    margin: 20px auto;        /* 添加上下间距 */
    text-align: center;       /* 居中文本 */
}
.no-color-change a {
    color: inherit;          /* 继承父元素的颜色 */
    text-decoration: none;   /* 去掉下划线 */
    display: inline-block;   /* 确保链接正确响应居中 */
}

.char-count {
    text-align: right;
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
    padding-right: 5px;
}

.char-count.exceeded {
    color: #ff4444;
}

textarea {
    margin-bottom: 0; /* 如果原来有margin-bottom，移除它 */
}
