/* =========================
   Tabs
   ========================= */
.tabs{
  width:700px;
  margin:0 auto 12px auto;
  display:grid;
  grid-template-columns: repeat(9, 1fr);
  gap:6px;
}
.tab{
  background:#f2f2f2;
  color:#333;
  border:1px solid #d8d8d8;
  border-radius:8px;
  padding:7px 0;
  cursor:pointer;
  text-align:center;
  font-size:14px;
}
.tab.is-active{
  background:#ceb67d;
  color:#482c16;
  border-color:#f0c24b;
}

/* =========================
   Cards Grid
   ========================= */
.grid-tiles{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 16px;
  width:700px;
  margin:18px auto;
}
.card{
  display:flex;
  flex-direction:column;
  align-items:center;
  width:120px;
  cursor:pointer;
  border-radius:10px;
  overflow:hidden;
  border:1px solid #d6d6d6;
  background:#fff;
  user-select:none;
}
.card:focus{
  outline:2px solid #6496C7;
  outline-offset:2px;
}
.tile{
  width:100%;
  height:154px;
  position:relative;
  overflow:hidden;
  background:#fff;
}
.tile::after{
  content: var(--img-a);
  position:absolute;
  bottom:6px;
  left:50%;

  /* ✅ 不填 imgMul 就是 1，填了就是倍数 */
  transform: translateX(-50%) scale(var(--img-mul, 1));
  transform-origin: center bottom;

  pointer-events:none;
}

.caption{
  width:100%;
  height:26px;
  line-height:26px;
  background:#ceb67d;
  color:#482c16;
  font-size:14px;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.caption::before{ content: attr(aria-label); }

/* =========================
   Modal Base
   ========================= */
.modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:9999;
}
.modal.is-open{ display:block; }

.modal-mask{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.55);
}

.modal-panel{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:660px;
  max-width: calc(100vw - 24px);
  background:#fff;
  border-radius:12px;
  border:1px solid #dcdcdc;
  box-shadow:0 12px 36px rgba(0,0,0,.28);
  padding:14px 14px 16px;
  box-sizing:border-box;
}

.modal-close{
  position:absolute;
  right:10px;
  top:10px;
  width:34px;
  height:34px;
  border:0;
  border-radius:10px;
  background:#f2f2f2;
  cursor:pointer;
  font-size:22px;
  line-height:34px;
  text-align:center;
}

/* =========================
   Modal Head
   ========================= */
.modal-head{
  display:flex;
  gap:14px;
  align-items:flex-start;
  padding-right:44px;
}
.modal-gif-wrap{
  width:140px;
  height:180px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #ededed;
  background:#fafafa;
  border-radius:12px;
  overflow:hidden;
  box-sizing:border-box;
}
.modal-gif{
  max-width:100%;
  max-height:100%;
  transform: scale(var(--img-mul, 1));
  transform-origin: center center;
}

.modal-title-wrap{
  flex:1;
  min-width:0;
}



/* =========================
   Title: name + corner tag + underline
   （分组标签放右上角，小一点）
   ========================= */
/* =========================
   标题整体容器（控制线的位置）
   ========================= */
.modal-title{
  position:relative;
  display:block;
  width:100%;
  padding-bottom:8px;
  margin-bottom:10px;
  border-bottom:1px solid #e3e3e3;   /* 结构线，干净 */
}

/* =========================
   主标题文字（核心质感在这）
   ========================= */
/* 标题文字：去掉黑影，变柔和有质感 */
.pet-name-text{
  display:inline-block;
  font-weight:900;
  font-size:20px;
  line-height:1.1;
  letter-spacing:0.5px;

  /* 不要死黑，换成深灰蓝 */
  color:#2b3a46;

  /* 只留轻微高光，不要黑色阴影 */
  text-shadow:
    0 1px 0 rgba(255,255,255,0.55);
}


/* =========================
   Top info (skills/source) - aligned + wrap
   ========================= */
.modal-top-info{
  margin-top:10px;
  padding:0;
}

.modal-line{
  display:grid;
  grid-template-columns: 64px 1fr;
  align-items:start;            /* 顶部对齐，长文本不乱 */
  column-gap:10px;
  margin-top:6px;
  font-size:14px;
  color:#333;
}
.modal-line:first-child{ margin-top:0; }

.modal-top-info .label{
  text-align:right;
  color:#111;
  font-weight:800;
  white-space:nowrap;
}

/* 右侧内容允许换行 */
.modal-top-info .modal-source,
.modal-top-info .modal-skills{
  white-space:normal;
  word-break:break-all;
  line-height:1.4;
  min-width:0;
}

/* 技能栏数字块（保持你原来的黄块） */
.skill-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:24px;
  padding:0 10px;
  border-radius:8px;
  background:#ffe6a6;
  color:#222;
  font-weight:800;
  border:1px solid #f0c24b;
  box-sizing:border-box;
}

/* =========================
   Modal Body
   ========================= */
.modal-body{
  margin-top:12px;
  box-sizing:border-box;
}

/* 两块区域：总档位(能力条) / 属性(地水火风) */
.modal-mid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  align-items:start;
}

/* 面板块 */
.panel-block{
  min-width:0;
  background:#fbfbfb;
  border:1px solid #e6e6e6;
  border-radius:12px;
  padding:10px 10px 10px;
  box-sizing:border-box;
}

/* 面板头（非椭圆按钮） */
.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:2px 2px 8px;
  border-bottom:1px solid #e9e9e9;
  margin-bottom:8px;
}
.panel-title{
  font-weight:900;
  font-size:14px;
  color:#222;
  line-height:1;
}

/* 行布局 */
.stat-row,
.elem-row{
  display:grid;
  align-items:center;
  gap:8px;
  margin-top:8px;
}
.stat-row{ grid-template-columns: 36px 1fr 42px; }
.elem-row{ grid-template-columns: 18px 1fr 42px; }

.stat-label,.elem-label{
  font-size:14px;
  color:#333;
  white-space:nowrap;
}

/* 数值块（你当前仍然是黄块风格：保留） */
.stat-val,.elem-val{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:22px;
  min-width:42px;
  padding:0 8px;
  border-radius:8px;

  background:#ffe6a6;          /* ✅ 黄色底 */
  color:#222;
  font-weight:900;
  border:1px solid #f0c24b;    /* ✅ 黄色边框 */
  box-sizing:border-box;
  white-space:nowrap;

  /* ⭐ 锁字体不跟系统字体变化 */
  font-size:12px !important;
  line-height:22px;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}


/* 连续条 */
.stat-bar,
.elem-bar{
  position:relative;
  width:100%;
  max-width: 260px;
  height:12px;
  background:#eceff2;
  border-radius:8px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.08);
  box-sizing:border-box;
}
.elem-bar{ height:10px; }

.stat-bar span,
.elem-bar span{
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:0;
  border-radius:8px;
}

/* 五维颜色 */
.stat-bar.is-vit span{ background:#ff5a5a; }
.stat-bar.is-str span{ background:#3b82f6; }
.stat-bar.is-def span{ background:#f6b21a; }
.stat-bar.is-agi span{ background:#22c55e; }
.stat-bar.is-mag span{ background:#06b6d4; }

/* 元素颜色 */
.elem-bar.is-earth span{ background:#38b000; }
.elem-bar.is-water span{ background:#1d4ed8; }
.elem-bar.is-fire  span{ background:#dc2626; }
.elem-bar.is-wind  span{ background:#f59e0b; }

/* 小屏 */
@media (max-width: 720px){
  .modal-panel{ width: calc(100vw - 24px); }
  .modal-mid{ grid-template-columns: 1fr; }
  .stat-bar,.elem-bar{ max-width: 100%; }
}
/* =========================
   宠物左上角分组标签（贴在形象上）
   ========================= */

/* 形象容器必须相对定位 */
.modal-gif-wrap{
  position:relative;
}

/* 左上角角标 */
.modal-gif-wrap::before{
  content: attr(data-group);
  position:absolute;
  left:6px;
  top:6px;

  padding:2px 6px;
  height:18px;
  line-height:18px;

  border-radius:6px;
  background:#ffe6a6;
  color:#7a4b00;
  font-size:11px;
  font-weight:800;
  border:1px solid #f0c24b;

  box-shadow:
    0 1px 2px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.4);

  pointer-events:none;
  white-space:nowrap;
}

/* 如果没有分组，不显示 */
.modal-gif-wrap[data-group=""]::before{
  display:none;
}

/* =========================
   Responsive 自适应增强
   ========================= */

/* 整体容器宽度改为自适应 */
.tabs,
.grid-tiles{
  width:100%;
  max-width:700px;
  margin-left:auto;
  margin-right:auto;
}

/* 弹窗面板自适应 */
.modal-panel{
  width:100%;
  max-width:660px;
}

/* 卡片区域自适应列数 */
.grid-tiles{
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

/* 小屏优化 */
@media (max-width: 768px){

  .modal-panel{
    width: calc(100vw - 16px);
    max-width: none;
    border-radius:10px;
  }

  .modal-head{
    flex-direction:column;
    align-items:center;
    text-align:center;
  }

  .modal-gif-wrap{
    width:120px;
    height:150px;
  }

  .modal-title{
    text-align:center;
  }

  .modal-mid{
    grid-template-columns: 1fr;   /* 两列变一列 */
  }

  .grid-tiles{
    gap:10px;
  }
}

/* 超小屏（手机） */
@media (max-width: 480px){

  .tabs{
    grid-template-columns: repeat(4, 1fr);
    gap:4px;
  }

  .tab{
    font-size:12px;
    padding:6px 0;
  }

  .card{
    width:100%;
  }

  .caption{
    font-size:12px;
  }

  .stat-row,
  .elem-row{
    grid-template-columns: 30px 1fr 36px;
  }

  .stat-bar,
  .elem-bar{
    max-width:100%;
  }
}

