/* 全局样式 */
body {
    max-width: 600px;
    margin: 0px auto;
    padding: 0 20px;
    font-family: "Microsoft YaHei", monospace;
    font-size: 16px;
    text-align: center;
      /* 浅灰底色 + 1px 浅灰线条的格子 */
    background-color: #f8f8f8; /* 更浅的底色，突出格子 */
    background-image: 
      linear-gradient(#e5e5e5 1px, transparent 1px), /* 1px细线条，浅灰色 */
      linear-gradient(90deg, #e5e5e5 1px, transparent 1px);
    background-size: 20px 20px; /* 格子间距不变，保证纹理细腻 */
}

/* 回合行动点 */
.status-bar {
    text-align: center;
    margin: 0px auto 0px;
    padding: 8px 30px 8px 8px;
    background-color: #f0f0f0;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    position: relative; /* 关键：让铅笔绝对定位，不被居中影响 */
}

.status-bar span {
    margin-right: 16px;
    font-weight: bold;
}

/* 飘字基础样式 */
.ap-float-text {
    position: fixed;
    color: #6c6c6c; /* 使用预警橙，或者 #666 深灰 */
    font-weight: bold;
    font-size: 18px;
    pointer-events: none; /* 确保不影响点击操作 */
    z-index: 10000;
    animation: apMoveUp 0.8s ease-out forwards;
}

/* 向上漂浮并淡出的动画 */
@keyframes apMoveUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-40px);
        opacity: 0;
    }
}
/* ========== 神奇铅笔圆形按钮（核心） ========== */
#magicPencilBtn {
    /* 绝对定位到状态栏右侧，不干扰其他元素 */
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    /* 圆形按钮：宽高相等+50%圆角 */
    width: 27px;
    height: 27px;
    border-radius: 50%;
    /* 按钮样式重置，无默认边框/背景 */
    border: none;
    outline: none;
    background-color: #afafaf;
    /* 铅笔emoji居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    /* 基础样式 */
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    /* 关闭态：灰色按钮+灰色铅笔 */
    color: #3d3d3d;
    border: 1px solid #7a7a7a;
}

/* 开启态：主题色按钮+主题色铅笔 */
#magicPencilBtn.active {
    color: #258a85; /* 亮绿色铅笔 */
    border: 0px solid #258a85; /* 绿色边框 */
    background-color: #62bcb7; /* 浅绿背景，更明显 */
}

/* 悬浮态：轻微加深 */
#magicPencilBtn:hover {
    color: #5c5c5c;
    border-color: #aaaaaa;
}


/* 日志展示区 */
#game-log {
    text-align: left;
    height: 225px;
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    overflow-y: auto;
    background-color: #e6e6e6;
}


/* 输入框 */
#cmd-input {
    width: 70%;
    padding: 8px;
    font-size: 16px;
    margin-right: 10px;
}

/* 输入框执行按钮 */
#submit-btn {
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 4px;
}
#submit-btn:hover {
    background-color: #005a9e;
}

/* 为参数显示区添加一些样式，使其更美观 */
.stats-bar {
    background-color: #f0f0f0;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: bold;
        }
.stats-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 12px; /* 与下方按钮保持距离 */
        }
.stat-item {
    text-align: center;
        }
.stat-label {
    font-size: 14px;
    color: #666;
        }
.stat-value {
    font-size: 24px;
    color: #0081d7;
        }
/* 按钮区域样式 */
.stats-bar .action-btn {
    display: block;
    margin: 0 auto;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 16px;
        }


/* 核心操作按钮容器：一行两个按钮 */
.core-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* 按钮之间的间距，和原有样式保持一致 */
    margin-bottom: 15px; /* 和下方按钮保持间距 */
}

/* 核心操作按钮：宽度占比调整为 50% 减间距 */
.core-actions .action-btn {
    width: calc(50% - 4px); /* 50%宽度 - 一半的gap间距，保证两个按钮刚好一排 */
    box-sizing: border-box; /* 避免padding导致宽度溢出 */
}

/* 核心操作按钮容器：一行两个按钮 */
.assist-actions {
    display: flex;
    justify-content: center; /* 2. 关键：让按钮组在屏幕水平居中，实现屏幕中横向分布 */
    gap: 8px; /* 按钮之间的间距，保留原有样式 */
    margin-bottom: 15px; /* 和下方按钮保持间距，保留原有样式 */
    width: 100%; /* 可选：让容器占满屏幕宽度，居中效果更稳定（推荐添加） */
}

/* 核心操作按钮：宽度占比调整为 50% 减间距 */
.assist-actions .action-btn {
    /* 3. 关键：调整宽度计算公式，3个按钮均分，扣除gap间距（总gap为 8px*2=16px，分摊到每个按钮上） */
    width: calc(33.333% - (16px / 3)); /* 1/3宽度 - 平均分摊的gap间距，保证三个按钮刚好一排 */
    box-sizing: border-box; /* 避免padding/border导致宽度溢出，保留原有样式 */
    /* 可选：添加最小宽度，防止屏幕过小时按钮变形（推荐添加，提升适配性） */
    min-width: 80px;
    border-radius: 20px;
}

/* 功能按钮容器 */
.action-buttons {
    margin: 15px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-direction: column;

}

/* 功能按钮样式 */
.action-btn {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    width: 100%;        /* 宽度拉满 */
    background-color: #258a85;
    color: white;
    text-align: center;
    transition: opacity 0.2s ease; /* 增加平滑感 */
}
.action-btn:hover {
    opacity: 0.9;
}
/* 准备一个类名，用于触发消失动画 */
.action-btn.fade-out {
    opacity: 0;
    transform: scale(0.95); /* 稍微缩小一点，更有“点下去”的感觉 */
    pointer-events: none;    /* 防止连点 */
}

#dynamic-recruit-buttons,
#dynamic-internship-buttons,
#dynamic-competition-buttons {
    /* 初始隐藏，仅当有内容时显示 */
    display: none;
    /* 清除默认的margin/gap，避免残留间距 */
    margin: 0;
    gap: 0;
}
#dynamic-recruit-buttons:not(:empty),
#dynamic-internship-buttons:not(:empty),
#dynamic-competition-buttons:not(:empty) {
    display: flex;
    margin: 15px 0;
    gap: 8px;
    flex-wrap: wrap;
    flex-direction: column;
}

/* “查看简历”按钮的特殊样式 */
#view-resume-btn {
    background-color: #2d5b85;      /* 特殊的背景色 */
    /* 2. 关键：重新设置边框样式，覆盖 border: none; */
    border-width: 2px;
    border-style: solid;
    border-color: #224463;
}

/* “查看简历”按钮的悬停效果 */
#view-resume-btn:hover {
    background-color: #1c3468;      /* 悬停时颜色变深 */
    /* 3. (可选) 为悬停状态也设置一个边框色，效果更好 */
    border-color: #152951;
    /* 移除从 .action-btn:hover 继承的 opacity，因为深色背景变透明会不好看 */
    opacity: 1;
}

/* “查看offer”按钮的特殊样式 */
#view-offer-btn {
    background-color: #274e73;      /* 特殊的背景色 */
    /* 2. 关键：重新设置边框样式，覆盖 border: none; */
    border-width: 2px;
    border-style: solid;
    border-color: #183642;
    margin-top: 12px;
}

/* “查看offer”按钮的悬停效果 */
#view-offer-btn:hover {
    background-color: #285a6e;      /* 悬停时颜色变深 */
    /* 3. (可选) 为悬停状态也设置一个边框色，效果更好 */
    border-color: #254e5e;
    /* 移除从 .action-btn:hover 继承的 opacity，因为深色背景变透明会不好看 */
    opacity: 1;
}

#reset-btn {
        background-color: #215a62;
        border-color: #246069;
    }
#reset-btn:hover {
        background-color: #2b7781;
    }

#viewAchieveBtn {
        background-color: #215a62;
        border-color: #246069;
    }
#viewAchieveBtn:hover {
        background-color: #2b7781;
    }

#game-guide-btn {
        background-color: #215a62;
        border-color: #246069;
    }
#game-guide-btn:hover {
        background-color: #2b7781;
    }

#end-turn-btn {
        background-color: #d9534f;
        border-color: #d43f3a;
        margin-top: 18px;
    }
#end-turn-btn:hover {
        background-color: #c9302c;
    }





/* ********** 新增：简历弹窗样式（适配移动端）********** */
.resume-modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* 允许弹窗内容滚动 */
    background-color: rgba(0, 0, 0, 0.7);
    /* 移动端触摸优化 */
    -webkit-overflow-scrolling: touch;
}

.resume-modal-content {
    text-align: left;
    background-color: #fffbfb;
    margin: 3% auto; /* 移动端减少上下边距 */
    padding: 20px 15px; /* 移动端减少内边距，左右更紧凑 */
    border: 1px solid #ccc;
    width: 95%; /* 移动端占95%宽度，最大化利用屏幕 */
    max-width: 800px; /* 大屏仍限制最大宽度 */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-family: "Microsoft YaHei", sans-serif;
    position: relative; /* 为关闭按钮定位 */
    /* 移动端防止内容溢出 */
    box-sizing: border-box;
}

.resume-modal-content h1 {
    text-align: center;
    color: #333;
    border-bottom: 2px solid #0078d7;
    padding-bottom: 10px; /* 移动端减少底部内边距 */
    margin-top: 10px; /* 适配移动端顶部间距 */
    font-size: 1.5rem; /* 使用rem适配移动端字体 */
}

.resume-section {
    margin-bottom: 20px; /* 移动端减少区块间距 */
}

.resume-section h2 {
    color: #0078d7;
    border-left: 5px solid #0078d7;
    padding-left: 10px; /* 移动端减少左侧内边距 */
    margin-top: 0;
    font-size: 1.2rem; /* rem适配字体 */
}

.resume-section p, .resume-section ul {
    font-size: 1rem; /* 基础字体适配移动端 */
    line-height: 1.5; /* 优化行高，提升可读性 */
    margin: 8px 0; /* 减少段落间距 */
}

.resume-section ul {
    list-style-type: none;
    padding-left: 0;
}

.resume-section ul li {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 10px; /* 移动端减少内边距 */
    margin-bottom: 8px; /* 减少列表项间距 */
    /* 移动端防止内容换行溢出 */
    word-wrap: break-word;
    word-break: break-all;
}

.resume-section ul li strong {
    color: #333;
    font-size: 1.05rem;
}

.resume-section .no-content {
    color: #888;
    font-style: italic;
    font-size: 0.95rem;
}

.close-resume-btn {
    color: #aaa;
    float: right;
    font-size: 24px; /* 移动端减小关闭按钮尺寸 */
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px; /* 移动端调整位置 */
    right: 15px; /* 移动端调整位置 */
    /* 增加点击区域，适配移动端触摸 */
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}

.close-resume-btn:hover,
.close-resume-btn:focus {
    color: black;
    text-decoration: none;
    opacity: 0.8;
}

/* Offer弹窗移动端适配 */
.offer-modal-content {
    background: #fdfdfd !important;
    border-radius: 16px !important;
    min-width: auto !important; /* 移除最小宽度限制，适配移动端 */
    width: 95% !important; /* 移动端占95%宽度 */
    max-width: 600px !important; /* 大屏限制最大宽度 */
    padding: 25px 15px !important; /* 移动端减少内边距 */
    box-sizing: border-box !important;
}

/* 列表去圆点+居中（适配移动端） */
.offer-list {
    list-style: none !important;
    padding: 0 !important;
    text-align: left !important; /* 移动端改为左对齐，提升可读性 */
}
/* 3. 弹窗标题：替换下划线为金色 */
.offer-modal .resume-modal-content h1 {
    border-bottom: 2px solid #0d4953 !important; /* 金色下划线（替换原#0078d7） */
    color: #0e535f !important; /* 标题文字改为深金色（可选） */
}

/* Offer项适配移动端 */
.offer-item {
    margin-bottom: 12px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important; /* 移除最大宽度限制，适配移动端 */
    padding: 8px !important;
    word-wrap: break-word !important;
    word-break: break-all !important;
}

/* 公司名适配移动端 */
.offer-item strong {
    display: block !important;
    text-align: left !important; /* 移动端左对齐 */
    color: #0e5b69 !important;
    font-size: 1.05rem !important;
}





/* ********** 新增：竞赛选择弹窗样式 ********** */
.job-modal,.competition-modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000; /* 确保在最上层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* 黑色背景，半透明 */
}

.job-modal-content,.competition-modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% 从顶部，水平居中 */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    text-align: center;
    font-family: "Microsoft YaHei", sans-serif;
}

.job-modal,.competition-modal h2 {
    margin-top: 0;
    color: #333;
}

.modal-option-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    color: white;
    text-align: left;
    box-sizing: border-box;
    background-color: #0d373c;
}


.modal-option-btn:hover {
    opacity: 0.9;
}

.modal-option-btn span {
    display: block;
    font-size: 14px;
    margin-top: 5px;
    color: #eee; /* 说明文字颜色浅一点 */
}


/* ====== 成就系统 CSS 样式（嵌入现有 CSS 文件或 <style> 标签）====== */
/* 查看成就按钮样式 */
/* .achieve-btn {
  padding: 12px 32px;
  background: #2f5496;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(47, 84, 150, 0.3);
  transition: all 0.3s ease;
}

.achieve-btn:hover {
  background: #1d3b6e;
  transform: translateY(-2px);
} */

/* 弹窗遮罩层 */
.achieve-modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999; /* 确保弹窗在最上层，可根据现有项目调整z-index数值 */
  display: none; /* 默认隐藏 */
  align-items: center;
  justify-content: center;
}

/* 成就弹窗主体 */
.achieve-modal {
  width: 90%;
  max-width: 700px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

/* 弹窗头部 */
.achieve-modal-header {
  padding: 20px;
  background: #215a62;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.achieve-modal-title {
  font-size: 20px;
  font-weight: bold;
}

/* 关闭按钮 */
.close-modal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* 成就列表容器（滚动适配） */
.achieve-modal-content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* 单个成就卡片 */
.achieve-card {
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.achieve-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* 成就图案容器 */
.achieve-icon {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 成就图标（图片/CS绘制均可） */
.achieve-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* 未获得成就：黑白滤镜 */
.achieve-card.unlocked-false .achieve-icon {
  filter: grayscale(100%); /* 完全黑白 */
  opacity: 0.7; /* 降低透明度，强化未激活视觉 */
}

/* 已获得成就：彩色（默认）+ 点缀色 */
.achieve-card.unlocked-true .achieve-icon {
  background: rgba(47, 84, 150, 0.1);
  border: 1px solid rgba(47, 84, 150, 0.2);
}

/* 成就信息容器 */
.achieve-info {
  flex: 1;
}

/* 成就标题 */
.achieve-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

/* 未获得成就标题：灰色 */
.achieve-card.unlocked-false .achieve-title {
  color: #999;
}

/* 成就条件 */
.achieve-condition {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
}

/* 未获得成就条件：浅灰色 */
.achieve-card.unlocked-false .achieve-condition {
  color: #ccc;
}

/* 成就描述 */
.achieve-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

/* 未获得成就描述：浅灰色 */
.achieve-card.unlocked-false .achieve-desc {
  color: #ccc;
}