/* 页面基本布局 */
body {
    font-family: 'Roboto', sans-serif; /* 使用更现代的字体 */
    margin: 0;
    padding: 0;
    background-color: #f4f7fb; /* 温和的背景色 */
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* 页面标题样式 */
.page-title {
    transition: color 0.5s ease;
    text-align: center;
    font-size: 40px;
    font-weight: bold;
    color: #3b3b3b;
    margin: 40px 0;
    text-transform: uppercase; /* 使标题大写 */
    letter-spacing: 2px; /* 标题字母间距 */
}

 /* 白天模式标题颜色 */
 body.day-mode .page-title {
    color: #000; /* 黑色 */
}

/* 黑夜模式标题颜色 */
body.night-mode .page-title {
    color: #f0f0f0; /* 浅灰色 */
}

/* 容器，中心对齐 */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* 每一轮的布局 */
.round {
    display: flex;
    justify-content: center; /* 使内容水平居中 */
    margin: 20px 0;
    align-items: flex-start;
}

/* 排名标签，增加背景色和圆角 */
.rank-label {
    font-size: 24px;
    font-weight: bold;
    margin-right: 20px;
    margin-top: 23px;
    background-color: #ffbb00; /* 黄色背景色 */
    color: white;
    padding: 8px 16px;
    border-radius: 15px; /* 圆角效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 轻微阴影效果 */
}

/* 角色列表，使用Grid布局 */
.characters {
    display: grid;
    grid-template-columns: repeat(9, 1fr); /* 每行9列 */
    gap: 20px;
    max-width: 1200px;
    justify-items: center;
    text-align: center;
}

a {
    text-decoration: none;
    color: inherit;  /* 保证链接的颜色继承父元素的颜色 */
}

/* 每个角色的样式 */
.character {
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 动画效果 */
}

.character:hover {
    transform: scale(1.05); /* 放大效果 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* 鼠标悬停时增加阴影 */
}

.character img {
    border-radius: 10%;
    object-fit: cover;
    border: 3px solid #ddd; /* 增加边框 */
    transition: transform 0.3s ease; /* 头像缩放效果 */
}

.character img:hover {
    transform: scale(1.1); /* 鼠标悬停时头像放大 */
}

/* 角色名和作品名共同的悬停效果 */
.character-name,
.ip {
    margin-top: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    transition: color 0.3s ease; /* 过渡效果 */
}

.character-name {
    font-weight: bold;
    transition: color 0.5s ease;
}

/* 作品名样式 */
.ip {
    font-style: italic;
    transition: color 0.5s ease;
}

  /* 白天模式角色名和作品名 */
  body.day-mode .character-name {
    color: #2c3e50; /* 深蓝色 */
}

body.day-mode .ip {
    color: #7f8c8d; /* 浅灰色 */
}

/* 黑夜模式角色名和作品名 */
body.night-mode .character-name {
    color: #ecf0f1; /* 浅白色 */
}

body.night-mode .ip {
    color: #95a5a6; /* 浅灰蓝色 */
}

/* 鼠标悬停在整个角色容器时，角色名和作品名都变红 */
.character:hover .character-name,
.character:hover .ip {
    color: #ff4500; /* 鼠标悬停时字体变为红色 */
}

/* 作品名的样式 */
.ip {
    margin-top: 5px;
    font-size: 14px;
    color: #777;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .characters {
        grid-template-columns: repeat(6, 1fr); /* 小屏幕时每行6个角色 */
    }
}

@media (max-width: 768px) {
    .characters {
        grid-template-columns: repeat(4, 1fr); /* 更小屏幕时每行4个角色 */
    }
    .rank-label {
        font-size: 20px; /* 适应小屏幕的排名标签 */
    }
}

@media (max-width: 480px) {
    .characters {
        grid-template-columns: repeat(3, 1fr); /* 手机屏幕时每行3个角色 */
    }
    .page-title {
        font-size: 28px; /* 小屏幕标题字体 */
    }
    .rank-label {
        font-size: 18px; /* 小屏幕排名标签字体 */
    }
}

.slide-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

.slide-in.show {
    opacity: 1;
    transform: translateY(0);
}

 /* 白天模式和黑夜模式样式 */
 body.day-mode {
    background-color: #ffffff;
    color: #000000;
}
body.night-mode {
    background-color: #1e1e1e;
    color: #ffffff;
}


 /* 自定义下拉框样式 */
.custom-dropdown {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 140px;
    z-index: 1000;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f5f5f5;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 选中值区域 */
.dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer; /* 鼠标悬停时变为手型，表示可点击 */
}

.dropdown-selected img.dropdown-icon,
.dropdown-option img.dropdown-icon {
    width: 24px; /* 缩小图标宽度 */
    height: 24px; /* 缩小图标高度 */
    flex-shrink: 0; /* 防止图标变形 */
}

/* 自定义箭头 */
.dropdown-arrow {
    border: solid #333;
    border-width: 0 1.5px 1.5px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

/* 展开时箭头旋转 */
.custom-dropdown.open .dropdown-arrow {
    transform: rotate(-135deg);
}

/* 下拉选项列表 */
.dropdown-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #ccc;
    z-index: 1010;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 展开选项列表 */
.custom-dropdown.open .dropdown-options {
    display: block;
}

/* 每个选项样式 */
.dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* 鼠标悬停选项 */
.dropdown-option:hover {
    background-color: #e0e0e0;
}

body.night-mode .custom-dropdown {
    background-color: #333333; /* 黑夜模式背景色 */
    border-color: #555555; /* 边框颜色适配深色主题 */
}

body.night-mode .dropdown-selected {
    color: #ffffff; /* 白色文字 */
}

body.night-mode .dropdown-arrow {
    border-color: #ffffff; /* 白色箭头 */
}

/* 高亮相同IP角色的样式 */
.character.highlight {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    border-radius: 10px;
    padding: 5px;
    transition: all 0.3s ease;
}

.character.highlight img {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.character.highlight .character-name,
.character.highlight .ip {
    color: #ffa500;
    font-weight: bold;
}