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 {
    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;
}

/* 输入部分 */
.input-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.input-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* 显示部分 */
.display-section {
    margin-bottom: 10px;
}

.octet-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 15px 0 25px 0;
}

.octet {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 18px;
    position: relative;
    background-color: #f9f9f9;
}

.bit {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 12px;
    border: 1px solid #ddd;
    margin: 1px;
}

.network {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.host {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.dot {
    display: inline-block;
    font-size: 24px;
    font-weight: bold;
    margin: 0 2px;
    line-height: 50px;
}

/* 结果部分 */
.result-section table {
    width: 100%;
    border-collapse: collapse;
}

.result-section td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.result-section .label {
    font-weight: bold;
    width: 30%;
    color: #555;
}

.result-section .value {
    font-family: monospace;
    font-size: 16px;
}


/* 分析显示部分 */
.analysis-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.decimal-display, .binary-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px 0;
}

.octet-decimal {
    display: inline-block;
    width: 50px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 16px;
    margin: 0 2px;
}

.octet-binary {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 2px;
    padding: 2px;
    background-color: #f9f9f9;
}

.bit {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 12px;
    font-family: monospace;
    border: 1px solid #ddd;
    margin: 1px;
}

.dot {
    display: inline-block;
    font-size: 20px;
    font-weight: bold;
    margin: 0 2px;
    line-height: 40px;
}

.network {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.host {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}