body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

h3, h4 {
    margin: 0;
    color: #333;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
}

.section-title {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* 转换部分 */
/* 修改转换部分的样式，使输入框水平排列 */
.conversion-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 15px;
}

.input-group {
    width: 40%;
    max-width: 300px;
}

.arrows-horizontal {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 24px;
    color: #4CAF50;
}

.arrow-right, .arrow-left {
    line-height: 1;
}

/* 其他CSS保持不变 */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"], input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: monospace;
    box-sizing: border-box;
}

.arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 24px;
    color: #4CAF50;
    margin: 5px 0;
}

.arrow-down, .arrow-up {
    line-height: 1;
}

/* 可视化部分 */
.visualization-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.tab-btn.active {
    border-bottom: 2px solid #4CAF50;
    color: #4CAF50;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.explanation {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
}

.conversion-steps {
    font-family: monospace;
    margin: 15px 0;
}

.step {
    display: flex;
    align-items: center;
    margin: 5px 0;
    padding: 5px;
    border-radius: 4px;
}

.step:nth-child(odd) {
    background-color: #f9f9f9;
}

.step-number {
    width: 30px;
    font-weight: bold;
    color: #4CAF50;
}

/* 位值表示 */
.bit-representation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.bit-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 5px;
}

.bit {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 18px;
    background-color: #f9f9f9;
}

.bit.active {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.bit-value {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.bit-power {
    font-size: 10px;
    color: #999;
}