.barracks-panel {
    position: absolute;
    inset: 0;
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #1a2438;
}

/* ===== 顶部总览条 ===== */
.barracks-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    box-sizing: border-box;
    background: rgb(0 35 49 / 70%);
    pointer-events: none;
}

.barracks-top-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.barracks-top-stat {
    color: #ffd75e;
    font-size: 13px;
    text-shadow: 1px 1px 2px #000;
    white-space: nowrap;
    font-weight:600;
}

.barracks-top-right {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 8px;
    max-width: 260px;
}

.barracks-top-num {
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 8px;
}

    .barracks-top-num img {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }

    .barracks-top-num span {
        color: #fff;
        font-size: 12px;
        text-shadow: 1px 1px 2px #000;
    }

/* ===== 关闭按钮 ===== */
.barracks-close-btn {
    position: absolute;
    width: 36px;
    height: 36px;
    border: none;
    padding: 0;
    background: transparent;
    z-index: 2000;
    cursor: pointer;
    bottom: 8px;
    left: 8px;
}

    .barracks-close-btn img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
/* 详情/主城弹框打开时隐藏主页关闭按钮 */
.barracks-panel.show-detail .barracks-close-btn,
.barracks-panel.show-city .barracks-close-btn {
    display: none;
}

/* ===== 主页大地图 ===== */
.barracks-main-view {
    position: absolute;
    inset: 0;
    z-index: 1000;
}

.barracks-wrap {
    position: absolute;
    inset: 0;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: none;
}

    .barracks-wrap::-webkit-scrollbar {
        display: none;
    }

.barracks-map {
    position: absolute;
    inset: 0;
    z-index: 1;
}
/* 舞台容器尺寸由背景原始尺寸和可视区域高度动态计算 */
.barracks-stage {
    position: relative;
}

.barracks-map-bg {
    position: absolute;
    inset: 0;
    width: auto;
    height: 100%;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    z-index: 0;
}

/* ===== 建筑 ===== */
.barracks-building {
    position: absolute;
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.barracks-building-img {
    width: 100px;
    height: auto;
    display: block;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(30px 0px 8px rgba(0, 0, 0, 0.4));
}

.barracks-building-icon-wrap {
    position: relative;
    width: 100px;
    height: auto;
    line-height: 0;
}

.barracks-building-tag {
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 5;
    width: 80px;
    transform: translateX(-50%);
    pointer-events: none;
}

.barracks-building-tag > img {
    display: block;
    width: 100%;
    height: auto;
}

.barracks-building-tag > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f1f1f1;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.barracks-building-level {
    color: #ffd75e;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    margin-bottom: 2px;
    z-index: 2;
    background-color: #000000d4;
    padding: 2px 6px;
    border-radius: 4px;
}
/* 升级进度条：宽度为建筑图标一半，高25px，位于建筑中间 */
.barracks-building-progress {
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 18px;
    background: linear-gradient(90deg, #3a4949, #0f6f81);
    border: 2px solid #00433f;
    border-radius: 10px;
    overflow: hidden;
    z-index: 3;
}

.barracks-progress-inner {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #5ce07a, #2fbf4f);
    border-radius: 10px;
    transition: width 0.3s linear;
}
/* 倒计时在进度条内部中间显示 */
.barracks-progress-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    line-height: 1;
    z-index: 2;
    pointer-events: none;
}

.barracks-building-gif {
    position: absolute;
    left: 50%;
    top: calc(50% - 55px);
    transform: translateX(-50%);
    width: 40px;
    height: auto;
    object-fit: contain;
    z-index: 3;
    pointer-events: none;
}

.barracks-building-upgrade {
    margin-top: 4px;
    width: 60px;
    height: 20px;
    border: 0;
    color: #492700;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding:0;
}

.barracks-building-upgrade:active {
    transform: scale(0.96);
}
/* 升级成功 gif：显示在建筑图标上（与升级进度条位置一致），1秒后隐藏（100px 宽，高度自适应） */
.barracks-up-success {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: auto;
    object-fit: contain;
    z-index: 6;
    pointer-events: none;
}
/* 首页建筑升级加速按钮：位于升级进度条右侧 */
.barracks-building-speedup {
    position: absolute;
    left: calc(50% + 46px);
    top: 55%;
    transform: translateY(-50%);
    width: 50px;
    height: 18px;
    border: 0;
    color: #492700;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    z-index: 3;
}

/* ===== 详情页 ===== */
.barracks-detail-view {
    position: absolute;
    inset: 0;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    background: rgba(12, 18, 32, 0.94);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .barracks-detail-view::-webkit-scrollbar {
        display: none;
    }

.barracks-detail-back {
    position: fixed;
    width: 36px;
    height: 36px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    bottom: 8px;
    left: 8px;
    z-index: 2000;
}

    .barracks-detail-back img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.barracks-dismiss-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 2000;
    width: 72px;
    height: 27px;
    border: 0;
}

.barracks-detail-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px;
}

.barracks-detail-icon-box {
    position: relative;
    flex: 0 0 auto;
}

.barracks-detail-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.barracks-detail-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.barracks-detail-name {
    color: #ffd75e;
    font-size: 18px;
    font-weight: bold;
}

.barracks-detail-desc {
    color: #c8d4ea;
    font-size: 12px;
    line-height: 1.5;
}

/* ===== 兵种属性（每行2个） ===== */
.barracks-attr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    padding: 4px 12px;
}

.barracks-attr-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
}

    .barracks-attr-item .attr-name {
        color: #9fb4d8;
    }

    .barracks-attr-item .attr-val {
        color: #ffd75e;
        font-weight: bold;
    }

/* "全部属性"折叠按钮 */
.barracks-attr-more {
    grid-column: 1 / -1;
    text-align: center;
    color: #ffd75e;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    padding: 3px 0;
    text-decoration: underline;
    user-select: none;
    -webkit-user-select: none;
}

.barracks-attr-more:active {
    opacity: 0.7;
}

/* 展开的全部属性区 */
.barracks-attr-extras {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    grid-column: 1 / -1;
}

/* ===== 主城入口 ===== */
/* ===== 兵营 NPC 行走 ===== */
/* 测试用：调整路径的关闭图标（相对定位显示，后续删除） */
.barracks-npc-test-close {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 99;
    width: 30px;
    height: 30px;
    border: 0;
    color: #492700;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.barracks-npc {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.barracks-npc-img {
    display: block;
    object-fit: contain;
    height: auto;
}

    .barracks-npc-img.flip {
        transform: scaleX(-1);
    }

.barracks-npc-bubble {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 11px;
    line-height: 1.4;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 10;
}

.barracks-corner {
    position: absolute;
    left: 8px;
    top: 64px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
}

.barracks-corner-row {
    color: #ffd75e;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    background: rgb(0 0 0 / 55%);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.barracks-top-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 4px;
}
/* 总战力数值变化放大特效（0.5秒） */
.fighting-pop {
    animation: fightingPop 0.5s ease-out;
}
@keyframes fightingPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}
/* 主城 200x200 透明区域：相对背景固定（left/top 由全局变量 cityPos 控制） */
.barracks-city-area {
    position: absolute;
    width: 200px;
    height: 200px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background: transparent;
}

.barracks-city-area-action {
    display: flex;
    align-items: center;
    gap: 6px;
}

.barracks-city-area-progress {
    position: relative;
    width: 120px;
    height: 25px;
    background: linear-gradient(90deg, #3a4949, #0f6f81);
    border: 2px solid #00433f;
    border-radius: 10px;
    overflow: hidden;
}

.barracks-city-area-action button {
    border: 0;
    color: #492700;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    height: 20px;
    width: 60px;
    padding: 0;
}

.barracks-city-area-max {
    color: #ffd75e;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

/* ===== 主城信息弹框 ===== */
.barracks-city-modal {
    position: absolute;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}

.barracks-city-card {
    width: 100%;
    height: 64%;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    padding: 30px 20px 40px 20px;
}

.barracks-city-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

    .barracks-city-close img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.barracks-city-title {
    color: #664d00;
    font-size: 18px;
    font-weight: bold;
    margin-top: 18px;
}

.barracks-city-level-text {
    color: #ff9d3c;
    margin-left: 6px;
}

.barracks-city-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px 4px 16px;
}

.barracks-city-info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
}

    .barracks-city-info-line .info-name {
        color: #3a3a3a;
    }

    .barracks-city-info-line .info-val {
        color: #664d00;
        font-weight: bold;
    }

        .barracks-city-info-line .info-val .next {
            color: #5ce07a;
        }
/* 已解锁/未解锁兵种列表 */
.barracks-city-unlocks {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 16px 16px 16px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .barracks-city-unlocks::-webkit-scrollbar {
        display: none;
    }

.barracks-city-unlock-title {
    color: #664d00;
    font-size: 14px;
    font-weight: bold;
    margin: 8px 0 6px 0;
    text-align: center;
}

.barracks-city-unlock-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.barracks-city-unlock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
}

    .barracks-city-unlock-item img {
        width: 44px;
        height: 44px;
        object-fit: contain;
    }

    .barracks-city-unlock-item span {
        color: #3a3a3a;
        font-size: 11px;
        text-align: center;
    }

    .barracks-city-unlock-item .unlock-need {
        color: #ff5e5e;
    }

/* ===== 未解锁兵种 ===== */
.barracks-building.locked .barracks-building-img {
    filter: brightness(0.6) drop-shadow(30px 0px 8px rgba(0, 0, 0, 0.4));
}

.barracks-lock-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 30px;
    height: 30px;
    object-fit: contain;
    z-index: 4;
    pointer-events: none;
}

/* ===== 强化等级图标 ===== */
.barracks-enhance-level-icon {
    width: 42px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.barracks-max-level-icon {
    width: 40px;
    height: 26px;
    object-fit: contain;
}

/* ===== 详情页区域 ===== */
.barracks-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

    .barracks-section:last-child {
        border-bottom: none;
    }

.barracks-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    color: #96dfff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

    .barracks-section-title::before {
        content: '';
        width: 4px;
        height: 14px;
        border-radius: 2px;
        background: linear-gradient(180deg, #ffd75e, #d99a2b);
        flex: 0 0 auto;
    }
/* 标题后附加信息（耗时/拥有、强化等级），显眼字体 */
.barracks-section-extra {
    margin-left: 5px;
    color: #ffc000;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

#barracks-train-extra {
    margin-left: 0;
    color: #ffd75e;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

    #barracks-train-extra .extra-sub {
        color: #ff9500;
        display: inline-block;
    }
    /* 制作完成：拥有数量文字放大特效（0.5秒） */
    #barracks-train-extra .extra-sub.extra-sub-pop {
        animation: extraSubPop 0.5s ease-out;
    }
    @keyframes extraSubPop {
        0% { transform: scale(1); }
        40% { transform: scale(1.6); }
        100% { transform: scale(1); }
    }
    /* 制作完成飞入图标：从右上角移动到拥有数量位置（1秒） */
    .barracks-fly-icon {
        position: absolute;
        z-index: 4000;
        width: 34px;
        height: 34px;
        object-fit: contain;
        pointer-events: none;
        transition: left 1s linear, top 1s linear;
    }

.barracks-detail-mid {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 4px 12px;
    gap: 4px;
}

.barracks-train-cost {
    display: flex;
    align-items: center;
    gap: 10px 4px;
    flex-wrap: wrap;
    padding: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.barracks-train-cost-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

    .barracks-train-cost-item img {
        width: 22px;
        height: 22px;
        object-fit: contain;
    }

    .barracks-train-cost-item .cost-num {
        color: #fff;
        font-size: 13px;
    }

        .barracks-train-cost-item .cost-num.enough {
            color: #5ce07a;
        }

        .barracks-train-cost-item .cost-num.lack {
            color: #ff5e5e;
        }

.barracks-train-time-text {
    color: #9fb4d8;
    font-size: 12px;
}

.barracks-btn {
    border: 0;
    color: #492700;
    font-size: 13px;
    font-weight: bold;
    padding: 4px;
    cursor: pointer;
    min-width: 70px;
}

    .barracks-btn:active {
        transform: scale(0.96);
    }

    .barracks-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.barracks-train-btn {
    align-self: center;
    width: 90px;
    height: 30px;
}

.barracks-queue-title {
    color: #ff9500;
    font-size: 14px;
    margin-top: 2px;
    font-weight: 600;
}

.barracks-queue {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: auto;
    min-height: 40px;
    border-radius: 6px;
    background-color: #3a686d5e;
}

.barracks-queue-empty {
    color: #9fb4d8;
    font-size: 12px;
    text-align: center;
    height: 46px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barracks-queue-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    height: 46px;
    box-sizing: border-box;
}

    .barracks-queue-item img {
        width: 34px;
        height: 34px;
        object-fit: contain;
    }

    .barracks-queue-item .queue-progress {
        position: relative;
        flex: 1;
        height: 20px;
        background: linear-gradient(90deg, #3a4949, #0f6f81);
        border: 2px solid #00433f;
        border-radius: 10px;
        overflow: hidden;
    }

        .barracks-queue-item .queue-progress .barracks-progress-inner {
            background: linear-gradient(90deg, #5ce07a, #2fbf4f);
            border-radius: 10px;
        }

        .barracks-queue-item .queue-progress .barracks-progress-text {
            font-size: 12px;
        }

    .barracks-queue-item .queue-time {
        display: none;
    }

    .barracks-queue-item .queue-speedup,
    .barracks-queue-item .queue-speedup-all {
        border: 0;
        cursor: pointer;
        width: 60px;
        height: 24px;
    }

    .barracks-queue-item .queue-speedup-all {
        width: 76px;
        color: #492700;
        font-size: 12px;
        font-weight: bold;
    }

.barracks-item-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.barracks-item-count {
    color: #fff;
    font-size: 13px;
    min-width: 48px;
}

    .barracks-item-count.enough {
        color: #5ce07a;
    }

    .barracks-item-count.lack {
        color: #ff5e5e;
    }

/* ===== 强化区域 ===== */
.barracks-enhance-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 12px 8px 12px;
}

.barracks-enhance-line {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
}

    .barracks-enhance-line .attr-name {
        color: #9fb4d8;
    }

    .barracks-enhance-line .attr-val {
        color: #ffd75e;
        font-weight: bold;
    }

        .barracks-enhance-line .attr-val .next {
            color: #5ce07a;
        }

.barracks-enhance-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    justify-content: end;
}

/* ===== 技能独立区域 ===== */
.barracks-skill-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
}

.barracks-skill-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.barracks-skill-panel-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.barracks-skill-level {
    color: #ffd75e;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.barracks-skill-panel-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.barracks-skill-panel-name {
    color: #7fd8ff;
    font-size: 13px;
    font-weight: bold;
}

.barracks-skill-panel-desc {
    color: #c8d4ea;
    font-size: 11px;
    line-height: 1.5;
    word-break: break-all;
}

.barracks-skill-upgrade-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    justify-content: end;
}

    .barracks-skill-upgrade-row .barracks-item-icon {
        width: 24px;
        height: 24px;
    }

.barracks-skill-cost-num {
    color: #fff;
    font-size: 12px;
    min-width: 40px;
}

    .barracks-skill-cost-num.lack {
        color: #ff5e5e;
    }

.skill-num {
    color: #5ce07a;
    font-weight: bold;
}

/* ===== 弹框 ===== */
.barracks-modal {
    position: absolute;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}

.barracks-modal-card {
    width: 300px;
    /* background: #2a3a55; */
    /* border: 2px solid #4a5a78; */
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    height: 300px;
    padding: 50px 40px;
}
/* 简单确认弹框（无滑块），不占满 300px */
.barracks-modal-compact {
    height: 250px;
    gap: 35px;
    padding: 40px;
}

.barracks-modal-title {
    color: #664d00;
    font-size: 15px;
    font-weight: bold;
}

.barracks-modal-desc {
    color: #3a3a3a;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
}

.barracks-modal-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

    .barracks-modal-row input[type="range"] {
        flex: 1;
        min-width: 0;
    }

.barracks-modal-count {
    color: #9e4f00;
    font-size: 13px;
    width: 80px;
    text-align: center;
}

.barracks-modal-btns {
    display: flex;
    gap: 12px;
}

/* ===== 医馆 ===== */
/* 医馆详情弹框：整屏100%高度，bg_xiao2 区域高度50%，上下居中，内边距50px */
.barracks-infi-modal {
    position: absolute;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 0px;
    box-sizing: border-box;
}
.barracks-infi-dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 80%;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 40px 20px;
}
.barracks-infi-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.barracks-infi-close img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* 复活徽章：圆形红底白字，30×30，字号25px，摇摆动画，位于升级进度条下方 */
.barracks-hos-badge {
    position: absolute;
    left: 35%;
    transform: translateX(-50%);
    top: 60%;
    z-index: 10;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: linear-gradient(180deg, #ff5a5a, #d92f2f);
    color: #fff;
    font-size: 25px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    animation: hos-wobble 0.9s ease-in-out infinite;
}
@keyframes hos-wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(8deg); }
    50% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
}

/* 医馆详情弹框 */
.barracks-infi-title {
    text-align: center;
    color: #664d00;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 12px 6px;
}
.barracks-infi-info {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    margin: 6px 12px;
}
.barracks-infi-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: #3a3a3a;
}
.barracks-infi-val {
    font-weight: bold;
    color: #9e4f00;
}
/* 下级加成：绿色字体 */
.barracks-infi-up {
    font-weight: bold;
    color: #3fae4a;
    font-size: 13px;
}
.barracks-infi-sec {
    font-size: 13px;
    font-weight: bold;
    color: #664d00;
    padding: 8px 12px 2px;
    text-align: center;
}
.barracks-infi-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 12px;
    justify-content: center;
}
.barracks-infi-btns {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 医馆复活队列区域 */
.barracks-infi-queue-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
}
.barracks-infi-queue-wrap .barracks-queue-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
}
.barracks-infi-queue-wrap .barracks-queue-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}
.barracks-infi-queue-wrap .queue-progress {
    flex: 1;
    position: relative;
    height: 25px;
    background: linear-gradient(90deg, #3a4949, #0f6f81);
    border: 2px solid #00433f;
    border-radius: 10px;
    overflow: hidden;
    min-width: 0;
}

/* 医馆可领取兵种图标 + 数量徽章 */
.barracks-infi-ready-item {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: 62px;
}
.barracks-infi-ready-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.barracks-infi-ready-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: linear-gradient(180deg, #ff5a5a, #d92f2f);
    color: #331b00;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-sizing: border-box;
}
