/* 算法动画页样式（全部 .anim-* 前缀，不动 OJ 原有样式）
 * 视觉对齐参考站：浅灰动画区 + 灰绿色柱子 + [i] 编号行 + 绿色按钮 + 绿边说明条 */

.anim-page { max-width: 1240px; margin: 0 auto; }

.anim-head {
    position: relative; overflow: hidden;
    background:
        radial-gradient(120% 140% at 0% -20%, rgba(91, 110, 225, .07), transparent 58%),
        linear-gradient(180deg, #fff, #fcfcfb);
    border: 1px solid #e9e9e4; border-radius: 12px; padding: 18px 22px; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    box-shadow: 0 1px 2px rgba(24, 30, 40, .03);
}
.anim-head h1 { margin: 0 0 7px; font-size: 22px; font-weight: 600; letter-spacing: -.015em; color: #131c26; }
.anim-head p { margin: 0; color: #5f6773; font-size: 12.8px; line-height: 1.85; max-width: 78ch; }
.anim-head b { color: #33405a; font-weight: 600; }

.anim-wrap { display: flex; gap: 14px; align-items: flex-start; }


/* ---------- 播放器顶部：排版放宽（窄屏也不挤） ---------- */
.anim-mainhead--player {
    align-items: flex-start; flex-wrap: wrap; gap: 10px 16px; padding: 18px 20px 16px;
}
.anim-mainhead--player .anim-mainhead__l { flex: 1 1 340px; min-width: 0; }
.anim-mainhead--player #anim-back { order: 2; margin-left: auto; flex: 0 0 auto; }
.anim-mainhead--player .anim-crumb {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex;
}
.anim-mainhead--player .anim-title-row { align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.anim-mainhead--player h2 {
    font-size: clamp(17px, 1.5vw, 21px); line-height: 1.25; margin: 0; letter-spacing: -.015em;
}
.anim-mainhead--player p { margin-top: 9px; font-size: 12.8px; line-height: 1.7; max-width: 70ch; color: #6b7488; }
.anim-studio__name { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================
 * 图标（统一 SVG 线性图标；不再用 emoji）
 * ================================================================ */
.anim-ico { width: 18px; height: 18px; flex: 0 0 auto; display: block; }
.anim-ico--sm { width: 13px; height: 13px; }
.anim-ico--xs { width: 14px; height: 14px; }

/* ---------------- 左侧 ---------------- */
.anim-aside {
    flex: 0 0 224px; background: #fdfdfc; border: 1px solid #e9e9e4; border-radius: 12px;
    padding: 12px 10px 12px; position: sticky; top: 12px;
    max-height: calc(100vh - 226px); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; box-shadow: 0 1px 2px rgba(24, 30, 40, .03);
}
.anim-aside::-webkit-scrollbar { width: 6px; }
.anim-aside::-webkit-scrollbar-thumb { background: #dcdfe4; border-radius: 3px; }
.anim-group { margin-bottom: 4px; }
.anim-group__title {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #2c343f;
    padding: 9px 8px 7px; margin-bottom: 2px; cursor: pointer; user-select: none;
}
.anim-group__ico {
    width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
    background: rgba(var(--rgb), .1); color: rgba(var(--rgb), .95); flex: 0 0 auto;
}
.anim-group__ico .anim-ico { width: 14px; height: 14px; }
.anim-group__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anim-group__title i, .anim-chapter i {
    font-style: normal; font-weight: 500; color: #a8adb6; font-size: 11px; margin-left: auto;
    font-variant-numeric: tabular-nums;
}
.anim-caret { display: inline-block; width: 9px; flex: 0 0 9px; color: #b3b9c2; font-size: 10px; }
.anim-chapter {
    display: flex; align-items: center; gap: 6px;
    margin-left: 12px; padding: 6px 9px 6px 10px; border-left: 1px solid #eceded;
    border-radius: 0 7px 7px 0; font-size: 12.5px; line-height: 1.55; color: #3a424d !important;
    text-decoration: none !important; transition: background .14s, border-color .14s, color .14s;
}
.anim-chapter:hover { background: #f3f6fb; border-left-color: #cddffb; color: #1f3a63 !important; }
.anim-chapter.is-on {
    background: linear-gradient(180deg, #3f7ee0, #2f6bd0); border-left-color: #1f4fa8;
    color: #fff !important; font-weight: 600; border-radius: 7px;
    box-shadow: 0 4px 10px -6px rgba(47, 107, 208, .9);
}
.anim-chapter.is-on i { color: #d8e6ff; }
.anim-tip {
    font-size: 11px; color: #9aa1ab; padding: 9px 8px 2px; line-height: 1.7;
    border-top: 1px solid #f0f1ee; margin-top: 6px;
}

/* ---------------- 右侧 ---------------- */
.anim-main { flex: 1 1 auto; min-width: 0; }
.anim-mainhead {
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, #fff, #fcfcfb);
    border: 1px solid #e9e9e4; border-radius: 12px; padding: 16px 20px; margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(24, 30, 40, .03);
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.anim-mainhead__l { min-width: 0; }
.anim-mainhead__mark {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 96px; height: 96px; color: rgba(var(--rgb), .085); pointer-events: none;
}
.anim-mainhead__mark .anim-ico { width: 96px; height: 96px; stroke-width: 1px; }
.anim-mainhead h2 {
    margin: 8px 0 5px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: #16202c;
}
.anim-mainhead p { margin: 0; font-size: 12.5px; color: #8a919b; }
.anim-crumb {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; letter-spacing: .02em; color: rgba(var(--rgb), .95);
    background: rgba(var(--rgb), .09); border: 1px solid rgba(var(--rgb), .14);
    border-radius: 999px; padding: 3px 10px 3px 8px; font-weight: 600;
}
.anim-title-row { display: flex; align-items: center; gap: 10px; }
.anim-list__head { font-size: 14px; font-weight: 600; color: #3b4a6b; margin: 6px 0 10px; }

/* ================================================================
 * 卡片：分层光效（底色渐变 → 蓝图网格 → 噪点 → 内容水印 → 鼠标柔光
 *       → 旋转描边 → 四角取景框 → 玻璃质感内容面板）
 * 每个章节一套主色（--rgb / --ink），每张卡印自己的算法图标当水印。
 * ================================================================ */
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

.anim-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-auto-rows: 1fr;
    gap: 16px; align-items: stretch;
}
.anim-card {
    --rx: 0deg; --ry: 0deg; --ty: 0px; --mx: 50%; --my: 0%;
    position: relative; isolation: isolate; overflow: hidden; min-width: 0; height: 100%;
    display: block; text-decoration: none !important; border-radius: 16px; padding: 11px;
    border: 1px solid rgba(var(--rgb), .24);
    background:
        radial-gradient(135% 105% at 106% -12%, rgba(var(--rgb), .38), transparent 56%),
        radial-gradient(90% 80% at -10% 122%, rgba(var(--rgb), .2), transparent 64%),
        linear-gradient(152deg, rgba(var(--rgb), .24) 0%, rgba(var(--rgb), .09) 48%, #fff 90%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 22, 32, .05),
                0 16px 34px -24px rgba(var(--rgb), .9);
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--ty));
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s, border-color .28s;
}
.anim-card:hover {
    border-color: rgba(var(--rgb), .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 2px 6px rgba(16, 22, 32, .06),
                0 26px 48px -28px rgba(var(--rgb), 1), 0 0 0 4px rgba(var(--rgb), .06);
}
.anim-card:focus-visible { outline: 2px solid rgba(var(--rgb), .65); outline-offset: 3px; }

/* ① 蓝图网格 */
.anim-card__grid {
    position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, rgba(var(--rgb), .07) 0 1px, transparent 1px 9px),
        repeating-linear-gradient(90deg, rgba(var(--rgb), .07) 0 1px, transparent 1px 9px),
        repeating-linear-gradient(0deg, rgba(var(--rgb), .13) 0 1px, transparent 1px 45px),
        repeating-linear-gradient(90deg, rgba(var(--rgb), .13) 0 1px, transparent 1px 45px);
    -webkit-mask-image: radial-gradient(132% 132% at 100% 0%, #000 10%, transparent 82%);
    mask-image: radial-gradient(132% 132% at 100% 0%, #000 10%, transparent 82%);
    opacity: .8; transition: opacity .3s;
}
.anim-card:hover .anim-card__grid { opacity: 1; }

/* ② 噪点（软光混合，制造颗粒质感） */
.anim-card__noise {
    position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
    opacity: .55; mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* ③ 内容水印：这张卡自己的算法图标，虚线缓慢流动 */
.anim-card__mark {
    position: absolute; right: 20px; top: -18px; z-index: 2; pointer-events: none;
    width: 104px; height: 104px; color: rgba(var(--rgb), .25); mix-blend-mode: multiply;
    -webkit-mask-image: radial-gradient(56% 56% at 74% 32%, #000 14%, transparent 78%);
    mask-image: radial-gradient(56% 56% at 74% 32%, #000 14%, transparent 78%);
    transition: color .3s;
}
.anim-card__mark .anim-ico { width: 106px; height: 106px; stroke-width: 1.1px; }
.anim-card__mark svg * { stroke-dasharray: 4 3; animation: animDash 16s linear infinite; }
.anim-card:hover .anim-card__mark { color: rgba(var(--rgb), .34); }
@keyframes animDash { to { stroke-dashoffset: -140; } }

/* ④ 鼠标位置的柔光 */
.anim-card__spot {
    position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
    background: radial-gradient(190px 190px at var(--mx) var(--my), rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 62%);
    opacity: 0; transition: opacity .25s;
}
.anim-card:hover .anim-card__spot { opacity: .9; }

/* ⑤ 旋转描边（悬停时沿边框转一圈的高光） */
.anim-card__ring {
    position: absolute; inset: 0; border-radius: inherit; padding: 1.2px; z-index: 3; pointer-events: none;
    background: conic-gradient(from var(--ang), transparent 0 56%, rgba(var(--rgb), .95) 76%,
        rgba(var(--rgb), .3) 87%, transparent 96%);
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    mask-composite: exclude;
    opacity: 0; transition: opacity .3s;
}
.anim-card:hover .anim-card__ring { opacity: 1; animation: animRing 3.2s linear infinite; }
@keyframes animRing { to { --ang: 360deg; } }

/* ⑥ 四角取景框 */
.anim-card__corner {
    position: absolute; width: 11px; height: 11px; z-index: 2; pointer-events: none;
    border: 0 solid rgba(var(--rgb), .5); transition: width .25s, height .25s, border-color .25s;
}
.anim-card__corner--tl { left: 7px; top: 7px; border-left-width: 1.4px; border-top-width: 1.4px; border-top-left-radius: 6px; }
.anim-card__corner--tr { right: 7px; top: 7px; border-right-width: 1.4px; border-top-width: 1.4px; border-top-right-radius: 6px; }
.anim-card__corner--bl { left: 7px; bottom: 7px; border-left-width: 1.4px; border-bottom-width: 1.4px; border-bottom-left-radius: 6px; }
.anim-card__corner--br { right: 7px; bottom: 7px; border-right-width: 1.4px; border-bottom-width: 1.4px; border-bottom-right-radius: 6px; }
.anim-card:hover .anim-card__corner { width: 16px; height: 16px; border-color: rgba(var(--rgb), .85); }

/* ⑦ 章节内序号 */
.anim-card__idx {
    position: absolute; right: 14px; top: 11px; z-index: 2; pointer-events: none;
    font: 700 10.5px/1 ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
    letter-spacing: .2em; color: rgba(var(--rgb), .55);
}

/* ⑧ 玻璃质感内容面板 */
.anim-card__body {
    position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .52));
    border: 1px solid rgba(255, 255, 255, .78); border-radius: 11px; padding: 13px 14px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 6px 16px -14px rgba(var(--rgb), .85);
    -webkit-backdrop-filter: blur(3px) saturate(1.06); backdrop-filter: blur(3px) saturate(1.06);
    transition: background .28s;
}
.anim-card:hover .anim-card__body {
    background: linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .68));
}
.anim-card__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.anim-card__badge {
    width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto;
    display: grid; place-items: center; color: var(--ink, #41529e);
    background: linear-gradient(160deg, rgba(255, 255, 255, .98), rgba(var(--rgb), .2));
    border: 1px solid rgba(var(--rgb), .34);
    box-shadow: 0 6px 14px -10px rgba(var(--rgb), 1), inset 0 1px 0 #fff;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s;
}
.anim-card:hover .anim-card__badge {
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 12px 22px -12px rgba(var(--rgb), 1), inset 0 1px 0 #fff;
}
.anim-card__badge .anim-ico { width: 20px; height: 20px; stroke-width: 1.85; transition: transform .28s; }
.anim-card:hover .anim-card__badge .anim-ico { transform: rotate(-5deg) scale(1.04); }
.anim-card__badge--lg { width: 40px; height: 40px; border-radius: 12px; }
.anim-card__badge--lg .anim-ico { width: 22px; height: 22px; }
.anim-card__title {
    font-size: 15px; font-weight: 600; color: #131c26; min-width: 0; letter-spacing: -.012em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.anim-card__desc {
    font-size: 12.5px; color: #59616d; line-height: 1.62; flex: 1 1 auto;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.anim-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.anim-card__time {
    font-size: 11.5px; font-weight: 600; color: var(--ink, #41529e);
    background: rgba(255, 255, 255, .92); border: 1px solid rgba(var(--rgb), .24);
    border-radius: 7px; padding: 2px 8px; white-space: nowrap; font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
    max-width: 62%; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 1px 2px rgba(16, 22, 32, .04);
}
.anim-card__go {
    display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600;
    letter-spacing: .01em; color: var(--ink, #41529e); white-space: nowrap;
}
.anim-card__go .anim-ico { transition: transform .22s; }
.anim-card:hover .anim-card__go .anim-ico { transform: translateX(4px); }


/* ---------------- 点击卡片：飞到屏幕正中 → 流光 + 放大 → 淡入进页面（1.5s） ---------------- */
.anim-launch {
    position: fixed; inset: 0; z-index: 900; pointer-events: none;
}
.anim-launch::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(120% 100% at 50% 45%, rgba(20, 28, 42, .16), rgba(14, 20, 30, .42));
    -webkit-backdrop-filter: blur(3px) saturate(.92);
    backdrop-filter: blur(3px) saturate(.92);
    animation: animVail .34s ease both;
}
@keyframes animVail { from { opacity: 0; } to { opacity: 1; } }

/* 飞出去的那张卡（克隆体，位置/尺寸由 JS 按原卡片设置） */
.anim-flyer {
    position: fixed !important; margin: 0 !important; z-index: 2; pointer-events: none;
    transform-origin: center center; will-change: transform, opacity;
    border-color: rgba(var(--rgb), .5) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95),
                0 40px 90px -46px rgba(16, 22, 32, .75), 0 0 0 1px rgba(var(--rgb), .34),
                0 0 60px -22px rgba(var(--rgb), .55) !important;
}
.anim-flyer { background-color: #fff; }
.anim-flyer .anim-card__body {
    background: linear-gradient(180deg, #ffffff, #f7f9fb);
    -webkit-backdrop-filter: none; backdrop-filter: none;
    border-color: rgba(255, 255, 255, .95);
}
.anim-flyer .anim-card__grid { opacity: 1; }
.anim-flyer .anim-card__mark { color: rgba(var(--rgb), .34); }
.anim-flyer .anim-card__badge { transform: scale(1.06); }
/* 流光带（飞行中触发一次） */
.anim-flyer--sweep .anim-card__sweep { animation: animSweep .62s cubic-bezier(.3, .7, .2, 1) both; }
.anim-flyer--sweep .anim-card__ring { opacity: 1; animation: animRing 1.1s linear infinite; }
.anim-card__sweep {
    position: absolute; inset: -30% -60%; z-index: 4; pointer-events: none; opacity: 0;
    background: linear-gradient(104deg, transparent 34%, rgba(255, 255, 255, 1) 46%,
        rgba(var(--rgb), .82) 51%, rgba(255, 255, 255, .72) 55%, transparent 68%);
    transform: translateX(-90%);
}
@keyframes animSweep {
    0% { opacity: 0; transform: translateX(-90%); }
    16% { opacity: 1; }
    100% { opacity: 0; transform: translateX(90%); }
}


/* 粒子 / 光晕拖尾画布（在卡片下面一层） */
.anim-particles {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
}

/* 落地后「卡片展开成播放页」：卡片内容先淡出，只留白色面板长大 */
.anim-flyer--expand .anim-card__body,
.anim-flyer--expand .anim-card__idx,
.anim-flyer--expand .anim-card__corner,
.anim-flyer--expand .anim-card__ring {
    opacity: 0; transition: opacity .18s ease-out;
}
.anim-flyer--expand .anim-card__grid { opacity: .35; transition: opacity .3s; }
.anim-flyer--expand .anim-card__mark { opacity: 0; transition: opacity .2s; }
.anim-flyer--expand {
    background: #fff !important;
    box-shadow: 0 30px 80px -40px rgba(16, 22, 32, .6), 0 0 0 1px rgba(var(--rgb), .2) !important;
}

/* 其它卡片后退虚化（把注意力交给飞出去的那张） */
.anim-cards.is-dim .anim-card:not(.anim-flyer) {
    opacity: .38; filter: saturate(.65) blur(.8px); transform: scale(.98);
    transition: opacity .35s, transform .35s, filter .35s;
}

/* 新页面淡入 */
.anim-main.is-enter { animation: animEnter .46s cubic-bezier(.2, .75, .2, 1) both; }
@keyframes animEnter {
    from { opacity: 0; transform: translateY(14px) scale(.99); }
    to { opacity: 1; transform: none; }
}
/* 点击某张卡时，其它卡片后退虚化（把注意力交给被点的那张） */
.anim-cards.is-dim .anim-card:not(.is-launching) {
    opacity: .42; filter: saturate(.7) blur(.6px); transform: scale(.982);
    transition: opacity .3s, transform .3s, filter .3s;
}
@media (prefers-reduced-motion: reduce) {
    .anim-card.is-launching { transform: none !important; }
    .anim-card.is-launching .anim-card__sweep,
    .anim-card.is-launching .anim-card__ring,
    .anim-main.is-enter { animation: none !important; }
}

/* 站内保持一致：分组主色会在 mainhead 上用 --rgb，这里给它一个兜底 */
.anim-mainhead { --rgb: 91, 110, 225; }

/* 减动效偏好下全部动画停掉（只看静态分层） */
@media (prefers-reduced-motion: reduce) {
    .anim-card { transform: none !important; }
    .anim-card__mark svg *, .anim-card:hover .anim-card__ring { animation: none !important; }
}

/* ---------------- 面板 / 工具条（参考站样式） ---------------- */
/* ================================================================
 * 播放器：控制台（亮） + 演播室舞台（深色）
 * 舞台上的所有渲染器都用同一套深色令牌，视觉才统一
 * ================================================================ */
.anim-panel {
    background: linear-gradient(180deg, #fff, #fbfbfa);
    border: 1px solid #e9e9e4; border-radius: 14px; padding: 14px 14px 12px;
    box-shadow: 0 1px 2px rgba(24, 30, 40, .03), 0 18px 40px -34px rgba(24, 30, 40, .5);
}

/* ---------- 顶部：数据输入 ---------- */
.anim-datarow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.anim-datarow label { font-size: 12.5px; color: #6b7280; font-weight: 600; letter-spacing: .02em; }
.anim-input {
    flex: 1 1 300px; min-width: 200px; height: 34px; padding: 0 12px;
    border: 1px solid #e3e6ea; border-radius: 9px; background: #fff;
    font: 13px ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; color: #26313f;
    box-shadow: inset 0 1px 2px rgba(16, 22, 32, .03);
    transition: border-color .18s, box-shadow .18s;
}
.anim-input:focus { outline: none; border-color: rgba(var(--rgb, 91, 110, 225), .55); box-shadow: 0 0 0 3px rgba(var(--rgb, 91, 110, 225), .12); }

/* ---------- 工具按钮（次要） ---------- */
.anim-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border-radius: 9px; border: 1px solid #e3e6ea; background: #fff; color: #33405a !important;
    font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none !important;
    white-space: nowrap; transition: border-color .16s, box-shadow .16s, transform .12s, background .16s;
}
.anim-btn:hover { border-color: rgba(var(--rgb, 91, 110, 225), .45); box-shadow: 0 6px 14px -10px rgba(var(--rgb, 91, 110, 225), .9); transform: translateY(-1px); }
.anim-btn:active { transform: translateY(0); }
.anim-btn .anim-ico { width: 14px; height: 14px; }
.anim-btn--green {
    background: linear-gradient(180deg, #4f8557, #3f6f47); border-color: #3a6641; color: #fff !important;
    box-shadow: 0 8px 18px -14px rgba(63, 111, 71, 1), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.anim-btn--green:hover { background: linear-gradient(180deg, #57905f, #457a4e); border-color: #3a6641; color: #fff !important; }
.anim-btn--green.is-playing { background: linear-gradient(180deg, #d3a94b, #b98f30); border-color: #a87f28; }
.anim-btn--ghost { border-color: transparent; background: transparent; color: #6b7280 !important; padding: 0 8px; }
.anim-btn--ghost:hover { background: #f3f5f7; box-shadow: none; transform: none; }

/* ---------- 控制条 ---------- */
.anim-ctrlrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.anim-ctrl {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
    border-radius: 11px; border: 1px solid #e3e6ea; background: #fff; color: #2c3a4d !important;
    font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16, 22, 32, .04);
    transition: transform .14s, box-shadow .18s, border-color .18s, background .18s;
}
.anim-ctrl .anim-ico { width: 16px; height: 16px; }
.anim-ctrl:hover { transform: translateY(-1px); border-color: rgba(var(--rgb, 91, 110, 225), .4); box-shadow: 0 10px 20px -14px rgba(var(--rgb, 91, 110, 225), .9); }
.anim-ctrl:active { transform: translateY(0) scale(.99); }
.anim-ctrl--primary {
    background: linear-gradient(180deg, rgba(var(--rgb, 91, 110, 225), .95), rgba(var(--rgb, 91, 110, 225), .75));
    border-color: rgba(var(--rgb, 91, 110, 225), .9); color: #fff !important;
    box-shadow: 0 12px 26px -16px rgba(var(--rgb, 91, 110, 225), 1), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.anim-ctrl--primary:hover { filter: brightness(1.05); }
.anim-ctrl--primary.is-playing {
    background: linear-gradient(180deg, #e0b455, #c19a33); border-color: #b08a2c;
    box-shadow: 0 12px 26px -16px rgba(193, 154, 51, 1), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.anim-speedwrap {
    display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 14px;
    border-radius: 11px; border: 1px solid #e9ecef; background: #fafbfc;
    font-size: 12.5px; color: #5b6675; font-weight: 600;
}
.anim-speedwrap input[type="range"] {
    width: 132px; height: 4px; -webkit-appearance: none; appearance: none;
    background: linear-gradient(90deg, rgba(var(--rgb, 91, 110, 225), .85), rgba(var(--rgb, 91, 110, 225), .25));
    border-radius: 999px; outline: none;
}
.anim-speedwrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
    background: #fff; border: 2px solid rgba(var(--rgb, 91, 110, 225), .9);
    box-shadow: 0 2px 6px rgba(16, 22, 32, .25); cursor: pointer;
}
.anim-speedwrap output { font: 700 12px ui-monospace, Consolas, monospace; color: rgba(var(--rgb, 91, 110, 225), 1); min-width: 22px; }
.anim-step {
    margin-left: auto; font: 700 12.5px ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
    letter-spacing: .04em; color: #47546a; background: #f4f6f8; border: 1px solid #e9ecef;
    border-radius: 9px; padding: 6px 11px; font-variant-numeric: tabular-nums;
}

/* ---------- 图例 ---------- */
.anim-legendrow {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
    font-size: 12px; color: #5b6675;
}
.anim-lg {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px;
    border-radius: 999px; background: #f7f9fa; border: 1px solid #eaedf0;
}
.anim-chip {
    display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .14);
}
.anim-chip.is-cur { background: #a855f7; box-shadow: 0 0 0 3px rgba(168, 85, 247, .18); }
.anim-chip.is-cmp { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.anim-chip.is-swap { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.anim-chip.is-ok, .anim-chip.is-vis { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.anim-chip.is-fresh { background: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, .18); }
.anim-chip.is-dep { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }

/* ================================================================
 * 熔岩锻炉场景（深色）：画面像游戏里的关卡场景
 * 深色熔岩底 + 地平线热辉 + 熔岩裂纹 + 飘浮火星 + 暗角
 * ================================================================ */
.anim-studio {
    position: relative; overflow: hidden; border-radius: 18px; padding: 12px 14px 14px;
    border: 1px solid rgba(255, 176, 96, .34);
    background:
        radial-gradient(64% 46% at 50% -10%, rgba(255, 96, 26, .22), transparent 72%),
        linear-gradient(180deg, #0b0705 0%, #1d0c06 40%, #37110a 72%, #150603 100%);
    box-shadow: inset 0 1px 0 rgba(255, 210, 160, .22),
                inset 0 0 70px rgba(255, 90, 20, .14),
                0 22px 44px -32px rgba(20, 10, 4, .9);
}
/* 场景纹样（按分组换），熔岩场景下一律换成暖色细纹 */
.anim-studio::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    -webkit-mask-image: radial-gradient(130% 120% at 50% 0%, #000 18%, transparent 86%);
    mask-image: radial-gradient(130% 120% at 50% 0%, #000 18%, transparent 86%);
    opacity: .9;
}
.anim-studio[data-pat="rules"]::before {
    background-image: repeating-linear-gradient(90deg, rgba(255, 160, 90, .09) 0 1px, transparent 1px 13px);
}
.anim-studio[data-pat="dots"]::before {
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 170, 100, .16) 1.2px, transparent 2px);
    background-size: 15px 15px;
}
.anim-studio[data-pat="diag"]::before {
    background-image: repeating-linear-gradient(135deg, rgba(255, 150, 80, .08) 0 1px, transparent 1px 15px);
}
.anim-studio[data-pat="mesh"]::before {
    background-image:
        repeating-linear-gradient(60deg, rgba(255, 150, 80, .08) 0 1px, transparent 1px 19px),
        repeating-linear-gradient(-60deg, rgba(255, 120, 60, .07) 0 1px, transparent 1px 19px);
}
.anim-studio[data-pat="grid"]::before {
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 150, 80, .07) 0 1px, transparent 1px 17px),
        repeating-linear-gradient(90deg, rgba(255, 150, 80, .07) 0 1px, transparent 1px 17px);
}
/* 飘浮光斑（熔岩火星的空气感） */
.anim-studio__orb {
    position: absolute; border-radius: 50%; pointer-events: none; filter: blur(7px);
    background: radial-gradient(circle at 35% 30%, rgba(255, 140, 50, .3), transparent 72%);
}
.anim-studio__orb--1 { width: 120px; height: 120px; left: -30px; top: -40px; animation: animFloat 11s ease-in-out infinite; }
.anim-studio__orb--2 { width: 86px; height: 86px; right: 6%; top: -30px; animation: animFloat 14s ease-in-out infinite reverse; }
.anim-studio__orb--3 { width: 150px; height: 150px; right: -50px; bottom: -70px; animation: animFloat 17s ease-in-out infinite; }
@keyframes animFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(14px, 12px, 0) scale(1.08); }
}
/* 四角取景框 */
.anim-studio__corner {
    position: absolute; width: 18px; height: 18px; pointer-events: none; z-index: 3;
    border: 0 solid rgba(255, 186, 116, .8);
}
.anim-studio__corner--tl { left: 8px; top: 8px; border-left-width: 2.5px; border-top-width: 2.5px; border-top-left-radius: 10px; }
.anim-studio__corner--tr { right: 8px; top: 8px; border-right-width: 2.5px; border-top-width: 2.5px; border-top-right-radius: 10px; }
.anim-studio__corner--bl { left: 8px; bottom: 8px; border-left-width: 2.5px; border-bottom-width: 2.5px; border-bottom-left-radius: 10px; }
.anim-studio__corner--br { right: 8px; bottom: 8px; border-right-width: 2.5px; border-bottom-width: 2.5px; border-bottom-right-radius: 10px; }

/* 关卡条 */
.anim-studio__top {
    position: relative; z-index: 3; display: flex; align-items: center; gap: 8px;
    padding: 0 4px 10px; font-size: 12px; color: #e6c9a5; font-weight: 600; flex-wrap: wrap;
}
.anim-studio__dot {
    width: 8px; height: 8px; border-radius: 50%; background: #ff8a3c;
    box-shadow: 0 0 0 4px rgba(255, 138, 60, .22), 0 0 12px rgba(255, 138, 60, .8);
    animation: animPulse 1.9s ease-in-out infinite;
}
@keyframes animPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.anim-studio__name { color: #fff1de; }
.anim-studio__pat {
    margin-left: auto; font: 700 10.5px ui-monospace, Consolas, monospace; letter-spacing: .16em;
    color: #ffc48a; background: rgba(255, 150, 80, .12);
    border: 1px solid rgba(255, 176, 96, .34); border-radius: 999px; padding: 3px 10px;
}

/* 关卡标签 + 进度条（游戏 HUD 家具） */
.anim-studio__lv {
    font: 800 10.5px ui-monospace, Consolas, monospace; letter-spacing: .14em;
    color: #ffe6c6; background: linear-gradient(180deg, #4c3a2a, #2a1d14);
    border: 1px solid rgba(255, 176, 96, .3);
    border-radius: 6px; padding: 3px 8px; box-shadow: 0 4px 10px -6px rgba(0, 0, 0, .9);
}
.anim-progress {
    position: relative; z-index: 3; height: 7px; margin: 0 4px 10px; border-radius: 999px;
    background: rgba(255, 180, 120, .12);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .55);
    overflow: hidden;
}
.anim-progress i {
    display: block; height: 100%; border-radius: 999px; width: 0;
    background: linear-gradient(90deg, #ff9c3c, #f2621a);
    box-shadow: 0 0 12px rgba(255, 122, 26, .9);
    transition: width .22s cubic-bezier(.2, .8, .2, 1);
}

/* 舞台本体 = 熔岩地面：热池 + 斜向裂纹 + 底部压暗 */
.anim-stage {
    position: relative; min-height: 250px; border-radius: 13px; padding: 14px 16px 12px;
    border: 1px solid rgba(255, 176, 96, .18);
    background:
        radial-gradient(26% 15% at 22% 100%, rgba(255, 150, 50, .55), transparent 72%),
        radial-gradient(22% 13% at 58% 102%, rgba(255, 96, 20, .5), transparent 74%),
        radial-gradient(26% 14% at 84% 99%, rgba(255, 170, 70, .45), transparent 76%),
        radial-gradient(120% 62% at 50% 112%, rgba(255, 120, 30, .34), transparent 70%),
        linear-gradient(180deg, #120b07 0%, #1e1009 46%, #2a1208 100%);
    box-shadow: inset 0 1px 0 rgba(255, 210, 170, .14),
                inset 0 -18px 34px -26px rgba(255, 120, 30, .9),
                0 8px 22px -20px rgba(0, 0, 0, .8);
}
/* 熔岩裂纹 + 地平线热辉（贴在舞台上，不挡内容） */
.anim-stage::before {
    content: ''; position: absolute; inset: 0; border-radius: 13px; pointer-events: none;
    background:
        repeating-linear-gradient(64deg, rgba(255, 110, 30, .16) 0 1.5px, transparent 1.5px 58px),
        repeating-linear-gradient(-58deg, rgba(255, 60, 10, .14) 0 1.5px, transparent 1.5px 72px),
        linear-gradient(180deg, transparent 58%, rgba(255, 110, 30, .12) 78%, rgba(255, 90, 20, .26) 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 30%, #000 72%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 30%, #000 72%, #000 100%);
    opacity: .95;
}
.anim-stage > * { position: relative; z-index: 1; }

/* ---------- 下方说明条 ---------- */
.anim-note {
    margin-top: 10px; border-radius: 11px; padding: 11px 14px;
    background: linear-gradient(180deg, rgba(34, 197, 94, .07), rgba(34, 197, 94, .03));
    border: 1px solid rgba(34, 197, 94, .22); border-left: 3px solid #22c55e;
    font-size: 13px; color: #2f4a38; line-height: 1.7;
}

/* ================================================================
 * 舞台里的渲染器（统一深色令牌）
 * ================================================================ */
/* ------------------------------------------------------------------
 * 柱子 = 铸铁件（铸铁柱体 / 机加工顶盖 / 法兰底座 / 两侧铆钉排 / 冲压编号牌）
 *      + 柱身正中的「状态色阳极氧化金属板」（颜色严格照图例）
 *   紫 #a855f7 当前最小 / 蓝 #3b82f6 扫描中 / 红 #ef4444 交换
 *   绿 #22c55e 已排序   / 灰 #94a3b8 普通
 * 结构：.anim-bar → __val（数值胶囊）
 *              → __tube（满高容器，--px = 当前柱高）
 *                   → __fill（铸铁柱身，含 __anod / __heat / __rivet×2 / __plate）
 *                   → __cap（顶盖）/ __foot（法兰底座）/ __socket（地面光）
 *              → __idx（编号）
 * ------------------------------------------------------------------ */
.anim-bars {
    display: flex; align-items: flex-end; gap: 10px;
    padding: 26px 6px 0 44px;   /* 左边留出刻度轴 */
    position: relative;
}
.anim-bars::after {
    content: ''; position: absolute; left: 40px; right: 4px; bottom: 22px; height: 2px; border-radius: 2px;
    background:
        repeating-linear-gradient(90deg, rgba(221, 143, 28, .6) 0 1px, transparent 1px 12px),
        linear-gradient(90deg, rgba(221, 143, 28, .05), rgba(221, 143, 28, .55), rgba(221, 143, 28, .05));
    box-shadow: 0 0 14px rgba(221, 143, 28, .35);
}
/* 刻度轴 */
.anim-axis {
    position: absolute; left: 4px; bottom: 24px; width: 36px; height: var(--h, 170px);
    border-right: 1px solid rgba(96, 88, 70, .2);
}
.anim-axis__tick {
    position: absolute; right: 0; transform: translateY(50%);
    display: flex; align-items: center; gap: 4px;
    font: 700 9.5px ui-monospace, Consolas, monospace; color: #475569; letter-spacing: .06em;
}
.anim-axis__tick i {
    width: 7px; height: 1px; background: rgba(96, 88, 70, .35); order: 2;
}
.anim-axis__tick:first-child i { width: 11px; background: rgba(var(--rgb, 91, 110, 225), .55); }

/* 单根柱子：状态色令牌（默认＝普通灰） */
.anim-bar {
    position: relative; flex: 1 1 0; min-width: 26px;
    display: flex; flex-direction: column; align-items: center;
    --bar: #94a3b8; --bar-lit: #cbd5e1; --bar-dark: #475569;
    --glow: rgba(148, 163, 184, .5);
}
/* 数值胶囊：铸铁铭牌风（深底浅字，随状态描边） */
.anim-bar__val {
    position: relative; z-index: 3; margin-bottom: 9px; padding: 2px 9px; border-radius: 3px;
    font: 700 12px ui-monospace, Consolas, monospace; color: #ffe9cf; letter-spacing: .02em;
    background: linear-gradient(180deg, #3b352c, #201c17);
    border: 1px solid rgba(255, 216, 170, .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 3px 8px -5px rgba(24, 20, 16, .8);
    white-space: nowrap; font-variant-numeric: tabular-nums;
    transition: color .16s, border-color .16s, box-shadow .18s;
}
/* 满高容器 */
.anim-bar__tube {
    position: relative; width: 100%; max-width: 46px;
}
/* 铸铁柱身 */
.anim-bar__fill {
    position: absolute; left: 0; right: 0; bottom: 0; border-radius: 2px; overflow: hidden;
    background:
        /* 顶部受光 / 底部暗部 */
        linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 26%,
            rgba(0, 0, 0, .16) 72%, rgba(0, 0, 0, .42)),
        /* 柱面：暗边 → 次亮 → 冷白高光 → 次亮 → 暗边 */
        linear-gradient(90deg, #0f0d0a 0%, #2f2b25 12%, #565048 26%, #8a8377 42%, #cfc9bd 50%,
            #8a8377 58%, #565048 74%, #2f2b25 88%, #0d0b08 100%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 2px);
    background-blend-mode: normal, normal, multiply;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 0 0 2px rgba(0, 0, 0, .5),
        0 12px 24px -16px rgba(0, 0, 0, .85);
    transition: height .3s cubic-bezier(.34, 1.4, .64, 1), box-shadow .18s;
}
/* 状态色阳极氧化金属板：柱身正中那一条，用自己的金属反光 */
.anim-bar__anod {
    position: absolute; left: 18%; right: 18%; top: 0; bottom: 0; border-radius: 1px;
    background: linear-gradient(90deg,
        var(--bar-dark) 0%, var(--bar) 22%, var(--bar-lit) 42%,
        var(--bar) 60%, var(--bar-dark) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .34), 0 0 16px -4px var(--glow);
    transition: background .18s, box-shadow .18s;
}
/* 柱底受热辉光（熔岩反射） */
.anim-bar__heat {
    position: absolute; left: 0; right: 0; bottom: 0; height: 40%; pointer-events: none;
    background: linear-gradient(0deg, rgba(255, 122, 26, .55), rgba(255, 90, 20, .16) 54%, transparent 100%);
    mix-blend-mode: screen;
}
/* 两侧铆钉排 */
.anim-bar__rivet {
    position: absolute; top: 6px; bottom: 6px; width: 4px;
    background-image: radial-gradient(circle at 50% 3px,
        #f4f1e8 1.3px, #6b6257 2.1px, #17140f 2.7px, transparent 3.1px);
    background-size: 100% 16px; background-repeat: repeat-y;
    opacity: .92; pointer-events: none;
}
.anim-bar__rivet--l { left: 1px; }
.anim-bar__rivet--r { right: 1px; }
/* 冲压编号牌 */
.anim-bar__plate {
    position: absolute; left: 50%; transform: translateX(-50%); top: 8px;
    padding: 0 4px; border-radius: 1px; font: 900 8px/10px ui-monospace, Consolas, monospace;
    font-style: normal; color: #1b1712;
    background: linear-gradient(180deg, #ded9ce, #918b7f);
    box-shadow: inset 0 1px 0 #fff, inset 0 -1px 2px rgba(0, 0, 0, .5),
        0 1px 2px rgba(0, 0, 0, .6), 0 0 10px -3px var(--glow);
    pointer-events: none;
}
/* 机加工顶盖（压在柱顶） */
.anim-bar__cap {
    position: absolute; left: -4px; right: -4px; bottom: var(--px, 0px); height: 8px; border-radius: 1px;
    background: linear-gradient(180deg, #f2efe7 0%, #b8b2a5 32%, #6a6357 70%, #2b2721 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 12px -4px var(--glow);
    transition: bottom .3s cubic-bezier(.34, 1.4, .64, 1);
}
/* 法兰底座 */
.anim-bar__foot {
    position: absolute; left: -6px; right: -6px; bottom: -8px; height: 9px; border-radius: 1px;
    background: linear-gradient(180deg, #332f28 0%, #6b6459 34%, #b7b0a3 66%, #e8e4da 100%);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .55), inset 0 1px 0 #fff;
    pointer-events: none;
}
/* 地面光 */
.anim-bar__socket {
    position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
    width: 92%; height: 9px; border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, var(--glow), transparent 72%);
    filter: blur(1px); pointer-events: none;
}
/* 编号 */
.anim-bar__idx {
    position: relative; z-index: 3; margin-top: 15px;
    font: 700 10.5px ui-monospace, Consolas, monospace; color: #52607a; letter-spacing: .12em;
}
/* ---- 状态色（阳极氧化板 + 描边 + 地面光），严格照图例 ---- */
.anim-bar.is-cmp { --bar: #3b82f6; --bar-lit: #93c5fd; --bar-dark: #1e3a8a; --glow: rgba(59, 130, 246, .65); }
.anim-bar.is-cmp .anim-bar__val { color: #bfdbfe; border-color: rgba(59, 130, 246, .7); }
.anim-bar.is-swap { --bar: #ef4444; --bar-lit: #fca5a5; --bar-dark: #7f1d1d; --glow: rgba(239, 68, 68, .6); }
.anim-bar.is-swap .anim-bar__val { color: #fecaca; border-color: rgba(239, 68, 68, .7); }
.anim-bar.is-swap .anim-bar__fill { animation: animJelly .36s ease-out; }
@keyframes animJelly {
    0% { transform: scaleY(1.06) scaleX(.93); }
    55% { transform: scaleY(.96) scaleX(1.05); }
    100% { transform: none; }
}
.anim-bar.is-ok { --bar: #22c55e; --bar-lit: #86efac; --bar-dark: #14532d; --glow: rgba(34, 197, 94, .6); }
.anim-bar.is-ok .anim-bar__val { color: #bbf7d0; border-color: rgba(34, 197, 94, .7); }
.anim-bar.is-cur { --bar: #a855f7; --bar-lit: #d8b4fe; --bar-dark: #581c87; --glow: rgba(168, 85, 247, .7); }
.anim-bar.is-cur .anim-bar__val { color: #e9d5ff; border-color: rgba(168, 85, 247, .75); }
.anim-bar.is-cur .anim-bar__fill { box-shadow: inset 0 0 0 1px rgba(216, 180, 254, .5), 0 12px 26px -14px var(--glow); }
.anim-bar.is-dead { --bar: #64748b; --bar-lit: #94a3b8; --bar-dark: #334155; --glow: rgba(100, 116, 139, .3); }
.anim-bar.is-dead .anim-bar__val { color: #b8c2cf; }
.anim-bar.is-dead .anim-bar__fill { opacity: .72; }

/* 图 / 树（SVG） */
.anim-graph { width: 100%; }
.anim-svg { width: 100%; height: 240px; }
.anim-edge { stroke: rgba(255, 196, 140, .45); stroke-width: 2.5; transition: stroke .18s, stroke-width .18s; }
.anim-edge.is-scan { stroke: #60a5fa; stroke-width: 4; filter: drop-shadow(0 0 6px rgba(96, 165, 250, .8)); }
.anim-node circle { fill: #241a13; stroke: rgba(255, 196, 140, .4); stroke-width: 2.5; transition: fill .18s, stroke .18s, filter .18s; }
.anim-node text { text-anchor: middle; font: 700 15px ui-monospace, Consolas, monospace; fill: #f4e8d8; }
.anim-node.is-vis circle { fill: rgba(34, 197, 94, .22); stroke: #22c55e; }
.anim-node.is-vis text { fill: #c6f6d5; }
.anim-node.is-cur circle { fill: rgba(168, 85, 247, .24); stroke: #a855f7; stroke-width: 3.5; filter: drop-shadow(0 0 8px rgba(139, 92, 246, .55)); }
.anim-node.is-fresh circle { fill: rgba(14, 165, 233, .22); stroke: #38bdf8; }
.anim-node.is-fresh text { fill: #bae6fd; }
.anim-node__tag { font: 700 11px ui-monospace, Consolas, monospace; fill: #fbbf24; }
.anim-node.is-red circle { fill: rgba(239, 68, 68, .85); stroke: #fca5a5; }
.anim-node.is-red text { fill: #241a13; }
.anim-node.is-black circle { fill: #0f0a07; stroke: #000000; }
.anim-node.is-black text { fill: #e2e8f0; }

/* 栈 / 队列 */
.anim-lin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 96px; }
.anim-lin__label { font-size: 12.5px; color: #dcc7a8; font-weight: 600; white-space: nowrap; }
.anim-lin__cells { display: flex; gap: 8px; align-items: center; min-height: 56px; }
.anim-lin__empty { font-size: 13px; color: #9c8f7f; }
.anim-lincell {
    min-width: 52px; height: 46px; line-height: 46px; text-align: center; border-radius: 8px;
    background: #241a13; border: 1.5px solid rgba(255, 196, 140, .32);
    color: #f4e8d8; font: 600 16px ui-monospace, Consolas, monospace;
    transition: border-color .16s, background .16s, box-shadow .16s;
}
.anim-lincell.is-swap { border-color: #ef4444; background: rgba(239, 68, 68, .22); color: #fecaca; }

/* 链表（箭头 / 环） */
.anim-chain { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 78px; padding: 8px 2px; }
.anim-chain__head { font-size: 12.5px; color: #dcc7a8; font-weight: 700; }
.anim-chain__arrow { color: #dcc7a8; font-size: 14px; }
.anim-chain__node {
    min-width: 50px; height: 42px; line-height: 42px; text-align: center; border-radius: 8px;
    background: #241a13; border: 1.5px solid rgba(255, 196, 140, .32);
    color: #f4e8d8; font: 600 15px ui-monospace, Consolas, monospace;
    transition: border-color .16s, background .16s, box-shadow .16s;
}
.anim-chain__node.is-cur { border-color: #a855f7; background: rgba(168, 85, 247, .24); color: #e9d5ff; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .9); }
.anim-chain__node.is-cmp { border-color: #3b82f6; background: rgba(59, 130, 246, .22); color: #c7dbff; }
.anim-chain__node.is-ok { border-color: #22c55e; background: rgba(34, 197, 94, .22); color: #c6f6d5; }
.anim-chain__null { font-size: 12.5px; color: #cbb9a0; font-weight: 600; }
.anim-chain__back { font-size: 12.5px; color: #fde68a; background: rgba(245, 158, 11, .2); border: 1px solid #f59e0b; border-radius: 999px; padding: 2px 9px; }

/* 竖条（贪心 / KMP / GCD） */
.anim-cols { display: flex; gap: 10px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.anim-col {
    min-width: 58px; border-radius: 9px; padding: 8px 10px 9px; text-align: center;
    background: #241a13; border: 1px solid rgba(255, 196, 140, .28); color: #f4e8d8;
}
.anim-col__tag { font: 700 10.5px ui-monospace, Consolas, monospace; color: #b3a08c; letter-spacing: .06em; }
.anim-col__top { font: 600 14px ui-monospace, Consolas, monospace; margin-top: 3px; }
.anim-col__mid { font-size: 11.5px; color: #c9b79e; margin-top: 2px; }
.anim-col.is-ok { background: rgba(34, 197, 94, .22); border-color: #22c55e; color: #c6f6d5; }
.anim-col.is-cur { background: rgba(168, 85, 247, .24); border-color: #a855f7; color: #e9d5ff; }
.anim-col.is-cmp { background: rgba(59, 130, 246, .22); border-color: #3b82f6; color: #c7dbff; }
.anim-col.is-dead { opacity: .45; }

/* 分桶 */
.anim-buckets { display: flex; gap: 8px; align-items: flex-start; justify-content: center; flex-wrap: wrap; padding: 8px 0; }
.anim-bucket {
    min-width: 68px; border-radius: 10px; overflow: hidden;
    background: #241a13; border: 1px solid rgba(255, 196, 140, .25);
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.anim-bucket.is-cur { border-color: #a855f7; background: rgba(168, 85, 247, .2); box-shadow: 0 8px 20px -12px rgba(139, 92, 246, .9); }
.anim-bucket__tag {
    font: 600 11.5px ui-monospace, Consolas, monospace; color: #dcc7a8; text-align: center;
    padding: 4px; background: rgba(255, 214, 170, .1); border-bottom: 1px solid rgba(255, 196, 140, .14);
}
.anim-bucket__body { min-height: 86px; padding: 7px; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.anim-bucket__item {
    width: 46px; height: 25px; line-height: 25px; text-align: center; border-radius: 6px;
    background: rgba(34, 197, 94, .22); border: 1px solid #22c55e;
    color: #c6f6d5; font: 700 13px ui-monospace, Consolas, monospace;
}
.anim-bucket__empty { font-size: 12px; color: #b3a08c; }

/* 多行格子（字符串 / 时间线） */
.anim-rows { display: flex; flex-direction: column; gap: 9px; padding: 8px 0; }
.anim-rowline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anim-rowline__tag {
    flex: 0 0 auto; min-width: 44px; font: 700 12px ui-monospace, Consolas, monospace;
    color: #dcc7a8; text-align: right;
}
.anim-rowline__cells { display: flex; gap: 4px; flex-wrap: wrap; }
.anim-charcell {
    min-width: 29px; height: 32px; line-height: 32px; text-align: center; border-radius: 6px;
    background: #241a13; border: 1px solid rgba(255, 196, 140, .26);
    color: #f4e8d8; font: 700 13.5px ui-monospace, Consolas, monospace; padding: 0 5px;
    transition: background .16s, border-color .16s, box-shadow .16s;
}
.anim-charcell.is-cur { background: rgba(168, 85, 247, .24); border-color: #a855f7; color: #e9d5ff; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .95); }
.anim-charcell.is-cmp { background: rgba(59, 130, 246, .22); border-color: #3b82f6; color: #c7dbff; }
.anim-charcell.is-ok { background: rgba(34, 197, 94, .22); border-color: #22c55e; color: #c6f6d5; }
.anim-charcell.is-dead { background: rgba(148, 163, 184, .1); color: #9c8f7f; text-decoration: line-through; }

/* 网格地图（A* / IDA*） */
.anim-map { display: grid; gap: 3px; justify-content: center; padding: 8px 0; }
.anim-map__cell {
    width: 27px; height: 27px; line-height: 25px; text-align: center; border-radius: 5px;
    background: #241a13; border: 1px solid rgba(255, 196, 140, .22);
    color: #cbb9a0; font: 600 12px ui-monospace, Consolas, monospace;
    transition: background .16s, border-color .16s;
}
.anim-map__cell.is-wall { background: #9c8f7f; border-color: #b3a08c; color: transparent; }
.anim-map__cell.is-start { background: rgba(34, 197, 94, .22); border-color: #22c55e; color: #c6f6d5; font-weight: 700; }
.anim-map__cell.is-goal { background: rgba(245, 158, 11, .2); border-color: #f59e0b; color: #fde68a; font-weight: 700; }
.anim-map__cell.is-cur { background: rgba(168, 85, 247, .24); border-color: #a855f7; color: #e9d5ff; box-shadow: 0 4px 14px -8px rgba(139, 92, 246, .95); }
.anim-map__cell.is-ok { background: rgba(34, 197, 94, .22); border-color: #22c55e; color: #c6f6d5; }
.anim-map__cell.is-cmp { background: rgba(59, 130, 246, .22); border-color: #3b82f6; color: #c7dbff; }
.anim-map__cell.is-dead { background: rgba(148, 163, 184, .1); color: #9c8f7f; }

/* 一排「值 + dp」 */
.anim-lis { display: flex; gap: 8px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.anim-lis__col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 46px; }
.anim-lis__v {
    width: 100%; text-align: center; padding: 6px 4px; border-radius: 7px;
    background: #241a13; border: 1px solid rgba(255, 196, 140, .28);
    color: #f4e8d8; font: 700 14px ui-monospace, Consolas, monospace;
}
.anim-lis__dp {
    width: 100%; text-align: center; padding: 4px; border-radius: 6px;
    background: rgba(14, 165, 233, .2); border: 1px solid #38bdf8;
    color: #bae6fd; font: 700 12.5px ui-monospace, Consolas, monospace;
}
.anim-lis__idx { font: 600 11.5px ui-monospace, Consolas, monospace; color: #dcc7a8; }
.anim-lis__col.is-dep .anim-lis__v { border-color: #f59e0b; background: rgba(245, 158, 11, .2); color: #fde68a; }
.anim-lis__col.is-cur .anim-lis__v { border-color: #a855f7; background: rgba(168, 85, 247, .24); color: #e9d5ff; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .95); }
.anim-lis__col.is-cur .anim-lis__dp { background: rgba(168, 85, 247, .24); border-color: #a855f7; color: #e9d5ff; font-weight: 700; }

/* 表格 / 格子 */
.anim-gridwrap { overflow-x: auto; }
.anim-grid { border-collapse: separate; border-spacing: 3px; font: 500 13px ui-monospace, Consolas, monospace; }
.anim-grid th { font-weight: 700; color: #dcc7a8; font-size: 12px; padding: 3px 6px; }
.anim-cell {
    background: #241a13; border: 1px solid rgba(255, 196, 140, .24); color: #f4e8d8;
    border-radius: 6px; padding: 5px 9px; text-align: center; min-width: 34px;
    transition: background .16s, border-color .16s, box-shadow .16s;
}
.anim-cell.is-dead { background: rgba(148, 163, 184, .1); color: #9c8f7f; }
.anim-cell.is-dep { background: rgba(245, 158, 11, .2); border-color: #f59e0b; color: #fde68a; }
.anim-cell.is-cur { background: rgba(168, 85, 247, .24); border-color: #a855f7; color: #e9d5ff; font-weight: 700; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .95); }
.anim-cells { display: flex; gap: 8px; flex-wrap: wrap; }
.anim-cell--w {
    min-width: 60px; border-radius: 8px; padding: 8px 10px; text-align: center;
    background: #241a13; border: 1px solid rgba(255, 196, 140, .26);
}
.anim-cell--w i { display: block; font-style: normal; font-size: 11px; color: #dcc7a8; }
.anim-cell--w b { display: block; font: 700 15px ui-monospace, Consolas, monospace; color: #f4e8d8; margin-top: 2px; }
.anim-cell--w.is-dep { background: rgba(245, 158, 11, .2); border-color: #f59e0b; }
.anim-cell--w.is-cur { background: rgba(168, 85, 247, .24); border-color: #a855f7; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .95); }

/* 画面下方的补充说明（渲染器自带的 label / info） */
.anim-info { margin-top: 12px; font-size: 12.5px; color: #dcc7a8; text-align: center; line-height: 1.75; }
.anim-info b { color: #f4e8d8; font-weight: 700; }

/* 链表的另一种（stack 渲染器里的 list 模式） */
.anim-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 70px; padding: 6px 2px; }
.anim-list__head { font-size: 12.5px; color: #dcc7a8; font-weight: 700; }
.anim-list__arrow { color: #dcc7a8; font-size: 14px; }
.anim-list__null { font-size: 12.5px; color: #fbbf24; font-weight: 600; }

/* 汉诺塔 */
.anim-hanoi { display: flex; align-items: flex-end; justify-content: space-around; gap: 16px; padding: 18px 6px 6px; min-height: 210px; }
.anim-peg { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.anim-peg__disks { display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; min-height: 140px; justify-content: flex-start; }
.anim-disk {
    height: 20px; line-height: 20px; text-align: center; border-radius: 5px;
    background: linear-gradient(180deg, rgba(148, 163, 184, .95), rgba(100, 116, 139, .7));
    color: #0b0805; font: 700 11px ui-monospace, Consolas, monospace;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); transition: width .2s;
}
.anim-peg.is-cur .anim-disk { background: linear-gradient(180deg, #7ff0b0, #22c55e); color: #06210f; }
.anim-peg.is-swap .anim-disk { background: linear-gradient(180deg, #ff9b9b, #ef4444); color: #2a0808; }
.anim-peg__base { width: 96px; height: 5px; border-radius: 3px; background: rgba(148, 163, 184, .4); }
.anim-peg__name { font: 700 12px ui-monospace, Consolas, monospace; color: #e8d6bd; }


/* —— 深色舞台下的补充修正 —— */
.anim-node.is-red text { fill: #fff3e8; }
.anim-node.is-black text { fill: #f4e8d8; }
.anim-lincell, .anim-chain__node, .anim-col, .anim-bucket, .anim-charcell,
.anim-map__cell, .anim-lis__v, .anim-cell, .anim-cell--w {
    box-shadow: inset 0 1px 0 rgba(255, 214, 170, .1), 0 4px 12px -10px #000;
}
.anim-bucket__tag { border-bottom: 1px solid rgba(255, 196, 140, .2); }
.anim-map__cell.is-wall { color: transparent; }
.anim-cell--w b { color: #fff1de; }
.anim-info { color: #dcc7a8; }
.anim-info b { color: #fff1de; }
.anim-peg__name { color: #f4e8d8; }
/* ---------------- 算法说明 / 时间复杂度（竖排两块，放在参考代码下面） ---------------- */
.anim-doc { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 4px 18px 16px; margin-top: 14px; }
.anim-doc__sec { padding: 12px 0; }
.anim-doc__sec + .anim-doc__sec { border-top: 1px dashed #e6e9e7; }
.anim-doc h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: #3b4a6b; }
.anim-doc p { margin: 0 0 8px; font-size: 13px; color: #3f4a55; line-height: 1.9; text-align: justify; }
.anim-doc p b { color: #2b3b5c; }
.anim-doc__tip { background: #fbfaf3; border-left: 3px solid #caa44a; border-radius: 0 4px 4px 0; padding: 8px 10px; }
.anim-cx { display: flex; flex-direction: column; }
.anim-cx__row { display: flex; gap: 12px; font-size: 13px; line-height: 1.9; padding: 3px 0; }
.anim-cx__row + .anim-cx__row { border-top: 1px dashed #f1f3f2; }
.anim-cx__row i { flex: 0 0 60px; font-style: normal; color: #6b7280; font-weight: 600; }
.anim-cx__row span { flex: 1 1 auto; color: #2b3b5c; }
.anim-cx__row span b { color: #10243f; }
.anim-card__meta { margin-top: 6px; font-size: 12px; color: #4f8a5b; font-family: Consolas, Menlo, monospace; }

/* ---------------- 代码（白底 + 语法高亮 + 当前行） ---------------- */
.anim-codebox { margin-top: 14px; background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 14px 18px 18px; }
.anim-codehead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: #3b4a6b; margin-bottom: 8px; }
.anim-codehead i { font-style: normal; font-weight: 400; font-size: 12px; color: #9a9a9a; }
.anim-code {
    background: #fff; border: 1px solid #e6eaf2; border-radius: 6px;
    max-height: 330px; overflow: auto; padding: 8px 0;
    font-family: Consolas, "Cascadia Mono", Menlo, "Courier New", monospace;
    font-size: 13px; line-height: 1.75;
}
.anim-line { display: flex; white-space: pre; border-left: 3px solid transparent; }
.anim-line:hover { background: #f7f9fc; cursor: pointer; }
.anim-ln { flex: 0 0 44px; text-align: right; padding-right: 12px; color: #b6bcc8; user-select: none; font-size: 12.5px; }
.anim-src { flex: 1 1 auto; color: #1f2937; padding-right: 14px; }
.anim-line.is-cur { background: #eef6ec; border-left-color: #5b8f5f; }
.anim-line.is-cur .anim-ln { color: #3f7a4c; font-weight: 700; }
.anim-line.is-cur .anim-src { color: #10243f; }

/* 语法配色（白底可读） */
.c-kw { color: #7c3aed; font-weight: 600; }
.c-ty { color: #0e7490; }
.c-st { color: #15803d; }
.c-nu { color: #2563eb; }
.c-cm { color: #8a8a8a; font-style: italic; }
.c-pp { color: #b45309; }

@media (max-width: 900px) {
    .anim-wrap { flex-direction: column; }
    .anim-aside { position: static; flex: 1 1 auto; width: 100%; }
    .anim-bar__col { max-width: 100%; }
    .anim-step { margin-left: 0; }
}

/* ================================================================
 * 熔岩锻炉皮肤（整页）：铸铁 + 阳极氧化 + 熔岩热辉
 * 只在 /animation 这一页生效（html.anim-forge 由 anim.js 挂上），
 * 参考代码 / 算法说明两块保持白底（老师要求），其余全部换成深色锻炉风；
 * 所有控件（按钮 / 输入框 / 滑杆 / 步数牌 / 图例）都是金属材质：
 *   钢件 = 竖向明暗（亮顶 → 暗腰 → 亮底）+ 拉丝纹 + 内高光 + 外投影
 *   热件 = 黄铜/灼热金属（做主按钮）
 * 参考代码 / 算法说明两块保持白底。
 * ================================================================ */
html.anim-forge { background: #0a0705; }
html.anim-forge body {
    background:
        radial-gradient(120% 58% at 50% 104%, rgba(255, 110, 30, .18), transparent 70%),
        radial-gradient(70% 40% at 8% -6%, rgba(255, 90, 20, .1), transparent 66%),
        linear-gradient(180deg, #0b0806, #130c07 42%, #0a0605);
    color: #e9dcc9;
}
html.anim-forge .anim-page { color: #e9dcc9; }
/* OJ 的外层容器 id="panel"（#edf0f2 浅灰）会把深色页面盖成白的 → 这一页让它透出去
   （必须写到 #panel，ID 选择器比类选择器优先） */
html.anim-forge #panel,
html.anim-forge .slideout-panel { background: transparent; }
html.anim-forge #main.main,
html.anim-forge .main { background: transparent; }
html.anim-forge footer { color: #b7a288; }
html.anim-forge footer a { color: #ffd7a8 !important; }

/* ---------- 页头 ---------- */
html.anim-forge .anim-head {
    background:
        radial-gradient(120% 140% at 0% -20%, rgba(255, 120, 40, .18), transparent 58%),
        linear-gradient(180deg, rgba(40, 26, 17, .97), rgba(20, 13, 9, .98));
    border: 1px solid rgba(255, 176, 96, .3);
    box-shadow: inset 0 1px 0 rgba(255, 210, 160, .16), 0 22px 46px -34px #000;
}
html.anim-forge .anim-head h1 { color: #ffeeda; }
html.anim-forge .anim-head p { color: #cbb49a; }
html.anim-forge .anim-head b { color: #ffd7a8; }

/* ---------- 左侧章节导航 ---------- */
html.anim-forge .anim-aside {
    background: linear-gradient(180deg, rgba(33, 21, 14, .97), rgba(17, 11, 7, .98));
    border: 1px solid rgba(255, 176, 96, .22);
    box-shadow: inset 0 1px 0 rgba(255, 210, 160, .12), 0 18px 40px -34px #000;
}
html.anim-forge .anim-aside::-webkit-scrollbar-thumb { background: rgba(255, 176, 96, .28); }
html.anim-forge .anim-group__title { color: #f0dfc8; }
html.anim-forge .anim-group__title i,
html.anim-forge .anim-chapter i { color: #a98f74; }
html.anim-forge .anim-caret { color: #a98f74; }
html.anim-forge .anim-chapter {
    color: #d9c5ab !important; border-left: 1px solid rgba(255, 176, 96, .18);
}
html.anim-forge .anim-chapter:hover {
    background: rgba(255, 140, 60, .1); border-left-color: rgba(255, 176, 96, .55); color: #ffe6c6 !important;
}
html.anim-forge .anim-chapter.is-on {
    background: linear-gradient(180deg, #f2a044, #cd6d1c); border-left-color: #ffd0a0;
    color: #2b1505 !important; box-shadow: 0 6px 16px -10px rgba(242, 160, 68, .95);
}
html.anim-forge .anim-chapter.is-on i { color: #3a1d07; }
html.anim-forge .anim-tip { color: #a98f74; border-top: 1px solid rgba(255, 176, 96, .14); }

/* ---------- 右侧标题条 ---------- */
html.anim-forge .anim-mainhead {
    background: linear-gradient(180deg, rgba(38, 25, 16, .97), rgba(20, 13, 9, .98));
    border: 1px solid rgba(255, 176, 96, .26);
    box-shadow: inset 0 1px 0 rgba(255, 210, 160, .14), 0 18px 40px -34px #000;
}
html.anim-forge .anim-mainhead h2 { color: #fff1de; }
html.anim-forge .anim-mainhead p { color: #bda98f; }
html.anim-forge .anim-mainhead__mark { color: rgba(255, 180, 110, .12); }
html.anim-forge .anim-list__head { color: #ffd7a8; }
html.anim-forge .anim-crumb {
    color: #ffd7a8; background: rgba(255, 150, 70, .14); border-color: rgba(255, 176, 96, .32);
}

/* ---------- 卡片：铸铁底板 + 章节色底纹 + 拉丝金属 ---------- */
html.anim-forge .anim-card {
    border-color: rgba(var(--rgb), .4);
    background:
        /* 斜向金属反光 */
        linear-gradient(128deg, rgba(255, 240, 215, .13) 0%, rgba(255, 240, 215, 0) 26%,
            rgba(255, 225, 190, .05) 46%, rgba(0, 0, 0, .26) 74%, rgba(255, 240, 215, .08) 100%),
        /* 章节色光晕 */
        radial-gradient(135% 105% at 106% -12%, rgba(var(--rgb), .52), transparent 56%),
        radial-gradient(90% 80% at -10% 122%, rgba(255, 120, 40, .36), transparent 64%),
        /* 拉丝纹 */
        repeating-linear-gradient(90deg, rgba(255, 220, 180, .05) 0 1px, transparent 1px 3px),
        linear-gradient(150deg, rgba(40, 27, 18, .98) 0%, rgba(21, 14, 9, .99) 62%, #0d0906 100%);
    box-shadow: inset 0 1px 0 rgba(255, 216, 172, .2), inset 0 0 0 1px rgba(0, 0, 0, .6),
                inset 0 -18px 30px -26px rgba(255, 130, 40, .8),
                0 2px 4px rgba(0, 0, 0, .45), 0 22px 44px -26px rgba(0, 0, 0, .95);
}
html.anim-forge .anim-card:hover {
    border-color: rgba(var(--rgb), .72);
    box-shadow: inset 0 1px 0 rgba(255, 216, 172, .3), inset 0 0 0 1px rgba(0, 0, 0, .6),
                inset 0 -18px 30px -24px rgba(255, 140, 50, .95),
                0 4px 10px rgba(0, 0, 0, .5), 0 30px 54px -26px rgba(0, 0, 0, 1),
                0 0 0 4px rgba(var(--rgb), .1);
}
html.anim-forge .anim-card__grid { opacity: .95; }
html.anim-forge .anim-card__noise { mix-blend-mode: overlay; opacity: .5; }
html.anim-forge .anim-card__mark { color: rgba(var(--rgb), .42); mix-blend-mode: screen; }
html.anim-forge .anim-card:hover .anim-card__mark { color: rgba(var(--rgb), .58); }
html.anim-forge .anim-card__spot {
    background: radial-gradient(200px 200px at var(--mx) var(--my), rgba(255, 190, 120, .26), transparent 62%);
}
html.anim-forge .anim-card__corner { border-color: rgba(var(--rgb), .7); }
html.anim-forge .anim-card__idx { color: rgba(255, 200, 150, .7); }
html.anim-forge .anim-card__body {
    background: linear-gradient(180deg, rgba(46, 32, 22, .84), rgba(23, 16, 11, .8));
    border: 1px solid rgba(255, 200, 150, .18);
    box-shadow: inset 0 1px 0 rgba(255, 216, 172, .16), 0 6px 16px -14px #000;
    -webkit-backdrop-filter: blur(3px) saturate(1.04); backdrop-filter: blur(3px) saturate(1.04);
}
html.anim-forge .anim-card:hover .anim-card__body {
    background: linear-gradient(180deg, rgba(56, 39, 26, .9), rgba(28, 19, 12, .86));
}
html.anim-forge .anim-card__badge {
    color: #ffe9cf;
    background: linear-gradient(160deg, rgba(62, 45, 31, .98), rgba(var(--rgb), .42));
    border: 1px solid rgba(var(--rgb), .55);
    box-shadow: inset 0 1px 0 rgba(255, 216, 172, .24), 0 8px 16px -10px #000;
}
html.anim-forge .anim-card__title { color: #fff2e0; }
html.anim-forge .anim-card__desc { color: #c9b49a; }
html.anim-forge .anim-card__time {
    color: #ffd7a8; background: rgba(255, 180, 110, .13); border-color: rgba(255, 176, 96, .3);
    box-shadow: none;
}
html.anim-forge .anim-card__go { color: #ffc47a; }

/* ---------- 飞卡 / 遮罩 / 展开（深色底，和页面同色系） ---------- */
html.anim-forge .anim-launch::before {
    background: radial-gradient(120% 100% at 50% 45%, rgba(24, 15, 8, .5), rgba(8, 5, 3, .72));
}
html.anim-forge .anim-flyer {
    background-color: #1a120b;
    box-shadow: inset 0 1px 0 rgba(255, 216, 172, .24),
                0 40px 90px -46px rgba(0, 0, 0, .95), 0 0 0 1px rgba(var(--rgb), .5),
                0 0 70px -22px rgba(var(--rgb), .7) !important;
}
html.anim-forge .anim-flyer .anim-card__body {
    background: linear-gradient(180deg, #2a1d14, #16100a);
    border-color: rgba(255, 200, 150, .22);
}
html.anim-forge .anim-flyer--expand {
    background: #100b07 !important;
    box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(var(--rgb), .3) !important;
}
html.anim-forge .anim-card__sweep {
    background: linear-gradient(104deg, transparent 34%, rgba(255, 236, 210, .9) 46%,
        rgba(var(--rgb), .95) 51%, rgba(255, 226, 190, .7) 55%, transparent 68%);
}

/* ================================================================
 * 控制台 + 金属控件
 * ================================================================ */
html.anim-forge .anim-panel {
    background: linear-gradient(180deg, rgba(37, 24, 16, .98), rgba(19, 12, 8, .99));
    border: 1px solid rgba(255, 176, 96, .3);
    box-shadow: inset 0 1px 0 rgba(255, 210, 160, .16), 0 22px 46px -34px #000;
}
html.anim-forge .anim-datarow label {
    color: #d5c1a6; letter-spacing: .06em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .8);
}

/* 输入框：机加工出来的凹槽（内阴刻，边缘一圈亮金属） */
html.anim-forge .anim-input {
    background:
        repeating-linear-gradient(90deg, rgba(255, 220, 180, .035) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, #0c0805, #17100a 55%, #221910);
    border: 1px solid #0a0705; border-radius: 8px;
    color: #ffe9cf;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .9), inset 0 -1px 0 rgba(255, 214, 170, .16),
                0 1px 0 rgba(255, 214, 170, .14);
}
html.anim-forge .anim-input:focus {
    border-color: rgba(255, 176, 96, .8);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .9), inset 0 -1px 0 rgba(255, 214, 170, .2),
                0 0 0 3px rgba(255, 140, 60, .18), 0 0 18px -6px rgba(255, 140, 60, .8);
}

/* 通用金属件（钢） */
html.anim-forge .anim-btn,
html.anim-forge .anim-ctrl {
    background:
        repeating-linear-gradient(90deg, rgba(255, 236, 208, .07) 0 1px, transparent 1px 2px),
        linear-gradient(180deg, #7d7264 0%, #584f44 16%, #3b342d 46%, #2b241f 70%, #4c443b 90%, #6e6558 100%);
    border: 1px solid #12100c; border-radius: 9px;
    color: #ffeacd !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .85);
    box-shadow: inset 0 1px 0 rgba(255, 244, 226, .55), inset 0 -1px 0 rgba(0, 0, 0, .7),
                0 2px 0 rgba(0, 0, 0, .5), 0 10px 18px -12px rgba(0, 0, 0, .95);
}
html.anim-forge .anim-btn:hover,
html.anim-forge .anim-ctrl:hover {
    background:
        repeating-linear-gradient(90deg, rgba(255, 240, 216, .09) 0 1px, transparent 1px 2px),
        linear-gradient(180deg, #948878 0%, #6a6053 18%, #484037 48%, #332c26 72%, #5b5248 92%, #847969 100%);
    border-color: #171410;
    box-shadow: inset 0 1px 0 rgba(255, 248, 232, .7), inset 0 -1px 0 rgba(0, 0, 0, .7),
                0 2px 0 rgba(0, 0, 0, .5), 0 14px 24px -14px rgba(255, 130, 40, .8);
}
html.anim-forge .anim-btn:active,
html.anim-forge .anim-ctrl:active {
    background: linear-gradient(180deg, #2a231d, #453d34 60%, #2f2822);
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, .9), inset 0 -1px 0 rgba(255, 214, 170, .18);
    transform: translateY(1px);
}
/* 主按钮 = 灼热黄铜（锻炉里烧过的那种） */
html.anim-forge .anim-btn--green,
html.anim-forge .anim-ctrl--primary {
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px 2px),
        linear-gradient(180deg, #ffe3b4 0%, #f6b052 20%, #cf7a1d 58%, #a1550f 76%, #e79b3c 92%, #ffd594 100%);
    border: 1px solid #6d3a08;
    color: #2b1405 !important;
    text-shadow: 0 1px 0 rgba(255, 236, 200, .6);
    box-shadow: inset 0 1px 0 rgba(255, 250, 236, .9), inset 0 -1px 0 rgba(90, 44, 6, .8),
                0 2px 0 rgba(60, 28, 4, .7), 0 14px 26px -12px rgba(255, 130, 30, .95);
}
html.anim-forge .anim-btn--green:hover,
html.anim-forge .anim-ctrl--primary:hover {
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 2px),
        linear-gradient(180deg, #fff0cf 0%, #ffc169 22%, #e08c26 58%, #b06012 76%, #f7ab47 92%, #ffe3b0 100%);
    filter: none;
}
html.anim-forge .anim-btn--green:active,
html.anim-forge .anim-ctrl--primary:active {
    background: linear-gradient(180deg, #b06012, #e08c26 60%, #a1550f);
    box-shadow: inset 0 3px 8px rgba(70, 32, 4, .9), inset 0 -1px 0 rgba(255, 236, 200, .4);
}
/* 播放中 = 红热金属 */
html.anim-forge .anim-btn--green.is-playing,
html.anim-forge .anim-ctrl--primary.is-playing {
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px 2px),
        linear-gradient(180deg, #ffb08e 0%, #ec6a3c 24%, #b93d19 62%, #8d2b0e 78%, #d4531f 94%, #ff9a6c 100%);
    border-color: #5f1d06; color: #fff3e8 !important; text-shadow: 0 1px 0 rgba(70, 20, 2, .8);
    box-shadow: inset 0 1px 0 rgba(255, 236, 220, .8), inset 0 -1px 0 rgba(70, 20, 2, .8),
                0 2px 0 rgba(50, 14, 2, .7), 0 14px 26px -12px rgba(239, 68, 68, .95);
}
/* 幽灵按钮（返回）：磨砂钢贴片，不抢镜头 */
html.anim-forge .anim-btn--ghost {
    background: linear-gradient(180deg, rgba(96, 86, 74, .55), rgba(44, 37, 30, .55));
    border: 1px solid rgba(255, 214, 170, .22); color: #e6d3b8 !important;
    box-shadow: inset 0 1px 0 rgba(255, 240, 220, .28), 0 6px 14px -12px #000;
}
html.anim-forge .anim-btn--ghost:hover {
    background: linear-gradient(180deg, rgba(124, 110, 92, .7), rgba(58, 48, 38, .7));
    border-color: rgba(255, 214, 170, .4);
}

/* 速度控制：金属外壳 + 开槽滑轨 + 镀铬滑块 */
html.anim-forge .anim-speedwrap {
    background:
        repeating-linear-gradient(90deg, rgba(255, 236, 208, .06) 0 1px, transparent 1px 2px),
        linear-gradient(180deg, #5c5246 0%, #3a3129 34%, #2a231d 68%, #4a4137 100%);
    border: 1px solid #12100c; border-radius: 11px;
    color: #e6d3b8;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .8);
    box-shadow: inset 0 1px 0 rgba(255, 244, 226, .45), inset 0 -1px 0 rgba(0, 0, 0, .7),
                0 2px 0 rgba(0, 0, 0, .5), 0 10px 18px -12px rgba(0, 0, 0, .95);
}
html.anim-forge .anim-speedwrap input[type="range"] {
    height: 6px; border-radius: 999px;
    background:
        linear-gradient(180deg, #0a0705, #1c1510 60%, #2a2119);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .95), inset 0 -1px 0 rgba(255, 214, 170, .2);
}
html.anim-forge .anim-speedwrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
    background: radial-gradient(circle at 34% 26%, #ffffff 0%, #e6dfd2 34%, #9a938a 66%, #4a443c 100%);
    border: 1px solid #17130f;
    box-shadow: 0 1px 0 rgba(255, 248, 232, .7), 0 3px 6px rgba(0, 0, 0, .85),
                0 0 10px -2px rgba(255, 150, 60, .7);
    cursor: grab;
}
html.anim-forge .anim-speedwrap input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
html.anim-forge .anim-speedwrap output {
    color: #ffd7a8; text-shadow: 0 1px 0 rgba(0, 0, 0, .9);
    background: rgba(10, 7, 5, .8); border: 1px solid rgba(255, 214, 170, .22);
    border-radius: 5px; padding: 0 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .9);
}

/* 步数牌：冲压出来的金属铭牌 */
html.anim-forge .anim-step {
    background:
        repeating-linear-gradient(90deg, rgba(255, 236, 208, .06) 0 1px, transparent 1px 2px),
        linear-gradient(180deg, #4c4339 0%, #332c26 40%, #241e19 68%, #453d34 100%);
    border: 1px solid #12100c; border-radius: 9px;
    color: #ffddb2;
    text-shadow: 0 1px 0 #000, 0 -1px 0 rgba(255, 255, 255, .12);
    box-shadow: inset 0 1px 0 rgba(255, 244, 226, .4), inset 0 -1px 0 rgba(0, 0, 0, .75),
                0 2px 0 rgba(0, 0, 0, .5), 0 8px 16px -12px #000;
}

/* 图例：小金属贴片 */
html.anim-forge .anim-legendrow { color: #cbb49a; }
html.anim-forge .anim-lg {
    background:
        linear-gradient(180deg, rgba(122, 110, 96, .55), rgba(52, 44, 36, .6));
    border: 1px solid rgba(255, 214, 170, .26); border-radius: 999px; color: #f2e4cd;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .8);
    box-shadow: inset 0 1px 0 rgba(255, 244, 226, .35), 0 1px 0 rgba(0, 0, 0, .55);
}
html.anim-forge .anim-note {
    background: linear-gradient(180deg, rgba(34, 197, 94, .13), rgba(34, 197, 94, .05));
    border: 1px solid rgba(34, 197, 94, .32); border-left: 3px solid #22c55e; color: #cdeed8;
}
/* ---------- 参考代码块：铸铁外框 + 金属拉丝标题条 + 暖白色「代码纸」 ---------- */
html.anim-forge .anim-codebox {
    position: relative; border-radius: 12px; padding: 0 0 14px; overflow: hidden;
    border: 1px solid rgba(255, 176, 96, .34);
    background:
        repeating-linear-gradient(90deg, rgba(255, 236, 208, .05) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, rgba(46, 32, 22, .98), rgba(23, 16, 11, .99));
    box-shadow: inset 0 1px 0 rgba(255, 216, 172, .22), 0 22px 46px -32px #000;
}
/* 标题条：拉丝金属 + 四角螺钉感 */
html.anim-forge .anim-codehead {
    margin: 0 0 10px; padding: 10px 18px;
    font-size: 13px; font-weight: 700; color: #ffddb2;
    letter-spacing: .04em; text-shadow: 0 1px 0 rgba(0, 0, 0, .85);
    background:
        repeating-linear-gradient(90deg, rgba(255, 240, 216, .08) 0 1px, transparent 1px 2px),
        linear-gradient(180deg, #6d6254 0%, #4b4238 22%, #332c25 58%, #2a241e 76%, #4a4137 100%);
    border-bottom: 1px solid #100d09;
    box-shadow: inset 0 1px 0 rgba(255, 244, 226, .5), inset 0 -1px 0 rgba(0, 0, 0, .8),
                0 6px 14px -10px rgba(0, 0, 0, .95);
}
html.anim-forge .anim-codehead i { color: #d3bb9a; font-weight: 500; }
html.anim-forge .anim-codehead b { color: #ffcf94; }
html.anim-forge .anim-card__meta { color: #ffc47a; }
/* 代码纸：暖白（老师要求代码不能是黑底），外面套一圈金属压边 */
html.anim-forge .anim-code {
    margin: 0 14px; border-radius: 8px; background: #ffffff;
    border: 1px solid #0f0c08;
    box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 214, 170, .5),
                0 2px 0 rgba(0, 0, 0, .55), 0 12px 26px -18px #000;
}
html.anim-forge .anim-line:hover { background: #f6f9fc; }
html.anim-forge .anim-ln { color: #b2a693; }
html.anim-forge .anim-line.is-cur {
    background: linear-gradient(90deg, rgba(255, 176, 96, .3), rgba(255, 176, 96, .12));
    border-left-color: #cf7a1d;
}
html.anim-forge .anim-line.is-cur .anim-ln { color: #a1550f; }
html.anim-forge .anim-line.is-cur .anim-src { color: #2b1a08; }

/* ---------- 算法说明 / 时间复杂度：深色铁板 + 浅色字 ---------- */
html.anim-forge .anim-doc {
    border-radius: 12px; padding: 2px 18px 16px; margin-top: 14px;
    border: 1px solid rgba(255, 176, 96, .3);
    background:
        repeating-linear-gradient(90deg, rgba(255, 236, 208, .04) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, rgba(40, 27, 18, .97), rgba(20, 13, 9, .98));
    box-shadow: inset 0 1px 0 rgba(255, 216, 172, .18), 0 22px 46px -32px #000;
}
html.anim-forge .anim-doc__sec + .anim-doc__sec { border-top: 1px dashed rgba(255, 176, 96, .2); }
html.anim-forge .anim-doc h3 {
    color: #ffddb2; font-weight: 700; letter-spacing: .05em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .85);
    padding-left: 10px; border-left: 3px solid #f2a044;
}
html.anim-forge .anim-doc p { color: #d7c4a9; }
html.anim-forge .anim-doc p b { color: #ffe6c6; }
html.anim-forge .anim-doc__tip {
    background: linear-gradient(180deg, rgba(242, 160, 68, .14), rgba(242, 160, 68, .06));
    border-left: 3px solid #f2a044; color: #e8d6bd;
}
html.anim-forge .anim-cx__row { color: #d7c4a9; }
html.anim-forge .anim-cx__row + .anim-cx__row { border-top: 1px dashed rgba(255, 176, 96, .16); }
html.anim-forge .anim-cx__row i { color: #b39c80; }
html.anim-forge .anim-cx__row span { color: #e2d0b6; }
html.anim-forge .anim-cx__row span b { color: #ffe6c6; }

/* ================================================================
 * 深色容器的纯色兜底（放在最后，覆盖上面的 background 简写）：
 * 一是让渐变边缘不出杂色，二是让对比度审查脚本能算准背景色。
 * ================================================================ */
html.anim-forge { background-color: #0a0705; }
html.anim-forge body { background-color: #0c0806; }
html.anim-forge .anim-studio { background-color: #140c07; }
html.anim-forge .anim-stage { background-color: #1b0f09; }
html.anim-forge .anim-panel { background-color: #1a1109; }
html.anim-forge .anim-doc { background-color: #180f0a; }
html.anim-forge .anim-codebox { background-color: #170f09; }
html.anim-forge .anim-card { background-color: #1a120b; }
html.anim-forge .anim-head { background-color: #241810; }
html.anim-forge .anim-aside { background-color: #1c120c; }
html.anim-forge .anim-mainhead { background-color: #20150e; }
html.anim-forge .anim-codehead { background-color: #3d352c; }
html.anim-forge .anim-flyer { background-color: #1a120b; }

/* 深色舞台上还要补对比度的几处（刻度、编号、冲压牌、汉诺塔圆盘） */
html.anim-forge .anim-axis__tick { color: #e6d3b4; }
html.anim-forge .anim-axis__tick i { background: rgba(255, 196, 140, .5); }
html.anim-forge .anim-bar__idx { color: #e0cbaa; }
html.anim-forge .anim-bar__plate { background-color: #d3cdc1; }
html.anim-forge .anim-disk { background-color: #9aa6b4; }
html.anim-forge .anim-peg.is-cur .anim-disk { background-color: #3fbf74; }
html.anim-forge .anim-peg.is-swap .anim-disk { background-color: #d94a4a; }

/* ---------- 参考代码：深色铁板 + 深底语法高亮（和整页统一，代码区不再是白纸） ---------- */
html.anim-forge .anim-code {
    margin: 0 14px; border-radius: 8px; background: #150e09;
    border: 1px solid #0a0705;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 214, 170, .12),
                inset 0 -14px 26px -22px rgba(255, 130, 40, .55),
                0 2px 0 rgba(0, 0, 0, .55), 0 12px 26px -18px #000;
}
html.anim-forge .anim-line { border-left: 3px solid transparent; }
html.anim-forge .anim-line:hover { background: rgba(255, 180, 96, .09); }
html.anim-forge .anim-ln { color: #8a7c6b; }
html.anim-forge .anim-src { color: #f3e7d5; }
html.anim-forge .anim-line.is-cur {
    background: linear-gradient(90deg, rgba(242, 160, 68, .26), rgba(242, 160, 68, .08));
    border-left-color: #f2a044;
    box-shadow: inset 0 0 0 1px rgba(255, 176, 96, .2);
}
html.anim-forge .anim-line.is-cur .anim-ln { color: #ffc47a; }
html.anim-forge .anim-line.is-cur .anim-src { color: #fff3e2; }
/* 深底语法配色 */
html.anim-forge .c-kw { color: #c9a6ff; }
html.anim-forge .c-ty { color: #7fd8ef; }
html.anim-forge .c-st { color: #9ef0b6; }
html.anim-forge .c-nu { color: #9ec3ff; }
html.anim-forge .c-cm { color: #a2937f; }
html.anim-forge .c-pp { color: #ffc47a; }

/* 高亮行跟着状态色走（--stepc 由 anim.js 每帧按当前元素设置）：
   紫=当前最小 / 蓝=扫描中 / 红=交换 / 绿=已排序 / 橙=默认 */
html.anim-forge .anim-code { --stepc: #f2a044; }
html.anim-forge .anim-line.is-cur {
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--stepc) 34%, transparent) 0%,
        color-mix(in srgb, var(--stepc) 12%, transparent) 62%,
        transparent 100%);
    border-left-color: var(--stepc);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stepc) 42%, transparent),
                0 0 26px -16px var(--stepc);
}
html.anim-forge .anim-line.is-cur .anim-ln {
    color: color-mix(in srgb, var(--stepc) 62%, #ffffff);
    text-shadow: 0 0 10px color-mix(in srgb, var(--stepc) 55%, transparent);
}
html.anim-forge .anim-line.is-cur .anim-src { color: #fff7ec; }
/* 行首再点一个小色点，扫一眼就知道这行属于哪种状态 */
html.anim-forge .anim-line.is-cur::before {
    content: ''; position: absolute; left: 2px; top: 50%; width: 5px; height: 5px;
    margin-top: -2.5px; border-radius: 50%; background: var(--stepc);
    box-shadow: 0 0 8px 1px color-mix(in srgb, var(--stepc) 70%, transparent);
}
html.anim-forge .anim-line { position: relative; }

/* ==================================================================
 * 主题层通用默认
 * 手办主题专用的小脸 / 圆底座，其它主题一律隐藏（金属主题靠这条）
 * ================================================================== */
.anim-bar__face, .anim-bar__pedestal { display: none; }

/* ============ 浅色主题层：原始风格(classic) / 手办卡通(toy) 共用 ============ */
/* 自动生成：浅色主题层（原始风格 / 手办卡通 共用）—— 来源 public/anim.css.bak-bars */
/* 算法动画页样式（全部 .anim-* 前缀，不动 OJ 原有样式）
 * 视觉对齐参考站：浅灰动画区 + 灰绿色柱子 + [i] 编号行 + 绿色按钮 + 绿边说明条 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-page { max-width: 1240px; margin: 0 auto; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-head {
    position: relative; overflow: hidden;
    background:
        radial-gradient(120% 140% at 0% -20%, rgba(91, 110, 225, .07), transparent 58%),
        linear-gradient(180deg, #fff, #fcfcfb);
    border: 1px solid #e9e9e4; border-radius: 12px; padding: 18px 22px; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    box-shadow: 0 1px 2px rgba(24, 30, 40, .03);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-head h1 { margin: 0 0 7px; font-size: 22px; font-weight: 600; letter-spacing: -.015em; color: #131c26; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-head p { margin: 0; color: #5f6773; font-size: 12.8px; line-height: 1.85; max-width: 78ch; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-head b { color: #33405a; font-weight: 600; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-wrap { display: flex; gap: 14px; align-items: flex-start; }

/* ---------- 播放器顶部：排版放宽（窄屏也不挤） ---------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead--player {
    align-items: flex-start; flex-wrap: wrap; gap: 10px 16px; padding: 18px 20px 16px;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead--player .anim-mainhead__l { flex: 1 1 340px; min-width: 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead--player #anim-back { order: 2; margin-left: auto; flex: 0 0 auto; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead--player .anim-crumb {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead--player .anim-title-row { align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead--player h2 {
    font-size: clamp(17px, 1.5vw, 21px); line-height: 1.25; margin: 0; letter-spacing: -.015em;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead--player p { margin-top: 9px; font-size: 12.8px; line-height: 1.7; max-width: 70ch; color: #6b7488; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__name { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================
 * 图标（统一 SVG 线性图标；不再用 emoji）
 * ================================================================ */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ico { width: 18px; height: 18px; flex: 0 0 auto; display: block; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ico--sm { width: 13px; height: 13px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ico--xs { width: 14px; height: 14px; }

/* ---------------- 左侧 ---------------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-aside {
    flex: 0 0 224px; background: #fdfdfc; border: 1px solid #e9e9e4; border-radius: 12px;
    padding: 12px 10px 12px; position: sticky; top: 12px;
    max-height: calc(100vh - 226px); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; box-shadow: 0 1px 2px rgba(24, 30, 40, .03);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-aside::-webkit-scrollbar { width: 6px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-aside::-webkit-scrollbar-thumb { background: #dcdfe4; border-radius: 3px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-group { margin-bottom: 4px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-group__title {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #2c343f;
    padding: 9px 8px 7px; margin-bottom: 2px; cursor: pointer; user-select: none;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-group__ico {
    width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
    background: rgba(var(--rgb), .1); color: rgba(var(--rgb), .95); flex: 0 0 auto;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-group__ico .anim-ico { width: 14px; height: 14px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-group__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-group__title i, html:is(.anim-theme-classic,.anim-theme-toy) .anim-chapter i {
    font-style: normal; font-weight: 500; color: #a8adb6; font-size: 11px; margin-left: auto;
    font-variant-numeric: tabular-nums;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-caret { display: inline-block; width: 9px; flex: 0 0 9px; color: #b3b9c2; font-size: 10px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chapter {
    display: flex; align-items: center; gap: 6px;
    margin-left: 12px; padding: 6px 9px 6px 10px; border-left: 1px solid #eceded;
    border-radius: 0 7px 7px 0; font-size: 12.5px; line-height: 1.55; color: #3a424d !important;
    text-decoration: none !important; transition: background .14s, border-color .14s, color .14s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chapter:hover { background: #f3f6fb; border-left-color: #cddffb; color: #1f3a63 !important; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chapter.is-on {
    background: linear-gradient(180deg, #3f7ee0, #2f6bd0); border-left-color: #1f4fa8;
    color: #fff !important; font-weight: 600; border-radius: 7px;
    box-shadow: 0 4px 10px -6px rgba(47, 107, 208, .9);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chapter.is-on i { color: #d8e6ff; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-tip {
    font-size: 11px; color: #9aa1ab; padding: 9px 8px 2px; line-height: 1.7;
    border-top: 1px solid #f0f1ee; margin-top: 6px;
}

/* ---------------- 右侧 ---------------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-main { flex: 1 1 auto; min-width: 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead {
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, #fff, #fcfcfb);
    border: 1px solid #e9e9e4; border-radius: 12px; padding: 16px 20px; margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(24, 30, 40, .03);
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead__l { min-width: 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead__mark {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 96px; height: 96px; color: rgba(var(--rgb), .085); pointer-events: none;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead__mark .anim-ico { width: 96px; height: 96px; stroke-width: 1px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead h2 {
    margin: 8px 0 5px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: #16202c;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead p { margin: 0; font-size: 12.5px; color: #8a919b; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-crumb {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; letter-spacing: .02em; color: rgba(var(--rgb), .95);
    background: rgba(var(--rgb), .09); border: 1px solid rgba(var(--rgb), .14);
    border-radius: 999px; padding: 3px 10px 3px 8px; font-weight: 600;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-title-row { display: flex; align-items: center; gap: 10px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-list__head { font-size: 14px; font-weight: 600; color: #3b4a6b; margin: 6px 0 10px; }

/* ================================================================
 * 卡片：分层光效（底色渐变 → 蓝图网格 → 噪点 → 内容水印 → 鼠标柔光
 *       → 旋转描边 → 四角取景框 → 玻璃质感内容面板）
 * 每个章节一套主色（--rgb / --ink），每张卡印自己的算法图标当水印。
 * ================================================================ */

@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-auto-rows: 1fr;
    gap: 16px; align-items: stretch;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card {
    --rx: 0deg; --ry: 0deg; --ty: 0px; --mx: 50%; --my: 0%;
    position: relative; isolation: isolate; overflow: hidden; min-width: 0; height: 100%;
    display: block; text-decoration: none !important; border-radius: 16px; padding: 11px;
    border: 1px solid rgba(var(--rgb), .24);
    background:
        radial-gradient(135% 105% at 106% -12%, rgba(var(--rgb), .38), transparent 56%),
        radial-gradient(90% 80% at -10% 122%, rgba(var(--rgb), .2), transparent 64%),
        linear-gradient(152deg, rgba(var(--rgb), .24) 0%, rgba(var(--rgb), .09) 48%, #fff 90%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 22, 32, .05),
                0 16px 34px -24px rgba(var(--rgb), .9);
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--ty));
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s, border-color .28s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover {
    border-color: rgba(var(--rgb), .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 2px 6px rgba(16, 22, 32, .06),
                0 26px 48px -28px rgba(var(--rgb), 1), 0 0 0 4px rgba(var(--rgb), .06);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:focus-visible { outline: 2px solid rgba(var(--rgb), .65); outline-offset: 3px; }

/* ① 蓝图网格 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__grid {
    position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, rgba(var(--rgb), .07) 0 1px, transparent 1px 9px),
        repeating-linear-gradient(90deg, rgba(var(--rgb), .07) 0 1px, transparent 1px 9px),
        repeating-linear-gradient(0deg, rgba(var(--rgb), .13) 0 1px, transparent 1px 45px),
        repeating-linear-gradient(90deg, rgba(var(--rgb), .13) 0 1px, transparent 1px 45px);
    -webkit-mask-image: radial-gradient(132% 132% at 100% 0%, #000 10%, transparent 82%);
    mask-image: radial-gradient(132% 132% at 100% 0%, #000 10%, transparent 82%);
    opacity: .8; transition: opacity .3s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__grid { opacity: 1; }

/* ② 噪点（软光混合，制造颗粒质感） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__noise {
    position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
    opacity: .55; mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* ③ 内容水印：这张卡自己的算法图标，虚线缓慢流动 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__mark {
    position: absolute; right: 20px; top: -18px; z-index: 2; pointer-events: none;
    width: 104px; height: 104px; color: rgba(var(--rgb), .25); mix-blend-mode: multiply;
    -webkit-mask-image: radial-gradient(56% 56% at 74% 32%, #000 14%, transparent 78%);
    mask-image: radial-gradient(56% 56% at 74% 32%, #000 14%, transparent 78%);
    transition: color .3s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__mark .anim-ico { width: 106px; height: 106px; stroke-width: 1.1px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__mark svg * { stroke-dasharray: 4 3; animation: animDash 16s linear infinite; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__mark { color: rgba(var(--rgb), .34); }

@keyframes animDash { to { stroke-dashoffset: -140; } }

/* ④ 鼠标位置的柔光 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__spot {
    position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
    background: radial-gradient(190px 190px at var(--mx) var(--my), rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 62%);
    opacity: 0; transition: opacity .25s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__spot { opacity: .9; }

/* ⑤ 旋转描边（悬停时沿边框转一圈的高光） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__ring {
    position: absolute; inset: 0; border-radius: inherit; padding: 1.2px; z-index: 3; pointer-events: none;
    background: conic-gradient(from var(--ang), transparent 0 56%, rgba(var(--rgb), .95) 76%,
        rgba(var(--rgb), .3) 87%, transparent 96%);
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    mask-composite: exclude;
    opacity: 0; transition: opacity .3s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__ring { opacity: 1; animation: animRing 3.2s linear infinite; }

@keyframes animRing { to { --ang: 360deg; } }

/* ⑥ 四角取景框 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__corner {
    position: absolute; width: 11px; height: 11px; z-index: 2; pointer-events: none;
    border: 0 solid rgba(var(--rgb), .5); transition: width .25s, height .25s, border-color .25s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__corner--tl { left: 7px; top: 7px; border-left-width: 1.4px; border-top-width: 1.4px; border-top-left-radius: 6px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__corner--tr { right: 7px; top: 7px; border-right-width: 1.4px; border-top-width: 1.4px; border-top-right-radius: 6px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__corner--bl { left: 7px; bottom: 7px; border-left-width: 1.4px; border-bottom-width: 1.4px; border-bottom-left-radius: 6px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__corner--br { right: 7px; bottom: 7px; border-right-width: 1.4px; border-bottom-width: 1.4px; border-bottom-right-radius: 6px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__corner { width: 16px; height: 16px; border-color: rgba(var(--rgb), .85); }

/* ⑦ 章节内序号 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__idx {
    position: absolute; right: 14px; top: 11px; z-index: 2; pointer-events: none;
    font: 700 10.5px/1 ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
    letter-spacing: .2em; color: rgba(var(--rgb), .55);
}

/* ⑧ 玻璃质感内容面板 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__body {
    position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .52));
    border: 1px solid rgba(255, 255, 255, .78); border-radius: 11px; padding: 13px 14px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 6px 16px -14px rgba(var(--rgb), .85);
    -webkit-backdrop-filter: blur(3px) saturate(1.06); backdrop-filter: blur(3px) saturate(1.06);
    transition: background .28s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__body {
    background: linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .68));
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__top { display: flex; align-items: center; gap: 10px; min-width: 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__badge {
    width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto;
    display: grid; place-items: center; color: var(--ink, #41529e);
    background: linear-gradient(160deg, rgba(255, 255, 255, .98), rgba(var(--rgb), .2));
    border: 1px solid rgba(var(--rgb), .34);
    box-shadow: 0 6px 14px -10px rgba(var(--rgb), 1), inset 0 1px 0 #fff;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__badge {
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 12px 22px -12px rgba(var(--rgb), 1), inset 0 1px 0 #fff;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__badge .anim-ico { width: 20px; height: 20px; stroke-width: 1.85; transition: transform .28s; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__badge .anim-ico { transform: rotate(-5deg) scale(1.04); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__badge--lg { width: 40px; height: 40px; border-radius: 12px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__badge--lg .anim-ico { width: 22px; height: 22px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__title {
    font-size: 15px; font-weight: 600; color: #131c26; min-width: 0; letter-spacing: -.012em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__desc {
    font-size: 12.5px; color: #59616d; line-height: 1.62; flex: 1 1 auto;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__time {
    font-size: 11.5px; font-weight: 600; color: var(--ink, #41529e);
    background: rgba(255, 255, 255, .92); border: 1px solid rgba(var(--rgb), .24);
    border-radius: 7px; padding: 2px 8px; white-space: nowrap; font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
    max-width: 62%; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 1px 2px rgba(16, 22, 32, .04);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__go {
    display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600;
    letter-spacing: .01em; color: var(--ink, #41529e); white-space: nowrap;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__go .anim-ico { transition: transform .22s; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__go .anim-ico { transform: translateX(4px); }

/* ---------------- 点击卡片：飞到屏幕正中 → 流光 + 放大 → 淡入进页面（1.5s） ---------------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-launch {
    position: fixed; inset: 0; z-index: 900; pointer-events: none;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-launch::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(120% 100% at 50% 45%, rgba(20, 28, 42, .16), rgba(14, 20, 30, .42));
    -webkit-backdrop-filter: blur(3px) saturate(.92);
    backdrop-filter: blur(3px) saturate(.92);
    animation: animVail .34s ease both;
}

@keyframes animVail { from { opacity: 0; } to { opacity: 1; } }

/* 飞出去的那张卡（克隆体，位置/尺寸由 JS 按原卡片设置） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer {
    position: fixed !important; margin: 0 !important; z-index: 2; pointer-events: none;
    transform-origin: center center; will-change: transform, opacity;
    border-color: rgba(var(--rgb), .5) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95),
                0 40px 90px -46px rgba(16, 22, 32, .75), 0 0 0 1px rgba(var(--rgb), .34),
                0 0 60px -22px rgba(var(--rgb), .55) !important;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer { background-color: #fff; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer .anim-card__body {
    background: linear-gradient(180deg, #ffffff, #f7f9fb);
    -webkit-backdrop-filter: none; backdrop-filter: none;
    border-color: rgba(255, 255, 255, .95);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer .anim-card__grid { opacity: 1; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer .anim-card__mark { color: rgba(var(--rgb), .34); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer .anim-card__badge { transform: scale(1.06); }

/* 流光带（飞行中触发一次） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--sweep .anim-card__sweep { animation: animSweep .62s cubic-bezier(.3, .7, .2, 1) both; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--sweep .anim-card__ring { opacity: 1; animation: animRing 1.1s linear infinite; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__sweep {
    position: absolute; inset: -30% -60%; z-index: 4; pointer-events: none; opacity: 0;
    background: linear-gradient(104deg, transparent 34%, rgba(255, 255, 255, 1) 46%,
        rgba(var(--rgb), .82) 51%, rgba(255, 255, 255, .72) 55%, transparent 68%);
    transform: translateX(-90%);
}

@keyframes animSweep {
    0% { opacity: 0; transform: translateX(-90%); }
    16% { opacity: 1; }
    100% { opacity: 0; transform: translateX(90%); }
}

/* 粒子 / 光晕拖尾画布（在卡片下面一层） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-particles {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
}

/* 落地后「卡片展开成播放页」：卡片内容先淡出，只留白色面板长大 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--expand .anim-card__body, html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--expand .anim-card__idx, html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--expand .anim-card__corner, html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--expand .anim-card__ring {
    opacity: 0; transition: opacity .18s ease-out;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--expand .anim-card__grid { opacity: .35; transition: opacity .3s; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--expand .anim-card__mark { opacity: 0; transition: opacity .2s; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-flyer--expand {
    background: #fff !important;
    box-shadow: 0 30px 80px -40px rgba(16, 22, 32, .6), 0 0 0 1px rgba(var(--rgb), .2) !important;
}

/* 其它卡片后退虚化（把注意力交给飞出去的那张） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cards.is-dim .anim-card:not(.anim-flyer) {
    opacity: .38; filter: saturate(.65) blur(.8px); transform: scale(.98);
    transition: opacity .35s, transform .35s, filter .35s;
}

/* 新页面淡入 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-main.is-enter { animation: animEnter .46s cubic-bezier(.2, .75, .2, 1) both; }

@keyframes animEnter {
    from { opacity: 0; transform: translateY(14px) scale(.99); }
    to { opacity: 1; transform: none; }
}

/* 点击某张卡时，其它卡片后退虚化（把注意力交给被点的那张） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cards.is-dim .anim-card:not(.is-launching) {
    opacity: .42; filter: saturate(.7) blur(.6px); transform: scale(.982);
    transition: opacity .3s, transform .3s, filter .3s;
}

@media (prefers-reduced-motion: reduce) {
    html:is(.anim-theme-classic,.anim-theme-toy) .anim-card.is-launching { transform: none !important; }

    html:is(.anim-theme-classic,.anim-theme-toy) .anim-card.is-launching .anim-card__sweep, html:is(.anim-theme-classic,.anim-theme-toy) .anim-card.is-launching .anim-card__ring, html:is(.anim-theme-classic,.anim-theme-toy) .anim-main.is-enter { animation: none !important; }
}

/* 站内保持一致：分组主色会在 mainhead 上用 --rgb，这里给它一个兜底 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-mainhead { --rgb: 91, 110, 225; }

/* 减动效偏好下全部动画停掉（只看静态分层） */

@media (prefers-reduced-motion: reduce) {
    html:is(.anim-theme-classic,.anim-theme-toy) .anim-card { transform: none !important; }

    html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__mark svg *, html:is(.anim-theme-classic,.anim-theme-toy) .anim-card:hover .anim-card__ring { animation: none !important; }
}

/* ---------------- 面板 / 工具条（参考站样式） ---------------- */
/* ================================================================
 * 播放器：控制台（亮） + 演播室舞台（深色）
 * 舞台上的所有渲染器都用同一套深色令牌，视觉才统一
 * ================================================================ */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-panel {
    background: linear-gradient(180deg, #fff, #fbfbfa);
    border: 1px solid #e9e9e4; border-radius: 14px; padding: 14px 14px 12px;
    box-shadow: 0 1px 2px rgba(24, 30, 40, .03), 0 18px 40px -34px rgba(24, 30, 40, .5);
}

/* ---------- 顶部：数据输入 ---------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-datarow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-datarow label { font-size: 12.5px; color: #6b7280; font-weight: 600; letter-spacing: .02em; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-input {
    flex: 1 1 300px; min-width: 200px; height: 34px; padding: 0 12px;
    border: 1px solid #e3e6ea; border-radius: 9px; background: #fff;
    font: 13px ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; color: #26313f;
    box-shadow: inset 0 1px 2px rgba(16, 22, 32, .03);
    transition: border-color .18s, box-shadow .18s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-input:focus { outline: none; border-color: rgba(var(--rgb, 91, 110, 225), .55); box-shadow: 0 0 0 3px rgba(var(--rgb, 91, 110, 225), .12); }

/* ---------- 工具按钮（次要） ---------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border-radius: 9px; border: 1px solid #e3e6ea; background: #fff; color: #33405a !important;
    font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none !important;
    white-space: nowrap; transition: border-color .16s, box-shadow .16s, transform .12s, background .16s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn:hover { border-color: rgba(var(--rgb, 91, 110, 225), .45); box-shadow: 0 6px 14px -10px rgba(var(--rgb, 91, 110, 225), .9); transform: translateY(-1px); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn:active { transform: translateY(0); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn .anim-ico { width: 14px; height: 14px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn--green {
    background: linear-gradient(180deg, #4f8557, #3f6f47); border-color: #3a6641; color: #fff !important;
    box-shadow: 0 8px 18px -14px rgba(63, 111, 71, 1), inset 0 1px 0 rgba(255, 255, 255, .22);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn--green:hover { background: linear-gradient(180deg, #57905f, #457a4e); border-color: #3a6641; color: #fff !important; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn--green.is-playing { background: linear-gradient(180deg, #d3a94b, #b98f30); border-color: #a87f28; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn--ghost { border-color: transparent; background: transparent; color: #6b7280 !important; padding: 0 8px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-btn--ghost:hover { background: #f3f5f7; box-shadow: none; transform: none; }

/* ---------- 控制条 ---------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ctrlrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ctrl {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
    border-radius: 11px; border: 1px solid #e3e6ea; background: #fff; color: #2c3a4d !important;
    font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16, 22, 32, .04);
    transition: transform .14s, box-shadow .18s, border-color .18s, background .18s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ctrl .anim-ico { width: 16px; height: 16px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ctrl:hover { transform: translateY(-1px); border-color: rgba(var(--rgb, 91, 110, 225), .4); box-shadow: 0 10px 20px -14px rgba(var(--rgb, 91, 110, 225), .9); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ctrl:active { transform: translateY(0) scale(.99); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ctrl--primary {
    background: linear-gradient(180deg, rgba(var(--rgb, 91, 110, 225), .95), rgba(var(--rgb, 91, 110, 225), .75));
    border-color: rgba(var(--rgb, 91, 110, 225), .9); color: #fff !important;
    box-shadow: 0 12px 26px -16px rgba(var(--rgb, 91, 110, 225), 1), inset 0 1px 0 rgba(255, 255, 255, .3);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ctrl--primary:hover { filter: brightness(1.05); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ctrl--primary.is-playing {
    background: linear-gradient(180deg, #e0b455, #c19a33); border-color: #b08a2c;
    box-shadow: 0 12px 26px -16px rgba(193, 154, 51, 1), inset 0 1px 0 rgba(255, 255, 255, .3);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-speedwrap {
    display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 14px;
    border-radius: 11px; border: 1px solid #e9ecef; background: #fafbfc;
    font-size: 12.5px; color: #5b6675; font-weight: 600;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-speedwrap input[type="range"] {
    width: 132px; height: 4px; -webkit-appearance: none; appearance: none;
    background: linear-gradient(90deg, rgba(var(--rgb, 91, 110, 225), .85), rgba(var(--rgb, 91, 110, 225), .25));
    border-radius: 999px; outline: none;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-speedwrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
    background: #fff; border: 2px solid rgba(var(--rgb, 91, 110, 225), .9);
    box-shadow: 0 2px 6px rgba(16, 22, 32, .25); cursor: pointer;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-speedwrap output { font: 700 12px ui-monospace, Consolas, monospace; color: rgba(var(--rgb, 91, 110, 225), 1); min-width: 22px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-step {
    margin-left: auto; font: 700 12.5px ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
    letter-spacing: .04em; color: #47546a; background: #f4f6f8; border: 1px solid #e9ecef;
    border-radius: 9px; padding: 6px 11px; font-variant-numeric: tabular-nums;
}

/* ---------- 图例 ---------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-legendrow {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
    font-size: 12px; color: #5b6675;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lg {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px;
    border-radius: 999px; background: #f7f9fa; border: 1px solid #eaedf0;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chip {
    display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .14);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chip.is-cur { background: #a855f7; box-shadow: 0 0 0 3px rgba(168, 85, 247, .18); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chip.is-cmp { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chip.is-swap { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chip.is-ok, html:is(.anim-theme-classic,.anim-theme-toy) .anim-chip.is-vis { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chip.is-fresh { background: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, .18); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chip.is-dep { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }

/* ================================================================
 * 游戏舞台（浅色场景）：柔和渐变 + 飘浮光斑 + 关卡条 + 四角 + 斜向光带
 * 不再用黑底 —— 底色跟着算法所属分组的色系走，画面更像游戏里的关卡场景
 * ================================================================ */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio {
    position: relative; overflow: hidden; border-radius: 18px; padding: 12px 14px 14px;
    border: 1px solid rgba(96, 88, 70, .22);
    background: linear-gradient(180deg, #fffefb, #f8f5ec 58%, #f1ecdf);
    box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(60, 52, 38, .05),
                0 22px 44px -32px rgba(60, 52, 38, .55);
}

/* 场景纹样（按分组换） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    -webkit-mask-image: radial-gradient(130% 120% at 50% 0%, #000 18%, transparent 86%);
    mask-image: radial-gradient(130% 120% at 50% 0%, #000 18%, transparent 86%);
    opacity: .9;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio[data-pat="rules"]::before {
    background-image: repeating-linear-gradient(90deg, rgba(120, 113, 98, .1) 0 1px, transparent 1px 13px);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio[data-pat="dots"]::before {
    background-image: radial-gradient(circle at 1px 1px, rgba(120, 113, 98, .18) 1.2px, transparent 2px);
    background-size: 15px 15px;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio[data-pat="diag"]::before {
    background-image: repeating-linear-gradient(135deg, rgba(120, 113, 98, .09) 0 1px, transparent 1px 15px);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio[data-pat="mesh"]::before {
    background-image:
        repeating-linear-gradient(60deg, rgba(120, 113, 98, .09) 0 1px, transparent 1px 19px),
        repeating-linear-gradient(-60deg, rgba(120, 113, 98, .07) 0 1px, transparent 1px 19px);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio[data-pat="grid"]::before {
    background-image:
        repeating-linear-gradient(0deg, rgba(120, 113, 98, .08) 0 1px, transparent 1px 17px),
        repeating-linear-gradient(90deg, rgba(120, 113, 98, .08) 0 1px, transparent 1px 17px);
}

/* 飘浮光斑（游戏场景的空气感） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__orb {
    position: absolute; border-radius: 50%; pointer-events: none; filter: blur(6px);
    background: radial-gradient(circle at 35% 30%, rgba(var(--rgb, 91, 110, 225), .22), transparent 72%);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__orb--1 { width: 120px; height: 120px; left: -30px; top: -40px; animation: animFloat 11s ease-in-out infinite; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__orb--2 { width: 86px; height: 86px; right: 6%; top: -30px; animation: animFloat 14s ease-in-out infinite reverse; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__orb--3 { width: 150px; height: 150px; right: -50px; bottom: -70px; animation: animFloat 17s ease-in-out infinite; }

@keyframes animFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(14px, 12px, 0) scale(1.08); }
}

/* 四角（圆润的游戏取景框） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__corner {
    position: absolute; width: 18px; height: 18px; pointer-events: none; z-index: 3;
    border: 0 solid rgba(58, 64, 78, .55);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__corner--tl { left: 8px; top: 8px; border-left-width: 2.5px; border-top-width: 2.5px; border-top-left-radius: 10px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__corner--tr { right: 8px; top: 8px; border-right-width: 2.5px; border-top-width: 2.5px; border-top-right-radius: 10px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__corner--bl { left: 8px; bottom: 8px; border-left-width: 2.5px; border-bottom-width: 2.5px; border-bottom-left-radius: 10px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__corner--br { right: 8px; bottom: 8px; border-right-width: 2.5px; border-bottom-width: 2.5px; border-bottom-right-radius: 10px; }

/* 关卡条 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__top {
    position: relative; z-index: 3; display: flex; align-items: center; gap: 8px;
    padding: 0 4px 10px; font-size: 12px; color: #55617a; font-weight: 600; flex-wrap: wrap;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__dot {
    width: 8px; height: 8px; border-radius: 50%; background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); animation: animPulse 1.9s ease-in-out infinite;
}

@keyframes animPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__name { color: #2f3542; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__pat {
    margin-left: auto; font: 700 10.5px ui-monospace, Consolas, monospace; letter-spacing: .16em;
    color: #6b6250; background: rgba(96, 88, 70, .07);
    border: 1px solid rgba(96, 88, 70, .16); border-radius: 999px; padding: 3px 10px;
}

/* 关卡标签 + 进度条（游戏 HUD 家具） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-studio__lv {
    font: 800 10.5px ui-monospace, Consolas, monospace; letter-spacing: .14em;
    color: #fffdf6; background: linear-gradient(180deg, #444c5c, #2b313d);
    border-radius: 6px; padding: 3px 8px; box-shadow: 0 4px 10px -6px rgba(30, 34, 42, .9);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-progress {
    position: relative; z-index: 3; height: 7px; margin: 0 4px 10px; border-radius: 999px;
    background: rgba(96, 88, 70, .1);
    box-shadow: inset 0 1px 2px rgba(96, 88, 70, .16);
    overflow: hidden;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-progress i {
    display: block; height: 100%; border-radius: 999px; width: 0;
    background: linear-gradient(90deg, #f0b23f, #dd8f1c);
    box-shadow: 0 0 12px rgba(221, 143, 28, .8);
    transition: width .22s cubic-bezier(.2, .8, .2, 1);
}

/* 舞台本体：半透明白，让下面的场景纹样透上来 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-stage {
    position: relative; min-height: 250px; border-radius: 13px; padding: 14px 16px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(253, 251, 247, .82));
    border: 1px solid rgba(255, 255, 255, .95);
    box-shadow: inset 0 1px 0 #fff, inset 0 -18px 34px -26px rgba(var(--rgb, 91, 110, 225), .9),
                0 8px 22px -20px rgba(var(--rgb, 91, 110, 225), .9);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-stage > * { position: relative; z-index: 1; }

/* ---------- 下方说明条 ---------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-note {
    margin-top: 10px; border-radius: 11px; padding: 11px 14px;
    background: linear-gradient(180deg, rgba(34, 197, 94, .07), rgba(34, 197, 94, .03));
    border: 1px solid rgba(34, 197, 94, .22); border-left: 3px solid #22c55e;
    font-size: 13px; color: #2f4a38; line-height: 1.7;
}

/* ================================================================
 * 舞台里的渲染器（统一深色令牌）
 * ================================================================ */
/* 柱子：玻璃能量管（游戏/科技感）
   结构：.anim-bar → 数值胶囊 / .anim-bar__tube（玻璃管，固定高度）
         → .anim-bar__fill（液柱，立体：顶面椭圆 + 侧光 + 高光条）
         → .anim-bar__socket（底部插座光）/ .anim-bar__idx（编号） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bars {
    display: flex; align-items: flex-end; gap: 10px;
    padding: 26px 6px 0 44px;   /* 左边留出刻度轴 */
    position: relative;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bars::after {
    content: ''; position: absolute; left: 40px; right: 4px; bottom: 22px; height: 2px; border-radius: 2px;
    background:
        repeating-linear-gradient(90deg, rgba(221, 143, 28, .6) 0 1px, transparent 1px 12px),
        linear-gradient(90deg, rgba(221, 143, 28, .05), rgba(221, 143, 28, .55), rgba(221, 143, 28, .05));
    box-shadow: 0 0 14px rgba(221, 143, 28, .35);
}

/* 刻度轴 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-axis {
    position: absolute; left: 4px; bottom: 24px; width: 36px; height: var(--h, 170px);
    border-right: 1px solid rgba(96, 88, 70, .2);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-axis__tick {
    position: absolute; right: 0; transform: translateY(50%);
    display: flex; align-items: center; gap: 4px;
    font: 700 9.5px ui-monospace, Consolas, monospace; color: #475569; letter-spacing: .06em;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-axis__tick i {
    width: 7px; height: 1px; background: rgba(96, 88, 70, .35); order: 2;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-axis__tick:first-child i { width: 11px; background: rgba(var(--rgb, 91, 110, 225), .55); }

/* 单根柱子 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar {
    position: relative; flex: 1 1 0; min-width: 26px;
    display: flex; flex-direction: column; align-items: center;
    --bar: #7f95d6; --bar-top: #b8c7ee; --glow: rgba(var(--rgb, 91, 110, 225), .45);
}

/* 数值胶囊 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__val {
    position: relative; z-index: 3; margin-bottom: 8px; padding: 2px 9px; border-radius: 999px;
    font: 700 12px ui-monospace, Consolas, monospace; color: #33415c; letter-spacing: .02em;
    background: rgba(255, 255, 255, .96); border: 1px solid rgba(var(--rgb, 91, 110, 225), .2);
    box-shadow: 0 3px 8px -5px rgba(24, 30, 48, .6);
    white-space: nowrap; font-variant-numeric: tabular-nums;
    transition: color .16s, border-color .16s, box-shadow .18s;
}

/* 玻璃管：固定的「容器」，充满时正好到顶 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__tube {
    position: relative; width: 100%; max-width: 42px;
    border-radius: 12px 12px 9px 9px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(244, 240, 231, .55));
    box-shadow:
        inset 0 0 0 1.6px rgba(96, 88, 70, .18),
        inset 0 2px 4px rgba(255, 255, 255, .95),
        inset 0 -8px 14px -10px rgba(96, 88, 70, .35);
}

/* 液柱 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__fill {
    position: absolute; left: 3px; right: 3px; bottom: 3px;
    border-radius: 9px 9px 7px 7px;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .16) 0%, rgba(255, 255, 255, .28) 26%,
            rgba(255, 255, 255, .1) 52%, rgba(0, 0, 0, .2) 100%),
        var(--bar);
    box-shadow: 0 6px 16px -8px var(--glow), inset 0 -8px 14px -10px rgba(0, 0, 0, .5);
    transition: height .3s cubic-bezier(.34, 1.4, .64, 1), background .18s, box-shadow .18s;
}

/* 液面（顶面椭圆）：竖着的圆柱从侧面看，顶面是个扁椭圆 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__cap {
    position: absolute; left: -1px; right: -1px; top: -4px; height: 9px; border-radius: 50%;
    background: var(--bar-top);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 4px var(--glow);
}

/* 左侧高光条：圆柱面的反光 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__gloss {
    position: absolute; left: 4px; top: 8px; bottom: 6px; width: 5px; border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .15));
    opacity: .8; pointer-events: none;
}

/* 底部插座：一圈光垫 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__socket {
    position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
    width: 78%; height: 8px; border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, var(--glow), transparent 72%);
    filter: blur(.6px); pointer-events: none;
}

/* 编号 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__idx {
    position: relative; z-index: 3; margin-top: 14px;
    font: 700 10.5px ui-monospace, Consolas, monospace; color: #52607a; letter-spacing: .12em;
}

/* 状态色（液柱 + 顶面 + 光） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-cmp { --bar: #4f93f5; --bar-top: #9cc4ff; --glow: rgba(59, 130, 246, .6); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-cmp .anim-bar__val { color: #1d4ed8; border-color: rgba(59, 130, 246, .45); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-swap { --bar: #f26b6b; --bar-top: #ffabab; --glow: rgba(239, 68, 68, .6); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-swap .anim-bar__val { color: #b91c1c; border-color: rgba(239, 68, 68, .5); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-swap .anim-bar__fill { animation: animJelly .36s ease-out; }

@keyframes animJelly {
    0% { transform: scaleY(1.06) scaleX(.93); }
    55% { transform: scaleY(.96) scaleX(1.05); }
    100% { transform: none; }
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-ok { --bar: #3fc983; --bar-top: #8ef0bb; --glow: rgba(34, 197, 94, .55); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-ok .anim-bar__val { color: #15803d; border-color: rgba(34, 197, 94, .5); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-cur { --bar: #9d63f0; --bar-top: #d0b0ff; --glow: rgba(168, 85, 247, .65); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-cur .anim-bar__val { color: #6d28d9; border-color: rgba(168, 85, 247, .55); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-cur .anim-bar__fill { box-shadow: 0 8px 22px -8px var(--glow), inset 0 -8px 14px -10px rgba(0, 0, 0, .45); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-dead { --bar: #e2e8f1; --bar-top: #eef2f8; --glow: transparent; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-dead .anim-bar__val { color: #a6b3c7; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar.is-dead .anim-bar__fill { box-shadow: inset 0 0 0 1px rgba(var(--rgb, 91, 110, 225), .12); }

/* 图 / 树（SVG） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-graph { width: 100%; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-svg { width: 100%; height: 240px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-edge { stroke: rgba(71, 85, 105, .45); stroke-width: 2.5; transition: stroke .18s, stroke-width .18s; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-edge.is-scan { stroke: #60a5fa; stroke-width: 4; filter: drop-shadow(0 0 6px rgba(96, 165, 250, .8)); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node circle { fill: #ffffff; stroke: rgba(71, 85, 105, .4); stroke-width: 2.5; transition: fill .18s, stroke .18s, filter .18s; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node text { text-anchor: middle; font: 700 15px ui-monospace, Consolas, monospace; fill: #1d2939; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-vis circle { fill: #d9f7e4; stroke: #16a34a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-vis text { fill: #14532d; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-cur circle { fill: #f3e8ff; stroke: #8b5cf6; stroke-width: 3.5; filter: drop-shadow(0 0 8px rgba(139, 92, 246, .55)); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-fresh circle { fill: #dbefff; stroke: #0284c7; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-fresh text { fill: #075985; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node__tag { font: 700 11px ui-monospace, Consolas, monospace; fill: #b45309; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-red circle { fill: rgba(239, 68, 68, .85); stroke: #fca5a5; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-red text { fill: #ffffff; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-black circle { fill: #1f2937; stroke: #0f172a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-node.is-black text { fill: #e2e8f0; }

/* 栈 / 队列 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 96px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lin__label { font-size: 12.5px; color: #52607a; font-weight: 600; white-space: nowrap; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lin__cells { display: flex; gap: 8px; align-items: center; min-height: 56px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lin__empty { font-size: 13px; color: #94a3b8; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lincell {
    min-width: 52px; height: 46px; line-height: 46px; text-align: center; border-radius: 8px;
    background: #ffffff; border: 1.5px solid rgba(71, 85, 105, .32);
    color: #1d2939; font: 600 16px ui-monospace, Consolas, monospace;
    transition: border-color .16s, background .16s, box-shadow .16s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lincell.is-swap { border-color: #dc2626; background: #fde8e8; color: #991b1b; }

/* 链表（箭头 / 环） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 78px; padding: 8px 2px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain__head { font-size: 12.5px; color: #52607a; font-weight: 700; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain__arrow { color: #55637a; font-size: 14px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain__node {
    min-width: 50px; height: 42px; line-height: 42px; text-align: center; border-radius: 8px;
    background: #ffffff; border: 1.5px solid rgba(71, 85, 105, .32);
    color: #1d2939; font: 600 15px ui-monospace, Consolas, monospace;
    transition: border-color .16s, background .16s, box-shadow .16s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain__node.is-cur { border-color: #8b5cf6; background: #f3e8ff; color: #5b21b6; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .9); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain__node.is-cmp { border-color: #2563eb; background: #e0ecff; color: #1e3a8a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain__node.is-ok { border-color: #16a34a; background: #d9f7e4; color: #14532d; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain__null { font-size: 12.5px; color: #475569; font-weight: 600; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-chain__back { font-size: 12.5px; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 999px; padding: 2px 9px; }

/* 竖条（贪心 / KMP / GCD） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cols { display: flex; gap: 10px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-col {
    min-width: 58px; border-radius: 9px; padding: 8px 10px 9px; text-align: center;
    background: #ffffff; border: 1px solid rgba(71, 85, 105, .28); color: #1d2939;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-col__tag { font: 700 10.5px ui-monospace, Consolas, monospace; color: #64748b; letter-spacing: .06em; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-col__top { font: 600 14px ui-monospace, Consolas, monospace; margin-top: 3px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-col__mid { font-size: 11.5px; color: #5b6779; margin-top: 2px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-col.is-ok { background: #d9f7e4; border-color: #16a34a; color: #14532d; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-col.is-cur { background: #f3e8ff; border-color: #8b5cf6; color: #5b21b6; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-col.is-cmp { background: #e0ecff; border-color: #2563eb; color: #1e3a8a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-col.is-dead { opacity: .45; }

/* 分桶 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-buckets { display: flex; gap: 8px; align-items: flex-start; justify-content: center; flex-wrap: wrap; padding: 8px 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bucket {
    min-width: 68px; border-radius: 10px; overflow: hidden;
    background: #ffffff; border: 1px solid rgba(71, 85, 105, .25);
    transition: border-color .18s, box-shadow .18s, background .18s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bucket.is-cur { border-color: #8b5cf6; background: #f7f0ff; box-shadow: 0 8px 20px -12px rgba(139, 92, 246, .9); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bucket__tag {
    font: 600 11.5px ui-monospace, Consolas, monospace; color: #52607a; text-align: center;
    padding: 4px; background: #f4f6fa; border-bottom: 1px solid rgba(71, 85, 105, .14);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bucket__body { min-height: 86px; padding: 7px; display: flex; flex-direction: column; gap: 5px; align-items: center; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bucket__item {
    width: 46px; height: 25px; line-height: 25px; text-align: center; border-radius: 6px;
    background: #d9f7e4; border: 1px solid #16a34a;
    color: #14532d; font: 700 13px ui-monospace, Consolas, monospace;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-bucket__empty { font-size: 12px; color: #64748b; }

/* 多行格子（字符串 / 时间线） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-rows { display: flex; flex-direction: column; gap: 9px; padding: 8px 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-rowline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-rowline__tag {
    flex: 0 0 auto; min-width: 44px; font: 700 12px ui-monospace, Consolas, monospace;
    color: #52607a; text-align: right;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-rowline__cells { display: flex; gap: 4px; flex-wrap: wrap; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-charcell {
    min-width: 29px; height: 32px; line-height: 32px; text-align: center; border-radius: 6px;
    background: #ffffff; border: 1px solid rgba(71, 85, 105, .26);
    color: #1d2939; font: 700 13.5px ui-monospace, Consolas, monospace; padding: 0 5px;
    transition: background .16s, border-color .16s, box-shadow .16s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-charcell.is-cur { background: #f3e8ff; border-color: #8b5cf6; color: #5b21b6; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .95); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-charcell.is-cmp { background: #e0ecff; border-color: #2563eb; color: #1e3a8a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-charcell.is-ok { background: #d9f7e4; border-color: #16a34a; color: #14532d; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-charcell.is-dead { background: #f1f4f8; color: #94a3b8; text-decoration: line-through; }

/* 网格地图（A* / IDA*） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map { display: grid; gap: 3px; justify-content: center; padding: 8px 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map__cell {
    width: 27px; height: 27px; line-height: 25px; text-align: center; border-radius: 5px;
    background: #ffffff; border: 1px solid rgba(71, 85, 105, .22);
    color: #475569; font: 600 12px ui-monospace, Consolas, monospace;
    transition: background .16s, border-color .16s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map__cell.is-wall { background: #94a3b8; border-color: #64748b; color: transparent; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map__cell.is-start { background: #d9f7e4; border-color: #16a34a; color: #14532d; font-weight: 700; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map__cell.is-goal { background: #fef3c7; border-color: #d97706; color: #92400e; font-weight: 700; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map__cell.is-cur { background: #f3e8ff; border-color: #8b5cf6; color: #5b21b6; box-shadow: 0 4px 14px -8px rgba(139, 92, 246, .95); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map__cell.is-ok { background: #d9f7e4; border-color: #16a34a; color: #14532d; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map__cell.is-cmp { background: #e0ecff; border-color: #2563eb; color: #1e3a8a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-map__cell.is-dead { background: #f1f4f8; color: #94a3b8; }

/* 一排「值 + dp」 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lis { display: flex; gap: 8px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lis__col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 46px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lis__v {
    width: 100%; text-align: center; padding: 6px 4px; border-radius: 7px;
    background: #ffffff; border: 1px solid rgba(71, 85, 105, .28);
    color: #1d2939; font: 700 14px ui-monospace, Consolas, monospace;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lis__dp {
    width: 100%; text-align: center; padding: 4px; border-radius: 6px;
    background: #e8f6ff; border: 1px solid #0284c7;
    color: #075985; font: 700 12.5px ui-monospace, Consolas, monospace;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lis__idx { font: 600 11.5px ui-monospace, Consolas, monospace; color: #52607a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lis__col.is-dep .anim-lis__v { border-color: #d97706; background: #fef3c7; color: #92400e; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lis__col.is-cur .anim-lis__v { border-color: #8b5cf6; background: #f3e8ff; color: #5b21b6; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .95); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-lis__col.is-cur .anim-lis__dp { background: #f3e8ff; border-color: #8b5cf6; color: #5b21b6; font-weight: 700; }

/* 表格 / 格子 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-gridwrap { overflow-x: auto; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-grid { border-collapse: separate; border-spacing: 3px; font: 500 13px ui-monospace, Consolas, monospace; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-grid th { font-weight: 700; color: #52607a; font-size: 12px; padding: 3px 6px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell {
    background: #ffffff; border: 1px solid rgba(71, 85, 105, .24); color: #1d2939;
    border-radius: 6px; padding: 5px 9px; text-align: center; min-width: 34px;
    transition: background .16s, border-color .16s, box-shadow .16s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell.is-dead { background: #f1f4f8; color: #94a3b8; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell.is-dep { background: #fef3c7; border-color: #d97706; color: #92400e; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell.is-cur { background: #f3e8ff; border-color: #8b5cf6; color: #5b21b6; font-weight: 700; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .95); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cells { display: flex; gap: 8px; flex-wrap: wrap; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell--w {
    min-width: 60px; border-radius: 8px; padding: 8px 10px; text-align: center;
    background: #ffffff; border: 1px solid rgba(71, 85, 105, .26);
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell--w i { display: block; font-style: normal; font-size: 11px; color: #52607a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell--w b { display: block; font: 700 15px ui-monospace, Consolas, monospace; color: #1d2939; margin-top: 2px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell--w.is-dep { background: #fef3c7; border-color: #d97706; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cell--w.is-cur { background: #f3e8ff; border-color: #8b5cf6; box-shadow: 0 6px 16px -10px rgba(139, 92, 246, .95); }

/* 画面下方的补充说明（渲染器自带的 label / info） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-info { margin-top: 12px; font-size: 12.5px; color: #52607a; text-align: center; line-height: 1.75; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-info b { color: #1d2939; font-weight: 700; }

/* 链表的另一种（stack 渲染器里的 list 模式） */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 70px; padding: 6px 2px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-list__head { font-size: 12.5px; color: #52607a; font-weight: 700; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-list__arrow { color: #55637a; font-size: 14px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-list__null { font-size: 12.5px; color: #fbbf24; font-weight: 600; }

/* 汉诺塔 */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-hanoi { display: flex; align-items: flex-end; justify-content: space-around; gap: 16px; padding: 18px 6px 6px; min-height: 210px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-peg { display: flex; flex-direction: column; align-items: center; gap: 8px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-peg__disks { display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; min-height: 140px; justify-content: flex-start; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-disk {
    height: 20px; line-height: 20px; text-align: center; border-radius: 5px;
    background: linear-gradient(180deg, rgba(148, 163, 184, .95), rgba(100, 116, 139, .7));
    color: #0b1220; font: 700 11px ui-monospace, Consolas, monospace;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); transition: width .2s;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-peg.is-cur .anim-disk { background: linear-gradient(180deg, #7ff0b0, #16a34a); color: #06210f; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-peg.is-swap .anim-disk { background: linear-gradient(180deg, #ff9b9b, #dc2626); color: #2a0808; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-peg__base { width: 96px; height: 5px; border-radius: 3px; background: rgba(148, 163, 184, .4); }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-peg__name { font: 700 12px ui-monospace, Consolas, monospace; color: #334155; }

/* ---------------- 算法说明 / 时间复杂度（竖排两块，放在参考代码下面） ---------------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-doc { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 4px 18px 16px; margin-top: 14px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-doc__sec { padding: 12px 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-doc__sec + .anim-doc__sec { border-top: 1px dashed #e6e9e7; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-doc h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: #3b4a6b; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-doc p { margin: 0 0 8px; font-size: 13px; color: #3f4a55; line-height: 1.9; text-align: justify; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-doc p b { color: #2b3b5c; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-doc__tip { background: #fbfaf3; border-left: 3px solid #caa44a; border-radius: 0 4px 4px 0; padding: 8px 10px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cx { display: flex; flex-direction: column; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cx__row { display: flex; gap: 12px; font-size: 13px; line-height: 1.9; padding: 3px 0; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cx__row + .anim-cx__row { border-top: 1px dashed #f1f3f2; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cx__row i { flex: 0 0 60px; font-style: normal; color: #6b7280; font-weight: 600; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cx__row span { flex: 1 1 auto; color: #2b3b5c; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-cx__row span b { color: #10243f; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-card__meta { margin-top: 6px; font-size: 12px; color: #4f8a5b; font-family: Consolas, Menlo, monospace; }

/* ---------------- 代码（白底 + 语法高亮 + 当前行） ---------------- */

html:is(.anim-theme-classic,.anim-theme-toy) .anim-codebox { margin-top: 14px; background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 14px 18px 18px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-codehead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: #3b4a6b; margin-bottom: 8px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-codehead i { font-style: normal; font-weight: 400; font-size: 12px; color: #9a9a9a; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-code {
    background: #fff; border: 1px solid #e6eaf2; border-radius: 6px;
    max-height: 330px; overflow: auto; padding: 8px 0;
    font-family: Consolas, "Cascadia Mono", Menlo, "Courier New", monospace;
    font-size: 13px; line-height: 1.75;
}

html:is(.anim-theme-classic,.anim-theme-toy) .anim-line { display: flex; white-space: pre; border-left: 3px solid transparent; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-line:hover { background: #f7f9fc; cursor: pointer; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-ln { flex: 0 0 44px; text-align: right; padding-right: 12px; color: #b6bcc8; user-select: none; font-size: 12.5px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-src { flex: 1 1 auto; color: #1f2937; padding-right: 14px; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-line.is-cur { background: #eef6ec; border-left-color: #5b8f5f; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-line.is-cur .anim-ln { color: #3f7a4c; font-weight: 700; }

html:is(.anim-theme-classic,.anim-theme-toy) .anim-line.is-cur .anim-src { color: #10243f; }

/* 语法配色（白底可读） */

html:is(.anim-theme-classic,.anim-theme-toy) .c-kw { color: #7c3aed; font-weight: 600; }

html:is(.anim-theme-classic,.anim-theme-toy) .c-ty { color: #0e7490; }

html:is(.anim-theme-classic,.anim-theme-toy) .c-st { color: #15803d; }

html:is(.anim-theme-classic,.anim-theme-toy) .c-nu { color: #2563eb; }

html:is(.anim-theme-classic,.anim-theme-toy) .c-cm { color: #8a8a8a; font-style: italic; }

html:is(.anim-theme-classic,.anim-theme-toy) .c-pp { color: #b45309; }

@media (max-width: 900px) {
    html:is(.anim-theme-classic,.anim-theme-toy) .anim-wrap { flex-direction: column; }

    html:is(.anim-theme-classic,.anim-theme-toy) .anim-aside { position: static; flex: 1 1 auto; width: 100%; }

    html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__col { max-width: 100%; }

    html:is(.anim-theme-classic,.anim-theme-toy) .anim-step { margin-left: 0; }
}

/* ================================================================
 * 修正块：柱子 DOM 换成「铸铁件 + 状态色阳极氧化板」之后的适配。
 * 浅色主题里只要玻璃管/果冻柱：铸铁件全部藏掉，液面按 --px 重新定位。
 * ================================================================ */
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__anod,
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__rivet,
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__plate,
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__heat,
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__foot,
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__face,
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__pedestal { display: none; }
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__cap {
    position: absolute; left: -1px; right: -1px; top: auto; bottom: var(--px, 0px);
    height: 9px; border-radius: 50%;
}
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__fill { overflow: visible; }
html:is(.anim-theme-classic,.anim-theme-toy) .anim-bar__socket { bottom: -7px; }

/* ============ 手办卡通皮肤（toy，覆盖在浅色层之上） ============ */
/* ================================================================
 * 手办卡通主题（toy）：浅色糖果系 + 手办娃娃柱
 * 只在 html.anim-theme-toy 下生效，接在浅色主题层后面覆盖。
 * 颜色含义仍按图例：紫=当前最小 蓝=扫描中 红=交换 绿=已排序 灰=普通
 * ================================================================ */
html.anim-theme-toy { background: #fff8fb; }
html.anim-theme-toy body {
    background-color: #fff8fb;
    background-image:
        radial-gradient(46% 34% at 8% 2%, rgba(255, 190, 220, .5), transparent 70%),
        radial-gradient(40% 30% at 92% 6%, rgba(186, 230, 255, .5), transparent 70%),
        radial-gradient(50% 40% at 78% 96%, rgba(214, 250, 233, .55), transparent 72%),
        radial-gradient(44% 36% at 22% 98%, rgba(233, 216, 255, .5), transparent 72%),
        linear-gradient(180deg, #fffafd 0%, #fdf1f8 44%, #f2f8fd 100%);
    color: #43334c;
}
/* OJ 外层容器透出糖果底色 */
html.anim-theme-toy #panel,
html.anim-theme-toy #main.main { background: transparent; }
html.anim-theme-toy footer { color: #8a7695; }
html.anim-theme-toy footer a { color: #d1608f !important; }

/* ---------------- 面板：白奶油圆角 + 粉色柔光 ---------------- */
html.anim-theme-toy .anim-head,
html.anim-theme-toy .anim-aside,
html.anim-theme-toy .anim-mainhead,
html.anim-theme-toy .anim-panel {
    background-color: #ffffff;
    background-image: linear-gradient(180deg, #ffffff, #fffafd);
    border-radius: 26px;
    border: 2px solid #fff;
    box-shadow: 0 22px 46px -30px rgba(214, 150, 185, .95), 0 2px 0 #fff inset;
}
html.anim-theme-toy .anim-head h1 { color: #57406a; font-weight: 800; }
html.anim-theme-toy .anim-head h1::after {
    content: ' ✿'; color: #ff9ec4; font-size: .8em;
}
html.anim-theme-toy .anim-head p { color: #7d6b86; }
html.anim-theme-toy .anim-head b { color: #d1608f; }
html.anim-theme-toy .anim-mainhead h2 { color: #57406a; }
html.anim-theme-toy .anim-mainhead p { color: #8a7695; }
html.anim-theme-toy .anim-crumb {
    color: #d1608f; background: linear-gradient(180deg, #fff, #ffeef6);
    border: 2px solid #fff; box-shadow: 0 10px 20px -14px rgba(255, 150, 190, .9);
    border-radius: 999px; font-weight: 700;
}
html.anim-theme-toy .anim-list__head { color: #57406a; }

/* 左侧目录 */
html.anim-theme-toy .anim-group__title { color: #6b5578; font-weight: 800; }
html.anim-theme-toy .anim-group__title i,
html.anim-theme-toy .anim-chapter i { color: #bfa8c8; }
html.anim-theme-toy .anim-caret { color: #c6b2cd; }
html.anim-theme-toy .anim-chapter { color: #7d6a88 !important; border-left-color: #f6e6f1; border-radius: 12px; }
html.anim-theme-toy .anim-chapter:hover { background: #fdf5fa; border-left-color: #ffd6e8; color: #57406a !important; }
html.anim-theme-toy .anim-chapter.is-on {
    background: linear-gradient(180deg, #ffb3d1, #ff89b4);
    border-left-color: #ffc2dc; color: #fff !important; border-radius: 12px;
    box-shadow: 0 10px 20px -12px rgba(255, 137, 180, .95), inset 0 1px 0 rgba(255, 255, 255, .7);
}
html.anim-theme-toy .anim-chapter.is-on i { color: #ffe3ee; }
html.anim-theme-toy .anim-tip { color: #b3a1bc; border-top-color: #fbeef6; }

/* ---------------- 卡片：糖果色 + 手办塑料光泽 ---------------- */
html.anim-theme-toy .anim-cards { gap: 16px; }
html.anim-theme-toy .anim-card {
    --toytint: 255, 190, 216;
    border-radius: 24px; border: 2px solid #fff;
    background-color: #ffffff;
    background-image:
        radial-gradient(126% 104% at 100% 0%, rgba(var(--toytint), .9), transparent 62%),
        radial-gradient(90% 80% at -8% 116%, rgba(var(--toytint), .38), transparent 66%),
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .9) 1.2px, transparent 1.8px) 0 0/14px 14px,
        linear-gradient(170deg, #ffffff, #fffafd 66%, #fff5fa);
    box-shadow: 0 24px 42px -28px rgba(190, 150, 180, .95), 0 2px 0 #fff inset;
}
html.anim-theme-toy .anim-card:hover {
    border-color: #fff;
    box-shadow: 0 32px 54px -28px rgba(190, 140, 180, 1), 0 2px 0 #fff inset;
}
/* 斜向塑料反光 */
html.anim-theme-toy .anim-card::before {
    content: ''; position: absolute; left: -30%; top: -60%; width: 80%; height: 180%; z-index: 1;
    background: linear-gradient(104deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 52%);
    transform: rotate(14deg); pointer-events: none;
}
html.anim-theme-toy .anim-card__grid { opacity: .5; }
html.anim-theme-toy .anim-card__noise { opacity: .35; mix-blend-mode: soft-light; }
html.anim-theme-toy .anim-card__mark { color: rgba(var(--rgb), .3); mix-blend-mode: multiply; }
html.anim-theme-toy .anim-card__spot {
    background: radial-gradient(200px 200px at var(--mx) var(--my), rgba(255, 255, 255, .9), transparent 62%);
}
html.anim-theme-toy .anim-card__corner { border-color: rgba(var(--rgb), .45); }
html.anim-theme-toy .anim-card__idx { color: #e2cbdb; }
html.anim-theme-toy .anim-card__body {
    background: linear-gradient(160deg, rgba(255, 255, 255, .82) 0%, rgba(255, 255, 255, .58) 44%,
        rgba(var(--toytint), .34) 100%);
    border: 2px solid #fff; border-radius: 18px;
    box-shadow: 0 12px 22px -18px rgba(190, 150, 180, .95), inset 0 2px 0 #fff;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
html.anim-theme-toy .anim-card:hover .anim-card__body {
    background: linear-gradient(160deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .66) 44%,
        rgba(var(--toytint), .44) 100%);
}
html.anim-theme-toy .anim-card__badge {
    width: 46px; height: 46px; border-radius: 16px; color: var(--ink, #f088ab);
    background: linear-gradient(160deg, #ffffff, rgba(var(--rgb), .22));
    border: 2px solid #fff;
    box-shadow: 0 12px 22px -14px rgba(180, 140, 170, .95), inset 0 2px 0 #fff;
}
html.anim-theme-toy .anim-card__badge .anim-ico { width: 24px; height: 24px; }
html.anim-theme-toy .anim-card__title { color: #57406a; font-weight: 800; }
html.anim-theme-toy .anim-card__desc { color: #75647e; }
html.anim-theme-toy .anim-card__time {
    color: #9a7fb2; background: #f8f2ff; border: 1.5px solid #efe3fb; border-radius: 999px;
    box-shadow: none; font-weight: 800;
}
html.anim-theme-toy .anim-card__go { color: #f088ab; font-weight: 800; }

/* 飞卡 / 遮罩 */
html.anim-theme-toy .anim-launch::before {
    background: radial-gradient(120% 100% at 50% 45%, rgba(255, 240, 248, .5), rgba(255, 226, 240, .62));
}
html.anim-theme-toy .anim-flyer { background-color: #ffffff; }
html.anim-theme-toy .anim-flyer .anim-card__body {
    background: linear-gradient(180deg, #ffffff, #fff7fb); border-color: #fff;
}
html.anim-theme-toy .anim-flyer--expand { background: #ffffff !important; }

/* ---------------- 控制台：糖果按钮 / 粉色滑杆 ---------------- */
html.anim-theme-toy .anim-datarow label { color: #8a7695; font-weight: 800; }
html.anim-theme-toy .anim-input {
    background: linear-gradient(180deg, #fdf7fb, #f8eef7); border: 2px solid #f4e4f0;
    border-radius: 14px; color: #5a4a63;
    box-shadow: inset 0 2px 5px rgba(190, 160, 185, .18);
}
html.anim-theme-toy .anim-input:focus {
    border-color: #ffb8d4; box-shadow: inset 0 2px 5px rgba(190, 160, 185, .18), 0 0 0 4px rgba(255, 184, 212, .35);
}
html.anim-theme-toy .anim-btn {
    background: linear-gradient(180deg, #ffffff, #f6eef5); border: 2px solid #fff; border-radius: 14px;
    color: #7a6884 !important;
    box-shadow: 0 10px 20px -14px rgba(190, 150, 180, .95), inset 0 2px 0 #fff, 0 0 0 1.5px #f2e2ee;
}
html.anim-theme-toy .anim-btn:hover { box-shadow: 0 14px 24px -14px rgba(190, 140, 180, 1), inset 0 2px 0 #fff, 0 0 0 1.5px #ffd6e8; }
html.anim-theme-toy .anim-btn--green,
html.anim-theme-toy .anim-ctrl--primary {
    background: linear-gradient(180deg, #ffc0da, #ff8fba 62%, #ff9ec4);
    border: 2px solid #fff; color: #fff !important;
    text-shadow: 0 1px 0 rgba(190, 80, 130, .35);
    box-shadow: 0 14px 24px -14px rgba(255, 137, 180, 1), inset 0 2px 0 rgba(255, 255, 255, .85), 0 0 0 1.5px #ffa8c8;
}
html.anim-theme-toy .anim-btn--green.is-playing,
html.anim-theme-toy .anim-ctrl--primary.is-playing {
    background: linear-gradient(180deg, #ffd9a8, #ffb066 62%, #ffc188);
    color: #7a4a12 !important; text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
    box-shadow: 0 14px 24px -14px rgba(255, 176, 102, 1), inset 0 2px 0 rgba(255, 255, 255, .85), 0 0 0 1.5px #ffc98c;
}
html.anim-theme-toy .anim-btn--ghost { background: linear-gradient(180deg, #fff, #fbf2f8); border: 2px solid #fff; color: #a68bb5 !important; }
html.anim-theme-toy .anim-ctrl {
    background: linear-gradient(180deg, #ffffff, #f6eef5); border: 2px solid #fff; border-radius: 14px;
    color: #6b5578 !important;
    box-shadow: 0 10px 20px -14px rgba(190, 150, 180, .95), inset 0 2px 0 #fff, 0 0 0 1.5px #f2e2ee;
}
html.anim-theme-toy .anim-ctrl:hover { box-shadow: 0 14px 24px -14px rgba(190, 140, 180, 1), inset 0 2px 0 #fff, 0 0 0 1.5px #ffd6e8; }
html.anim-theme-toy .anim-speedwrap {
    background: #fdf7fb; border: 2px solid #f6e8f2; border-radius: 14px; color: #8a7695;
    box-shadow: none;
}
html.anim-theme-toy .anim-speedwrap input[type="range"] {
    height: 8px; background: linear-gradient(90deg, #ffb8d4, #ffd9e8);
    box-shadow: inset 0 1px 3px rgba(200, 140, 175, .35);
}
html.anim-theme-toy .anim-speedwrap input[type="range"]::-webkit-slider-thumb {
    width: 18px; height: 18px; border: 1.5px solid #fff;
    background: radial-gradient(circle at 34% 28%, #fff, #ffe0ee 46%, #ffb4d2);
    box-shadow: 0 4px 10px -4px rgba(255, 120, 170, .9);
}
html.anim-theme-toy .anim-speedwrap output { color: #d1608f; background: transparent; border: 0; box-shadow: none; }
html.anim-theme-toy .anim-step {
    background: #fdf7fb; border: 2px solid #f6e8f2; border-radius: 14px; color: #8a7695;
    box-shadow: none;
}
html.anim-theme-toy .anim-legendrow { color: #8a7695; }
html.anim-theme-toy .anim-lg {
    background: #fffafd; border: 2px solid #f8ecf4; border-radius: 999px; color: #8a7695;
    box-shadow: none; font-weight: 700;
}
html.anim-theme-toy .anim-chip { border-radius: 50%; }

/* ---------------- 舞台：棉花糖地台 ---------------- */
html.anim-theme-toy .anim-studio {
    background-color: #fdf6fb; border: 2px solid #fff; border-radius: 26px;
    background-image: linear-gradient(180deg, #fdf6fb, #f6f9fe);
    box-shadow: inset 0 2px 0 #fff, 0 18px 36px -30px rgba(180, 140, 175, .9);
}
html.anim-theme-toy .anim-studio__top { color: #b19cb9; }
html.anim-theme-toy .anim-studio__name { color: #57406a; }
html.anim-theme-toy .anim-studio__lv {
    background: linear-gradient(180deg, #ffc0da, #ff9ec4); color: #fff; border: 2px solid #fff;
    box-shadow: 0 8px 16px -10px rgba(255, 140, 180, .95), inset 0 1px 0 rgba(255, 255, 255, .8);
}
html.anim-theme-toy .anim-studio__pat { color: #c19bb8; background: #fffafd; border: 1.5px solid #f8ecf4; }
html.anim-theme-toy .anim-studio__dot { background: #ff9ec4; box-shadow: 0 0 0 4px #ffe6f2; }
html.anim-theme-toy .anim-progress { background: #ffeaf4; box-shadow: inset 0 1px 2px rgba(210, 160, 190, .3); }
html.anim-theme-toy .anim-progress i { background: linear-gradient(90deg, #ffc0da, #ff89b4); box-shadow: 0 0 12px rgba(255, 158, 196, .8); }
html.anim-theme-toy .anim-stage {
    background-color: #fdf7fc;
    background-image:
        radial-gradient(60% 40% at 50% 116%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
        linear-gradient(180deg, #f3fbff 0%, #fdf4fa 52%, #fff8fc 100%);
    border: 2px solid #fff; border-radius: 24px;
    box-shadow: inset 0 2px 0 #fff, inset 0 -22px 40px -30px rgba(255, 175, 210, .9),
                0 16px 34px -28px rgba(180, 140, 175, .9);
}
/* 小圆点 + 云朵地台 */
html.anim-theme-toy .anim-stage::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .85; border-radius: 22px;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 190, 220, .5) 1.4px, transparent 2px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, transparent 34%, #000 82%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 30%, #000 82%, #000 100%);
}
html.anim-theme-toy .anim-stage::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 74px; pointer-events: none;
    background:
        radial-gradient(20% 60% at 14% 100%, #fff 0 60%, transparent 62%),
        radial-gradient(22% 70% at 34% 100%, #fff 0 60%, transparent 62%),
        radial-gradient(18% 56% at 55% 100%, #fff 0 60%, transparent 62%),
        radial-gradient(24% 72% at 76% 100%, #fff 0 60%, transparent 62%),
        radial-gradient(16% 50% at 92% 100%, #fff 0 60%, transparent 62%);
    filter: blur(2px);
}
/* 立柱用的地台光带（原来那根橙色刻度线换成糖果色） */
html.anim-theme-toy .anim-bars::after {
    background:
        repeating-linear-gradient(90deg, rgba(255, 176, 210, .8) 0 1px, transparent 1px 12px),
        linear-gradient(90deg, rgba(255, 176, 210, .05), rgba(255, 137, 180, .6), rgba(255, 176, 210, .05));
    box-shadow: 0 0 14px rgba(255, 158, 196, .5); border-radius: 999px;
}
html.anim-theme-toy .anim-axis { border-right: 1px solid #f7e6f1; }
html.anim-theme-toy .anim-axis__tick { color: #b19cb9; }
html.anim-theme-toy .anim-axis__tick i { background: #f6e0ee; }
html.anim-theme-toy .anim-axis__tick:first-child i { background: #ffb8d4; }

/* ---------------- 手办娃娃柱 ---------------- */
html.anim-theme-toy .anim-bar {
    --t1: #efe7e0; --t2: #d9cfc6; --tink: #6b5c66; --tglow: rgba(180, 165, 155, .45);
}
html.anim-theme-toy .anim-bar.is-cur { --t1: #dcc9ff; --t2: #a884ff; --tink: #5b3fa8; --tglow: rgba(167, 139, 250, .6); }
html.anim-theme-toy .anim-bar.is-cmp { --t1: #c2e2ff; --t2: #74b7ff; --tink: #2f5f9e; --tglow: rgba(96, 165, 250, .6); }
html.anim-theme-toy .anim-bar.is-swap { --t1: #ffc4cf; --t2: #ff8ba2; --tink: #a33a52; --tglow: rgba(251, 113, 133, .6); }
html.anim-theme-toy .anim-bar.is-ok { --t1: #b8f4da; --t2: #67dcaa; --tink: #1f7a55; --tglow: rgba(52, 211, 153, .6); }
html.anim-theme-toy .anim-bar.is-dead { --t1: #eae3dd; --t2: #d5ccc5; --tink: #8b7d84; --tglow: rgba(150, 140, 135, .35); }
html.anim-theme-toy .anim-bar__val {
    margin-bottom: 8px; padding: 2px 11px; border-radius: 999px;
    font: 800 12px ui-monospace, Consolas, monospace; letter-spacing: 0;
    color: var(--tink); background: #fff; border: 2px solid var(--t2);
    box-shadow: 0 8px 14px -10px var(--tglow); text-shadow: none;
}
/* 玻璃管容器在糖果主题里不要（不然整根是个白管子） */
html.anim-theme-toy .anim-bar__tube { background: none; box-shadow: none; border-radius: 0; }
html.anim-theme-toy .anim-bar__fill {
    border-radius: 26px 26px 18px 18px; overflow: hidden;
    background:
        radial-gradient(circle at 28% 8%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .5) 1.1px, transparent 1.7px) 0 0/14px 16px,
        linear-gradient(180deg, var(--t1) 0%, var(--t2) 58%, var(--t2) 100%);
    border: 2.5px solid #fff;
    box-shadow: 0 20px 32px -18px var(--tglow), inset 0 3px 0 rgba(255, 255, 255, .95),
                inset -8px 0 12px -9px rgba(255, 255, 255, .9), 0 0 0 2.5px var(--tglow);
}
html.anim-theme-toy .anim-bar__cap { display: none; }
html.anim-theme-toy .anim-bar__socket {
    width: 70%; height: 12px; bottom: -8px;
    background: radial-gradient(50% 50% at 50% 50%, var(--tglow), transparent 74%);
    filter: blur(1.4px);
}
html.anim-theme-toy .anim-bar__idx { color: #b19cb9; margin-top: 15px; }
/* 小脸（眼睛 / 腮红 / 微笑）——只在高柱子身上出现 */
html.anim-theme-toy .anim-bar__face {
    display: block; position: absolute; left: 0; right: 0; top: 10px; height: 20px; pointer-events: none;
}
html.anim-theme-toy .anim-bar__eye {
    position: absolute; top: 2px; width: 6px; height: 8px; border-radius: 50%; background: #57406a;
}
html.anim-theme-toy .anim-bar__eye::after {
    content: ''; position: absolute; left: 1px; top: 1px; width: 2.4px; height: 2.4px; border-radius: 50%;
    background: #fff;
}
html.anim-theme-toy .anim-bar__eye--l { left: 24%; }
html.anim-theme-toy .anim-bar__eye--r { right: 24%; }
html.anim-theme-toy .anim-bar__blush {
    position: absolute; top: 11px; width: 9px; height: 5px; border-radius: 50%;
    background: rgba(255, 130, 170, .55); filter: blur(.6px);
}
html.anim-theme-toy .anim-bar__blush--l { left: 8%; }
html.anim-theme-toy .anim-bar__blush--r { right: 8%; }
html.anim-theme-toy .anim-bar__mouth {
    position: absolute; left: 50%; top: 12px; width: 10px; height: 6px; margin-left: -5px;
    border-bottom: 2px solid #57406a; border-radius: 0 0 10px 10px;
}
html.anim-theme-toy .anim-bar__pedestal {
    display: block; position: absolute; left: -6px; right: -6px; bottom: -10px; height: 12px;
    border-radius: 50%; border: 2px solid #fff;
    background: radial-gradient(60% 100% at 50% 30%, #fff, #ffe6f2 62%, #ffcfe4);
    box-shadow: 0 10px 18px -12px var(--tglow);
}

/* ---------------- 说明条 / 代码（糖果纸） ---------------- */
html.anim-theme-toy .anim-note {
    background: linear-gradient(180deg, #eefaf3, #e4f7ee); border: 2px solid #d6f2e4;
    border-left: 3px solid #7fe3b8; border-radius: 18px; color: #3f6b56;
}
html.anim-theme-toy .anim-codebox {
    border: 2px solid #f7ecf3; border-radius: 22px; background-color: #fff;
    background-image: linear-gradient(180deg, #ffffff, #fffafd);
    box-shadow: 0 18px 34px -28px rgba(180, 140, 175, .9);
}
html.anim-theme-toy .anim-codehead {
    background: linear-gradient(180deg, #fff6fb, #fdeef7); border-bottom: 2px solid #f9ecf4;
    color: #7a6884; font-weight: 800; text-shadow: none; margin: 0; padding: 11px 18px;
    box-shadow: none; border-radius: 20px 20px 0 0;
}
html.anim-theme-toy .anim-codehead i { color: #b3a1bc; }
html.anim-theme-toy .anim-card__meta { color: #d1608f; }
html.anim-theme-toy .anim-code {
    margin: 12px 14px; border-radius: 14px; background-color: #fdfaff;
    background-image: none; border: 1.5px solid #f4ecfa; color: #5a4a63;
    box-shadow: none;
}
html.anim-theme-toy .anim-ln { color: #c9b8d4; }
html.anim-theme-toy .anim-src { color: #5a4a63; }
html.anim-theme-toy .anim-line:hover { background: #fdf6fb; }
html.anim-theme-toy .anim-line.is-cur {
    background: linear-gradient(90deg, rgba(255, 158, 196, .3), rgba(255, 158, 196, .08));
    border-left-color: #ff9ec4; box-shadow: none;
}
html.anim-theme-toy .anim-line.is-cur::before { display: none; }
html.anim-theme-toy .anim-line.is-cur .anim-ln { color: #ff8fb8; text-shadow: none; }
html.anim-theme-toy .anim-line.is-cur .anim-src { color: #a83d6d; }
/* 深底语法配色 → 浅底（原始那套是给白底写的，这里保持原样即可） */
html.anim-theme-toy .c-kw { color: #a855f7; }
html.anim-theme-toy .c-ty { color: #0891b2; }
html.anim-theme-toy .c-st { color: #16a34a; }
html.anim-theme-toy .c-nu { color: #2563eb; }
html.anim-theme-toy .c-cm { color: #9a8f96; }
html.anim-theme-toy .c-pp { color: #d97706; }

/* 算法说明 / 时间复杂度：奶油纸 */
html.anim-theme-toy .anim-doc {
    border: 2px solid #f7ecf3; border-radius: 22px; background-color: #fff;
    background-image: linear-gradient(180deg, #ffffff, #fffafd);
    box-shadow: 0 18px 34px -28px rgba(180, 140, 175, .9); padding: 2px 20px 16px; margin-top: 14px;
}
html.anim-theme-toy .anim-doc h3 {
    color: #7a4a86; border-left: 4px solid #ffb8d4; padding-left: 10px;
    text-shadow: none; font-weight: 800;
}
html.anim-theme-toy .anim-doc p { color: #5f4f6b; }
html.anim-theme-toy .anim-doc p b { color: #43334c; }
html.anim-theme-toy .anim-doc__tip {
    background: linear-gradient(180deg, #fff6fb, #fdf0f7); border-left: 3px solid #ffb8d4;
    border-radius: 0 12px 12px 0; color: #6b5578;
}
html.anim-theme-toy .anim-doc__sec + .anim-doc__sec { border-top: 1px dashed #f7e6f1; }
html.anim-theme-toy .anim-cx__row { color: #5f4f6b; }
html.anim-theme-toy .anim-cx__row i { color: #a68bb5; }
html.anim-theme-toy .anim-cx__row span { color: #43334c; }
html.anim-theme-toy .anim-cx__row span b { color: #7a4a86; }
html.anim-theme-toy .anim-cx__row + .anim-cx__row { border-top: 1px dashed #fbeef6; }

/* 舞台里其它渲染器（栈/链表/桶/格子/地图/LIS/汉诺塔）统一成糖果贴纸 */
html.anim-theme-toy .anim-lincell,
html.anim-theme-toy .anim-chain__node,
html.anim-theme-toy .anim-col,
html.anim-theme-toy .anim-bucket,
html.anim-theme-toy .anim-charcell,
html.anim-theme-toy .anim-map__cell,
html.anim-theme-toy .anim-lis__v,
html.anim-theme-toy .anim-cell {
    border-radius: 12px; border: 2px solid #fff; background-color: #fff;
    box-shadow: 0 12px 20px -16px rgba(180, 140, 175, .95), 0 0 0 1.5px #f4e6f0;
    color: #43334c;
}
html.anim-theme-toy .anim-node circle { stroke: #f0dcea; }
html.anim-theme-toy .anim-info { color: #8a7695; }
html.anim-theme-toy .anim-info b { color: #57406a; }

/* 四张卡轮换糖果底色：粉 → 天蓝 → 薄荷 → 薰衣草 */
html.anim-theme-toy .anim-card:nth-child(4n+1) { --toytint: 255, 168, 203; }
html.anim-theme-toy .anim-card:nth-child(4n+2) { --toytint: 150, 200, 255; }
html.anim-theme-toy .anim-card:nth-child(4n+3) { --toytint: 128, 232, 188; }
html.anim-theme-toy .anim-card:nth-child(4n+4) { --toytint: 198, 168, 255; }
html.anim-theme-toy .anim-card__badge {
    color: #6b5578;
}
html.anim-theme-toy .anim-card__badge .anim-ico { stroke-width: 2; }

/* ==================================================================
 * 导航栏「主题切换」控件（原始 / 金属 / 手办）
 * 只在算法动画页由 nav-swap.js 注入；样式中性，三种主题下都不突兀
 * ================================================================== */
.anim-themesw-item { padding: 0 2px; }
.anim-themesw {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px;
    border-radius: 999px; background: #f1f3f6; border: 1px solid #e4e8ee;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, .05);
}
.anim-themesw__cap {
    font-size: 11px; font-weight: 600; color: #98a1ad; padding: 0 6px 0 5px; letter-spacing: .04em;
}
.anim-themesw__b {
    appearance: none; -webkit-appearance: none; border: 0; background: transparent; cursor: pointer;
    font: 600 12px/1 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: #6b7280;
    padding: 6px 11px; border-radius: 999px; transition: background .16s, color .16s, box-shadow .16s;
}
.anim-themesw__b:hover { background: #e7ecf3; color: #374151; }
.anim-themesw__b:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }
.anim-themesw__b.is-on {
    background: #fff; color: #1f2937; box-shadow: 0 1px 3px rgba(16, 24, 40, .16), 0 0 0 1px rgba(16, 24, 40, .04);
}
@media (max-width: 900px) {
    .anim-themesw__cap { display: none; }
    .anim-themesw__b { padding: 6px 8px; font-size: 11.5px; }
}
