/* 详情弹窗(层叠:新弹窗在上层,关闭回上层) */
.modal-mask { position: fixed; inset: 0; z-index: 100; }
.modal-layer {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(5, 12, 8, .6); backdrop-filter: blur(3px);
  animation: layerIn .14s ease-out;
}
.modal-layer:nth-child(n+2) .modal { box-shadow: 0 30px 90px rgba(0, 0, 0, .7); }
@keyframes layerIn { from { opacity: 0; } to { opacity: 1; } }
/* hidden 属性会被上面的 display:flex 盖掉(作者样式优先于 UA),必须显式关掉 */
.modal-mask[hidden] { display: none; }
.modal {
  background: linear-gradient(175deg, #1c3427 0%, var(--panel) 45%);
  border: 1px solid var(--line); border-radius: 16px; width: min(860px, 100%);
  max-height: 92vh; overflow-y: auto; padding: 20px 22px 22px; position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.modal-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--muted);
  font-size: 24px; cursor: pointer; line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--accent); }
.m-head { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.m-img { width: 128px; height: 128px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); flex: 0 0 auto; }
.m-title h2 { font-size: 23px; letter-spacing: .5px; }
.m-title .m-en { color: var(--muted); font-size: 13px; }
.m-title .m-tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; align-items: center; }
.m-tag { font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; color: var(--muted); }
.m-tag.gold { color: var(--accent); border-color: rgba(255, 210, 87, .4); }
.m-tag.moon { color: #9fc9e8; border-color: rgba(159, 201, 232, .4); }

.m-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
@media (max-width: 760px) { .m-grid { grid-template-columns: 1fr; } }
.m-box {
  background: rgba(13, 26, 20, .55); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px;
}
.m-box h3 { font-size: 13.5px; color: var(--accent); letter-spacing: 1px; margin-bottom: 7px; font-weight: 650; }
.stat-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.stat-row .sn { width: 62px; color: var(--muted); font-size: 12.5px; flex: none; }
.stat-row .sv { width: 44px; text-align: right; font-weight: 650; font-size: 13px; flex: none; }
.stat-bar { flex: 1; height: 9px; border-radius: 5px; background: #0b1710; overflow: hidden; }
.stat-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #6cc24a, #ffd257); }
.kv { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; border-bottom: 1px dashed rgba(39,68,53,.5); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }
.work-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mwork-chip {
  font-size: 13px; padding: 2px 9px; border-radius: 7px;
  background: rgba(108, 194, 74, .12); border: 1px solid rgba(108, 194, 74, .35); color: #b8e6a5;
}
.drop-table, .skill-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.drop-table th, .skill-table th { color: var(--muted); font-weight: 500; text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.drop-table td, .skill-table td { padding: 3.5px 6px; border-bottom: 1px dashed rgba(39,68,53,.4); }
.drop-rate { color: var(--muted); font-size: 11.5px; }
.m-desc { font-size: 13.5px; color: #cfe4d4; line-height: 1.8; }
.breed-pairs { font-size: 12.5px; line-height: 2; }
.breed-pairs b { color: var(--accent); font-weight: 600; cursor: pointer; }
.breed-pairs b:hover { text-decoration: underline; }

/* 全部繁殖配方弹窗 */
.combos-modal { width: min(820px, 100%); padding-top: 14px; }
.combo-list { max-height: 78vh; overflow-y: auto; display: grid; grid-template-columns: 1fr; gap: 3px; }
.combo-row {
  display: flex; align-items: center; gap: 5px; padding: 2px 5px;
  background: rgba(13, 26, 20, .5); border: 1px solid var(--line); border-radius: 8px;
}
.combo-row i, .combo-row b { font-style: normal; color: var(--muted); font-size: 15px; flex: none; }
.combo-row b { color: var(--accent); }
.combo-tile {
  display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0;
  cursor: pointer; padding: 1px 4px; border-radius: 6px; transition: .12s;
}
.combo-tile:hover { background: rgba(255, 210, 87, .1); }
.combo-tile img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.combo-tile span { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 620px) { .combo-list { grid-template-columns: 1fr 1fr; } }

/* 繁殖另一半搜索选择器 */
.breed-calc { position: relative; }
.breed-calc input {
  width: 100%; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); outline: none; font-size: 13px;
}
.breed-calc input:focus { border-color: var(--accent); }
.pick-list {
  position: absolute; left: 0; right: 0; top: 34px; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  background: #101f18; border: 1px solid var(--line); border-radius: 10px; padding: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
}
.pick-tile {
  display: flex; align-items: center; gap: 5px; padding: 2px 6px;
  border-radius: 6px; cursor: pointer; min-width: 0;
}
.pick-tile:hover { background: rgba(255, 210, 87, .12); }
.pick-tile img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.pick-tile span { font-size: 11.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-tile em { font-style: normal; color: var(--muted); font-size: 10.5px; flex: none; }
.pick-empty { color: var(--muted); font-size: 12.5px; padding: 8px; text-align: center; }

/* 繁殖搭配:标题与搜索同一行(左标题右选择) */
.breed-head { display: flex; align-items: center; gap: 10px; }
.breed-head h3 { flex: none; }
.breed-head .breed-calc { flex: 1; min-width: 0; }

.combo-tile.self { background: rgba(255, 210, 87, .14); border-radius: 8px; }
.combo-tile.self span { color: var(--accent); font-weight: 650; }
