/* ---------- 全局样式与配色 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 标题区 */
.title-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.title-main h1 {
    font-size: 1.5rem;
    color: #4a2f6b;
    text-shadow: 2px 2px 0 #e0d4f5;
}

.title-main p {
    color: #666;
    font-size: 1rem;
    margin-top: 5px;
}

.class-filter select {
    padding: 8px 25px;
    border-radius: 20px;
    border: 2px solid #b19cd9;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

/* 统计看板 */
.stats-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    background: #f0e8ff;
    padding: 20px;
    border-radius: 50px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2.0rem;
    font-weight: bold;
    color: #4a2f6b;
    background: white;
    display: inline-block;
    min-width: 100px;
    padding: 5px 20px;
    border-radius: 40px;
    box-shadow: 0 4px 0 #b19cd9;
}

.refresh-btn {
    background: none;
    border: none;
    font-size: 2.0rem;
    font-weight: bold;
    color: #4a2f6b;
    cursor: pointer;
    transition: transform 0.3s;
}

/* 地图区 */
.map-section {
    margin: 20px 0;
}

.map-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.map-icon {
    font-size: 2.5em;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* S型网格 */
.s-grid {
    background: rgba(240, 232, 255, 0.5);
    border-radius: 30px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px 10px;
    min-height: 300px;
    padding: 25px;
}

/* SVG层用于画线 */
#svgLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* 节点层 */
.milestone-node {
    position: relative;
    width: 80%;
    aspect-ratio: 1/0.4;
    background: #ffd966;
    border: 3px solid white;
    border-radius: 12px;
    box-shadow: 0 6px 0 #b68b40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.3;
    padding: 4px;
}

.milestone-node .icon {
    font-size: 18px;
}

.milestone-node .name {
    font-size: 11px;
    font-weight: bold;
}

.milestone-node .week {
    font-size: 9px;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 10px;
    margin-top: 2px;
}

.milestone-node:hover {
    transform: scale(1.10);
    background: #ff8c42;           /* 深橙色 */
    box-shadow: 0 0 15px #ff8c42;  /* 橙色外发光 */
    border-color: #fff;             /* 保持白色边框 */
    z-index: 10;
}

.milestone-node.teacher-current {
    background: #90be6d;              /* 紫色背景 */
    box-shadow: 0 6px 0 #90be6d;      /* 深紫色阴影 */
    border: 3px solid white;            /* 金色边框，更醒目 */
    position: relative;
}
/* 可选：添加一个小徽章表示老师 */
.milestone-node.teacher-current::after {
    content: "👨‍🏫";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    background: #90be6d;
    border-radius: 90%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
/* 学生云 */
.student-cloud {
    background: rgba(240, 232, 255, 0.5);
    border-radius: 30px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;      /* 自动换行 */
    gap: 8px;             /* 项目之间的间隙 */
    align-items: center;
    justify-content: flex-start;
}

/* 关卡分隔符样式（紫色圆点，带关卡编号） */
.level-separator {
    width: 40px;
    height: 40px;
    background: #ffd966;      /* 紫色背景 */
    color: black;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 0 orange;  /* 深紫色阴影，与棋子一致 */
    border: 2px solid white;
    margin: 2px;              /* 与棋子的外边距保持一致 */
}

.level-tag {
    width: 30px;
    height: 30px;
    background: #90be6d;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4a9eff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 0 #2a6fb0;
    border: 2px solid white;
}

.student-avatar.teacher {
    background: #90be6d;
    box-shadow: 0 4px 0 #90be6d;
    width: 45px;
    height: 45px;
}

.student-avatar:hover {
    transform: translateY(-5px);
}

/* 图例 */
.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 10px 0;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.legend-dot.student {
    background: #4a9eff;
}

.legend-dot.teacher {
    background: #90be6d;
}

.legend-dot.milestone {
    width: 20px;
    height: 20px;
    background: #ffd966;
    border-radius: 50%;
}

/* 底部三列布局 */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.footer-card {
    background: white;
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

/* 第一列：搜索与动态演示 */
.search-area {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-area input {
    flex: 1;
    padding: 12px 15px;
    border: 3px solid #b19cd9;
    border-radius: 50px;
    font-size: 1em;
}

.search-area button {
    padding: 0 20px;
    background: #4a2f6b;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1em;
    border-bottom: 4px solid #2a1b3d;
}

.func-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.func-btn {
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.0em;
    cursor: pointer;
    border-bottom: 4px solid #4a2f6b;
}

/* 第二、三列：排行榜 */
.rank-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a2f6b;
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0d4f5;
}

.rank-list {
    max-height: 300px;
    overflow-y: auto;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
    cursor: pointer;
}

.rank-item:hover {
    background-color: #f9f5ff;
}

.rank-index {
    width: 28px;
    height: 28px;
    background: #f0e8ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #4a2f6b;
}

.rank-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
}
/* 常用链接样式 */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}
.link-item {
    display: block;
    padding: 10px 15px;
    background: #f0e8ff;
    color: #4a2f6b;
    text-decoration: none;
    border-radius: 30px;
    text-align: center;
    font-weight: bold;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.link-item:hover {
    background: #4a2f6b;
    color: white;
    border-color: #b19cd9;
    transform: translateY(-2px);
}
/* 页脚 */
.footer-note {
    height: 40px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #f0f0f0;
    transition: background-color 0.3s;
}

/* 流动虚线动画 */
@keyframes flow {
    from {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -16; /* 负值使虚线向正方向移动，值的大小应与 dasharray 总和匹配 */
    }
}

.flow-line {
    stroke: #6a4e9b;     /* 亮紫色 */
    stroke-width: 5px;    /* 加粗到3px */
    stroke-dasharray: 8 4;      /* 8px线段，8px间隔 */
    animation: flow 1s linear infinite;
}