/* =========================================================
   物件图鉴 (Map Object Codex) 样式
   ★ 与「怪物图鉴」同一套视觉语言 (用户 2026-09-30 报"和怪物图鉴不搭"):
     浅色卡片 + 白面板 12px 圆角 + 0 2px 10px 软阴影 / 主色 #2f6fa8 / 边框 #d8dee5
     文字 #2c3e50(标题) · #34495e(正文) · #97a3b0(次要)
     缩略图 = 透明底 3D 渲染, 垫在浅色渐变上 (与怪物图鉴的预览 PNG 同款)
     详情弹窗 = 白弹窗 + 左侧暗色 3D 舞台 + 右侧浅色信息面板
   ========================================================= */

.ocodex-wrapper { max-width: 1180px; margin: 2em auto 3em; padding: 0 15px; }
.ocodex-title { font-size: 24px; font-weight: bold; text-align: center; margin-bottom: 4px; letter-spacing: 6px; color: #2c3e50; }
.ocodex-subtitle { text-align: center; color: #97a3b0; font-size: 12px; letter-spacing: 1px; margin-bottom: 20px; line-height: 1.8; }
.ocodex-subtitle a { color: #2f6fa8; text-decoration: none; }
.ocodex-subtitle a:hover { text-decoration: underline; }

.ocodex-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06); padding: 14px 16px; margin-bottom: 16px; }
.ocodex-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ocodex-input, .ocodex-select {
    border: 1px solid #d8dee5; border-radius: 8px; padding: 7px 10px; font-size: 13px;
    color: #34495e; background: #fff; font-family: inherit;
}
.ocodex-input { flex: 1 1 220px; min-width: 160px; }
.ocodex-input:focus, .ocodex-select:focus { outline: none; border-color: #7fb3d5; box-shadow: 0 0 0 3px rgba(127,179,213,.18); }
.ocodex-select { max-width: 250px; }
.ocodex-chk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #7b8894; cursor: pointer; user-select: none; white-space: nowrap; }
.ocodex-chk input { margin: 0; }
.ocodex-count { color: #97a3b0; font-size: 12px; margin-left: auto; }

/* ---------- 网格 + 卡片 ---------- */
.ocodex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; }
.ocodex-empty { text-align: center; color: #97a3b0; padding: 40px 0; font-size: 13px; }

.oc-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;
}
.oc-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.oc-thumb {
    width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; position: relative;
    background: linear-gradient(160deg, #eef2f6 0%, #dfe6ec 100%);
    display: flex; align-items: center; justify-content: center;
}
.oc-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.oc-thumb canvas { display: block; width: 100%; height: 100%; }
.oc-nomodel {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #9aa7b4; font-size: 12px; text-align: center; padding: 8px; line-height: 1.6; gap: 2px;
}
.oc-nomodel b { color: #7b8894; font-weight: normal; }
.oc-badge { position: absolute; top: 6px; right: 6px; font-size: 10px; padding: 2px 6px; border-radius: 999px; background: #eef3f8; color: #4a6b88; }
.oc-body { padding: 0 2px; }
.oc-id { font-size: 11px; color: #93a1ad; font-family: Consolas, monospace; margin-top: 8px; }
.oc-name { font-size: 14px; font-weight: bold; color: #2c3e50; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-en { font-size: 11px; color: #98a4b2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: Consolas, monospace; }
.oc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.oc-tag { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: #eef3f8; color: #4a6b88; }
.oc-tag.anim { background: #e8f5ee; color: #25784a; }
.oc-tag.dye { background: #fdf3e5; color: #a9702a; }
.oc-tag.spin { background: #f3e8fd; color: #7a45b5; }
.oc-tag.placed { background: #eaf3fb; color: #2f6fa8; }
.oc-tag.cli { background: #e6f6f8; color: #1c6f7d; }
.oc-tag.still { background: #eef1f4; color: #5b6b7a; }
.oc-yes2 { color: #2b7bba; font-weight: 700; }
.oc-meta { font-size: 10px; color: #a3aeb9; margin-top: 6px; font-family: Consolas, monospace; word-break: break-all; line-height: 1.5; }

.ocodex-more { text-align: center; margin-top: 18px; }
.ocodex-more button {
    border: 1px solid #d8dee5; background: #fff; color: #40505f; border-radius: 8px;
    padding: 9px 22px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.ocodex-more button:hover { border-color: #7fb3d5; color: #2c3e50; }

/* ---------- 详情弹窗 (白弹窗 + 左暗舞台 + 右浅面板) ----------
   ★ z-index 必须压过站点 sticky 导航(1000)与顶部浮动块 —— 与怪物图鉴取同一档 21000 */
.oc-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;
}
.oc-modal-mask.on { display: flex; }
.oc-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: oc-in .16s ease-out;
}
@keyframes oc-in { from { transform: translateY(10px); opacity: .6; } to { transform: none; opacity: 1; } }
.oc-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;
}
.oc-head > div { flex: 1; min-width: 0; }
.oc-head h3 { margin: 0; font-size: 19px; color: #22303c; letter-spacing: 2px; }
.oc-head .sub { font-size: 12px; color: #98a4b2; margin-top: 3px; font-family: Consolas, monospace; }
.oc-close {
    margin-left: 8px; border: none; background: #f2f5f8; color: #63707d; width: 30px; height: 30px;
    border-radius: 8px; cursor: pointer; font-size: 15px; flex: none;
}
.oc-close:hover { background: #e6ebf1; color: #2c3e50; }
.oc-main { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; padding: 16px 18px 6px; }
@media (max-width: 820px) { .oc-main { grid-template-columns: 1fr; gap: 12px; } }

/* 3D 舞台 (与怪物图鉴同款暗色径向渐变; 渲染器透明清屏 ⇒ 渐变当背景) */
.oc-view {
    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;
}
.oc-view canvas { display: block; width: 100%; height: 100%; }
.oc-view .oc-nomodel { color: #9fb0bf; font-size: 13px; line-height: 1.7; }
.oc-view-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.oc-view-tools button {
    border: none; background: rgba(255,255,255,.12); color: #dfe7ee; border-radius: 7px;
    font-size: 11px; padding: 4px 9px; cursor: pointer; font-family: inherit;
}
.oc-view-tools button:hover { background: rgba(255,255,255,.22); }
.oc-view-tools button.on { background: #3f8ec4; color: #fff; }

/* 难度贴图切换条 (箱子族: 普通 N / EP1 究极 A) — 叠在 3D 舞台左下角 */
.oc-texalt {
    position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px;
    background: rgba(10,14,18,.55); border-radius: 8px; padding: 3px 6px; backdrop-filter: blur(2px);
}
.oc-texalt-lb { color: #9fb0bf; font-size: 11px; margin-right: 2px; }
.oc-texalt button {
    border: none; background: rgba(255,255,255,.12); color: #dfe7ee; border-radius: 6px;
    font-size: 11px; padding: 3px 8px; cursor: pointer; font-family: inherit;
}
.oc-texalt button:hover { background: rgba(255,255,255,.22); }
.oc-texalt button.on { background: #3f8ec4; color: #fff; }

/* 变体/阶段切换条 (二十一轮: 客户端按参数/状态多选一的几何, 如 0x51 索尼克四角色 / 0x3C0 卵三阶段)
   与贴图条同款样式; 两者同在时 JS 会把这条抬高一层 (bottom:40px) */
.oc-stages {
    position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px;
    background: rgba(10,14,18,.55); border-radius: 8px; padding: 3px 6px; backdrop-filter: blur(2px);
    flex-wrap: wrap; max-width: calc(100% - 16px);
}
.oc-stages button {
    border: none; background: rgba(255,255,255,.12); color: #dfe7ee; border-radius: 6px;
    font-size: 11px; padding: 3px 8px; cursor: pointer; font-family: inherit;
}
.oc-stages button:hover { background: rgba(255,255,255,.22); }
.oc-stages button.on { background: #3f8ec4; color: #fff; }

/* 信息面板 */
.oc-info { min-width: 0; padding-bottom: 10px; }
.oc-sec { margin-bottom: 12px; }
.oc-sec h4 { margin: 0 0 6px; font-size: 12px; color: #7b8894; font-weight: normal; letter-spacing: 1px; }
.oc-sec p { margin: 0 0 4px; font-size: 12px; color: #4a5b6b; line-height: 1.8; white-space: pre-wrap; }
.oc-kv { display: grid; grid-template-columns: 84px 1fr; gap: 4px 10px; font-size: 12px; }
.oc-kv dt { color: #93a1ad; }
.oc-kv dd { margin: 0; color: #22303c; font-family: Consolas, monospace; word-break: break-all; }
/* 表格: ★ 必须显式覆盖站点的**全局表格样式** (css/app.css: table/th/td/tbody tr 都带样式,
   其中 `th { background-color:#007bff; color:#fff; text-transform:uppercase }` 会把这里的表头
   染成蓝底白字、`tbody tr:nth-child(odd)` 会加灰底 —— 弹窗里就成了另一种风格) */
.oc-table {
    width: 100%; border-collapse: collapse; margin: 0; font-family: inherit; font-size: 12px; table-layout: auto;
}
.oc-table th, .oc-table td {
    text-align: left; padding: 5px 6px; border: none; border-bottom: 1px solid #f1f4f7;
    white-space: nowrap; background: none;
}
.oc-table th { background: none; color: #93a1ad; font-weight: normal; text-transform: none; font-size: 11px; letter-spacing: 1px; }
.oc-table td { background: none; color: #34495e; font-family: Consolas, monospace; }
.oc-table tbody tr { height: auto; }
.oc-table tbody tr:nth-child(odd), .oc-table tbody tr:hover { background: none; }
.oc-chiplist { display: flex; flex-wrap: wrap; gap: 6px; }
.oc-chip { font-size: 11px; background: #f2f5f8; border-radius: 6px; padding: 4px 8px; color: #4a5b6b; }
.oc-chip b { color: #2f6fa8; font-weight: normal; margin-left: 4px; }
.oc-note { font-size: 11px; color: #a9702a; background: #fdf6ea; border-radius: 8px; padding: 8px 10px; line-height: 1.7; margin: 0 18px 16px; }

/* ---------- 参数表 / 记录字段 / 标志位 (2026-09-30) ---------- */
.oc-param td { white-space: normal; vertical-align: top; font-family: inherit; }
.oc-param td.oc-pn { font-family: Consolas, monospace; color: #2f6fa8; white-space: nowrap; width: 74px; }
.oc-param td.oc-pv { font-family: Consolas, monospace; color: #4a5b6b; white-space: normal; }
.oc-pvn { color: #93a1ad; font-size: 11px; margin-left: 2px; }
.oc-yes { color: #3f9d63; font-weight: bold; }
.oc-no { color: #b9c3cc; }
.oc-plain { color: #5b6b7b; font-size: 12px; line-height: 1.75; margin: 0 0 8px; }
.oc-src { color: #7d90b0; font-size: 11px; line-height: 1.7; margin: 6px 0 0; }
.oc-sub-h { font-size: 12px; color: #93a1ad; font-weight: normal; letter-spacing: 1px; margin: 14px 0 6px; }
.oc-rec td { white-space: normal; vertical-align: top; font-family: inherit; }
.oc-rec td.oc-off { font-family: Consolas, monospace; color: #2f6fa8; white-space: nowrap; width: 54px; }
.oc-rec td:nth-child(2) { width: 140px; }
.oc-fold { border-top: 1px solid #eef2f6; padding-top: 10px; }
.oc-fold-h { cursor: pointer; -webkit-user-select: none; user-select: none; }
.oc-fold-h .oc-caret { float: right; color: #b9c3cc; }
.oc-fold .oc-fold-b { display: none; }
.oc-fold.on .oc-fold-b { display: block; }
.oc-fold.on .oc-fold-h .oc-caret { color: #2f6fa8; }

/* 手机 (与怪物图鉴同一档断点) */
@media (max-width: 560px) {
    .ocodex-wrapper { padding: 0 10px; }
    .ocodex-title { font-size: 20px; letter-spacing: 3px; }
    .ocodex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .oc-card { padding: 7px; border-radius: 10px; }
    .oc-name { font-size: 13px; margin-top: 6px; }
    .oc-thumb .oc-nomodel { font-size: 11px; }
    .oc-modal-mask { padding: 8px 6px; }
    .oc-modal { max-height: calc(100vh - 16px); }
    .oc-head { padding: 12px; }
    .oc-head h3 { font-size: 17px; }
    .oc-main { padding: 12px 12px 4px; }
    .oc-note { margin: 0 12px 12px; }
}

/* 老手机浏览器兼容（不认 aspect-ratio）：比例盒兜底 —— 说明见 npc_codex.css 末尾同款注释
   （.oc-thumb 本就是 position:relative，内部 .oc-nomodel/.oc-badge 本就绝对定位） */
@supports not (aspect-ratio: 4 / 3) {
    .oc-thumb { height: 0; padding-top: 75%; }
    .oc-thumb > img, .oc-thumb > canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
}
