/* =========================================================
   怪物图鉴 (Monster Codex) 样式
   列表区与装备图鉴一致 (浅色卡片); 详情弹框 = 暗色 3D 舞台 + 浅色数值面板
   ========================================================= */

.mcodex-wrapper { max-width: 1180px; margin: 2em auto 3em; padding: 0 15px; }
.mcodex-title { font-size: 24px; font-weight: bold; text-align: center; margin-bottom: 4px; letter-spacing: 6px; color: #2c3e50; }
.mcodex-subtitle { text-align: center; color: #97a3b0; font-size: 12px; letter-spacing: 1px; margin-bottom: 20px; }
.mcodex-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06); padding: 14px 16px; margin-bottom: 16px; }

/* ---------- 章节页签 ---------- */
.mcodex-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mcodex-tab {
    border: 1px solid #d8dee5; background: #f7f9fb; color: #40505f; border-radius: 8px;
    padding: 7px 14px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.mcodex-tab:hover { border-color: #7fb3d5; color: #2c3e50; }
.mcodex-tab.active { background: #2f6fa8; border-color: #2f6fa8; color: #fff; box-shadow: 0 2px 6px rgba(47,111,168,.28); }
.mcodex-tab .n { opacity: .7; font-size: 11px; margin-left: 4px; }

/* ---------- 筛选行 ---------- */
.mcodex-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mcodex-input, .mcodex-select {
    border: 1px solid #d8dee5; border-radius: 8px; padding: 7px 10px; font-size: 13px; color: #34495e; background: #fff;
}
.mcodex-input { flex: 1 1 220px; min-width: 160px; }
.mcodex-input:focus, .mcodex-select:focus { outline: none; border-color: #7fb3d5; box-shadow: 0 0 0 3px rgba(127,179,213,.18); }
.mcodex-count { color: #97a3b0; font-size: 12px; margin-left: auto; }
.mcodex-check { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #7b8894; cursor: pointer; user-select: none; }
.mcodex-check input { margin: 0; }

/* ---------- 网格 ---------- */
.mcodex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; }
/* 手机: 固定两列 (auto-fill 在 360px 宽度下只排得下一列 = 卡片大得没法看) */
@media (max-width: 560px) {
    .mcodex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mcodex-wrapper { padding: 0 10px; }
    .mcodex-title { font-size: 20px; letter-spacing: 3px; }
    .mcodex-tab { padding: 8px 11px; font-size: 12px; }
    .mc-card { padding: 7px; border-radius: 10px; }
    .mc-name { font-size: 13px; margin-top: 6px; }
    .mc-thumb .ph { font-size: 11px; }
    .mc-badge { font-size: 9px; padding: 2px 5px; }
    .mc-modal-mask { padding: 8px 6px; }
    .mc-modal { max-height: calc(100vh - 16px); }
    .mc-body { padding: 12px; gap: 12px; }
    .mc-head { padding: 12px; }
    .mc-head h3 { font-size: 17px; }
    .mc-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mc-card {
    background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06);
    padding: 10px; cursor: pointer; transition: transform .12s, box-shadow .12s; position: relative;
}
.mc-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.mc-thumb {
    width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden;
    background: linear-gradient(160deg, #eef2f6 0%, #dfe6ec 100%);
    display: flex; align-items: center; justify-content: center;
}
.mc-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mc-thumb .ph { color: #9aa7b4; font-size: 12px; text-align: center; padding: 8px; line-height: 1.5; }
.mc-name { font-size: 14px; font-weight: bold; color: #2c3e50; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-en { font-size: 11px; color: #98a4b2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mc-badge { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: #eef3f8; color: #4a6b88; }
.mc-badge.hp { background: #fdeeee; color: #b04747; }
.mc-badge.warn { background: #fdf3e5; color: #a9702a; }
.mc-badge.rare { background: #f3e8fd; color: #7a45b5; }
.mc-badge.imm { background: #e8f5ee; color: #25784a; border: 1px solid #cbe8d8; }   /* 免疫某属性 */
.mc-badge.boss { background: #fdeaea; color: #b23b3b; font-weight: bold; }
.mcodex-more { text-align: center; margin-top: 18px; }
.mcodex-more button {
    border: 1px solid #d8dee5; background: #fff; color: #40505f; border-radius: 8px;
    padding: 9px 22px; font-size: 13px; cursor: pointer;
}
.mcodex-more button:hover { border-color: #7fb3d5; color: #2c3e50; }
.mcodex-empty { text-align: center; color: #97a3b0; padding: 40px 0; font-size: 13px; }

/* ---------- 详情弹框 ----------
   ★ z-index 必须压过站点的 sticky 导航栏(1000)与顶部浮动块: 曾用 900 → 导航栏/登录栏盖在弹窗上 */
.mc-modal-mask {
    position: fixed; inset: 0; background: rgba(16,22,28,.55); z-index: 21000; display: none;
    align-items: center; justify-content: center; overflow: hidden; padding: 16px 12px;
}
.mc-modal-mask.open { display: flex; }
/* ★ 弹窗限高 + 自身滚动 (2026-09-29): 原来靠遮罩滚动、弹窗可以长到 1000px 以上 —— 多形态表
   (暗黑佛/波鲁欧普那种带缩略图的) 一加就超出屏幕, 用户报"形态列表显示不全"。
   改成弹窗 max-height:100vh-32px 内部滚动, 标题吸顶, 页面本身不再被滚动。 */
.mc-modal {
    width: 100%; max-width: 1020px; background: #fff; border-radius: 14px;
    max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,.35); animation: mc-in .16s ease-out;
}
@keyframes mc-in { from { transform: translateY(10px); opacity: .6; } to { transform: none; opacity: 1; } }
.mc-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #eef1f5;
    position: sticky; top: 0; background: #fff; z-index: 3; }
.mc-head h3 { margin: 0; font-size: 19px; color: #22303c; letter-spacing: 2px; }
.mc-head .sub { font-size: 12px; color: #98a4b2; margin-top: 3px; }
.mc-close { margin-left: 8px; border: none; background: #f2f5f8; color: #63707d; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.mc-close:hover { background: #e6ebf1; color: #2c3e50; }
/* 上一只 / 下一只 (在筛选结果里翻, 键盘 ← → 同效) */
.mc-nav {
    margin-left: 8px; border: 1px solid #d8dee5; background: #fff; color: #4a5b6b; width: 30px; height: 30px;
    border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1;
}
.mc-nav:hover { border-color: #7fb3d5; color: #2c3e50; background: #f7f9fb; }
.mc-head > div { flex: 1; min-width: 0; }
.mc-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; padding: 16px 18px 6px; }
/* 出现区域 / 各难度名字 横跨整宽 (放左栏下面会留一大片空白, 放右栏又把右栏拖太长) */
.mc-full { padding: 6px 18px 20px; }
.mc-full .mc-sec:last-child { margin-bottom: 0; }
@media (max-width: 820px) { .mc-body { grid-template-columns: 1fr; gap: 12px; } }

/* 3D 舞台 */
.mc-stage {
    position: relative; background: radial-gradient(120% 90% at 50% 15%, #3b4650 0%, #232a31 60%, #1a1f24 100%);
    border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; min-height: 240px;
}
.mc-stage canvas { display: block; width: 100%; height: 100%; }
.mc-stage .hint { position: absolute; left: 10px; bottom: 8px; color: #93a1ad; font-size: 11px; }
.mc-stage .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9fb0bf; font-size: 13px; text-align: center; padding: 20px; line-height: 1.7; }
.mc-stage .tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 16px); }
.mc-stage .tools button { white-space: nowrap; }
.mc-stage .tools button {
    border: none; background: rgba(255,255,255,.12); color: #dfe7ee; border-radius: 7px;
    font-size: 11px; padding: 4px 9px; cursor: pointer;
}
.mc-stage .tools button:hover { background: rgba(255,255,255,.22); }
.mc-stage .tools button.on { background: #3f8ec4; color: #fff; }
/* 演示时的招式/证据小注 (2026-10-06 第二版): 让用户一眼看到这一招的实证来源 (服务端招式表下发)。
   ★ 位置 = **舞台底部整条**: 旧版放左上角会和右上角的工具条 (招式下拉/自转/复位/演示中/倍率)
   撞在一起 (窄弹窗里直接压成一团, 用户报"UI 相互遮挡") —— 顶左归工具条, 底条归招式说明。 */
.mc-stage .mc-demo-cap {
    position: absolute; left: 8px; right: 8px; bottom: 8px;
    display: flex; justify-content: space-between; align-items: flex-end; gap: 10px;
    color: #e6eef6; font-size: 11px; line-height: 1.5; pointer-events: none;
    background: rgba(12,18,24,.62); border-radius: 8px; padding: 5px 8px;
}
.mc-stage .mc-demo-cap .mc-cap-l { min-width: 0; }
/* 证据行最多两行: 底条太高会压住模型下身 (窄弹窗里证据能折四行) —— 悬停可看全文 */
.mc-stage .mc-demo-cap .mc-cap-l span {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
    pointer-events: auto;
}
.mc-stage .mc-demo-cap .mc-cap-r { flex: none; color: #93a1ad; font-size: 10px; white-space: nowrap; }
.mc-stage .mc-demo-cap b { color: #ffd08a; font-weight: 600; }
.mc-stage .mc-demo-cap span { display: block; color: #9fb0bf; font-size: 10px; margin-top: 2px; }
/* 窄弹窗: 右侧那行提示收起, 让招式/证据有整行宽度 */
@media (max-width: 560px) { .mc-stage .mc-demo-cap .mc-cap-r { display: none; } }


/* 数值面板 */
.mc-panel { min-width: 0; }
.mc-diff { display: flex; gap: 6px; margin-bottom: 10px; }
.mc-diff button {
    flex: 1; border: 1px solid #d8dee5; background: #f7f9fb; color: #4a5b6b; border-radius: 8px;
    padding: 6px 4px; font-size: 12px; cursor: pointer;
}
.mc-diff button.active { background: #2f6fa8; border-color: #2f6fa8; color: #fff; }
.mc-sec { margin-bottom: 12px; }
.mc-sec h4 { margin: 0 0 6px; font-size: 12px; color: #7b8894; font-weight: normal; letter-spacing: 1px; }
.mc-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.mc-kv { background: #f7f9fb; border-radius: 8px; padding: 6px 8px; }
.mc-kv .k { font-size: 10px; color: #93a1ad; }
.mc-kv .v { font-size: 14px; color: #22303c; font-weight: bold; }
.mc-kv .v small { font-size: 10px; color: #93a1ad; font-weight: normal; margin-left: 2px; }
.mc-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-area { font-size: 11px; background: #f2f5f8; border-radius: 6px; padding: 4px 8px; color: #4a5b6b; }
.mc-area b { color: #2f6fa8; font-weight: normal; margin-right: 4px; }
.mc-names { font-size: 11px; color: #7b8894; line-height: 1.8; }
.mc-names b { color: #4a5b6b; font-weight: normal; }
.mc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.mc-btn {
    display: inline-block; text-decoration: none; border-radius: 8px; padding: 8px 14px; font-size: 12px;
    background: #2f6fa8; color: #fff; border: none; cursor: pointer;
}
.mc-btn:hover { background: #28608f; }
.mc-btn.ghost { background: #f2f5f8; color: #40505f; }
.mc-btn.ghost:hover { background: #e6ebf1; }
.mc-note { font-size: 11px; color: #a9702a; background: #fdf6ea; border-radius: 8px; padding: 8px 10px; line-height: 1.7; }

/* "AI 生成" 角标 (潘阿姆斯分裂体这类: 由客户端 AI 产生, 不是地图刷怪) */
.mc-badge.info { background: #eaf3fb; color: #2f6fa8; }

/* 多形态表 (暗黑佛三形态 / 波鲁欧普各部件) */
.mc-forms { width: 100%; border-collapse: collapse; font-size: 12px; }
.mc-forms th, .mc-forms td { padding: 5px 6px; text-align: right; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
.mc-forms th { color: #93a1ad; font-weight: normal; font-size: 11px; background: none; text-transform: none; }
.mc-forms td:first-child, .mc-forms th:first-child { text-align: left; color: #2c3e50; }

/* 形态行: 带缩略图 + 可点击切 3D (点一次切过去, 再点回到本体) */
.mc-form-row.has-model { cursor: pointer; }
.mc-form-row.has-model:hover td { background: #f2f7fd; }
.mc-form-row.active td { background: #e7f1ff; box-shadow: inset 3px 0 0 #2f8fe0; }
.mc-form-name { display: flex; align-items: center; gap: 6px; }
.mc-form-thumb { width: 46px; height: 40px; object-fit: contain; background: #f6f8fa; border: 1px solid #e4e9ee; border-radius: 3px; image-rendering: auto; }
.mc-form-nothumb { display: inline-block; min-width: 46px; text-align: center; color: #b7c2cc; }
.mc-form-note { margin-left: 4px; font-style: normal; font-size: 10px; color: #a3aeb9; }
.mc-form-base { color: #93a1ad; font-size: 10px; border: 1px solid #dfe6ec; border-radius: 3px; padding: 0 3px; }

/* ★ 攻击特效 / 弹体 (2026-10-06): 远程攻击怪实际使用的弹体/特效网格, 点一格切 3D */
.mc-fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.mc-fx-cell {
    border: 1px solid #e2e8ee; background: #fafcfd; border-radius: 8px; padding: 6px;
    display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.mc-fx-cell.has-model { cursor: pointer; }
.mc-fx-cell.has-model:hover { border-color: #b9d6f2; background: #f2f8ff; }
.mc-fx-cell.active { border-color: #2f8fe0; background: #e7f1ff; box-shadow: inset 0 0 0 1px #2f8fe0; }
.mc-fx-thumb { width: 100%; height: 88px; object-fit: contain; border-radius: 4px; background: #171a1f; }
.mc-fx-nothumb { display: inline-block; width: 100%; height: 88px; line-height: 88px; color: #b7c2cc; background: #f1f4f7; border-radius: 4px; }
.mc-fx-name { font-size: 12px; color: #2d3b48; font-weight: 600; }
.mc-fx-kind { font-style: normal; font-size: 10px; color: #7d8b98; font-weight: 400; border: 1px solid #dfe6ec; border-radius: 3px; padding: 0 3px; }
.mc-fx-note { font-size: 11px; color: #7f8c99; line-height: 1.35; }

/* 详情底部页签 (形态/区域 ↔ 掉落) */
.mc-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.mc-tabs button {
    border: 1px solid #d8dee5; background: #f7f9fb; color: #40505f; border-radius: 8px;
    padding: 6px 15px; font-size: 12px; cursor: pointer; transition: all .15s;
}
.mc-tabs button:hover { border-color: #7fb3d5; color: #2c3e50; }
.mc-tabs button.active { background: #2f6fa8; border-color: #2f6fa8; color: #fff; box-shadow: 0 2px 6px rgba(47,111,168,.25); }

/* 掉落页签: 三维度控件 + 掉落表 */
.mc-drop-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.mc-drop-tools label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #7b8894; }
.mc-drop-tools select {
    border: 1px solid #d8dee5; border-radius: 7px; padding: 5px 8px; font-size: 12px; color: #34495e; background: #fff;
}
.mc-drop-tools select:focus { outline: none; border-color: #7fb3d5; box-shadow: 0 0 0 3px rgba(127,179,213,.18); }
.mc-drop { width: 100%; border-collapse: collapse; font-size: 12px; }
.mc-drop th {
    text-align: left; font-weight: normal; color: #93a1ad; font-size: 11px; letter-spacing: 1px;
    padding: 5px 6px; border-bottom: 1px solid #e6ebf0;
    /* ★ 覆盖站点全局 `th{background:#007bff;color:#fff;text-transform:uppercase}` —
       本站本意是灰字表头, 不覆盖就变成"灰字压蓝底 + 全大写"(与物件图鉴同一坑) */
    background: none; text-transform: none;
}
.mc-drop td { padding: 6px; border-bottom: 1px solid #f1f4f7; color: #34495e; vertical-align: top; }
.mc-drop tr:last-child td { border-bottom: none; }
.mc-drop td.r { text-align: right; white-space: nowrap; color: #b5730f; font-variant-numeric: tabular-nums; }
.mc-drop td.cs { max-width: 300px; }
.mc-drop .en { display: block; color: #a7b3bd; font-size: 10px; }
.mc-drop-c {
    display: inline-block; background: #eef3f8; color: #4a6b86; border-radius: 5px;
    padding: 1px 5px; font-size: 10px; margin: 1px 2px 1px 0;
}
.mc-drop-c.all { background: #e7f4ea; color: #2f7a45; }
@media (max-width: 560px) {
    .mc-drop-tools { gap: 6px; }
    .mc-drop { font-size: 11px; }
    .mc-drop td.cs { max-width: 110px; }
}

/* 招式判定表 (attack 段: 每招一行的伤害浮动/命中加成/判定距离/锥角/垂直) */
.mc-atk-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mc-atk-table th, .mc-atk-table td { padding: 5px 6px; text-align: right; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
.mc-atk-table th { color: #93a1ad; font-weight: normal; font-size: 11px; background: none; text-transform: none; }
.mc-atk-table td:first-child, .mc-atk-table th:first-child { text-align: left; color: #2c3e50; }
.mc-atk-table tr:first-child td { color: #2c3e50; }

/* 动作下拉 (模型动作来自客户端 .njm, 服务端烘帧前端插值) */
.mc-anim-sel { font-size: 12px; padding: 3px 6px; border: 1px solid #d7dee6; border-radius: 6px; background: #fff; color: #2c3e50; max-width: 150px; }
/* 手机端: 工具行仍浮在舞台右上 (canvas 按 clientWidth/Height 定尺寸, 不能改静态), 收紧控件宽度 */
@media (max-width: 560px) {
    .mc-anim-sel { max-width: 108px; font-size: 11px; padding: 3px 4px; }
    .mc-stage .tools button { padding: 4px 6px; }
}

/* 掉落页签的基础掉落率行 */
.mc-drop-dar { font-size: 12px; color: #2c3e50; margin: 8px 0 2px; }
.mc-drop-dar b { font-size: 14px; }
.mc-note-inline { font-size: 11px; color: #93a1ad; margin-left: 6px; }
.mc-speed-sel { max-width: 62px; }

/* 拓展数据区 (info 页签全宽): 行动速度 + 细节 并排 */
.mc-extra-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 680px) { .mc-extra-2col { grid-template-columns: 1fr; } }
