body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* 改为 flex-start 以便内容多时正常滚动 */
    min-height: 100vh;
}

.container {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #5a4a7c;
    /* 紫色调 */
    margin-bottom: 20px;
}

.section {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    /* 防止 padding 影响总宽度 */
    font-size: 1rem;
}

input[type="text"]#codec {
    width: auto;
    /* 让自定义输入框宽度自适应 */
    min-width: 100px;
    margin-right: 10px;
}

textarea {
    resize: vertical;
    /* 允许用户垂直调整大小 */
    min-height: 80px;
}

.controls {
    display: flex;
    justify-content: space-around;
    /* 按钮间留有空隙 */
    margin-bottom: 15px;
}

button {
    background-color: #785fba;
    /* 深一点的紫色 */
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    margin: 5px;
    /* 给按钮之间添加一些间距 */
}

button:hover {
    background-color: #5a4a7c;
    /* 悬停时更深的紫色 */
}

button#copyBtn {
    background-color: #6c757d;
    /* 灰色 */
    margin-top: 5px;
    display: block;
    /* 让复制按钮独占一行 */
    margin-left: auto;
    /* 如果想让它靠右 */
    margin-right: auto;
    /* 居中显示 */
    width: fit-content;
    /* 按钮宽度适应内容 */
}

button#copyBtn:hover {
    background-color: #5a6268;
}

.error-message {
    color: #dc3545;
    /* 红色 */
    font-size: 0.9em;
    margin-left: 5px;
}

.status-message {
    color: #28a745;
    /* 绿色 */
    font-size: 0.9em;
    margin-left: 10px;
    display: inline-block;
    /* 让它和按钮在同一行 */
    vertical-align: middle;
}


.info {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.9em;
    color: #666;
}

.info ul {
    padding-left: 20px;
}

.info li {
    margin-bottom: 5px;
}

footer {
    text-align: center;
    margin-top: 30px;
    /* 与主内容保持一些间距 */
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    /* 页脚上方的分隔线 */
    font-size: 0.9em;
    color: #777;
}

footer a {
    color: #5a4a7c;
    /* 与主题颜色一致的链接颜色 */
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 响应式设计：小屏幕 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

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

    .controls {
        flex-direction: column;
        /* 在小屏幕上将按钮垂直排列 */
    }

    .controls button {
        width: 100%;
        /* 让按钮占满宽度 */
        margin-bottom: 10px;
        /* 添加垂直间距 */
    }

    button#copyBtn {
        width: 100%;
    }
}