/* mcres/static/css/pages/profile/level.css */
/* ============================================================
   个人主页 · 我的等级
   配色沿用站点既有的深色卡片体系（--role-color 由 base.html 注入）
   ============================================================ */

/* ★ 全局兜底：HTML 的 hidden 属性是 UA 样式（display:none），
   会被本文件里的 .lv-actions{display:flex} / .lv-btn{display:inline-flex} 盖掉。
   这里强制它优先生效，否则 hidden 设了等于没设。 */
#level-card [hidden] {
    display: none !important;
}

#level-card {
    padding: 22px;
}

/* ---- 头部 ---- */
.lv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lv-head-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.lv-badge {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    gap: 2px;
    padding: 8px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(85, 216, 139, .16), rgba(74, 144, 217, .16));
    border: 1px solid rgba(85, 216, 139, .32);
}

.lv-badge-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--role-color, #55d88b);
    opacity: .85;
}

.lv-badge-num {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: #e4e4ea;
    font-variant-numeric: tabular-nums;
}

.lv-title {
    font-size: 16px;
    font-weight: 600;
    color: #e4e4ea;
    margin-bottom: 4px;
}

.lv-subtitle {
    font-size: 13px;
    color: #8a8a9e;
    line-height: 1.5;
}

.lv-box-count {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    color: #e8a437;
    background: rgba(232, 164, 55, .08);
    border: 1px solid rgba(232, 164, 55, .2);
}

.lv-box-count b {
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

/* ---- 区块 ---- */
.lv-section {
    margin-top: 20px;
}

.lv-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #b9b9c8;
    margin-bottom: 12px;
}

.lv-section-title i {
    color: var(--role-color, #55d88b);
    font-size: 13px;
}

.lv-target {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: #8a8a9e;
}

/* ---- 材料格 ---- */
.lv-materials {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.lv-mat {
    position: relative;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    transition: background .2s, border-color .2s;
}

.lv-mat.done {
    background: rgba(85, 216, 139, .06);
    border-color: rgba(85, 216, 139, .3);
}

.lv-mat-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.lv-mat-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.lv-mat-name {
    font-size: 13px;
    color: #cfcfdb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lv-mat-count {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: #e4e4ea;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lv-mat.done .lv-mat-count {
    color: #55d88b;
}

.lv-mat-bar {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .06);
    overflow: hidden;
}

.lv-mat-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #55d88b, #4A90D9);
    transition: width .35s ease;
}

/* ---- 按钮 ---- */
/* ★ 注意：下面的 display:flex / inline-flex 会盖掉 HTML 的 [hidden] 属性
   （[hidden] 只是 UA 样式里的 display:none，优先级最低）。
   所以在文件顶部加了一条 [hidden]{display:none!important} 兜底，见第 8 行左右。 */
.lv-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.lv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s, background .2s, opacity .2s;
    font-family: inherit;
}

.lv-btn:active:not(:disabled) {
    transform: scale(.97);
}

.lv-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.lv-btn-open {
    color: #0f1115;
    background: linear-gradient(135deg, #55d88b, #4A90D9);
}

.lv-btn-open:hover:not(:disabled) {
    filter: brightness(1.08);
}

.lv-btn-ten {
    color: #f5c542;
    background: rgba(245, 197, 66, .1);
    border-color: rgba(245, 197, 66, .42);
}

.lv-btn-ten:hover:not(:disabled) {
    background: rgba(245, 197, 66, .2);
}

.lv-btn-up {
    color: #55d88b;
    background: rgba(85, 216, 139, .1);
    border-color: rgba(85, 216, 139, .4);
}

.lv-btn-up:hover:not(:disabled) {
    background: rgba(85, 216, 139, .18);
}

/* ---- 开箱舞台 ---- */
.lv-drop-stage {
    position: relative;
    margin-top: 18px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 55%, rgba(85, 216, 139, .07), transparent 62%);
    border: 1px solid rgba(255, 255, 255, .05);
    overflow: hidden;
}

/* ---- 幸运方块本身：用配置里的 lucky_block.png ---- */
.lv-drop-box {
    position: absolute;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center;
    will-change: transform, opacity;
    /* 图片没加载出来时的兜底底块（MC 幸运方块那种木箱色） */
}

.lv-drop-box.is-fallback {
    border-radius: 10px;
    background: linear-gradient(135deg, #8a5a2b, #c98a5b);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}

.lv-drop-box.is-fallback::after {
    content: "?";
    font-size: 30px;
    font-weight: 700;
    color: rgba(255, 255, 255, .75);
    text-shadow: 0 2px 4px rgba(0, 0, 0, .4);
}

/* 阶段 1：剧烈晃动（比之前幅度更大、节奏更快） */
@keyframes lv-box-shake {
    0%   { transform: rotate(0deg) scale(1); }
    8%   { transform: rotate(-14deg) scale(1.04); }
    16%  { transform: rotate(14deg)  scale(1.08); }
    26%  { transform: rotate(-18deg) scale(1.12); }
    38%  { transform: rotate(18deg)  scale(1.16); }
    50%  { transform: rotate(-16deg) scale(1.22); }
    62%  { transform: rotate(15deg)  scale(1.28); }
    74%  { transform: rotate(-11deg) scale(1.34); }
    86%  { transform: rotate(7deg)   scale(1.40); }
    100% { transform: rotate(0deg)   scale(1.44); }
}

/* 阶段 2：放大 + 淡出 */
@keyframes lv-box-pop {
    0%   { transform: rotate(0deg) scale(1.44); opacity: 1; filter: brightness(1.9); }
    55%  { transform: rotate(0deg) scale(1.85); opacity: .55; filter: brightness(2.6); }
    100% { transform: rotate(0deg) scale(2.30); opacity: 0;  filter: brightness(3.2); }
}

/* ---- 开出的物品 ---- */
.lv-drop-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: scale(.45);
    transition: opacity .26s ease, transform .34s cubic-bezier(.18, 1.5, .5, 1);
}

.lv-drop-item.show {
    opacity: 1;
    transform: scale(1);
}

/* 物品底板：背景 = 材料稀有度色（具体颜色由 JS 内联注入） */
.lv-drop-icon {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    transition: transform .2s;
}

.lv-drop-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .5));
}

.lv-drop-dot {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: block;
}

.lv-drop-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}

/* ---- 十连结果网格 ---- */
.lv-drop-grid {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
}

.lv-drop-cell {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(.6);
    animation: lv-cell-in .32s cubic-bezier(.18, 1.5, .5, 1) forwards;
}

@keyframes lv-cell-in {
    to { opacity: 1; transform: scale(1); }
}

.lv-drop-cell-num {
    position: absolute;
    right: -4px;
    bottom: -4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 6px;
    color: #0f1115;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

/* ---- 历史 ---- */
.lv-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lv-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    color: #b9b9c8;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
}

.lv-chip .lv-mat-swatch {
    width: 9px;
    height: 9px;
    border-radius: 3px;
}

/* ★ 空提示要居中显示：不只是在所属区域里横排居中，
   而是撑满可用高度、真正落在中间。以前只有 text-align:center，
   顶部一条，看起来贴在左上角。 */
.lv-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    padding: 18px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 13px;
    color: #6f6f84;
}

/* 关卡卡片本身是 tab 里的唯一元素时，撑满高度让「已达到最高等级」等空提示居中 */
#level-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#level-card > .lv-section,
#level-card > .lv-stage {
    flex: 0 0 auto;
}
/* 材料区是等级页的主体：空的时候撑满，让占位符居中找到落点 */
#level-card #lv-req-section {
    display: flex;
    flex-direction: column;
}
#level-card #lv-materials {
    flex: 1;
    min-height: 120px;
}
#level-card #lv-materials > .lv-placeholder {
    min-height: 120px;
    height: 100%;
}

/* ---- 空状态：没有方块且已到顶 ---- */
.lv-note {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #8a8a9e;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
}


/* ---- 直链图标 ---- */
.lv-box-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.lv-box-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.lv-mat-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lv-mat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.lv-drop-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.lv-chip-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
    display: block;
}

.lv-chip .lv-mat-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- 移动端 ---- */
@media (max-width: 640px) {
    #level-card { padding: 16px; }
    .lv-head { flex-wrap: wrap; }
    .lv-badge-num { font-size: 24px; }
    .lv-materials { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .lv-btn { flex: 1 1 100%; justify-content: center; }
}

/* ============================================================
   抽取台（v5）：中间一个大幸运方块，左下角抽 1，右下角抽 10
   ============================================================ */
.lv-stage {
    position: relative;
    margin-top: 20px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 50% 55%, rgba(232, 164, 55, .10), transparent 65%),
        rgba(255, 255, 255, .02);
    border: 1px solid rgba(255, 255, 255, .06);
    overflow: hidden;
}

/* 装饰光晕，跟着方块呼吸 */
.lv-stage-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 58%, rgba(232, 164, 55, .18), transparent 55%);
    animation: lv-glow-breathe 3.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lv-glow-breathe {
    0%, 100% { opacity: .55; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.08); }
}

/* ---- 中间的大幸运方块 ---- */
.lv-stage-box {
    position: relative;
    z-index: 1;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: #e8a437;
    filter: drop-shadow(0 6px 18px rgba(232, 164, 55, .35));
    transition: transform .18s ease;
}

.lv-stage-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 有方块时轻轻浮动，没方块时静止变灰 */
.lv-stage-box.is-idle {
    color: #55555f;
    filter: none;
}
.lv-stage-box.is-idle img {
    filter: grayscale(1) opacity(.35);
}

.lv-stage-box:not(.is-idle) {
    animation: lv-stage-float 3.2s ease-in-out infinite;
}

@keyframes lv-stage-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

/* 抽取中：方块疯狂抖 */
.lv-stage-box.is-shaking {
    animation: lv-stage-shake .42s ease-in-out infinite !important;
}

@keyframes lv-stage-shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20%      { transform: translate(-4px, 2px) rotate(-4deg); }
    40%      { transform: translate(4px, -2px) rotate(4deg); }
    60%      { transform: translate(-3px, -3px) rotate(-3deg); }
    80%      { transform: translate(3px, 3px) rotate(3deg); }
}

/* ---- 空箱子提示 ---- */
.lv-stage-empty {
    position: absolute;
    left: 50%;
    top: calc(50% + 62px);
    transform: translateX(-50%);
    font-size: 12px;
    color: #7a7a8c;
    white-space: nowrap;
    pointer-events: none;
}

/* ---- 左下 / 右下按钮 ---- */
.lv-draw-btn {
    position: absolute;
    bottom: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .12s, filter .2s, opacity .2s;
    white-space: nowrap;
}

.lv-draw-btn:active:not(:disabled) {
    transform: scale(.96);
}

.lv-draw-btn:disabled {
    opacity: .38;
    cursor: not-allowed;
}

/* 左下：抽取 1 个 —— 主色，最显眼 */
.lv-draw-one {
    left: 16px;
    color: #0f1115;
    background: linear-gradient(135deg, #e8a437, #f5c542);
    box-shadow: 0 4px 14px rgba(232, 164, 55, .28);
}

.lv-draw-one:hover:not(:disabled) {
    filter: brightness(1.1);
}

/* 右下：抽取 10 个 —— 次级色 */
.lv-draw-many {
    right: 16px;
    color: #f5c542;
    background: rgba(245, 197, 66, .1);
    border-color: rgba(245, 197, 66, .42);
}

.lv-draw-many:hover:not(:disabled) {
    background: rgba(245, 197, 66, .2);
}

/* ---- 落点层：盖在抽取台上 ---- */
.lv-stage .lv-drop-stage {
    position: absolute;
    inset: 0;
    margin: 0;
    z-index: 2;
    height: 100%;
    border: none;
    border-radius: 0;
    background: radial-gradient(circle at 50% 55%, rgba(10, 12, 18, .92), rgba(10, 12, 18, .96));
    border-radius: 16px;
}

/* ---- 移动端 ---- */
@media (max-width: 640px) {
    .lv-stage {
        height: 176px;
        margin-top: 16px;
    }

    .lv-stage-box {
        width: 78px;
        height: 78px;
        font-size: 52px;
    }

    .lv-stage-empty {
        top: calc(50% + 50px);
    }

    .lv-draw-btn {
        bottom: 12px;
        padding: 8px 14px;
        font-size: 12px;
    }

    .lv-draw-one {
        left: 12px;
    }

    .lv-draw-many {
        right: 12px;
    }
}


/* ============================================================
   MC 风格物品栏（v6）
   ============================================================
   槽位系统：
     * 一组 = 64 个。一个槽位只放一组。
     * 一排 9 格，和 MC 一样。
     * 仓库：排数按实际占用的槽位数动态增长（占 2 槽 → 1 排；占 10 槽 → 2 排）
     * 交付区：格数由「要交多少组」算出，不满一组也占一格
   ============================================================ */

.lv-inv-section .lv-section-title {
    margin-bottom: 10px;
}

/* ---- 槽位网格：一排 9 格 ---- */
.lv-inv {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 6px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(255, 255, 255, .06);
    /* MC 物品栏的那种内凹感 */
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, .35);
}

/* ---- 单个槽位 ---- */
.lv-slot {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: background .12s, border-color .12s, transform .08s;
}

/* 空槽：什么都不画 */
.lv-slot.is-empty {
    background: rgba(0, 0, 0, .18);
    border-color: rgba(255, 255, 255, .04);
    box-shadow: inset 0 1px 6px rgba(0, 0, 0, .4);
}

/* 有物品的槽位 */
.lv-slot.is-filled {
    cursor: pointer;
}

.lv-slot.is-filled:hover {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .32);
    /* MC 里鼠标划过格子的高亮 */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 0 10px rgba(255, 255, 255, .1);
    z-index: 1;
}

.lv-slot.is-filled:active {
    transform: scale(.94);
}

/* 右键（拿一半/放一个）时闪一下不同颜色 */
.lv-slot.is-filled.flash-half {
    border-color: #f5c542;
    box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .6), 0 0 12px rgba(245, 197, 66, .3);
}

/* ---- 槽位里的物品图标 ---- */
.lv-slot-icon {
    width: 64%;
    height: 64%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    /* 图标自带的像素感 */
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}

/* 没有图标时退回色块 */
.lv-slot-dot {
    width: 46%;
    height: 46%;
    border-radius: 3px;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

/* ---- 数量角标（MC 右下角的小数字） ---- */
.lv-slot-stack {
    position: absolute;
    right: 3px;
    bottom: 1px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow:
        1px 1px 0 #000, -1px 1px 0 #000,
        1px -1px 0 #000, -1px -1px 0 #000,
        0 2px 4px rgba(0, 0, 0, .8);
    pointer-events: none;
    letter-spacing: -.3px;
}

/* 满组（64）的数字用金色，和 MC 的「堆满」呼应 */
.lv-slot.is-full .lv-slot-stack {
    color: #ffd95e;
}

/* ---- 交付区：需求格 ---- */
.lv-inv-req {
    background:
        linear-gradient(180deg, rgba(232, 164, 55, .06), rgba(0, 0, 0, .22));
    border-color: rgba(232, 164, 55, .18);
}

/* 交得起的格子：绿色描边 + 勾 */
.lv-inv-req .lv-slot.is-filled.is-met {
    border-color: rgba(85, 216, 139, .55);
    background: linear-gradient(145deg, rgba(85, 216, 139, .16), rgba(85, 216, 139, .05));
    box-shadow: inset 0 0 0 1px rgba(85, 216, 139, .35);
}

/* 交不起的格子：红色描边 + 变暗 */
.lv-inv-req .lv-slot.is-filled.is-lack {
    border-color: rgba(249, 117, 131, .45);
    background: linear-gradient(145deg, rgba(249, 117, 131, .12), rgba(249, 117, 131, .03));
}

.lv-inv-req .lv-slot.is-lack .lv-slot-icon,
.lv-inv-req .lv-slot.is-lack .lv-slot-dot {
    opacity: .45;
    filter: grayscale(.6);
}

/* 交付区空提示 */
.lv-inv-empty {
    grid-column: 1 / -1;
    padding: 22px 12px;
    text-align: center;
    font-size: 13px;
    color: #6f6f84;
}

/* ---- 跟随光标的「手上的物品」 ---- */
/* 挂在 body 下（JS 会强制搬过去），所以这里的 fixed 一定相对视口。
   left/top 由 JS 用 clientX/clientY 写入，配合 -50% 让图标中心对准指针。 */
.lv-held {
    position: fixed;
    z-index: 9999;
    width: 44px;
    height: 44px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .6));
}

.lv-held .lv-slot-icon {
    width: 100%;
    height: 100%;
}

.lv-held .lv-slot-stack {
    right: -2px;
    bottom: -2px;
    font-size: 13px;
}

/* ---- 移动端：格子小一点，一排 9 个仍保留 ---- */
@media (max-width: 640px) {
    .lv-inv {
        gap: 4px;
        padding: 7px;
    }

    .lv-slot {
        border-radius: 5px;
    }

    .lv-slot-stack {
        font-size: 10px;
        right: 2px;
    }

    .lv-held {
        width: 36px;
        height: 36px;
    }
}

/* ---- 抽取台：没方块时置灰 （见 .lv-stage-box.is-idle） ---- */
.lv-stage-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    image-rendering: pixelated;
}

/* ============================================================
   拒绝反馈 / 落格回弹 / MC tooltip
   ============================================================ */

/* 放不下时红闪一下。物品一个都不动 —— 这是 MC 的真实行为。 */
.lv-slot.is-reject {
    animation: lv-slot-reject .32s ease-out;
}

@keyframes lv-slot-reject {
    0%   { box-shadow: inset 0 0 0 2px rgba(255, 70, 70, .95), 0 0 14px rgba(255, 70, 70, .55); }
    45%  { box-shadow: inset 0 0 0 2px rgba(255, 70, 70, .55), 0 0 8px rgba(255, 70, 70, .30); }
    100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
}

/* 放下时的轻微放大回弹，由 JS 用 Web Animations 驱动 */
.lv-slot.is-pop {
    animation: none;
}

/* 交付区：右下角「已交/目标」进度 */
.lv-slot-progress {
    position: absolute;
    left: 2px;
    bottom: 1px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #9a9aa8;
    font-variant-numeric: tabular-nums;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 0 2px 4px rgba(0, 0, 0, .8);
    pointer-events: none;
}

/* 交付区格子交满：绿框 + 绿色进度 */
.lv-inv-req .lv-slot.is-done {
    border-color: rgba(85, 216, 139, .7);
    background: linear-gradient(145deg, rgba(85, 216, 139, .18), rgba(85, 216, 139, .06));
    box-shadow: inset 0 0 0 1px rgba(85, 216, 139, .45);
}

.lv-inv-req .lv-slot.is-done .lv-slot-progress {
    color: #55d88b;
}

/* 交付区可点击（仓库够料时的手型提示） */
.lv-inv-req .lv-slot.is-filled {
    cursor: pointer;
}

/* 交付区不可拾取：图标不跟鼠标走 */
.lv-inv-req .lv-slot .lv-slot-icon,
.lv-inv-req .lv-slot .lv-slot-dot {
    pointer-events: none;
}

/* ============================================================
   只读态：看别人的物品栏（#level-card.is-readonly）
   不能拾取、不能拖拽、不能交付 —— 光标和悬停反馈一起收掉。
   ============================================================ */
.is-readonly .lv-slot.is-filled {
    cursor: default;
}

.is-readonly .lv-slot.is-filled:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
    border-color: rgba(255, 255, 255, .09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.is-readonly .lv-slot.is-filled:active {
    transform: none;
}

/* 交付区在只读态下没有"可点击扣除"的暗示 */
.is-readonly .lv-inv-req .lv-slot.is-filled {
    cursor: default;
}

/* 拖拽划过的高亮：告诉玩家"这一格已经算进去了" */
.lv-slot.is-drag-over {
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

/* 拖拽进行中禁止文本选择，否则划过去会选中一片文字 */
.lv-inv.is-dragging,
.lv-inv.is-dragging * {
    user-select: none;
}

/* MC 风格 tooltip：紫边黑底、物品名用稀有度色 */
.lv-tip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    padding: 5px 9px;
    border-radius: 3px;
    background: rgba(16, 0, 16, .94);
    border: 2px solid #2b0a4a;
    box-shadow:
        inset 0 0 0 1px rgba(80, 30, 130, .9),
        0 4px 14px rgba(0, 0, 0, .55);
    font-size: 12.5px;
    line-height: 1.35;
    letter-spacing: .2px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.lv-tip-name {
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .8);
}

.lv-tip-count {
    color: #9a9aa8;
    font-size: 11.5px;
    margin-top: 1px;
}

/* 光标上的物品：捏着的感觉 */
.lv-held {
    transition: width .06s ease-out, height .06s ease-out;
}

/* 尊重系统减弱动效设置：关掉抖动/回弹/红闪 */
@media (prefers-reduced-motion: reduce) {
    .lv-slot,
    .lv-slot.is-reject,
    .lv-held {
        animation: none !important;
        transition: none !important;
    }

    .lv-slot.is-reject {
        box-shadow: inset 0 0 0 2px rgba(255, 70, 70, .9) !important;
    }
}

