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

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: Arial, sans-serif;
    padding: 10px 90px;
}

h1 {
    text-align: center;
    margin-bottom: 31px;
    color: #2e75cc;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.content-area {
    width: 100%;
}

/* 新添加的样式：顶部两个 textarea 并排 */
.input-output-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.input-area,
.output-area {
    flex: 1;
}

h2 {
    margin-bottom: 10px;
    font-size: 18px;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 新添加的样式：下方左右布局 */
.bottom-container {
    display: flex;
    gap: 20px;
}

/* 左侧设置区域 */
.settings-area {
    width: 300px;
    flex-shrink: 0;
}

#settings,
#operation-buttons {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: rgba(247, 250, 252, 0.95);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    /* 添加flex布局 */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#operation-buttons h2 {
    width: 100%;
    /* 确保标题占满整行 */
    margin-bottom: 10px;
}

button {
    /* 不再是100%宽度，而是50%减去间距的一半 */
    width: calc(50% - 5px);
    padding: 10px;
    margin-bottom: 0;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    background-color: #2e75cc;
    /* 添加过渡效果使按钮更美观 */
    transition: all 0.3s ease;
}

/* 确保按钮颜色保持不变 */
button:nth-child(2) {
    background-color: #2e75cc;
}

button:nth-child(3) {
    background-color: #38a169;
}

button:nth-child(4) {
    background-color: #ed8936;
}

button:nth-child(5) {
    background-color: #e53e3e;
}

button:nth-child(6) {
    background-color: #805ad5;
}

/* 响应式调整 - 在小屏幕上仍保持垂直排列 */
@media (max-width: 768px) {
    button {
        width: 100%;
    }
}

/* 序号级别设置 */
.level-settings {
    margin-bottom: 20px;
}

.level-settings h2 {
    margin-bottom: 10px;
    font-size: 18px;
    color: #2e75cc;
}

#settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e9ecef;
}

.level {
    color: #ffffff;
    border: 2px solid #333;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    width: 100%;
}

.level input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.level span {
    font-size: 16px;
    font-weight: 500;
}

.first-level {
    background-color: rgb(255, 0, 0);
}

.second-level {
    background-color: rgb(0, 0, 255);
}

.third-level {
    background-color: rgb(0, 255, 0);
}

.level input[type="radio"]:checked+span {
    font-weight: bold;
}

.order {
    width: 40px;
    font-size: 30px;
    font-weight: bold;
    color: #51de6f;
}

/* 左侧字符显示区域 */
.conversion-display-area {
    flex: 1;
    padding: 15px;
    background-color: rgba(247, 250, 252, 0.95);
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* 左侧字符显示区标题样式 */
.conversion-display-area h2 {
    margin-bottom: 10px;
    font-size: 18px;
    color: #2e75cc;
}

/* 字符显示区容器 */
.conversion-area {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    min-height: 400px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
}

/* 每个字符样式 */
ol li {
    display: flex;
    flex-wrap: wrap;
    /* gap: 2px; */
    /* margin-bottom: 5px; */
    border-bottom: 4px double rgb(81, 0, 255);
    width: 100%;
}

/* 字符列表 */
ol {
    font-size: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    /* list-style: none; */
    width: 100%;
}


.small-div {
    border: 1px solid rgb(225, 207, 207);
    margin: 0px 2px 2px 0px;
    background-color: rgb(255, 255, 255);
    font-size: 30px;
    padding: 2px 5px;
    width: 40px;
    /* 固定宽度 */
    height: 40px;
    /* 固定高度 */
    text-align: center;
    border-radius: 3px;
    box-sizing: border-box;
    /* 确保padding和border包含在宽高内 */
    display: inline-flex;
    /* 使用flex布局使文字垂直居中 */
    align-items: center;
    justify-content: center;
}

/* 响应式设计 - 移动设备适配 */
@media (max-width: 768px) {
    body {
        padding: 10px 20px;
    }

    .input-output-container {
        flex-direction: column;
    }

    .bottom-container {
        flex-direction: column;
    }

    .settings-area {
        width: 100%;
    }

    textarea {
        min-height: 120px;
    }
}

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

    .container {
        padding: 15px;
    }

    #settings,
    #operation-buttons {
        padding: 12px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .level {
        padding: 8px 12px;
    }

    .small-div {
        font-size: 24px;
        min-width: 25px;
    }
}

.nav-tag {
    position: absolute;
    right: 20px;
    top: 50px;
    display: flex;
    align-items: center;
    padding: 7px 7px;
    background: #878887;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 102, 102, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-tag:hover {
    background: #51de6f;
    transform: translateY(-2px);
}

.tag-text {
    margin-left: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}