body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 900px; /* 可以根据需要调整宽度 */
    margin: 30px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 25px 35px;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
}

h2 {
    color: #16a085;
    border-bottom: 2px solid #1abc9c;
    padding-bottom: 5px;
    margin-top: 30px;
}

p {
    margin-bottom: 10px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid #3498db;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.back-link:hover {
    background-color: #3498db;
    color: #fff;
}

.comm-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 6px;
}

.diagram-container {
    position: relative;
    height: 120px; /* 调整高度以适应节点 */
    background-color: #ecf0f1;
    border-radius: 5px;
    margin-bottom: 20px;
    padding: 15px;
    display: flex; /* 使用 Flexbox 布局节点 */
    justify-content: space-around; /* 均匀分布节点 */
    align-items: center; /* 垂直居中 */
}

.node {
    background-color: #bdc3c7;
    color: #fff;
    padding: 10px 15px;
    border-radius: 50%; /* 圆形节点 */
    text-align: center;
    font-size: 0.9em;
    width: 70px; /* 固定宽度 */
    height: 70px; /* 固定高度 */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative; /* 用于定位线条 */
    z-index: 1;
}

.node.sender {
    background-color: #e74c3c; /* 红色表示发送方 */
}

.node.receiver {
    background-color: #2ecc71; /* 绿色表示接收方 */
}

.node.anycast-group {
    background-color: #f39c12; /* 橙色表示任播组成员 */
}

.explanation {
    background: #f9f9f9;
    border-left: 4px solid #1abc9c;
    padding: 15px;
    border-radius: 0 4px 4px 0;
    font-size: 0.95em;
}

.explanation ul {
    padding-left: 20px;
}

.explanation li {
    margin-bottom: 5px;
}

/* 简单的线条模拟，实际动态效果需要 JS */
.comm-line {
    position: absolute;
    border-top: 2px dashed #555;
    z-index: 0;
    /* 线条定位需要 JS 根据节点位置计算 */
}

/* 示例：手动定位单播线条 (需要 JS 动态计算) */
#unicast-line {
    /* top: 50%; left: 25%; width: 50%; transform: translateY(-50%); */
    /* 实际位置需要 JS 计算 */
}

/* 可以为不同类型的线条设置不同颜色 */
.comm-line.unicast { border-color: #3498db; }
.comm-line.multicast { border-color: #9b59b6; }
.comm-line.broadcast { border-color: #e67e22; }
.comm-line.anycast { border-color: #f1c40f; }

/* 注意：上面的线条 (.comm-line) 只是占位符，
   要实现从一个节点精确指向另一个节点的动态线条，
   通常需要使用 JavaScript 配合 SVG 或 Canvas 来绘制。
   目前的 CSS 仅提供基本样式。 */