/* 电梯编程：页面是哈珀编程的官方版式（令牌），只有「游戏世界」那一块复刻原版 Elevator Saga 的配色
 * （深灰楼层、青绿色电梯、灰色上下按钮、亮绿色的亮灯），所以这里的游戏配色单独定义成 --evg-* 变量；除了这几行变量，别处不写颜色。 */
.ev-world, .ev-mini {
  --evg-bg: #333;
  --evg-line: #444;
  --evg-text: #999;
  --evg-floor-border: #333;
  --evg-elevator: #4f8686;
  --evg-elevator-border: #fff;
  --evg-dim: rgba(255, 255, 255, 0.2);
  --evg-dim-text: rgba(255, 255, 255, 0.3);
  --evg-floor-no: rgba(255, 255, 255, 0.15);
  --evg-lit: #33ff44;
  --evg-user: #fff;
  --evg-user-leaving: #eee;
  --evg-emphasis: #f1f2d8;
  --evg-feedback: rgba(44, 44, 44, 0.6);
  --evg-shadow: rgba(0, 0, 0, 0.7);
}

/* 入口卡片（闯关地图最下面） */
.ev-entry { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin: 4px 0 18px; text-decoration: none; color: inherit; }
.ev-entry b { font: 800 18px var(--ho-serif); display: block; }
.ev-entry small { color: var(--hc-muted); display: block; margin-top: 2px; line-height: 1.6; }
.ev-entry > div { flex: 1; }
.ev-entry-ico { font-size: 34px; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: var(--hc-radius); background: var(--hc-brand-soft); }
.ev-credit { font-size: 12px; color: var(--hc-muted); margin: 8px 0 0; }
.ev-credit a { color: var(--hc-brand); font-weight: 700; }

/* 挑战列表 */
.ev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 12px; }
.ev-tile { display: flex; gap: 14px; align-items: flex-start; padding: 16px; text-decoration: none; color: inherit; }
.ev-tile .ev-tt { font: 800 16px var(--ho-serif); display: block; line-height: 1.5; }
.ev-tile small b { color: var(--hc-brand); }
.ev-tile small { display: block; color: var(--hc-muted); line-height: 1.55; margin-top: 4px; font-size: 13px; }
.ev-tile .ev-meta { margin-top: 6px; font-size: 12px; }
.ev-tile.done { border-color: var(--hc-ok); }
.ev-no { flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; background: var(--ho-soft-2); border: 3px solid var(--hc-border); }
.ev-tile.done .ev-no { background: var(--hc-brand); border-color: var(--hc-brand); color: var(--hc-on-brand); }

/* 关卡页：标题行 + 控制 */
.ev-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin: 6px 0 14px; }
.ev-goal { margin: 0; color: var(--hc-muted); font-size: 15px; line-height: 1.7; }
.ev-goal b { color: var(--hc-brand); font-size: 17px; }
.ev-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ev-speed { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; border: 1px solid var(--hc-border); border-radius: 999px; background: var(--ho-panel); }
.ev-speed b { min-width: 34px; text-align: center; font-size: 14px; }
.ev-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin: 0 0 10px; }
.ev-links a { font-weight: 700; color: var(--hc-brand); }

/* 游戏世界（复刻原版：938 像素宽的楼 + 右边 240 像素的数据面板，整体按页面宽度缩放） */
.ev-fit { position: relative; width: 100%; overflow: hidden; border-radius: var(--hc-radius); box-shadow: var(--ho-shadow); }
.ev-world { position: absolute; left: 0; top: 0; width: 1220px; background: var(--evg-bg); transform-origin: 0 0; overflow: hidden; font-family: Arial, Helvetica, sans-serif; user-select: none; }
.ev-inner { position: relative; width: 938px; border-right: 1px solid var(--evg-shadow); border-left: 1px solid var(--evg-shadow); }
.ev-floor { position: absolute; left: 0; width: 100%; height: 49px; box-sizing: content-box; background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1)); border-bottom: 1px solid var(--evg-floor-border); }
.ev-floor .ev-fno { position: absolute; color: var(--evg-floor-no); font-size: 32px; line-height: 50px; padding-left: 10px; }
.ev-floor .ev-fbtn { position: absolute; left: 50px; top: 0; height: 50px; display: flex; align-items: center; gap: 4px; padding-left: 10px; cursor: pointer; }
.ev-arrow { width: 16px; height: 16px; display: block; color: var(--evg-dim); fill: currentColor; }
.ev-arrow.on { color: var(--evg-lit); }
.ev-arrow.hidden { visibility: hidden; }
.ev-car { position: absolute; left: 0; top: 0; height: 46px; box-sizing: content-box; background: var(--evg-elevator); border: 2px solid var(--evg-elevator-border); z-index: 1; will-change: transform; }
.ev-car .ev-ind { position: absolute; top: 3px; }
.ev-car .ev-ind.u { left: 2px; }
.ev-car .ev-ind.d { right: 2px; }
.ev-car .ev-ind .ev-arrow { width: 10px; height: 10px; }
.ev-car .ev-cur { position: absolute; left: 0; width: 100%; top: 0; font-size: 15px; text-align: center; color: var(--evg-dim-text); line-height: 20px; }
.ev-car .ev-btns { position: absolute; top: 15px; left: 0; width: 95%; text-align: center; font-size: 8px; line-height: 8px; color: var(--evg-dim-text); }
.ev-car .ev-btns span { cursor: pointer; display: inline-block; }
.ev-car .ev-btns span.on { color: var(--evg-lit); }
.ev-user { position: absolute; left: 0; top: 0; width: 11px; height: 18px; display: block; color: var(--evg-user); fill: currentColor; z-index: 2; filter: drop-shadow(0 1px 1px var(--evg-shadow)); will-change: transform; }
.ev-user.leaving { color: var(--evg-user-leaving); }
.ev-user.child { width: 8px; height: 13px; }
.ev-stats { position: absolute; top: 0; right: 0; width: 240px; height: 200px; padding: 20px; z-index: 1; box-sizing: content-box; font: 12px/10px Consolas, Monaco, monospace; color: var(--evg-text); }
.ev-stats div { position: absolute; display: block; width: 240px; height: 10px; border-bottom: 1px solid var(--evg-line); }
.ev-stats span { position: absolute; display: block; width: 240px; height: 10px; }
.ev-stats .v { text-align: right; }
.ev-feedback { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 5; background: var(--evg-feedback); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 40px; box-sizing: border-box; }
.ev-feedback h2 { margin: 0 0 6px; font: 400 26px Oswald, "Microsoft YaHei", Arial, sans-serif; color: var(--evg-emphasis); text-shadow: 0 2px 0.4pt var(--evg-shadow); }
.ev-feedback p { margin: 0 0 10px; color: var(--evg-emphasis); }
.ev-feedback a { color: var(--evg-emphasis); font-weight: 800; text-decoration: none; }
.ev-feedback a:hover { text-decoration: underline; }
.ev-blink { animation: ev-blink 0.5s steps(3, start) infinite; display: inline-block; }
@keyframes ev-blink { to { visibility: hidden; } }

/* 代码区 */
.ev-status { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--ho-warn-bg); color: var(--hc-err); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.ev-code { margin: 12px 0; padding: 14px 16px; }
.ev-editor { display: block; }
.ev-code-f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.ev-code-f .grow { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ev-help { padding: 14px 18px; }
.ev-help summary { cursor: pointer; font-weight: 800; }
.ev-help code { padding: 1px 5px; border-radius: 6px; background: var(--ho-soft-2); font-size: 12.5px; }
.ev-api { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; font-size: 13.5px; line-height: 1.7; }
.ev-api ul { margin: 6px 0 10px; padding-left: 20px; }
@media (max-width: 899px) { .ev-ctl { width: 100%; } }

/* 首页宣传卡片里的迷你电梯（纯 CSS 动画：电梯上上下下，乘客站在楼层上） */
.cd-mock-elev .ev-code-mini i.k { background: var(--ho-blk-event); border-radius: 12px 12px 7px 7px; }
.cd-mock-elev .ev-code-mini i.f { background: var(--ho-blk-motion); margin-left: 14px; }
.ev-mini { position: relative; border-radius: 12px; background: var(--evg-bg); overflow: hidden; display: flex; flex-direction: column; }
.ev-mini .mfloors { flex: 1; display: flex; flex-direction: column; }
.ev-mini .mf { flex: 1; position: relative; display: flex; align-items: center; gap: 4px; padding: 0 8px; background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1)); border-bottom: 1px solid var(--evg-floor-border); }
.ev-mini .mf em { font: normal 800 18px var(--ho-serif); color: var(--evg-floor-no); min-width: 16px; }
.ev-mini .mb { display: inline-flex; gap: 2px; }
.ev-mini .mb .ev-arrow { width: 11px; height: 11px; }
.ev-mini .mf .ev-user { position: static; width: 9px; height: 15px; }
.ev-mini .mcar { position: absolute; left: 46%; top: 3%; width: 30%; height: 29%; box-sizing: border-box; background: var(--evg-elevator); border: 2px solid var(--evg-elevator-border); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 2px 3px; animation: evRide 6s ease-in-out infinite; }
.ev-mini .mcar .ci { display: flex; justify-content: space-between; width: 100%; }
.ev-mini .mcar .ci .ev-arrow { width: 8px; height: 8px; }
.ev-mini .mcar .cp { display: flex; gap: 2px; align-items: flex-end; }
.ev-mini .mcar .cp .ev-user { position: static; width: 7px; height: 12px; }
.ev-mini .mstat { position: absolute; right: 6px; top: 6px; font: 10px Consolas, Monaco, monospace; color: var(--evg-text); display: flex; gap: 6px; }
.ev-mini .mstat b { color: var(--evg-emphasis); }
@keyframes evRide { 0% { top: 68%; } 30% { top: 68%; } 45% { top: 35%; } 60% { top: 35%; } 80% { top: 3%; } 100% { top: 68%; } }
@media (prefers-reduced-motion: reduce) { .ev-mini .mcar { animation: none; top: 35%; } }
