body {
    font-family: 'Microsoft YaHei', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f2f5;
    padding: 20px;
    color: #333;
}

h1 {
    margin-bottom: 30px;
    color: #2c3e50;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

#initialScreen h1 {
    text-align: center;
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    gap: 15px; /* 卡片之间的间距 */
    margin: 20px auto; /* 居中容器 */
    max-width: 1000px;
}

/* 角色盒子样式 */
.character-box {
  box-sizing: border-box;
  width: 210px;
  height: 254px;
  margin: 7px;
  border: 1px solid white;
  box-shadow: 12px 17px 51px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(6px);
  border-radius: 17px;
  text-align: center;
  cursor: pointer;
  transition: all 0.5s;
  display: flex;
  flex-direction: column; 
  align-items: center;
  justify-content: space-evenly; 
  user-select: none;
  font-weight: bolder;
  color: black;
  padding: 15px; 
  position: relative;
  overflow: hidden;
}

.character-box:hover {
  border: 1px solid black;
  transform: scale(1.05);
}

.character-box:active {
  transform: scale(0.95) rotateZ(1.7deg);
}

.character-image {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 50%;
  background-color: rgba(249, 249, 249, 0.5);
  padding: 5px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.character-box:hover .character-image {
  transform: scale(1.05);
}

.character-name {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  color: #2c3e50;
  margin-top: 10px; /* 与图片保持间距 */
  transition: color 0.3s;
  margin: 10px;
  position: relative;
  z-index: 1;
}

.character-box:hover .character-name {
  color: #3498db;
}

/* 按钮样式 */
.start-button {
    padding: 12px 35px;
    font-size: 18px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    margin: 20px;
}

.start-button:hover, #missionButton:hover {
    background-color: #2980b9;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.start-button:disabled, #missionButton:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* BP按钮样式 */
.bp-button {
    padding: 12px 35px;
    font-size: 18px;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    letter-spacing: 1px;
    margin: 10px;
}

/* 不同模式颜色 */
.bp-button[data-mode="global"] { background-color: #e74c3c; }
.bp-button[data-mode="personal"] { background-color: #3498db; }
.bp-button[data-mode="off"] { background-color: #2ecc71; }

.bp-button:disabled {
    background-color: #95a5a6 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 重置按钮 */
.reset-button {
    padding: 12px 35px;
    font-size: 18px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    letter-spacing: 1px;
}

.reset-button:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* 黑色半透明背景 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    z-index: 199;
    cursor: pointer; /* 鼠标悬停时显示手型 */
}

/* 事件样式 */
.mission-box {
  box-sizing: border-box;
  width: 200px ; /* 调整宽度 */
  height: 180px ; /* 调整高度 */
  border: 1px solid white;
  box-shadow: 12px 17px 51px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(6px);
  border-radius: 17px;
  text-align: center;
  cursor: pointer;
  transition: all 0.5s;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  font-weight: bolder;
  color: black;
  padding: 15px; 
  margin: 2px; 
  position: relative;
  overflow: hidden;
}


/* 添加玩家标识样式 */
.player-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #3498db;
    color: white;
    font-weight: bold;
    font-size: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.character-box.active::before,
.mission-box.active::before {
    content: attr(data-player);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 150px;
    font-weight: bold;
    color: rgba(219, 219, 219, 0.35);
    z-index: 0;
    pointer-events: none;
}

.mission-box.active {
    transform: translateY(0);
    opacity: 1;
}

.mission-box:hover {
  border: 1px solid black;
  transform: scale(1.05);
}

.mission-box:active {
  transform: scale(0.95) rotateZ(1.7deg);
}

.mission-title {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  color: #2c3e50;
  margin-bottom: 5px; /* 减少与内容的间距 */
  transition: color 0.3s;
  position: relative;
  z-index: 1;
}

.mission-content {
  font-size: 16px;
  text-align: center;
  color: #7f8c8d;
  line-height: 1.4;
  margin-top: 0; /* 移除顶部多余间距 */
  transition: color 0.3s;
  position: relative;
  z-index: 1;
}

.mission-box:hover .mission-title {
    color: #3498db;
}

.mission-box:hover .mission-content {
    color: #34495e;
}

/* 主界面容器居中 */
#gameScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center; /* 确保文字居中 */
    width: 100%;
}

/* 按钮居中 */
.button-container {
    display: flex;
    flex-direction: column; /* 垂直排列 */
    align-items: center; /* 水平居中 */
    gap: 10px; /* 按钮和计数器之间的间距 */
}

/* 重抽计数器样式 */
#rerollCounter {
    display: flex;
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    gap: 10px; /* 按钮和文本之间的间距 */
    font-size: 16px;
    color: #666;
}

.remaining-characters {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    display: none; /* 默认隐藏 */
}

.history-popup .history-round {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
    font-size: 14px;
    color: #333;
}

.history-popup .round-label {
    font-weight: bold;
    margin-right: 10px;
}

.history-popup .separator {
    margin: 0 10px;
    color: #999;
    display: inline-block;
    text-align: center;
    width: 20px; /* 确保分隔符宽度一致 */
}

@keyframes stripe-move {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes legendary-glow {
    0% { transform: scale(0.8); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 0.9; }
    100% { transform: scale(0.8); opacity: 0.7; }
}


@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 弹窗样式 */
.bonus-popup {
    cursor: pointer;
}

/* 游戏规则样式 */
.rules-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    .container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        max-width: 100vw;
        padding: 0 8px;
    }

.rules-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.rules-content li {
    text-align: left; /* 内容靠左对齐 */
    margin: 15px; /* 去除默认外边距 */
    padding: 0; /* 去除默认内边距 */
}

.rules-content h3 {
    text-align: left; /* 内容靠左对齐 */
    margin: 5px; /* 去除默认外边距 */
    padding: 0; /* 去除默认内边距 */
    margin-top: 5px;
}

    .character-box,
    .mission-box {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
    }
    .character-box {
        height: auto;
        min-height: 140px;
    }
    .mission-box {
        height: auto;
        min-height: 100px;  /* 减小最小高度 */
        padding: 8px;  /* 减小内边距 */
    }
    .character-image {
        width: 80px;
        height: 80px;
    }
    .mission-title {
        font-size: 16px;  /* 减小字体大小 */
        margin-bottom: 6px;  /* 减小下边距 */
    }
    .mission-content {
        font-size: 14px;  /* 减小字体大小 */
        line-height: 1.3;
    }
    
    /* 修复弹窗在移动端的显示 */
    .popup-content {
        max-width: 85% !important;
        padding: 20px !important;
    }
    
    .popup-content h3 {
        font-size: 18px !important;
    }
    
    .popup-content p {
        font-size: 20px !important;
    }
    
    .popup-content button {
        padding: 8px 20px !important;
        font-size: 14px !important;
    }
}


/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    color: #7f8c8d;
    font-size: 14px;
}

.footer p {
    margin: 0;
}

/* 确保角色卡片和事件卡片在重置后可见 */
.character-box, .mission-box {
    opacity: 1; /* 确保可见 */
    pointer-events: auto; /* 确保可点击 */
    transition: opacity 0.3s ease; /* 添加平滑过渡效果 */
}

/* 历史记录表格样式 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
    text-align: center;
    max-height: 300px; /* 限制表格高度 */
    overflow-y: auto; /* 启用垂直滚动条 */
    display: table;
    opacity: 0; /* 初始状态不可见 */
    transform: translateY(20px); /* 初始位置稍微向下 */
    animation: slideIn 0.3s ease forwards; /* 应用动画 */
}

/* 定义表格行依次浮现的动画 */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 定义表头和表格行的初始状态 */
.history-table tr{
    opacity: 0; /* 初始状态不可见 */
    transform: translateY(20px); /* 初始位置稍微向下 */
}

/* 动画触发状态 */
.history-table tr.animate {
    animation: slideIn 0.3s ease forwards;
}

body {
    user-select: none; /* 禁用文字选择 */
}

img {
    -webkit-user-drag: none; /* 禁用图片拖动 (WebKit 浏览器) */
    pointer-events: none; /* 禁用鼠标事件 */
}

/* 弹窗切换按钮样式 */
/* 弹窗标题样式 */
.popup-title {
    font-size: 30px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
}

/* 切换按钮样式 - 改进版本 */
.radio-inputs {
    position: relative;
    display: flex;
    border-radius: 12px;
    background: linear-gradient(145deg, #34495e, #2c3e50);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    padding: 4px;
    width: 400px;
    font-size: 14px;
    height: 48px;
    margin: 20px auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.radio-inputs::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(145deg, #3498db, #2980b9);
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(52, 152, 219, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.radio-inputs:has(#teamEventsRadioInSettings:checked)::before {
    transform: translateX(100%);
}

.radio-inputs .radio {
    flex: 1;
    position: relative;
    z-index: 2;
    display: flex; /* 使用 flex 布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}

.radio-inputs .radio input {
    display: none;
}

.radio-inputs .radio .radio-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center; /* 确保文字居中 */
    height: 100%;
    padding: 0 16px;
    color: #bdc3c7;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.radio-inputs .radio .radio-item:hover {
    color: #ecf0f1;
    transform: translateY(-1px);
}

.radio-inputs input:checked ~ .radio-item {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.radio-inputs input:checked ~ .radio-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* 表格样式 */
.event-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    table-layout: fixed; /* 固定表格布局，防止列宽动态变化 */
    position: relative; /* 确保表格位置固定 */
}

/* 表头固定样式 */
.event-table thead {
    position: relative;
    z-index: 10;
}

.event-table thead tr {
    opacity: 1 !important; /* 表头始终可见 */
    transform: none !important; /* 表头不参与动画 */
}

.event-table th, .event-table td {
    border: 1px solid #ddd;
    padding: 8px;
    overflow: hidden; /* 隐藏溢出的内容 */
    text-overflow: ellipsis; /* 显示省略号 */
    white-space: nowrap; /* 防止换行 */
    box-sizing: border-box; /* 确保边框包含在宽度内 */
}

.event-table th {
    color: white; /* 设置表头文字颜色为白色 */
    font-weight: bold; /* 加粗文字 */
    text-align: center; /* 居中对齐 */
    padding: 10px; /* 增加内边距 */
    border: 1px solid #ddd; /* 添加边框 */
    position: relative; /* 固定表头位置 */
    min-width: 0; /* 防止内容撑开表头 */
}

/* 为事件表格列设置固定宽度比例 - 使用更精确的定位 */
.event-table th:nth-child(1), .event-table td:nth-child(1) {
    width: 8%; /* 序号列 */
    max-width: 8%;
    min-width: 8%;
}

.event-table th:nth-child(2), .event-table td:nth-child(2) {
    width: 30%; /* 事件标题列 */
    max-width: 30%;
    min-width: 30%;
    white-space: normal; /* 允许标题换行 */
}

.event-table th:nth-child(3), .event-table td:nth-child(3) {
    width: 52%; /* 事件内容列 */
    max-width: 52%;
    min-width: 52%;
    white-space: normal; /* 允许内容换行 */
}

.event-table th:nth-child(4), .event-table td:nth-child(4) {
    width: 10%; /* 启用列 */
    max-width: 10%;
    min-width: 10%;
}

.event-table tr:hover {
    background-color: rgba(0, 0, 0, 0.1); /* 添加浅灰色背景 */
    transform: scale(1.01); /* 略微放大 */
    transition: all 0.1s ease; /* 平滑过渡效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 添加阴影效果 */
}

/* 为未启用的行添加暗红色遮罩 */
.event-table tr.unchecked {
    background-color: rgba(139, 0, 0, 0.2); /* 暗红色背景 */
    border: 1.8px solid rgba(139, 0, 0, 0.5); 
    transition: background-color 0.3s ease; /* 添加平滑过渡效果 */
}

.event-table tr.unchecked:hover {
    background-color: rgba(139, 0, 0, 0.3); /* 鼠标悬停时加深遮罩 */
}

/* 事件行动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 只有tbody中的行才参与动画，表头不参与 */
.event-table tbody tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease forwards;
}

/* 确保表头行始终可见且不参与动画 */
.event-table thead tr {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

/* 设置每行的动画延迟，实现逐行出现的效果 - 加快速度 */
/* 只为tbody中的行设置动画延迟 */
.event-table tbody tr:nth-child(1) { animation-delay: 0.005s; }
.event-table tbody tr:nth-child(2) { animation-delay: 0.01s; }
.event-table tbody tr:nth-child(3) { animation-delay: 0.015s; }
.event-table tbody tr:nth-child(4) { animation-delay: 0.02s; }
.event-table tbody tr:nth-child(5) { animation-delay: 0.025s; }
.event-table tbody tr:nth-child(6) { animation-delay: 0.03s; }
.event-table tbody tr:nth-child(7) { animation-delay: 0.035s; }
.event-table tbody tr:nth-child(8) { animation-delay: 0.04s; }
.event-table tbody tr:nth-child(9) { animation-delay: 0.045s; }
.event-table tbody tr:nth-child(10) { animation-delay: 0.05s; }
.event-table tbody tr:nth-child(n+11) { animation-delay: 0.055s; }

/* 表格行重新加载动画类 */
.event-table tbody tr.animate-row {
    animation: none;
    opacity: 0;
}

.event-table tbody tr.animate-row.show {
    animation: fadeInUp 0.23s ease forwards;
}

/* From Uiverse.io by KhaledMatalkah */
.custom-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 16px;
  color: #333;
  transition: color 0.3s;
}

.custom-checkbox input[type="checkbox"] {
  display: none;
}

.custom-checkbox .checkmark {
  width: 24px;
  height: 24px;
  border: 2px solid #333;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  transition: background-color 0.3s, border-color 0.3s, transform 0.3s;
  transform-style: preserve-3d;
}

.custom-checkbox .checkmark::before {
  content: "\2713";
  font-size: 16px;
  color: transparent;
  transition: color 0.3s, transform 0.3s;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
  background-color: #333;
  border-color: #333;
  transform: scale(1.1) rotateZ(360deg) rotateY(360deg);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark::before {
  color: #fff;
}

.custom-checkbox:hover {
  color: #666;
}

.custom-checkbox:hover .checkmark {
  border-color: #666;
  background-color: #f0f0f0;
  transform: scale(1.05);
}

.custom-checkbox input[type="checkbox"]:focus + .checkmark {
  box-shadow: 0 0 3px 2px rgba(0, 0, 0, 0.2);
  outline: none;
}

.custom-checkbox .checkmark,
.custom-checkbox input[type="checkbox"]:checked + .checkmark {
  transition: background-color 1.3s, border-color 1.3s, color 1.3s, transform 0.3s;
}

/* 右键菜单样式 */
.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    border-radius: 5px;
    padding: 5px 0;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.context-menu.visible {
    opacity: 1;
    transform: scale(1);
}

/* 弹窗展开和收起动画 */
@keyframes slideDown {
    from {
        transform: translateY(-20%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20%);
        opacity: 0;
    }
}

/* 高亮行样式 */
.highlighted-row {
    background-color: rgba(51, 150, 217, 0.3) !important;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 10px rgba(51, 150, 217, 0.5);
    transition: all 0.2s ease;
}

.highlighted-row::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #3396D9;
    pointer-events: none;
    animation: pulse 1.5s infinite alternate;
    z-index: -1;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(51, 150, 217, 0.4); }
    100% { box-shadow: 0 0 0 8px rgba(51, 150, 217, 0); }
}

/* 事件表格行选中时文字加粗 */
.highlighted-row td {
    font-weight: bold;
    color: #ffffff;
}

/* 触摸反馈效果 */
.touch-feedback {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background-color: rgba(51, 150, 217, 0.3);
    transform: scale(0);
    z-index: 9999;
    animation: ripple 0.6s linear;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 弹窗显示时的动画 */
.edit-event-form.show {
    animation: slideDown 0.3s ease-out forwards;
}

/* 弹窗隐藏时的动画 */
.edit-event-form.hide {
    animation: slideUp 0.3s ease-in forwards;
}

/* 编辑事件弹窗样式 */
.edit-event-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

.edit-event-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.edit-event-form input,
.edit-event-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.edit-event-form button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.edit-event-form button#saveEventButton {
    background-color: #3498db;
    color: white;
}

.edit-event-form button#deleteEventButton {
    background-color: #e74c3c;
    color: white;
}

/* 输入框和文本域样式 */
.input-field, .textarea-field {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc; /* 边框颜色 */
    border-radius: 5px; /* 圆角 */
    font-size: 16px;
    font-family: 'Microsoft YaHei', sans-serif; /* 字体 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* 内阴影 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* 过渡效果 */
    background-color: #78797ad4; /* 浅灰背景 */
    color: #ffffff; /* 字体颜色 */
}

.input-field::placeholder, .textarea-field::placeholder {
    color: #ffffff; /* 将 placeholder 的颜色改为白色 */
    opacity: 0.8; /* 设置透明度 */
    font-style: italic; /* 可选：让文字倾斜 */
}

.input-field:focus, .textarea-field:focus {
    border-color: #3498db; /* 聚焦时的边框颜色 */
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5); /* 聚焦时的阴影 */
    outline: none; /* 去掉默认的聚焦样式 */
}

/* 文本域样式 */
.textarea-field {
    resize: none; /* 禁止调整大小 */
    height: 100px; /* 固定高度 */
}

/* 按钮样式 */
.add-event-btn {
    width: 100%; /* 按钮宽度与输入框对齐 */
    padding: 10px;
    background-color: #1C7CC5; /* 按钮背景颜色 */
    color: white; /* 按钮文字颜色 */
    border: none;
    border-radius: 5px; /* 圆角 */
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease; /* 过渡效果 */
    margin-bottom: 20px;
}

.add-event-btn:hover {
    background-color: #2C86C2; /* 悬停时的背景颜色 */
    transform: translateY(-2px); /* 悬停时的轻微上移效果 */
}

.add-event-btn:active {
    background-color: rgb(110, 119, 128); /* 点击时的背景颜色 */
    transform: translateY(0); /* 恢复位置 */
}

/* 表单容器样式 */
.add-event-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px; /* 输入框和按钮之间的间距 */
}

/* 设置弹窗样式 */
.settings-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 70%;
    height: 70%;
    z-index: 200;
    display: flex;
    overflow: hidden;
    color: white;
    justify-content: center;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(9px);
    background-color: rgba(0, 191, 255, 0);
    box-shadow: rgba(0, 0, 0, 0.3) 2px 8px 8px;
    border: 4px rgba(255, 255, 255, 0.4) solid;
    border-bottom: 4px rgba(40, 40, 40, 0.35) solid;
    border-right: 4px rgba(40, 40, 40, 0.35) solid;
}

/* 关闭按钮样式 */
.close-popup-button {
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 20px;
    color: #fff;
    background-color: #e74c3c; /* 红色背景 */
    border: none;
    border-radius: 50%; /* 圆形按钮 */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 999;
}

/* 使用伪元素显示叉号 */
.close-popup-button::before {
    content: "×"; /* 显示叉号 */
    font-size: 25px; /* 设置叉号大小 */
    color: #fff; /* 设置叉号颜色 */
    transition: transform 0.3s ease; /* 添加动画 */
}

/* 悬停时的效果 */
.close-popup-button:hover {
    background-color: #c0392b; /* 深红色背景 */
    transform: scale(1.1); /* 放大 */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* 增强阴影 */
}

.close-popup-button:hover::before {
    transform: rotate(360deg); /* 悬停时旋转 */
}

/* 左上角大标题 */
.settings-title {
position: absolute;
    top: 40px;
    left: 45px;
    font-size: 40px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.settings-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.input {
    display: flex;
    flex-direction: column;
    width: 160px;
    justify-content: center;
    border-radius: 10px;
    transition: 1s;
    padding: 10px;
    overflow: hidden;
    justify-content: flex-start;
    margin-top:100px;
}

.value {
    font-size: 15px;
    background-color: transparent;
    border: none;
    padding: 10px;
    color: white;
    display: flex;
    position: relative;
    gap: 5px;
    cursor: pointer;
    border-radius: 10px;
    transition: 1s;
    box-sizing: border-box;
}

.value:not(:active):hover,
.value:focus {
    display: flex;
    box-sizing: border-box;
    border: 2px solid #ffffff;
}

.value:focus,
.value:active {
    background-color: #ffffff;
    outline: none;
    margin-left: 17px;
}

.value::before {
    content: "";
    position: absolute;
    top: 5px;
    left: -15px;
    width: 5px;
    height: 80%;
    background-color: #FFFFFF;
    border-radius: 5px;
    opacity: 0;
    transition: 1s;
}

.value:focus::before,
.value:active::before {
    opacity: 1;
}

.value svg {
    width: 20px;
}

.input:hover > :not(.value:hover) {
    transition: 300ms;
    transform: scale(0.95, 0.95);
}

.settings-content {
    flex: 1;
    padding: 20px;
    color: white;
    overflow-y: auto;
    scrollbar-width: none; /* 隐藏滚动条 (适用于 Firefox) */   
}
.settings-content::-webkit-scrollbar {
    display: none; /* 隐藏滚动条 (适用于 WebKit 浏览器，如 Chrome 和 Safari) */
}

.settings-content h2 {
    margin-bottom: 10px;
    font-size: 30px;
    color: #fff;
    text-align: center;
}

.value.active {
    background-color: #8e8e8e; /* 激活状态背景色 */
    color: white;
    font-weight: bold;
    border: 2px solid #ffffff; /* 激活状态边框 */
}

/* 禁用页面滚动 */
.no-scroll {
    overflow: hidden;
    height: 100%; /* 防止页面内容超出可视区域 */
}

/* 角色管理界面专属样式 */
.character-management-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;  
}

.enabled-count-container,
.filter-container {
    flex: 1 1 100%;  
    text-align: center;
    margin: 10px 0;  
}

.character-management-card {
    border: 2px solid #aaa;
    border-radius: 12px;
    padding: 6px;
    text-align: center;
    width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.character-management-card:hover {
    transform: scale(1.05) !important; 
    border-color: #ffffff; 
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); 
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; 
}

.character-management-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%; /* 圆形头像 */
    border: 2px solid #ddd; /* 添加边框 */
    margin-bottom: 10px;
    background-color: #f9f9f9;
}

.character-management-name {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
}

.disable-button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.disable-button:hover {
    background-color: #d32f2f;
}

.enable-button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.enable-button:hover {
    background-color: #388e3c;
}

.character-management-card.disabled {
    background-color: rgba(255, 0, 0, 0.3); 
    border-color: rgba(255, 0, 0, 0.7); 
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); 
}

.character-management-card.disabled:hover {
    background-color: rgba(255, 0, 0, 0.33); 
    border-color: rgba(255, 0, 0, 0.9); 
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8); 
}

.character-management-card.disabled .character-management-image {
    filter: grayscale(25%); 
    opacity: 0.6; 
    transition: filter 0.3s ease, opacity 0.3s ease; 
}

.character-management-card.disabled:hover .character-management-image {
    filter: grayscale(0); 
    opacity: 0.8; 
}

.character-management-card.disabled .character-management-name {
    color: #a9a9a9;
    opacity: 0.8; /* 降低透明度 */
    transition: color 0.3s ease, opacity 0.3s ease; 
}

.character-management-card.disabled:hover .character-management-name {
    color: #c0c0c0; 
    opacity: 1; /* 鼠标悬停时提高透明度 */
}

/* 定义卡片依次排开的动画 */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 为角色卡片添加动画效果 */
.character-card-container .character-management-card {
    opacity: 0; 
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.character-card-container .character-management-card.animate {
    opacity: 1;
    transform: translateY(0);
}

.enabled-count-container {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
/* 筛选按钮容器 */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 10px;  
}

/* 筛选按钮 */
.filter-button {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: transform 0.2s ease;
    pointer-events: auto !important;
    filter: brightness(0) invert(1);
    background-color: transparent;
    /* border: 1px solid white; */
    color: white;
    border-radius: 5px;
}

.filter-button:hover {
    transform: scale(1.2);
    border-radius: 8px; 
    width: 40px; 
    height: 40px; 
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); 
}

.filter-button.active {
    border-radius: 8px;
    filter: none;
}

/* 卡片容器 */
.character-card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

/* 菜单滑入和滑出动画 */
@keyframes slideInRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* 默认隐藏菜单 */
.input {
    display: none; /* 默认隐藏 */
    top: 0;
    left: 0;
    /* height: 100%; */
    background-color: #6C6C6E; /* 半透明背景 */
    z-index: 300;
    padding: 20px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    transform: translateX(-100%); /* 初始位置在屏幕外 */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 显示菜单时的样式 */
.input.show {
    display: flex; /* 显示菜单 */
    animation: slideInRight 0.3s forwards; /* 向右滑入动画 */
}

/* 隐藏菜单时的样式 */
.input.hide {
    animation: slideOutLeft 0.3s forwards; /* 向左滑出动画 */
}

/* 汉堡菜单样式 */
.burger {
  position: absolute; /* 绝对定位 */
  top: 8px; /* 距离弹窗顶部 */
  left: 8px; /* 距离弹窗左侧 */
  width: 40px;
  height: 30px;
  background: transparent;
  cursor: pointer;
  display: block;
  z-index: 400; /* 确保在其他元素之上 */
}

.burger input {
  display: none;
}

.burger span {
  display: block;
  position: absolute;
  height: 4px;
  width: 100%;
  background: white; /* 改为白色 */
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}

.filter-button.active {
    border: 2px solid #e0e0e0; 
    border-radius: 10px; 
}

.burger span:nth-of-type(1) {
  top: 0px;
  transform-origin: left center;
}

.burger span:nth-of-type(2) {
  top: 50%;
  transform: translateY(-50%);
  transform-origin: left center;
}

.burger span:nth-of-type(3) {
  top: 100%;
  transform-origin: left center;
  transform: translateY(-100%);
}

.burger input:checked ~ span:nth-of-type(1) {
  transform: rotate(45deg);
  top: 0px;
  left: 5px;
}

.burger input:checked ~ span:nth-of-type(2) {
  width: 0%;
  opacity: 0;
}

.burger input:checked ~ span:nth-of-type(3) {
  transform: rotate(-45deg);
  top: 28px;
  left: 5px;
}

/* 向上划出动画 */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 应用于右侧内容的动画 */
.settings-content.animate {
    animation: slideUp 0.3s ease-out;
}

/* 困难事件显示区域样式 */
.hard-missions-container {
    margin: 20px auto;
    max-width: 1000px;
    display: none; /* 默认隐藏 */
}

.hard-missions-title {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    margin: 20px 0 15px 0;
    color: #000000;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.hard-missions-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

/* 困难事件盒子样式 - 基于原有mission-box但有区别 */
.hard-mission-box {
    box-sizing: border-box;
    width: 220px;
    height: 200px;
    border: 2px solid #ababab;
    box-shadow: 12px 17px 51px rgba(191, 191, 191, 0.3);
    backdrop-filter: blur(6px);
    border-radius: 17px;
    text-align: center;
    transition: all 0.5s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    font-weight: bolder;
    color: #2c3e50;
    padding: 15px;
    margin: 5px;
    background: #F0F2F5;
    position: relative;
    overflow: hidden;
}

.hard-mission-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 17px;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
}

.hard-mission-box:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 15px 20px 60px rgba(231, 76, 60, 0.4);
}

.hard-mission-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.hard-mission-content {
    font-size: 0.9em;
    line-height: 1.4;
    color: #7F8C8D;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .hard-missions-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .hard-mission-box {
        width: 280px;
        height: 180px;
    }
}

@media screen and (max-width: 480px) {
    .hard-mission-box {
        width: 250px;
        height: 160px;
        padding: 10px;
    }
    
    .hard-missions-title {
        font-size: 1.3em;
    }
}

/* 投票系统样式 */
.vote-dots-container {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    min-height: 12px;
}

.vote-dot {
    width: 28px;
    height: 28px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: voteDotPulse 1s ease-in-out;
    background-color: transparent;
}

@keyframes voteDotPulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 投票状态样式 */
.hard-mission-box.voted {
    border-color: #27ae60;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.5);
    transform: scale(1.02);
}

.hard-mission-box.selected {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    box-shadow: 0 0 25px rgba(243, 156, 18, 0.8);
    transform: scale(1.05);
}

.hard-mission-box.rejected {
    opacity: 0.5;
    filter: grayscale(100%);
    border-color: #95a5a6;
    transform: scale(0.95);
}

/* 投票结果提示 */
.voting-result {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.5s ease-out;
}

.voting-result h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    color: #fff;
}

.voting-result p {
    margin: 5px 0;
    font-size: 0.95em;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 改进困难事件盒子的点击反馈 */
.hard-mission-box:hover:not(.rejected) {
    cursor: pointer;
    border-color: #3498db;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.4);
}

.hard-mission-box:active:not(.rejected) {
    transform: scale(0.98);
}

/* 投票说明样式 */
.voting-instructions {
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    animation: fadeInDown 0.5s ease-out;
}

.voting-instructions p {
    margin: 0;
    color: #1976d2;
    font-weight: 500;
    font-size: 0.9em;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式优化 */
@media screen and (max-width: 518px) {
    .voting-instructions {
        font-size: 0.85em;
        padding: 8px 12px;
    }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .status-bar {
        height: 50px;
        padding: 0 10px;
    }
    
    .status-center {
        gap: 10px;
    }
    
    .status-left,
    .status-right {
        gap: 8px;
    }
    
    .status-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .status-info {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .room-code-value {
        font-size: 12px;
    }
    
    body {
        padding-top: 70px;
    }
}

@media screen and (max-width: 480px) {
    .status-bar {
        height: 45px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .status-center {
        order: 1;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }
    
    .status-left,
    .status-right {
        order: 0;
    }
    
    .status-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    body {
        padding-top: 65px;
    }
}

@media screen and (max-width: 518px) {
    .container {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 一行显示两个 */
        gap: 12px; /* 卡片之间的间距 */
    }

    .character-image {
        width: 110px; /* 缩小宽度 */
        height: 110px; /* 缩小高度 */
    }

    .character-box,
    .mission-box {
        width: 100%; /* 让卡片宽度自适应 */
        max-width: 100%; /* 防止超出容器 */
        margin: 0; /* 去除外边距 */
        height: 220px;
    }

    .history-popup {
        width: 120%; /* 宽度为屏幕的 90% */
        height: 45%; /* 高度为屏幕的 70% */
        font-size: 13px; /* 减小字体大小 */
        padding: 20px; /* 调整内边距 */
    }

    .history-table {
        width: 90%; /* 表格宽度为 80% */
        margin: 0 auto; /* 居中对齐 */
    }
  
    .event-popup {
        width: 85%; /* 宽度为屏幕的 90% */
        height: 75%; /* 高度为屏幕的 70% */
        font-size: 12px; /* 减小字体大小 */
        padding: 20px; /* 调整内边距 */
    }
    /* 菜单 */
    .settings-popup {
        width: 95%; /* 弹窗宽度占满屏幕的 95% */
        height: 85%;
        font-size: 14px; /* 缩小字体 */
        padding: 10px; /* 调整内边距 */
    }

    .settings-title {
        display: none;
    }

    .settings-toggle-button {
        display: block; /* 显示菜单按钮 */
        position: absolute;
        top: 10px;
        left: 10px;
        background-color: #3498db;
        color: white;
        border: none;
        border-radius: 5px;
        padding: 8px;
        font-size: 14px;
        cursor: pointer;
        z-index: 400;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .settings-toggle-button:hover {
        background-color: #2980b9;
    }

    .input {
        display: none; /* 默认隐藏左侧设置选项 */
        position: absolute;
        top: -105px;
        left: 0;
        height: 100%;
        z-index: 300;
        padding: 20px;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
        backdrop-filter: blur(10px); 
        background-color: rgba(79, 79, 79, 0.9); 
        box-shadow: rgba(0, 0, 0, 0.4) 2px 8px 8px; 
        border: 4px rgba(255, 255, 255, 0.4) solid;
        border-bottom: 4px rgba(40, 40, 40, 0.35) solid;
        border-right: 4px rgba(40, 40, 40, 0.35) solid;
    }
    #characterManagement{
        margin-top: 40px;
    }
    
    .input.show {
        display: flex; /* 显示左侧设置选项 */
    }    .character-management-card {
        width: 25%; /* 缩小卡片宽度 */

    }    /* 当筛选后角色卡片小于4个时，增加卡片宽度 */
    .character-card-container.few-cards .character-management-card {
        width: auto !important;
        min-width: 94px !important;
    }

    .character-management-image {
        width: 78px; /* 缩小图片宽度 */
        height: 78px; /* 缩小图片高度 */
    }

    .character-management-name {
        font-size: 16px; /* 缩小字体大小 */
    }

    .character-card-container {
        gap: none;
    }

    .settings-content {
        padding: 0px;
    }

    .character-management-container {
        padding: 0px;
    }
        .placeholder-tooltip {
            width: 100% !important;
        }
}

    /* 大屏幕默认显示菜单选项栏 */
    @media screen and (min-width: 519px) {
        .input {
            display: flex !important; /* 确保菜单选项栏显示 */
            transform: translateX(0); /* 确保位置正确 */
            animation: none; /* 禁用动画 */
            box-shadow: none !important; 
            background-color: transparent !important
        }
        .burger {
            display: none !important; /* 隐藏汉堡菜单按钮 */
        }
    }

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
