/* ==========================================================================
 * 胜利游戏 · 玩家门户站 —— 下载入口样式（右上角按钮 + 游戏图标弹层）
 * 文件路径：web/css/download.css
 *
 * 风格：与全站一致的浅色卡通魔兽风；所有图形纯 CSS 绘制，零外部图片。
 * 依赖：base.css 里的设计变量（--c-primary / --radius / --shadow 等）
 * ========================================================================== */

/* --------------------------------------------------------------------------
 * 1. 右上角按钮（登录页、用户中心、GM 后台三处共用）
 * -------------------------------------------------------------------------- */
.dl-topbtn {
  position: fixed;
  right: 28px;
  top: 22px;
  z-index: 900;                      /* 高于页面内容，低于弹层 */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-primary-dark);
  background: #ffffff;
  border: 2px solid #cfe3fa;
  box-shadow: var(--shadow-sm);
  transition: var(--trans);
}
.dl-topbtn:hover {
  transform: translateY(-2px);
  border-color: var(--c-primary);
  box-shadow: var(--shadow);
  color: #ffffff;
  background: linear-gradient(135deg, #5aa0ea 0%, #4a90e2 100%);
}
.dl-topbtn:active { transform: translateY(0); }
.dl-topbtn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #ffd166 0%, #f7b731 100%);
}
.dl-topbtn:hover .dl-topbtn-ico {
  color: var(--c-gold);
  background: #ffffff;
}

/* 内页顶栏版：跟在导航条里，不悬浮 */
.dl-topbtn-inline {
  position: static;
  right: auto;
  top: auto;
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  border-radius: 19px;
}

/* 打开弹层时锁住背景滚动 */
body.dl-lock { overflow: hidden; }

/* --------------------------------------------------------------------------
 * 2. 弹层遮罩
 * -------------------------------------------------------------------------- */
.dl-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(43, 66, 92, .42);
  backdrop-filter: blur(3px);
  animation: dl-fade .18s ease-out;
}
@keyframes dl-fade { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------------------------
 * 3. 弹层主体
 * -------------------------------------------------------------------------- */
.dl-modal {
  width: 760px;
  max-width: 100%;
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid #dbe6f2;
  box-shadow: var(--shadow-lg);
  animation: dl-pop .22s cubic-bezier(.34, 1.28, .64, 1);
}
@keyframes dl-pop {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- 标题栏 ---- */
.dl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(120deg, #eaf4ff 0%, #f7fbff 60%, #f1fbf4 100%);
  border-bottom: 1px solid #e2eefb;
}
.dl-head-l {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
}
.dl-head-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 10px;
  font-size: 16px;
  background: #ffffff;
  border: 1px solid #d8e8fa;
}
.dl-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text-light);
  background: #ffffff;
  border: 1px solid #e0ebf7;
  transition: var(--trans);
}
.dl-close:hover {
  color: #ffffff;
  background: var(--c-danger);
  border-color: var(--c-danger);
  transform: rotate(90deg);
}

/* ---- 内容区 ---- */
.dl-body {
  padding: 22px;
  overflow-y: auto;
}

/* ---- 游戏卡片：一行三张，图标 + 名字 + 下载动作 ---- */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.dl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfdff 0%, #f2f8ff 100%);
  border: 1px solid #dde9f6;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--trans);
  outline: none;
}
.dl-card:hover,
.dl-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--c-primary);
  box-shadow: 0 12px 30px rgba(74, 144, 226, .22);
  background: linear-gradient(180deg, #ffffff 0%, #eaf4ff 100%);
}

/* ---- 游戏图标方块（优先官方图标图片；没有图片时退回字符） ---- */
.dl-ico {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px; height: 74px;
  border-radius: 20px;
  background: linear-gradient(140deg, #ffd98a 0%, #f7b731 46%, #ef9d2b 100%);
  box-shadow: inset 0 -6px 12px rgba(255, 255, 255, .35), 0 6px 14px rgba(247, 183, 49, .32);
  transition: var(--trans);
  overflow: hidden;                    /* 官方图标按圆角裁切 */
}
/* 官方图标（从安装包里提取的原图）：铺满整个方块 */
.dl-ico-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
/* 用图片时去掉纯 CSS 的那块小高光，免得压在官方图标上 */
.dl-ico:has(.dl-ico-img)::after { display: none; }

.dl-ico::after {                     /* 图标右下角的小高光块，让方块更像游戏图标（仅字符图标时显示） */
  content: '';
  position: absolute;
  right: 6px; bottom: 6px;
  width: 14px; height: 14px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .45);
}
.dl-card:hover .dl-ico { transform: scale(1.06) rotate(-3deg); }

/* ---- 安装包不在服务器上时的置灰态（由 js/download.js 探测后加上） ---- */
.dl-card-off {
  opacity: .55;
  filter: grayscale(.75);
  cursor: not-allowed;
}
.dl-card-off:hover { transform: none; }
.dl-card-off .dl-btn {
  background: #dfe6ef;
  color: #93a2b5;
  box-shadow: none;
  cursor: not-allowed;
}
.dl-ico-txt {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(120, 70, 0, .28));
}

/* ---- 卡片文字 ---- */
.dl-info { text-align: center; }
.dl-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
}
.dl-note {
  margin-top: 2px;
  font-size: 12px;
  color: var(--c-text-light);
}

/* ---- 卡片里的下载按钮（视觉提示，实际整卡都可点） ---- */
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #5aa0ea 0%, #4a90e2 100%);
  box-shadow: 0 4px 10px rgba(74, 144, 226, .30);
  transition: var(--trans);
}
.dl-card:hover .dl-btn {
  background: linear-gradient(135deg, #6ec07f 0%, #3da36b 100%);
  box-shadow: 0 4px 12px rgba(61, 163, 107, .34);
}

/* ---- 底部小字提示 ---- */
.dl-tip {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--c-text-light);
}

/* ---- 一个游戏都没有时的占位 ---- */
.dl-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--c-text-light);
}
