* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow: hidden;
}

/* 登录面板（输入 playerId + 选择房间） */
.login-panel {
    position: fixed;
    inset: 0;
    background: var(--ui-bg-scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 5000;
}

.login-content {
    width: min(520px, calc(100vw - 24px));
    max-height: min(78vh, 640px);
    overflow: auto;
}

.login-step {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 2px;
}

.login-hint {
    color: var(--ui-text-muted);
    font-family: var(--ui-font-ui);
    line-height: 1.6;
    font-size: 13px;
}

.login-em {
    color: var(--ui-accent-gold-bright);
    font-weight: 800;
}

.login-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-label {
    font-size: 12px;
    color: rgba(240, 240, 240, 0.9);
    letter-spacing: 0.6px;
    font-family: var(--ui-font-ui);
}

.login-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(139, 115, 85, 0.55);
    background: rgba(18, 18, 18, 0.6);
    color: var(--ui-text-primary);
    outline: none;
    font-size: 14px;
    font-family: var(--ui-font-ui);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-input:focus {
    border-color: rgba(212, 175, 55, 0.7);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.login-room-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.login-room-chip,
.login-room-item {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(139, 115, 85, 0.45);
    background: rgba(20, 18, 16, 0.6);
    color: rgba(240, 240, 240, 0.92);
    cursor: pointer;
    font-family: var(--ui-font-ui);
    font-size: 12px;
    transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease;
}

.login-room-chip:hover,
.login-room-item:hover {
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, 0.55);
}

.login-room-chip.active,
.login-room-item.active {
    border-color: rgba(212, 175, 55, 0.85);
    background: rgba(212, 175, 55, 0.14);
    color: var(--ui-accent-gold-bright);
    font-weight: 800;
}

.login-room-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.login-room-meta {
    opacity: 0.6;
    font-size: 10px;
    margin-left: 4px;
}

.login-loading,
.login-empty {
    border: 1px dashed rgba(139, 115, 85, 0.45);
    background: rgba(10, 10, 10, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--ui-text-muted);
    font-family: var(--ui-font-ui);
    line-height: 1.5;
}

.login-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.login-error {
    border: 1px solid rgba(196, 92, 92, 0.55);
    background: rgba(196, 92, 92, 0.12);
    color: rgba(255, 230, 230, 0.92);
    font-family: var(--ui-font-ui);
    padding: 8px 10px;
    border-radius: 10px;
    line-height: 1.5;
    font-size: 12px;
}

.login-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 4px;
}

.login-actions--split {
    justify-content: space-between;
}

.login-primary {
    min-width: 180px;
}

/* 顶部信息边条；--top-bar-measured 由 JS 写入实际高度（多行时），用于对齐 #gameCanvas */
:root {
    --game-top-bar-inner-h: 30px;
    /* 水墨国风 UI 令牌 — 见 docs/UI_STYLE_GUIDE.md */
    --ui-bg-base: #141414;
    --ui-bg-elevated: rgba(26, 26, 26, 0.96);
    --ui-bg-scrim: rgba(0, 0, 0, 0.88);
    --ui-border-gold: #8b7355;
    --ui-border-subtle: rgba(212, 175, 55, 0.35);
    --ui-accent-gold: #d4af37;
    --ui-accent-gold-bright: #e8c547;
    --ui-accent-cinnabar: #c45c5c;
    --ui-accent-cinnabar-hover: #d65a5a;
    --ui-semantic-ally: #5b8bc4;
    --ui-semantic-enemy: #c45c5c;
    --ui-semantic-ally-hp: #4a7ab8;
    --ui-semantic-enemy-hp: #b84040;
    --ui-text-primary: #f0f0f0;
    --ui-text-muted: #a8a8a8;
    --ui-font-display: 'Microsoft YaHei', 'SimHei', serif;
    --ui-font-ui: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    --ui-radius-panel: 8px;
    --ui-radius-card: 6px;
    --ui-shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 全局滚动条主题（与水墨金边 UI 一致）
   - Chromium/WebKit: ::-webkit-scrollbar*
   - Firefox: scrollbar-color / scrollbar-width
*/
:root {
    --ui-scrollbar-track: rgba(139, 115, 85, 0.14);
    --ui-scrollbar-thumb: rgba(139, 115, 85, 0.55);
    --ui-scrollbar-thumb-hover: rgba(160, 130, 100, 0.75);
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

/* WebKit 系滚动条（全局） */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--ui-scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: var(--ui-scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, 0.28);
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--ui-scrollbar-thumb-hover);
}

/* 细滚动容器（横向为主的条） */
.top-bar-right,
.card-system-tabs,
.draw-result-row {
    scrollbar-width: thin;
    scrollbar-color: var(--ui-scrollbar-thumb) transparent;
}

.game-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: calc(var(--game-top-bar-inner-h) + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px max(10px, env(safe-area-inset-right, 0px)) 6px max(10px, env(safe-area-inset-left, 0px));
    padding-top: calc(4px + env(safe-area-inset-top, 0px));
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(18, 16, 22, 0.94) 0%, rgba(10, 9, 14, 0.92) 100%);
    border-bottom: 1px solid rgba(139, 115, 85, 0.45);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    color: #e8e6e3;
    font-size: 12px;
    font-family: var(--ui-font-ui);
    z-index: 999;
}

.game-top-bar .top-bar-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 8px 10px;
    flex: 1;
    min-width: 0;
    min-height: var(--game-top-bar-inner-h);
}

.game-top-bar .settings-gear-btn {
    flex-shrink: 0;
    margin-left: 0;
    align-self: flex-start;
    width: 28px;
    height: 26px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-top: 1px;
}

.top-bar-left {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.top-bar-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--ui-accent-gold-bright);
    background: radial-gradient(circle at 35% 25%, rgba(80, 70, 55, 0.9), rgba(22, 18, 14, 0.98));
    border: 2px solid rgba(200, 170, 100, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.top-bar-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.top-bar-line {
    line-height: 1.35;
    font-size: 11px;
    color: var(--ui-text-muted);
}

.top-bar-line--title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.top-bar-tag {
    padding: 1px 6px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(139, 115, 85, 0.35);
    color: var(--ui-accent-gold-bright);
    font-size: 11px;
    font-weight: 700;
}

.top-bar-player-name {
    color: var(--ui-text-primary);
    font-weight: 700;
    font-size: 14px;
}

.top-bar-line--sub {
    font-size: 12px;
}

.top-bar-dot {
    opacity: 0.5;
    margin: 0 2px;
}

.top-bar-main-city {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: var(--ui-semantic-ally);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
}

.top-bar-main-city:hover {
    color: #8ec8ff;
}

.top-bar-line--time {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.top-bar-alliance {
    color: #b0a0d8;
    font-size: 11px;
}

.top-bar-line--mp {
    font-size: 10px;
    opacity: 0.85;
}

.top-bar-mp {
    opacity: 0.9;
}

.top-bar-defeated {
    padding: 1px 6px;
    border-radius: 2px;
    background: rgba(140, 40, 40, 0.45);
    color: #ffb0b0;
    font-size: 11px;
    font-weight: 700;
}

.top-bar-right {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.top-bar-res {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 6px;
    min-width: 86px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(100, 90, 80, 0.35);
}

.top-bar-res-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    border-radius: 4px;
    color: #2a2218;
}

.top-bar-res--wood .top-bar-res-icon {
    background: linear-gradient(135deg, #6d9e5a 0%, #4a7a42 100%);
}

.top-bar-res--iron .top-bar-res-icon {
    background: linear-gradient(135deg, #8a8a9a 0%, #5a5a6a 100%);
}

.top-bar-res--stone .top-bar-res-icon {
    background: linear-gradient(135deg, #a89880 0%, #6a5a48 100%);
}

.top-bar-res--grain .top-bar-res-icon {
    background: linear-gradient(135deg, #c4a060 0%, #8a7038 100%);
}

.top-bar-res-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.top-bar-res-rate {
    font-size: 10px;
    color: #7dd3a0;
    font-variant-numeric: tabular-nums;
}

.top-bar-res-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--ui-text-primary);
    font-variant-numeric: tabular-nums;
}

.top-bar-res-max {
    font-size: 10px;
    font-weight: 600;
    color: var(--ui-text-muted);
}

.top-bar-res-label {
    align-self: center;
    font-size: 10px;
    color: var(--ui-text-muted);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.08em;
    margin-left: 2px;
}

/* 窄屏：一行放不下时多行换行，背景随内容增高；不再用横向滚动 */
@media (max-width: 768px) {
    :root {
        --game-top-bar-inner-h: 26px;
    }

    .game-top-bar {
        gap: 6px;
        padding-left: max(6px, env(safe-area-inset-left, 0px));
        padding-right: max(4px, env(safe-area-inset-right, 0px));
        font-size: 11px;
    }

    .game-top-bar .top-bar-inner {
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 5px 10px;
        row-gap: 5px;
        overflow-x: visible;
        overflow-y: visible;
    }

    .game-top-bar .settings-gear-btn {
        width: 28px;
        height: 26px;
        font-size: 16px;
    }
}

/* 横屏且较矮：进一步压缩顶栏高度，避免占满可视区 */
@media (orientation: landscape) and (max-height: 500px) {
    :root {
        --game-top-bar-inner-h: 22px;
    }

    .game-top-bar {
        font-size: 10px;
        gap: 4px;
    }

    .game-top-bar .top-bar-inner {
        gap: 4px 8px;
        row-gap: 4px;
    }

    .game-top-bar .settings-gear-btn {
        width: 26px;
        height: 24px;
        font-size: 14px;
    }
}

.multiplayer-status {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: rgba(0,0,0,0.85);
    border: 1px solid #5a8a5a;
    border-radius: 4px;
    font-size: 12px;
    color: #8bc98b;
    z-index: 999;
    display: none;
}

#gameCanvas {
    display: block;
    position: fixed;
    /* JS 写入 --top-bar-measured 为 #gameTopBar 实际高度（含安全区 padding、多行） */
    top: var(--top-bar-measured, calc(var(--game-top-bar-inner-h) + env(safe-area-inset-top, 0px)));
    left: 0;
    width: 100%;
    height: calc(100vh - var(--top-bar-measured, calc(var(--game-top-bar-inner-h) + env(safe-area-inset-top, 0px))));
    background: #1a1a1a;
    cursor: default;
    /* 移动端：由画布接管平移，避免整页滚动抢走滑动 */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 控制面板（left/top 由 JS 根据选中城池位置动态设置，显示在城池旁） */
#controlPanel {
    position: fixed;
    width: auto;
    max-width: min(92vw, 980px);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    z-index: 1000;
}

/* 城池 HUD（参考截图：左信息/中标题/右类型/最右按钮） */
.city-hud {
    display: grid;
    grid-template-columns: 156px minmax(186px, 1fr) 88px auto;
    align-items: stretch;
    gap: 6px;
    padding: 0;
    height: 0 !important;
}

.city-hud-left, 
.city-hud-mid,
.city-hud-type {
    height: 0 !important;
}

.city-hud-left-card,
.city-hud-mid-card,
.city-hud-type-card {
    background: rgba(6, 8, 12, 0.78);
    border: 1px solid rgba(200, 175, 110, 0.38);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
}

.city-hud-left-card {
    padding: 5px 7px;
}

.city-hud-left-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 16px;
    font-family: var(--ui-font-ui);
    font-size: 10px;
}

.city-hud-left-k {
    color: rgba(220, 210, 195, 0.85);
    letter-spacing: 0.08em;
}

.city-hud-left-v {
    color: rgba(245, 240, 232, 0.95);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.city-hud-mid-card {
    padding: 5px 8px 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.city-hud-owner {
    color: rgba(232, 197, 71, 0.92);
    font-family: var(--ui-font-ui);
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-hud-city-name {
    color: rgba(245, 240, 232, 0.97);
    font-family: var(--ui-font-ui);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-hud-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 4px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #0b0e14;
    background: linear-gradient(180deg, #e8c547 0%, #b89830 100%);
    border: 1px solid rgba(0, 0, 0, 0.35);
}

.city-hud-tag--main {
    background: linear-gradient(180deg, #6ab8e8 0%, #3a78a8 100%);
    color: #091018;
}

.city-hud-type-card {
    padding: 5px 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.city-hud-type-ic {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.20) 0%, transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(0, 0, 0, 0.25) 100%),
        linear-gradient(180deg, #2a2f36 0%, #161a20 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.city-hud-type-txt {
    font-family: var(--ui-font-ui);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: rgba(245, 240, 232, 0.94);
}

/* HUD 内按钮紧凑版（不影响其他区域的 .game-btn） */
.city-hud-actions .game-btn {
    padding: 4px 8px;
    font-size: 10px;
    border-width: 1px;
    /* height: 0 !important; */
}

.city-hud-actions .game-btn:hover {
    transform: translateY(-1px);
}

/* 城池信息卡（参考大地图：深底、细金边、直角、分行图标与配色） */
.city-popup-card {
    background: rgba(6, 8, 12, 0.82);
    border: 1px solid rgba(200, 175, 110, 0.42);
    border-radius: 0;
    padding: 12px 14px 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    font-family: var(--ui-font-ui);
}

.city-popup-title {
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(100, 95, 88, 0.45);
    font-size: 15px;
    font-weight: 800;
    color: #f2efe8;
    letter-spacing: 0.04em;
    line-height: 1.35;
}

.city-popup-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #1a1814;
    background: linear-gradient(180deg, #e8c547 0%, #b89830 100%);
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 2px;
    vertical-align: middle;
}

.city-popup-tag--main {
    background: linear-gradient(180deg, #6ab8e8 0%, #3a78a8 100%);
    color: #0a1018;
}

.city-popup-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.city-info-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 28px;
    font-size: 13px;
}

.city-info-ic {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d4af37;
}

.city-info-svg {
    width: 16px;
    height: 16px;
    display: block;
}

.city-info-txt {
    flex: 1;
    min-width: 0;
    color: #e8e4e0;
    font-weight: 600;
}

.city-info-txt--status {
    color: #f0ebe4;
    font-weight: 700;
}

.city-info-name--self {
    color: #6ee7a8;
    font-weight: 700;
}

.city-info-name--ally {
    color: #7dd3a0;
    font-weight: 700;
}

.city-info-name--enemy {
    color: #ff9a9a;
    font-weight: 700;
}

.city-info-name--muted {
    color: #b8b0a8;
    font-weight: 600;
}

.city-info-ally-wrap {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
}

.city-info-ally--yes {
    color: #7dd3a0;
}

.city-info-ally--wild {
    color: #ff5555;
}

.city-info-ally--muted {
    color: #9a9288;
    font-weight: 600;
}

.city-info-hr {
    border: none;
    border-top: 1px solid rgba(90, 88, 82, 0.55);
    margin: 8px 0;
}

.city-info-row--vision {
    align-items: center;
}

.city-info-label {
    flex: 0 0 auto;
    color: #e8e4e0;
    font-size: 13px;
    font-weight: 600;
}

.city-info-vision-val {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #f2efe8;
    font-variant-numeric: tabular-nums;
}

.city-info-diamond {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #f0d78c 0%, #b89430 100%);
    transform: rotate(45deg);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.35);
}

.city-info-meta-line {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
    color: #a09890;
}

.city-info-meta-k {
    color: #9a9288;
}

.city-info-meta-v {
    color: #dcd6ce;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.main-city-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: normal;
    color: #1a1a1a;
    background: #ffd700;
    border-radius: 4px;
}

#actionButtons {
    margin-top: 0;
    display: flex;
    gap: 6px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.game-btn {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(135deg, #8b7355 0%, #6b5a45 100%);
    border: 2px solid #a0826d;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Microsoft YaHei', 'SimHei', serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.game-btn:hover {
    background: linear-gradient(135deg, #a0826d 0%, #8b7355 100%);
    border-color: #b89a7d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.game-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 参考图按钮风格（两套可复用组件）
   - ui-btn-metal：深色铁牌 + 金边 + 左侧小图标
   - ui-btn-parchment：浅色帛书底 + 深色描边 + 左侧徽记 + “数值/标题”排版
*/
.ui-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: none;
    font-family: var(--ui-font-ui, 'Microsoft YaHei', 'SimHei', serif);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ui-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.25);
    transform: none !important;
    box-shadow: none !important;
}

/* 深色铁牌按钮 */
.ui-btn-metal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 18px;
    min-height: 44px;
    border-radius: 2px;
    color: #e9d7a6;
    letter-spacing: 0.18em;
    font-weight: 700;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 12%, rgba(0, 0, 0, 0.20) 100%),
        linear-gradient(180deg, #3f3f3f 0%, #2e2e2e 55%, #1f1f1f 100%);
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.ui-btn-metal:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.ui-btn-metal:active:not(:disabled) {
    transform: translateY(1px);
}

.ui-btn-metal .ui-btn-ic {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e6c36a;
    font-size: 16px;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.ui-btn-metal .ui-btn-text {
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
}

/* 浅色帛书按钮 */
.ui-btn-parchment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 2px;
    color: #1a1814;
    background:
        radial-gradient(ellipse 180px 90px at 20% 30%, rgba(255, 255, 255, 0.75) 0%, transparent 60%),
        linear-gradient(180deg, #f2f2f2 0%, #dadada 60%, #cfcfcf 100%);
    border: 1px solid rgba(0, 0, 0, 0.55);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.ui-btn-parchment:hover:not(:disabled) {
    filter: brightness(1.04);
}

.ui-btn-parchment:active:not(:disabled) {
    transform: translateY(1px);
}

.ui-btn-parchment .ui-btn-badge {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 4px;
    background: linear-gradient(180deg, #7b5a3a 0%, #4a3320 100%);
    border: 1px solid rgba(0, 0, 0, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transform: rotate(45deg);
}

.ui-btn-parchment .ui-btn-badge > span {
    transform: rotate(-45deg);
    color: #f2e6cf;
    font-weight: 900;
    font-size: 12px;
    line-height: 1;
}

.ui-btn-parchment .ui-btn-main {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.ui-btn-parchment .ui-btn-num {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.ui-btn-parchment .ui-btn-suffix {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

/* 统一小尺寸按钮（用于表格行“申请”等） */
.ui-btn.small {
    padding: 6px 10px;
    min-height: 32px;
    font-size: 12px;
}

.ui-btn-metal.small {
    letter-spacing: 0.12em;
}

#attackBtn {
    background: linear-gradient(135deg, #c44 0%, #a22 100%);
    border-color: #d55;
}

#attackBtn:hover {
    background: linear-gradient(135deg, #d55 0%, #c44 100%);
    border-color: #e66;
}

/* 战斗结果面板 */
.battle-result-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.battle-result-content {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 16px;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* UIFramework.Panel 在 .battle-result-content 内包一层 .panel-body，滚动交给内层 */
.battle-result-content .panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.battle-result-content h2 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 12px;
    font-size: 20px;
    border-bottom: 2px solid #8b7355;
    padding-bottom: 8px;
}

.battle-result-content .winner {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin: 12px 0;
    color: #4a90e2;
}

.battle-result-content .survivors {
    margin: 12px 0;
    padding: 10px;
    background: rgba(139, 115, 85, 0.2);
    border-radius: 4px;
}

.battle-result-content .survivors h3 {
    color: #ffd700;
    margin-bottom: 6px;
    font-size: 14px;
}

.battle-result-content .survivors h4 {
    color: #a0826d;
    margin: 6px 0 4px 0;
    font-size: 13px;
}

.battle-result-content .survivors p {
    margin: 3px 0;
    padding-left: 12px;
    color: #e0e0e0;
    font-size: 13px;
}

.battle-result-content .game-btn {
    width: 100%;
    margin-top: 12px;
}

#occupyBtn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: #5ba0f2;
}

#occupyBtn:hover {
    background: linear-gradient(135deg, #5ba0f2 0%, #4a90e2 100%);
    border-color: #6bb0ff;
}

/* 滚动条样式（内容在 .panel-body 内滚动） */
.battle-result-content .panel-body::-webkit-scrollbar {
    width: 10px;
}

.battle-result-content .panel-body::-webkit-scrollbar-track {
    background: var(--ui-scrollbar-track);
    border-radius: 5px;
}

.battle-result-content .panel-body::-webkit-scrollbar-thumb {
    background: var(--ui-scrollbar-thumb);
    border-radius: 5px;
}

.battle-result-content .panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--ui-scrollbar-thumb-hover);
}

/* 卡牌系统按钮 */
.march-cancel-btn {
    position: fixed;
    bottom: 60px;
    left: 20px;
    z-index: 1500;
    background: linear-gradient(135deg, #c44 0%, #a22 100%) !important;
    border-color: #d55 !important;
}

.march-cancel-btn:hover {
    background: linear-gradient(135deg, #d55 0%, #c44 100%) !important;
}

.march-panel-container {
    position: fixed;
    bottom: 60px;
    left: 20px;
    z-index: 1500;
    max-height: 240px;
    overflow-y: auto;
}

.march-panel {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 220px;
}

.march-panel h4 {
    color: #ffd700;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.march-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.march-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: #e0e0e0;
    font-size: 13px;
}

.march-item.returning {
    color: #888;
}

.march-cancel-btn-inline {
    padding: 4px 10px;
    font-size: 12px;
    background: linear-gradient(135deg, #c44 0%, #a22 100%) !important;
    border-color: #d55 !important;
}

.march-cancel-btn-inline:hover {
    background: linear-gradient(135deg, #d55 0%, #c44 100%) !important;
}

/* 左下角：竖签 + 底部装饰块 + 折叠（参考大地图主界面） */
.card-system-buttons {
    position: fixed;
    bottom: 10px;
    left: max(8px, env(safe-area-inset-left, 0px));
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 4px;
    z-index: 1000;
    max-width: calc(100vw - 16px);
}

.card-system-collapse {
    flex-shrink: 0;
    width: 28px;
    height: 72px;
    margin-bottom: 2px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(28, 24, 20, 0.96) 0%, rgba(12, 10, 8, 0.98) 100%);
    border: 1px solid rgba(139, 115, 85, 0.55);
    color: var(--ui-accent-gold-bright);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    font-family: var(--ui-font-ui);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.card-system-collapse:hover {
    filter: brightness(1.08);
}

.card-system-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-width: calc(100vw - 48px);
    padding-bottom: 2px;
}

.card-system-buttons--collapsed .card-system-tabs {
    display: none;
}

.card-system-tab {
    flex: 0 0 auto;
    width: 44px;
    min-height: 118px;
    padding: 8px 4px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: linear-gradient(180deg, #ebe8e0 0%, #c8c4ba 52%, #a8a29a 100%);
    border: 1px solid #4a4038;
    color: #1a1814;
    border-radius: 4px;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-family: var(--ui-font-ui);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.card-system-tab:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.card-system-tab.card-system-tab--accent {
    border-color: #8b6914;
    box-shadow:
        0 0 0 1px rgba(200, 180, 80, 0.35),
        0 3px 12px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.card-system-tab-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2em;
    line-height: 1;
}

.card-system-tab-art {
    width: 30px;
    height: 42px;
    border-radius: 50% 50% 4px 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* 底部小图：纯色渐变模拟水墨块（无外链图） */
.card-system-tab-art--general {
    background: linear-gradient(165deg, #5a6a9a 0%, #2a3048 55%, #1a1c28 100%);
}

.card-system-tab-art--vault {
    background: linear-gradient(165deg, #8a7050 0%, #5a4838 55%, #2a2218 100%);
}

.card-system-tab-art--scroll {
    background: linear-gradient(165deg, #c8b8a0 0%, #8a7860 50%, #4a4038 100%);
}

.card-system-tab-art--recruit {
    background: linear-gradient(165deg, #c4a040 0%, #8a6018 45%, #4a3010 100%);
}

.card-system-tab-art--army {
    background: linear-gradient(165deg, #4a6860 0%, #2a4840 55%, #182420 100%);
}

.card-system-tab-art--alliance {
    background: linear-gradient(165deg, #6a5888 0%, #3a3058 55%, #201828 100%);
}

@media (max-width: 900px) {
    .card-system-buttons {
        bottom: max(6px, env(safe-area-inset-bottom, 0px));
    }

    .card-system-tab {
        width: 40px;
        min-height: 108px;
        padding: 6px 3px 8px;
    }

    .card-system-tab-label {
        font-size: 12px;
    }

    .card-system-tab-art {
        width: 26px;
        height: 38px;
    }

    .card-system-collapse {
        height: 64px;
        width: 26px;
        font-size: 18px;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .card-system-buttons {
        bottom: max(4px, env(safe-area-inset-bottom, 0px));
    }

    .card-system-tab {
        width: 36px;
        min-height: 92px;
        padding: 4px 2px 6px;
        gap: 4px;
    }

    .card-system-tab-label {
        font-size: 11px;
        letter-spacing: 0.14em;
    }

    .card-system-tab-art {
        width: 24px;
        height: 32px;
    }

    .card-system-collapse {
        height: 56px;
        width: 24px;
        font-size: 16px;
    }
}

/* 卡牌列表面板 */
.card-list-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ui-bg-scrim);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.card-pool-panel .card-list-content {
    max-width: 900px;
}
.card-pool-desc {
    color: #b0b0b0;
    margin-bottom: 12px;
    font-size: 14px;
}
.card-pool-item {
    cursor: pointer;
}
.card-pool-item:hover {
    background: rgba(139, 115, 85, 0.25);
}
.card-pool-item .card-item-attrs {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* 我的战法：与 player-card-panel 同底，战法圆标横排参考手游战法列表 */
.player-skills-panel.player-card-panel .card-list-content {
    max-width: 960px;
    background:
        linear-gradient(165deg, rgba(40, 36, 30, 0.35) 0%, transparent 42%),
        linear-gradient(180deg, rgba(22, 20, 18, 0.97) 0%, rgba(12, 11, 10, 0.99) 100%);
    border: 1px solid var(--ui-border-gold);
    box-shadow: var(--ui-shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.player-skills-panel .panel-header h2 {
    font-family: var(--ui-font-display);
    color: var(--ui-accent-gold);
    letter-spacing: 0.12em;
    font-weight: 600;
    text-shadow: 0 0 24px rgba(212, 175, 55, 0.15);
}

.player-skills-desc,
.player-skills-hint,
.player-skills-loading,
.player-skills-error {
    color: var(--ui-text-muted);
    font-size: 12px;
    margin: 0 0 8px 0;
    line-height: 1.45;
}

.player-skills-error {
    color: #e88;
}

.player-skills-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skill-tactics-section {
    margin: 0;
}

.skill-tactics-section-title {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-text-primary);
    font-family: var(--ui-font-ui);
    letter-spacing: 0.06em;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.35);
}

.skill-tactics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 10px;
    align-items: flex-start;
}

.skill-tactic-card {
    position: relative;
    width: 112px;
    flex: 0 0 auto;
    cursor: pointer;
    border-radius: 4px;
    padding: 8px 6px 10px;
    background: linear-gradient(180deg, rgba(34, 32, 38, 0.95) 0%, rgba(16, 14, 20, 0.98) 100%);
    border: 1px solid rgba(100, 85, 120, 0.45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.skill-tactic-card:hover {
    transform: translateY(-3px);
    border-color: rgba(180, 150, 210, 0.55);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.skill-tactic-card.is-selected {
    border-color: rgba(232, 197, 71, 0.55);
    box-shadow: 0 0 0 1px rgba(232, 197, 71, 0.25), 0 4px 14px rgba(0, 0, 0, 0.45);
}

.skill-tactic-card.is-selected::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    margin-left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--ui-accent-gold);
    filter: drop-shadow(0 0 4px rgba(232, 197, 71, 0.5));
}

.skill-tactic-card-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.skill-tactic-circle {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    border: 2px solid var(--skill-tactic-border, #a855d4);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 0 12px -4px var(--skill-tactic-border, rgba(168, 85, 212, 0.45));
    background:
        radial-gradient(circle at 40% 28%, rgba(255, 255, 255, 0.2) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 100%, rgba(40, 35, 50, 0.6) 0%, transparent 55%),
        linear-gradient(165deg, rgba(245, 242, 238, 0.14) 0%, rgba(55, 50, 62, 0.5) 100%);
}

.skill-tactic-rank {
    position: absolute;
    top: 2px;
    left: 4px;
    z-index: 2;
    font-size: 12px;
    font-weight: 800;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--ui-accent-gold-bright);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    line-height: 1;
}

.skill-tactic-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: rgba(35, 28, 40, 0.35);
    user-select: none;
    font-family: var(--ui-font-display);
}

.skill-tactic-img {
    position: absolute;
    inset: 0px;
    width: calc(100% - 0px);
    height: calc(100% - 0px);
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
    pointer-events: none;
    user-select: none;
}

.skill-tactic-img--lg {
    inset: 0px;
    width: calc(100% - 0px);
    height: calc(100% - 0px);
}

.skill-tactic-fraction {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    z-index: 2;
}

.skill-tactic-fraction.is-done {
    color: var(--ui-text-primary);
}

.skill-tactic-fraction.is-pending {
    color: #e07070;
}

.skill-tactic-name-banner {
    clip-path: polygon(8% 0%, 92% 0%, 100% 50%, 92% 100%, 8% 100%, 0% 50%);
    background: linear-gradient(180deg, rgba(55, 40, 72, 0.95) 0%, rgba(22, 16, 32, 0.98) 100%);
    border: 1px solid rgba(130, 100, 160, 0.4);
    padding: 6px 4px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-tactic-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--ui-text-primary);
    text-align: center;
    line-height: 1.25;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.skill-tactic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.skill-tactic-tag {
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 2px;
    line-height: 1.2;
    font-weight: 600;
}

.skill-tactic-tag--type {
    background: rgba(70, 120, 90, 0.45);
    color: #c8e8d0;
    border: 1px solid rgba(100, 160, 120, 0.35);
}

.skill-tactic-tag--status {
    background: rgba(80, 70, 110, 0.45);
    color: #dcd0f0;
    border: 1px solid rgba(130, 110, 160, 0.35);
}

.card-list-content {
    background: var(--ui-bg-elevated);
    border: 2px solid var(--ui-border-gold);
    border-radius: var(--ui-radius-panel);
    padding: 12px;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--ui-shadow-panel);
    width: 90%;
    font-family: var(--ui-font-ui);
}

/* 玩家「我的卡牌」武将列表 — 水墨国风竖卡（docs/UI_STYLE_GUIDE.md §4.4） */
.player-card-panel .card-list-content {
    max-width: 960px;
    background:
        linear-gradient(165deg, rgba(40, 36, 30, 0.35) 0%, transparent 42%),
        linear-gradient(180deg, rgba(22, 20, 18, 0.97) 0%, rgba(12, 11, 10, 0.99) 100%);
    border: 1px solid var(--ui-border-gold);
    box-shadow: var(--ui-shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.player-card-panel .panel-header h2 {
    font-family: var(--ui-font-display);
    color: var(--ui-accent-gold);
    letter-spacing: 0.12em;
    font-weight: 600;
    text-shadow: 0 0 24px rgba(212, 175, 55, 0.15);
}

.player-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px 10px;
}

/* 大卡竖构图：参考立绘区 + 左竖条姓名 + 上右星级 + 底栏（立绘无资源时为水墨占位） */
.player-card-tile {
    position: relative;
    border-radius: 3px;
    border: 2px solid var(--player-card-rarity, var(--ui-border-gold));
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 0 12px -4px var(--player-card-rarity, rgba(160, 100, 200, 0.25));
    background: linear-gradient(180deg, rgba(24, 22, 28, 0.98) 0%, rgba(8, 7, 10, 0.99) 100%);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 180px;
    margin: 0 auto;
    width: 100%;
}

.player-card-tile:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 8px 22px rgba(0, 0, 0, 0.55),
        0 0 16px -2px var(--player-card-rarity, rgba(180, 120, 220, 0.45));
}

.player-card-tile-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 220px;
    overflow: hidden;
}

.player-card-art-wrap {
    position: relative;
    flex: 1;
    min-height: 168px;
    display: flex;
    flex-direction: column;
}

.player-card-art {
    position: relative;
    flex: 1;
    min-height: 168px;
    background-color: #1a1820;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.player-card-art-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background:
        radial-gradient(ellipse 80% 60% at 50% 35%, rgba(60, 52, 72, 0.45) 0%, transparent 55%),
        linear-gradient(165deg, rgba(35, 32, 40, 0.95) 0%, rgba(14, 12, 18, 0.98) 100%);
}

.player-card-art-placeholder-shade {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
    pointer-events: none;
}

.player-card-art-placeholder-icon {
    position: relative;
    font-size: 42px;
    line-height: 1;
    opacity: 0.22;
    filter: grayscale(0.3);
}

.player-card-art-placeholder-hint {
    position: relative;
    font-size: 10px;
    color: var(--ui-text-muted);
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.player-card-banner-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px 8px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 100%);
    border-right: 1px solid rgba(139, 115, 85, 0.35);
    z-index: 2;
    pointer-events: none;
}

.player-card-faction {
    font-size: 11px;
    font-weight: 800;
    color: var(--ui-text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.player-card-name-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: var(--ui-font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-accent-gold-bright);
    letter-spacing: 0.2em;
    max-height: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.player-card-stars {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    display: flex;
    gap: 1px;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 2px;
    pointer-events: none;
    font-size: 9px;
    line-height: 1;
}

.player-card-star {
    color: rgba(80, 80, 88, 0.95);
    text-shadow: none;
}

.player-card-star.is-on {
    color: #e8c547;
    text-shadow: 0 0 6px rgba(232, 197, 71, 0.45);
}

.player-card-footer-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 6px 6px 7px;
    min-height: 34px;
    background: linear-gradient(180deg, rgba(18, 14, 24, 0.98) 0%, rgba(6, 5, 10, 0.99) 100%);
    border-top: 1px solid rgba(100, 80, 130, 0.35);
    font-size: 10px;
    color: var(--ui-text-primary);
    font-variant-numeric: tabular-nums;
}

.player-card-footer-bar .player-card-lv {
    flex-shrink: 0;
    font-weight: 600;
}

.player-card-cost {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: var(--ui-text-muted);
    font-size: 9px;
    letter-spacing: 0.02em;
}

.player-card-cost--empty {
    opacity: 0.45;
}

.player-card-troop-cluster {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.player-card-diamond {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(45deg);
    border: 1px solid var(--player-card-rarity, var(--ui-accent-gold));
    background: rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 0 6px rgba(212, 175, 55, 0.12);
}

.player-card-troop-glyph {
    display: block;
    transform: rotate(-45deg);
    font-size: 10px;
    font-weight: 700;
    color: var(--ui-accent-gold-bright);
    line-height: 1;
}

.player-card-range {
    font-size: 10px;
    font-weight: 600;
    color: var(--ui-text-primary);
    min-width: 0.6em;
}

/* 抽卡 / 招募面板（横滑卡池 + 右侧招募按钮，与水墨面板一致） */
.draw-recruit-panel .draw-panel-content {
    max-width: 920px;
    width: 96%;
}

.draw-recruit-panel.player-card-panel .card-list-content {
    background:
        linear-gradient(165deg, rgba(40, 36, 30, 0.35) 0%, transparent 42%),
        linear-gradient(180deg, rgba(22, 20, 18, 0.97) 0%, rgba(12, 11, 10, 0.99) 100%);
    border: 1px solid var(--ui-border-gold);
    box-shadow: var(--ui-shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.draw-panel-content .panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    position: relative;
    padding-top: 8px;
}

.draw-recruit-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.draw-recruit-root {
    padding-right: 8px;
}

.draw-recruit-hero {
    margin-bottom: 14px;
    text-align: left;
}

.draw-recruit-title {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-family: var(--ui-font-display);
    color: var(--ui-accent-gold);
    letter-spacing: 0.15em;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.draw-recruit-lead {
    margin: 0;
    font-size: 13px;
    color: var(--ui-text-muted);
}

.draw-recruit-main {
    display: flex;
    flex-direction: row;
    gap: 18px;
    align-items: stretch;
}

.draw-recruit-carousel-wrap {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.draw-recruit-carousel {
    display: flex;
    flex-direction: row;
    gap: 14px;
    padding: 4px 2px 8px;
}

.draw-banner {
    position: relative;
    flex: 0 0 200px;
    width: 200px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(120, 90, 160, 0.45);
    background: linear-gradient(180deg, rgba(28, 24, 36, 0.98) 0%, rgba(12, 10, 18, 0.99) 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.draw-banner.is-active {
    border-color: rgba(200, 170, 100, 0.55);
    box-shadow: 0 0 0 1px rgba(232, 197, 71, 0.15), 0 10px 28px rgba(0, 0, 0, 0.55);
}

.draw-banner--placeholder {
    opacity: 0.45;
    pointer-events: none;
}

.draw-banner-vstrip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 4px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-right: 1px solid rgba(139, 115, 85, 0.25);
    z-index: 2;
}

.draw-banner-vtitle {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 14px;
    font-weight: 700;
    color: var(--ui-text-primary);
    letter-spacing: 0.2em;
}

.draw-banner-vstars {
    margin-top: 10px;
    writing-mode: vertical-rl;
    font-size: 10px;
    color: #b8a0e0;
}

.draw-banner-art {
    flex: 1;
    margin-left: 36px;
    position: relative;
    min-height: 220px;
    background:
        radial-gradient(ellipse 80% 50% at 50% 30%, rgba(80, 60, 120, 0.25) 0%, transparent 55%),
        linear-gradient(165deg, rgba(45, 38, 58, 0.9) 0%, rgba(18, 14, 24, 0.98) 100%);
}

.draw-banner-art--muted {
    min-height: 120px;
}

.draw-banner-art-shade {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
    pointer-events: none;
}

.draw-banner-art-silhouette {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 100px;
    background: radial-gradient(ellipse at 50% 30%, rgba(30, 22, 40, 0.5), rgba(10, 8, 14, 0.85));
    border-radius: 40% 40% 35% 35%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.draw-banner-lvtab {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #c9a020;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(200, 170, 80, 0.35);
    border-radius: 2px;
    writing-mode: vertical-rl;
    line-height: 1.2;
}

.draw-banner-genicon {
    position: absolute;
    bottom: 52px;
    right: 8px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--ui-accent-gold-bright);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(200, 170, 80, 0.45);
}

.draw-banner-bottom {
    margin-left: 36px;
    padding: 10px 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid rgba(100, 85, 130, 0.35);
    background: rgba(0, 0, 0, 0.35);
}

.draw-banner-currency {
    font-size: 11px;
    color: var(--ui-text-muted);
}

.draw-banner-price {
    font-size: 13px;
    font-weight: 700;
    color: #7dd3a0;
    font-variant-numeric: tabular-nums;
}

.draw-recruit-side {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.draw-recruit-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.draw-recruit-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    text-align: left;
    min-height: auto;
    background: linear-gradient(180deg, rgba(55, 48, 38, 0.95) 0%, rgba(32, 28, 22, 0.98) 100%) !important;
    border: 1px solid rgba(139, 115, 85, 0.55) !important;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.draw-recruit-btn:hover {
    border-color: rgba(232, 197, 71, 0.35) !important;
}

.draw-recruit-btn-free {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 2px;
    background: rgba(80, 160, 110, 0.35);
    color: #b8f0d0;
    font-weight: 600;
}

.draw-recruit-btn-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--ui-text-primary);
}

.draw-recruit-btn-sub {
    font-size: 12px;
    color: #7dd3a0;
    font-variant-numeric: tabular-nums;
}

.draw-recruit-meta {
    margin-top: auto;
}

.draw-recruit-reserve {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--ui-text-muted);
}

.draw-recruit-reserve strong {
    color: var(--ui-accent-gold-bright);
}

.draw-recruit-hint {
    margin: 0;
    font-size: 11px;
    color: var(--ui-text-muted);
    line-height: 1.45;
    opacity: 0.9;
}

@media (max-width: 720px) {
    .draw-recruit-main {
        flex-direction: column;
    }

    .draw-recruit-side {
        flex: 1;
        width: 100%;
    }

    .draw-banner {
        flex: 0 0 180px;
        width: 180px;
        min-height: 280px;
    }
}

/* 抽卡动画遮罩 */
.draw-animation-overlay {
    position: fixed;
    inset: 0;
    z-index: 3150;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.88);
}
.draw-animation-content {
    text-align: center;
}
.draw-animation-text {
    font-size: 24px;
    color: #ffd700;
    margin-bottom: 16px;
    animation: draw-pulse 0.6s ease-in-out infinite;
}
@keyframes draw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.draw-animation-cards {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.draw-card-back {
    display: inline-block;
    width: 48px;
    height: 64px;
    line-height: 64px;
    background: linear-gradient(135deg, #5a4a3a 0%, #3a2a1a 100%);
    border: 2px solid #8b7355;
    border-radius: 6px;
    color: #ffd700;
    font-size: 24px;
    animation: draw-flip 0.4s ease-in-out infinite;
}
.draw-card-back:nth-child(2) { animation-delay: 0.1s; }
.draw-card-back:nth-child(3) { animation-delay: 0.2s; }
.draw-card-back:nth-child(4) { animation-delay: 0.3s; }
.draw-card-back:nth-child(5) { animation-delay: 0.4s; }
@keyframes draw-flip {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.85); }
}

/* 抽卡结果（全屏雾底 + 大卡横排 + 空位光环） */
.draw-result-panel {
    position: fixed;
    inset: 0;
    z-index: 3080;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background:
        radial-gradient(ellipse 70% 50% at 50% 40%, rgba(35, 32, 42, 0.5) 0%, transparent 60%),
        linear-gradient(180deg, rgba(8, 8, 12, 0.92) 0%, rgba(4, 4, 8, 0.96) 100%);
}

.draw-result-inner {
    position: relative;
    width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
}

.draw-result-smoke {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

.draw-result-content {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    cursor: default;
    max-width: min(96vw, 1100px);
    padding: 20px 22px 24px;
    border: 1px solid var(--ui-border-gold);
    border-radius: var(--ui-radius-panel);
    background:
        linear-gradient(165deg, rgba(32, 28, 36, 0.92) 0%, rgba(14, 12, 18, 0.96) 100%);
    box-shadow: var(--ui-shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.draw-result-heading {
    margin: 0 0 16px 0;
    text-align: center;
    font-size: 18px;
    font-family: var(--ui-font-display);
    color: var(--ui-accent-gold-bright);
    letter-spacing: 0.1em;
}

.draw-result-row {
    /* 横向排列：一排可横向滚动（卡面宽高比例沿用 cardpool） */
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 14px 16px;
    justify-content: flex-start;
    align-items: flex-end;
    max-height: min(70vh, 520px);
    overflow-x: auto;
    overflow-y: auto;
    padding-bottom: 8px;
}

.draw-result-slot {
    flex: 0 0 auto;
}

.draw-result-panel .player-card-tile {
    /* 固定为 cardPool 网格最小列宽，避免横排时被挤压变形 */
    width: 132px;
    max-width: 132px;
    transform: none;
}

.draw-result-panel .player-card-tile-inner {
    min-height: unset;
}

/* 不再展示空白占位槽位：保留样式但隐藏（兼容旧 DOM） */
.draw-result-slot--empty {
    display: none;
}

.draw-result-fallback {
    padding: 12px;
    color: var(--ui-text-primary);
    font-size: 13px;
}

.draw-result-tip {
    color: var(--ui-text-muted);
    font-size: 12px;
    text-align: center;
    margin: 18px 0 0 0;
    line-height: 1.45;
}

/* 设置面板（水墨暗色 + 顶栏 Tab + 金褐点缀，仅样式；Tab 为装饰） */
.card-list-panel.settings-panel {
    background:
        radial-gradient(ellipse 200px 140px at 10% 12%, rgba(130, 110, 125, 0.12) 0%, transparent 58%),
        radial-gradient(ellipse 160px 100px at 92% 88%, rgba(70, 85, 110, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, rgba(12, 14, 20, 0.82) 0%, rgba(4, 6, 10, 0.9) 100%);
    backdrop-filter: blur(3px);
}

.settings-panel .settings-content.card-list-content {
    position: relative;
    max-width: 460px;
    width: 92%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(150, 145, 135, 0.22);
    border-radius: 0;
    background:
        radial-gradient(ellipse 180px 120px at 0% 0%, rgba(90, 75, 95, 0.08) 0%, transparent 55%),
        linear-gradient(165deg, #22201e 0%, #141210 48%, #0a0908 100%);
    box-shadow:
        0 16px 56px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.settings-panel .settings-content.card-list-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 110px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background: radial-gradient(ellipse at 35% 45%, rgba(160, 140, 155, 0.25) 0%, transparent 62%);
}

.settings-panel .settings-content.card-list-content > * {
    position: relative;
    z-index: 1;
}

.settings-panel .panel-header {
    margin-bottom: 0;
    padding: 10px 12px 9px;
    border-bottom: 1px solid rgba(85, 82, 76, 0.55);
    background: linear-gradient(180deg, rgba(28, 26, 24, 0.95) 0%, rgba(18, 16, 14, 0.98) 100%);
}

.settings-panel .panel-header h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: #c5a367;
    text-shadow: 0 0 22px rgba(197, 163, 103, 0.18);
}

.settings-panel .panel-header .close-btn {
    width: 26px;
    height: 26px;
    border-radius: 2px;
    border: 1px solid rgba(160, 60, 60, 0.65);
    background: rgba(36, 14, 14, 0.85);
    color: #ff9090;
    font-size: 16px;
    line-height: 1;
}

.settings-panel .panel-header .close-btn:hover {
    background: rgba(70, 24, 24, 0.95);
    color: #fff;
}

.settings-panel .panel-body {
    padding: 0;
}

.settings-frame {
    display: flex;
    flex-direction: column;
}

.settings-tab-strip {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    border-bottom: 1px solid rgba(70, 68, 64, 0.55);
    background: rgba(0, 0, 0, 0.22);
}

.settings-tab {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(175, 170, 162, 0.45);
    letter-spacing: 0.08em;
}

.settings-tab--active {
    color: #f2efe8;
    box-shadow:
        inset 0 -3px 0 #b22222,
        0 0 18px rgba(178, 34, 34, 0.2);
}

.settings-tab--muted {
    cursor: default;
}

.settings-tab-divider {
    align-self: center;
    width: 1px;
    height: 16px;
    background: rgba(95, 92, 88, 0.55);
    flex-shrink: 0;
}

.settings-section {
    padding: 16px 18px 22px;
}

.settings-section-h {
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #c5a367;
    border-bottom: 1px solid rgba(197, 163, 103, 0.32);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #e8e6e3;
    font-size: 13px;
}

.settings-row + .settings-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(70, 68, 64, 0.35);
}

.settings-row-label {
    flex: 1;
    min-width: 0;
    color: #dcd8d2;
    font-weight: 600;
}

.settings-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.settings-panel .settings-toggle-btn {
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 2px;
    background: linear-gradient(180deg, #2e2c2a 0%, #1f1d1b 100%);
    border: 1px solid rgba(105, 102, 98, 0.5);
    color: #e8e6e3;
    text-shadow: none;
    transition: opacity 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.settings-panel .settings-toggle-btn::before {
    content: '';
    width: 5px;
    height: 5px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e0c070 0%, #8a7038 100%);
    transform: rotate(45deg);
    box-shadow: 0 0 6px rgba(197, 163, 103, 0.35);
}

.settings-panel .settings-toggle-btn.active {
    opacity: 1;
    border-color: rgba(197, 163, 103, 0.55);
    background: linear-gradient(180deg, #383632 0%, #201e1c 100%);
    box-shadow:
        0 0 0 1px rgba(197, 163, 103, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #fff;
}

.settings-panel .settings-toggle-btn:not(.active) {
    opacity: 0.52;
}

.settings-title {
    color: #c5a367;
    margin-bottom: 16px;
    text-align: center;
    border-bottom: 1px solid rgba(197, 163, 103, 0.28);
    padding-bottom: 8px;
}

/* 同盟面板 */
.alliance-panel .alliance-content {
    max-width: 800px;
}

.alliance-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.alliance-topbar input {
    height: 34px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    color: #eaeaea;
    outline: none;
}

.alliance-topbar input:focus {
    border-color: rgba(197, 163, 103, 0.65);
    box-shadow: 0 0 0 1px rgba(197, 163, 103, 0.18);
}

.alliance-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #dcdcdc;
    font-size: 13px;
}

.alliance-statusbar-left {
    display: grid;
    gap: 4px;
}

.alliance-status-line {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-variant-numeric: tabular-nums;
}

.alliance-status-line .label {
    opacity: 0.72;
    min-width: 56px;
}

.alliance-status-line .value.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    opacity: 0.92;
}

.alliance-status-line .value.danger {
    color: #e35b5b;
    font-weight: 700;
}

.alliance-table {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18);
}

.alliance-table-header,
.alliance-row {
    display: grid;
    grid-template-columns: 2.1fr 1.4fr 0.9fr 1.1fr 1.1fr 1.1fr 0.9fr;
    align-items: center;
    column-gap: 10px;
}

.alliance-table-header {
    padding: 8px 10px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
}

.alliance-table-body {
    max-height: 310px;
    overflow: auto;
}

.alliance-row {
    padding: 10px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #d8d8d8;
    font-size: 13px;
}

.alliance-row:last-child {
    border-bottom: none;
}

.alliance-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.alliance-reco {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    margin-right: 8px;
    font-size: 12px;
    color: #0e1510;
    background: linear-gradient(180deg, #7fd68a 0%, #3ea04c 100%);
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 2px;
    font-weight: 800;
}

.alliance-name {
    color: #79b3ff;
}

.alliance-lv,
.alliance-members {
    font-variant-numeric: tabular-nums;
}

.alliance-distance.is-far {
    color: #e35b5b;
    font-weight: 800;
}

.alliance-distance.is-near {
    color: #6fd38a;
    font-weight: 800;
}

.alliance-empty {
    padding: 18px 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-align: center;
}

.alliance-bottombar {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 12px;
}

/* 已加入同盟：成员列表 */
.alliance-members-panel {
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.16);
}

.alliance-members-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
}

.alliance-members-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--ui-accent-gold-bright);
}

.alliance-members-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
}

.alliance-members-table {
    display: flex;
    flex-direction: column;
}

.alliance-members-header {
    display: grid;
    grid-template-columns: 1.4fr 1.2fr 1.4fr;
    gap: 10px;
    padding: 8px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.alliance-members-body {
    max-height: 180px;
    overflow: auto;
}

.alliance-member-row {
    display: grid;
    grid-template-columns: 1.4fr 1.2fr 1.4fr;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #d8d8d8;
    font-size: 13px;
    align-items: center;
}

.alliance-member-row:last-child {
    border-bottom: none;
}

.alliance-member-row.is-me {
    background: rgba(197, 163, 103, 0.08);
}

.alliance-member-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.alliance-member-me {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 800;
    color: #1a1814;
    background: linear-gradient(180deg, #e8c547 0%, #b88a26 100%);
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 999px;
}

.alliance-member-id.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    opacity: 0.9;
}

.alliance-member-joined {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--ui-border-gold);
    padding-bottom: 6px;
}

.panel-header h2 {
    color: var(--ui-accent-gold-bright);
    margin: 0;
    font-size: 16px;
    font-family: var(--ui-font-display);
}

.close-btn {
    background: var(--ui-accent-cinnabar);
    border: none;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.3s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--ui-accent-cinnabar-hover);
    transform: scale(1.1);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.card-item {
    background: rgba(139, 115, 85, 0.2);
    border: 2px solid;
    border-radius: var(--ui-radius-card);
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-family: var(--ui-font-ui);
    font-variant-numeric: tabular-nums;
}

.card-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--ui-shadow-panel);
    background: rgba(139, 115, 85, 0.4);
}

.card-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.card-item-portrait {
    font-size: 24px;
}

.card-item-rarity {
    font-size: 10px;
    font-weight: bold;
}

.card-item-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--ui-text-primary);
    margin: 6px 0;
}

.card-item-level {
    font-size: 12px;
    color: var(--ui-text-muted);
    margin: 3px 0;
}

.card-item-count {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

/* 卡牌详情面板（全屏：左立绘 + 左缘导航 + 右玻璃面板，参考大地图武将详情） */
.card-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 10, 0.92);
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    z-index: 3000;
}

.card-detail-content {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
    overflow: hidden;
    box-shadow: none;
    position: relative;
    display: flex;
    flex-direction: column;
    font-family: var(--ui-font-ui);
    font-variant-numeric: tabular-nums;
}

/* UIFramework.Panel：正文在 .panel-body 内，滚动交给内层 */
.card-detail-content .panel-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    overflow-y: auto;
    position: relative;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.card-detail-close {
    position: absolute;
    top: max(8px, env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    z-index: 20;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 28px;
    line-height: 1;
    border-radius: 4px;
    border: 1px solid rgba(180, 60, 60, 0.85);
    background: rgba(40, 12, 12, 0.75);
    color: #ff9090;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.card-detail-close:hover {
    background: rgba(70, 20, 20, 0.9);
    color: #fff;
}

.card-detail-topbar {
    position: absolute;
    top: max(8px, env(safe-area-inset-top, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    z-index: 15;
    pointer-events: none;
}

.card-detail-protected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: #6dcea0;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(80, 160, 120, 0.35);
    border-radius: 3px;
}

.card-detail-protected::before {
    content: '📜';
    font-size: 12px;
    opacity: 0.85;
}

.card-detail-shell {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: min(100vh, 100%);
    min-height: 100dvh;
}

/* 左缘竖导航 */
.card-detail-rail {
    flex: 0 0 36px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 56px 0 12px;
    background: linear-gradient(90deg, rgba(8, 8, 12, 0.95) 0%, rgba(18, 16, 22, 0.88) 100%);
    border-right: 1px solid rgba(80, 70, 60, 0.4);
    z-index: 2;
}

.card-detail-rail-btn {
    flex: 0 0 auto;
    min-height: 52px;
    padding: 6px 4px;
    border: none;
    background: transparent;
    color: rgba(200, 190, 175, 0.55);
    font-size: 11px;
    font-weight: 700;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.15em;
    cursor: not-allowed;
    font-family: var(--ui-font-ui);
}

.card-detail-rail-btn.is-active {
    color: #e8c547;
    background: linear-gradient(90deg, rgba(90, 30, 30, 0.5) 0%, transparent 100%);
    box-shadow: inset 3px 0 0 #c44;
}

.card-detail-rail-btn:not(:disabled) {
    cursor: pointer;
}

/* 中立绘区 */
.card-detail-artboard {
    flex: 1 1 42%;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.card-detail-art-bg {
    position: absolute;
    inset: 0;
    background-color: #1a1510;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
}

.card-detail-art-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: radial-gradient(ellipse at 50% 30%, rgba(60, 50, 40, 0.5) 0%, #120e0a 70%);
    color: rgba(255, 255, 255, 0.35);
}

.card-detail-art-ph-icon {
    font-size: 56px;
    opacity: 0.45;
}

.card-detail-art-ph-hint {
    font-size: 12px;
    letter-spacing: 0.1em;
}

.card-detail-art-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.card-detail-art-actions {
    position: absolute;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    left: 12px;
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.card-detail-ghost-btn {
    padding: 6px 12px;
    font-size: 11px;
    color: #d4af37;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 4px;
    cursor: not-allowed;
    font-family: var(--ui-font-ui);
}

.card-detail-faction-diamond {
    position: absolute;
    top: 16px;
    left: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5a 0%, #0f1a28 100%);
    border: 1px solid rgba(100, 140, 200, 0.4);
    transform: rotate(45deg);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.card-detail-faction-diamond span {
    transform: rotate(-45deg);
    font-size: 18px;
    font-weight: 900;
    color: #8ec8ff;
    text-shadow: 0 0 12px rgba(120, 180, 255, 0.35);
}

.card-detail-name-ribbon {
    position: absolute;
    top: 72px;
    left: 8px;
    padding: 10px 8px 14px;
    background: linear-gradient(180deg, rgba(15, 35, 65, 0.92) 0%, rgba(8, 12, 22, 0.96) 100%);
    border: 1px solid rgba(80, 120, 180, 0.35);
    border-radius: 2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.card-detail-name-vertical {
    display: block;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #a8d4ff;
    font-family: var(--ui-font-display);
    text-shadow: 0 0 20px rgba(100, 160, 255, 0.2);
}

.card-detail-stars-vertical {
    position: absolute;
    top: 120px;
    left: 52px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-detail-stars-vertical .player-card-star {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.2);
    text-shadow: none;
}

.card-detail-stars-vertical .player-card-star.is-on {
    color: #e8c547;
    text-shadow: 0 0 8px rgba(232, 197, 71, 0.45);
}

.card-detail-wc-row {
    position: absolute;
    bottom: 56px;
    left: 12px;
}

.card-detail-wc-diamond {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transform: rotate(45deg);
    font-size: 13px;
    font-weight: 800;
    color: #eee;
}

.card-detail-role-row {
    position: absolute;
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: 90%;
    pointer-events: none;
}

.card-detail-role-pill {
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.35);
}

.card-detail-role-pill--0 {
    background: rgba(120, 80, 50, 0.85);
    color: #f0e0d0;
}

.card-detail-role-pill--1 {
    background: rgba(140, 40, 40, 0.88);
    color: #ffd0d0;
}

.card-detail-role-pill--2 {
    background: rgba(40, 100, 70, 0.88);
    color: #d0ffe8;
}

/* 右侧玻璃面板 */
.card-detail-side {
    flex: 1 1 50%;
    min-width: 0;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(165deg, rgba(28, 26, 32, 0.72) 0%, rgba(12, 10, 14, 0.88) 55%),
        rgba(18, 16, 20, 0.55);
    border-left: 1px solid rgba(100, 90, 80, 0.35);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
}

.card-detail-tabs {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 12px 12px 0;
    border-bottom: 1px solid rgba(100, 90, 80, 0.3);
    flex-shrink: 0;
}

.card-detail-tab {
    flex: 1;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(200, 190, 180, 0.55);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    position: relative;
    font-family: var(--ui-font-ui);
}

.card-detail-tab:hover {
    color: #e0d8d0;
}

.card-detail-tab.is-active {
    color: #f0ebe4;
    border-bottom-color: #b03030;
    text-shadow: 0 0 12px rgba(200, 80, 80, 0.25);
}

.card-detail-tab-dot {
    position: absolute;
    top: 6px;
    right: 18%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3dcc6a;
    box-shadow: 0 0 6px rgba(60, 200, 100, 0.6);
}

.card-detail-tab-panels {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px 20px;
}

.card-detail-tab-panel {
    display: none;
}

.card-detail-tab-panel.is-active {
    display: block;
}

.card-detail-side-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--ui-text-muted);
}

.card-detail-troop-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(139, 115, 85, 0.4);
    font-weight: 800;
    color: var(--ui-accent-gold-bright);
}

.card-detail-range {
    color: #b8b0a8;
}

.card-detail-cost {
    margin-left: auto;
    font-size: 13px;
    font-weight: 800;
    color: #d4af37;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

.card-detail-bar-block {
    margin-bottom: 10px;
}

.card-detail-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--ui-text-muted);
    margin-bottom: 4px;
}

.card-detail-bar-sub {
    font-variant-numeric: tabular-nums;
    color: #c8c0b8;
}

.card-detail-bar-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.card-detail-bar-track > span {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.2s ease;
}

.card-detail-bar-track--exp > span {
    background: linear-gradient(90deg, #5a7a9a 0%, #3a5a78 100%);
}

.card-detail-bar-track--troops > span {
    background: linear-gradient(90deg, #4a8ad0 0%, #2a5a98 100%);
}

.card-detail-bar-track--sta > span {
    background: linear-gradient(90deg, #4a9a5a 0%, #2a6828 100%);
}

.card-detail-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin: 14px 0;
}

.card-detail-stat-cell {
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(80, 70, 60, 0.35);
    border-radius: 4px;
}

.card-detail-stat-label {
    display: block;
    font-size: 11px;
    color: var(--ui-text-muted);
    margin-bottom: 4px;
}

.card-detail-stat-rec {
    margin-left: 6px;
    padding: 0 4px;
    font-size: 9px;
    font-weight: 700;
    color: #3dcc6a;
    border: 1px solid rgba(60, 200, 100, 0.35);
    border-radius: 2px;
    vertical-align: middle;
}

.card-detail-stat-val {
    font-size: 17px;
    font-weight: 800;
    color: var(--ui-text-primary);
}

.card-detail-stat-growth {
    margin-left: 6px;
    font-size: 12px;
    color: #5dd87a;
    font-weight: 600;
}

.card-detail-innate-skills {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(100, 90, 80, 0.3);
}

.card-detail-innate-title {
    display: block;
    font-size: 12px;
    color: var(--ui-accent-gold-bright);
    margin-bottom: 8px;
    font-weight: 700;
}

.card-detail-skill-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(60, 50, 40, 0.35);
    border-radius: 4px;
    font-size: 13px;
}

.card-detail-skill-pill-name {
    color: #e8e4e0;
    font-weight: 700;
}

.card-detail-skill-pill-type {
    font-size: 11px;
    color: #a09890;
}

/* 配点 Tab */
.card-detail-build-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.card-detail-build-rarity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-detail-build-rk-label {
    font-size: 12px;
    color: var(--ui-text-muted);
}

.card-detail-build-rk-stars {
    letter-spacing: 1px;
}

.card-detail-rarity-star {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.15);
}

.card-detail-rarity-star.is-on {
    color: #e8c547;
}

.card-detail-advance-btn {
    padding: 6px 14px;
    font-size: 12px;
    color: #333;
    background: linear-gradient(180deg, #e8e4e0 0%, #b8b4b0 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    cursor: not-allowed;
}

.card-detail-scheme-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.card-detail-scheme-tabs button {
    flex: 1;
    padding: 6px 4px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid rgba(100, 90, 80, 0.45);
    background: rgba(0, 0, 0, 0.25);
    color: var(--ui-text-muted);
    cursor: not-allowed;
}

.card-detail-scheme-tabs button.is-active {
    border-color: #a04040;
    color: #ffb0b0;
    background: rgba(80, 30, 30, 0.35);
}

.card-detail-alloc-row {
    margin-bottom: 10px;
    padding: 10px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(80, 70, 60, 0.35);
    border-radius: 4px;
}

.card-detail-alloc-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
}

.card-detail-alloc-name {
    color: #d0c8c0;
    font-weight: 600;
}

.card-detail-alloc-proj {
    font-variant-numeric: tabular-nums;
    color: #8a9aaa;
    font-size: 11px;
}

.card-detail-alloc-rec {
    margin-left: 4px;
    font-size: 9px;
    color: #3dcc6a;
    font-weight: 700;
}

.card-detail-alloc-ctrl {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-detail-alloc-min,
.card-detail-alloc-plus,
.card-detail-alloc-max {
    min-width: 36px;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid rgba(100, 90, 80, 0.5);
    cursor: pointer;
    font-family: var(--ui-font-ui);
}

.card-detail-alloc-min {
    background: rgba(40, 40, 40, 0.8);
    color: #777;
}

.card-detail-alloc-plus {
    background: linear-gradient(180deg, #4a6a4a 0%, #2a4a2a 100%);
    color: #e0ffe8;
}

.card-detail-alloc-plus:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.card-detail-alloc-max {
    background: rgba(60, 55, 50, 0.85);
    color: #ddd;
    font-size: 12px;
}

.card-detail-alloc-max:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.card-detail-alloc-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 90, 80, 0.35);
}

.card-detail-remain {
    display: block;
    font-size: 13px;
    color: #8a9aaa;
    margin-bottom: 10px;
}

.card-detail-remain strong {
    color: #5dd87a;
    font-size: 15px;
}

.card-detail-alloc-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.card-detail-btn-reset {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid rgba(120, 120, 120, 0.45);
    background: rgba(50, 50, 52, 0.8);
    color: #999;
    cursor: not-allowed;
}

.card-detail-btn-confirm {
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid rgba(180, 150, 90, 0.55);
    background: linear-gradient(180deg, #4a4038 0%, #2a2218 100%);
    color: #e8c547;
    cursor: pointer;
}

.card-detail-btn-confirm:hover {
    filter: brightness(1.08);
}

.card-detail-troop-desc-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--ui-accent-gold-bright);
    margin: 0 0 10px 0;
}

.card-detail-troop-desc {
    font-size: 13px;
    line-height: 1.55;
    color: #b8b0a8;
    margin: 0 0 12px 0;
}

.card-detail-troop-facts {
    margin: 0;
    padding-left: 1.1em;
    font-size: 13px;
    color: #c8c0b8;
    line-height: 1.6;
}

.card-equipped-skills--detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 90, 80, 0.35);
}

.card-equipped-skills-title {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--ui-accent-gold-bright);
}

.skill-slot-row-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-slot-circle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.skill-slot-circle .skill-slot-label {
    flex: 0 0 5em;
}

.skill-slot-circle .skill-slot-select {
    flex: 1;
    min-width: 0;
}

/* 武将详情：战法编辑（圆徽章参考图样式） */
.card-skill-slots-circles {
    margin-top: 10px;
}

.card-skill-slot-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.card-skill-slot-tiles.is-with-innate {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skill-slot-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.skill-slot-badge {
    position: relative;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 35%, rgba(0,0,0,0.25) 100%),
        rgba(255,255,255,0.06);
    box-shadow:
        0 8px 18px rgba(0,0,0,0.35),
        inset 0 0 0 1px rgba(255,255,255,0.10);
    border: 3px solid var(--skill-ring, rgba(255,255,255,0.18));
    overflow: hidden;
}

.skill-slot-tile.is-empty .skill-slot-badge {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.14);
}

.skill-slot-rank {
    position: absolute;
    left: -6px;
    top: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255, 215, 0, 0.55);
    color: #ffd24d;
    font-weight: 900;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 6px rgba(0,0,0,0.55);
}

.skill-slot-tile.is-empty .skill-slot-rank {
    display: none;
}

.skill-slot-tag {
    position: absolute;
    right: -4px;
    top: -6px;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.82);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2px;
    transform: scale(0.95);
    text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

.skill-slot-tile:not(.is-innate) .skill-slot-tag {
    display: none;
}

.skill-slot-lv {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.15);
    color: #e8e4dc;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.skill-slot-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ui-font-display);
    font-size: 26px;
    font-weight: 900;
    color: rgba(255,255,255,0.88);
    text-shadow: 0 2px 10px rgba(0,0,0,0.55);
    user-select: none;
    pointer-events: none;
}

.skill-slot-tile.is-empty .skill-slot-icon {
    font-size: 34px;
    color: rgba(120, 220, 150, 0.75);
    text-shadow: 0 0 18px rgba(120, 220, 150, 0.25);
}

.skill-slot-select--overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.skill-slot-name {
    width: 100%;
    text-align: center;
    font-size: 13px;
    line-height: 1.1;
    padding: 6px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.28);
    color: #eae6de;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-slot-name.is-empty {
    color: rgba(120, 220, 150, 0.9);
    background: transparent;
    border-color: transparent;
    font-weight: 800;
}

@media (max-width: 540px) {
    .card-skill-slot-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .card-skill-slot-tiles.is-with-innate {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .card-detail-shell {
        flex-direction: column;
    }

    .card-detail-rail {
        flex-direction: row;
        flex: 0 0 auto;
        width: 100%;
        padding: 8px 8px 6px;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid rgba(80, 70, 60, 0.4);
    }

    .card-detail-rail-btn {
        min-height: auto;
        min-width: 44px;
        writing-mode: horizontal-tb;
        letter-spacing: 0;
    }

    .card-detail-artboard {
        flex: 0 0 38vh;
        min-height: 220px;
    }

    .card-detail-side {
        max-width: none;
    }
}

/* 战法详情（左右分栏，参考手游战法详情） */
.skill-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ui-bg-scrim);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3100;
}

.skill-detail-content {
    background:
        linear-gradient(165deg, rgba(38, 34, 42, 0.5) 0%, transparent 45%),
        var(--ui-bg-elevated);
    border: 1px solid var(--ui-border-gold);
    border-radius: var(--ui-radius-panel);
    padding: 0;
    max-width: 880px;
    max-height: 88vh;
    width: 94%;
    overflow: hidden;
    box-shadow: var(--ui-shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    display: flex;
    flex-direction: column;
    font-family: var(--ui-font-ui);
}

.skill-detail-content .panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    position: relative;
    padding: 16px 18px 20px;
}

.skill-detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
}

.skill-detail-layout {
    display: flex;
    flex-direction: row;
    gap: 18px;
    align-items: flex-start;
}

.skill-detail-left {
    flex: 0 0 auto;
    width: 140px;
    padding-top: 8px;
}

.skill-detail-circle-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.skill-detail-circle-lg.skill-tactic-circle {
    width: 96px;
    height: 96px;
}

.skill-detail-circle-lg .skill-tactic-icon {
    font-size: 34px;
}

.skill-detail-name-banner {
    width: 100%;
    max-width: 132px;
}

.skill-detail-right {
    flex: 1;
    min-width: 0;
    position: relative;
    padding: 4px 8px 0 0;
    background:
        radial-gradient(ellipse 120px 80px at 80% 20%, rgba(120, 90, 160, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 100px 70px at 10% 60%, rgba(80, 120, 140, 0.06) 0%, transparent 50%);
}

.skill-detail-right-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.35);
}

.skill-detail-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.skill-detail-title {
    margin: 0;
    font-size: 20px;
    font-family: var(--ui-font-display);
    color: #e07070;
    text-shadow: 0 0 20px rgba(224, 112, 112, 0.15);
}

.skill-detail-level-pill {
    font-size: 13px;
    color: #6dcea0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.skill-detail-level-arrow {
    letter-spacing: -0.05em;
}

.skill-detail-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.skill-detail-pill-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(139, 115, 85, 0.35);
    background: rgba(0, 0, 0, 0.25);
    color: var(--ui-text-muted);
    cursor: not-allowed;
}

.skill-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.35);
}

.skill-detail-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.skill-detail-cell--wide {
    grid-column: 1 / -1;
}

.skill-detail-k {
    color: var(--ui-text-muted);
}

.skill-detail-v {
    color: var(--ui-text-primary);
    font-weight: 600;
}

.skill-detail-v--troops {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.skill-detail-troop-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #6b5a4a;
    background: rgba(0, 0, 0, 0.35);
    font-size: 11px;
    font-weight: 800;
    color: var(--ui-accent-gold-bright);
}

.skill-detail-desc-section {
    margin-top: 4px;
}

.skill-detail-desc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.skill-detail-desc-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-accent-gold-bright);
}

.skill-detail-desc-toggles {
    display: inline-flex;
    border: 1px solid rgba(139, 115, 85, 0.35);
    border-radius: 4px;
    overflow: hidden;
}

.skill-detail-desc-toggle {
    padding: 4px 12px;
    font-size: 11px;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: var(--ui-text-muted);
    cursor: pointer;
}

.skill-detail-desc-toggle.is-active {
    background: rgba(120, 90, 60, 0.45);
    color: var(--ui-text-primary);
}

.skill-detail-desc-body {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #d8d4d0;
    white-space: normal;
}

.skill-detail-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(139, 115, 85, 0.35);
    font-size: 12px;
    color: var(--ui-text-muted);
}

.skill-detail-footer-label {
    display: block;
    font-weight: 600;
    color: #b8a0d0;
    margin-bottom: 6px;
}

.skill-detail-footer-hint {
    opacity: 0.85;
}

@media (max-width: 640px) {
    .skill-detail-layout {
        flex-direction: column;
        align-items: center;
    }

    .skill-detail-left {
        width: 100%;
    }

    .skill-detail-right-head {
        flex-direction: column;
    }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ui-border-gold);
}

.card-portrait {
    font-size: 48px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 115, 85, 0.3);
    border-radius: var(--ui-radius-card);
}

.card-title h2 {
    color: var(--ui-accent-gold-bright);
    margin: 0 0 3px 0;
    font-size: 18px;
    font-family: var(--ui-font-display);
}

.card-rarity {
    font-size: 12px;
    font-weight: bold;
}

.card-attributes {
    margin: 12px 0;
}

.card-attributes h3 {
    color: #ffd700;
    margin-bottom: 8px;
    font-size: 14px;
}

.attr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.attr-item {
    background: rgba(139, 115, 85, 0.2);
    padding: 8px;
    border-radius: 4px;
    text-align: center;
}

.attr-label {
    display: block;
    color: #a0a0a0;
    font-size: 11px;
    margin-bottom: 3px;
}

.attr-value {
    display: block;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
}

.card-level-exp {
    margin: 8px 0;
    padding: 8px;
    background: rgba(80, 80, 120, 0.25);
    border-radius: 4px;
    font-size: 13px;
}

.card-level-exp p { margin: 4px 0; }

.free-points { color: #7ab8e8; }

.attr-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.attr-row .attr-label { margin-bottom: 0; flex: 0 0 auto; }
.attr-row .attr-value { flex: 0 0 auto; }
.attr-extra { color: #7ab8e8; font-size: 12px; }
.attr-plus-btn {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 12px;
    background: #4a7a4a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.attr-plus-btn:hover { background: #5a9a5a; }

.card-skills {
    margin: 12px 0;
}

.card-skills h3 {
    color: #ffd700;
    margin-bottom: 8px;
    font-size: 14px;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skill-item {
    background: rgba(139, 115, 85, 0.2);
    padding: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-name {
    color: #ffffff;
    font-weight: bold;
}

.skill-type {
    color: #a0a0a0;
    font-size: 12px;
}

.card-equipped-skills {
    margin: 14px 0;
    padding-top: 12px;
    border-top: 2px solid #8b7355;
}

.card-equipped-skills h3 {
    color: #ffd700;
    margin-bottom: 6px;
    font-size: 14px;
}

.card-skill-slots-hint {
    color: #aaa;
    font-size: 12px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.card-skill-slots-loading,
.card-skill-slots-err {
    color: #bbb;
    font-size: 13px;
    margin: 0;
}

.card-skill-slots-err {
    color: #e88;
}

.card-skill-slots-status {
    font-size: 12px;
    color: #8c8;
    margin: 8px 0 0 0;
    min-height: 1.2em;
}

.skill-slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.skill-slot-label {
    flex: 0 0 auto;
    min-width: 5em;
    color: #ccc;
    font-size: 13px;
}

.skill-slot-select {
    flex: 1;
    min-width: 140px;
    max-width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    background: #2a2a2a;
    border: 1px solid #6b5344;
    color: #eee;
    border-radius: 4px;
}

.card-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #8b7355;
    color: #a0a0a0;
    font-size: 12px;
}

.card-info p {
    margin: 3px 0;
}

/* 部队管理面板 */
.army-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.army-panel-content {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 16px;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    width: 90%;
}

.army-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid #8b7355;
    padding-bottom: 6px;
}
.army-tabs-row .army-tabs {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    flex: 1;
}
.army-tabs-row .add-army-btn {
    flex-shrink: 0;
}
.army-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.army-editor-header h3 {
    margin: 0;
}
.army-editor-header .disband-army-btn {
    flex-shrink: 0;
}
.army-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 2px solid #8b7355;
    padding-bottom: 6px;
}

.army-tab {
    padding: 6px 12px;
    background: rgba(139, 115, 85, 0.2);
    border: 2px solid #8b7355;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.army-tab:hover {
    background: rgba(139, 115, 85, 0.4);
}

.army-tab.active {
    background: #8b7355;
    border-color: #a0826d;
}

.army-editor h3 {
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 16px;
}

.army-edit-hint {
    color: #e0a020;
    font-size: 13px;
    margin-bottom: 10px;
}

/* 部队管理 · 征兵区（参考手游：底栏深色半透明、绿条、右侧资源列；无新增系统功能） */
.army-recruit-section {
    margin-top: 8px;
    margin-bottom: 6px;
}

.army-recruit-section-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 700;
    color: #c5a367;
    letter-spacing: 0.12em;
}

.army-recruit-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 200px);
    gap: 14px 18px;
    align-items: start;
    padding: 14px 16px 16px;
    background: rgba(6, 8, 12, 0.88);
    border: 1px solid rgba(130, 115, 90, 0.38);
    border-radius: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 6px 24px rgba(0, 0, 0, 0.35);
}

.army-recruit-panel-main {
    min-width: 0;
}

.army-recruit-panel-side {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(100, 95, 88, 0.4);
    font-size: 12px;
    color: #b8b0a8;
}

.army-recruit-cost-h {
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #c5a367;
    border-bottom: 1px solid rgba(197, 163, 103, 0.28);
}

.army-recruit-cost-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 12px;
    color: #dcd6ce;
}

.army-recruit-cost-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(197, 163, 103, 0.45);
    color: #e8c547;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.35);
}

.army-recruit-cost-k {
    flex: 0 0 auto;
    color: #9a948c;
}

.army-recruit-cost-v {
    margin-left: auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #f0ebe4;
}

.army-recruit-missing {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #a09890;
    line-height: 1.45;
}

.army-recruit-missing strong {
    color: #8fd4a8;
}

.army-recruit-cost-hint {
    margin: 10px 0 0 0;
    font-size: 11px;
    color: #7a7268;
    line-height: 1.4;
}

.army-recruit-section .recruit-block {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(70, 66, 60, 0.55);
}

.army-recruit-section .recruit-block--conscript {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.army-recruit-section .recruit-block-title {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 700;
    color: #e0d4c0;
    letter-spacing: 0.08em;
}

.army-recruit-section .recruit-desc {
    margin: 0 0 10px 0;
    font-size: 11px;
    line-height: 1.45;
    color: #8a8580;
}

.army-recruit-section .recruit-slot-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.army-recruit-section .recruit-slot-cell {
    position: relative;
    padding: 10px 10px 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(85, 80, 72, 0.45);
}

.army-recruit-section .recruit-slot-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.army-recruit-section .recruit-slot-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 28px;
    font-size: 18px;
    background: rgba(20, 18, 16, 0.9);
    border: 1px solid rgba(120, 110, 95, 0.5);
    flex-shrink: 0;
    overflow: hidden;
}

.army-recruit-section .recruit-slot-thumb--empty {
    font-size: 12px;
    color: #666;
}

.army-recruit-section .recruit-slot-name {
    font-size: 13px;
    font-weight: 700;
    color: #e8e4dc;
    letter-spacing: 0.1em;
}

.army-recruit-section .recruit-slot-qty-label {
    font-size: 12px;
    color: #a8a298;
    margin-bottom: 6px;
}

.army-recruit-section .recruit-slot-frac {
    color: #c8f0d0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.army-recruit-section .recruit-slot-control {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.army-recruit-section .recruit-slot-time {
    font-size: 11px;
    color: #8a9688;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.army-recruit-section .recruit-slot-value {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.army-recruit-section .recruit-range-input {
    flex: 1;
    min-width: 100px;
    height: 22px;
    cursor: pointer;
    accent-color: #2ecc71;
}

.army-recruit-section .recruit-range-input::-webkit-slider-runnable-track {
    height: 7px;
    border-radius: 2px;
    background: #2a2a28;
    border: 1px solid #1a1a18;
}

.army-recruit-section .recruit-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -5px;
    border-radius: 50%;
    background: #f2f2f2;
    border: 1px solid #888;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.army-recruit-section .recruit-range-input::-moz-range-track {
    height: 7px;
    border-radius: 2px;
    background: #2a2a28;
    border: 1px solid #1a1a18;
}

.army-recruit-section .recruit-range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f2f2f2;
    border: 1px solid #888;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.army-recruit-section .recruit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.army-recruit-section .recruit-slot-max-btn {
    padding: 6px 14px;
    font-size: 12px;
    background: rgba(45, 44, 42, 0.95);
    border: 1px solid rgba(110, 105, 98, 0.55);
    color: #e0dcd6;
}

.army-recruit-section .recruit-primary-btn {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(180deg, #3a3836 0%, #1e1c1a 100%);
    border: 1px solid rgba(160, 145, 120, 0.45);
    color: #f5f2ec;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.army-recruit-section .recruit-primary-btn:hover {
    filter: brightness(1.06);
}

.army-recruit-section .recruit-cancel-btn {
    padding: 6px 14px;
    font-size: 12px;
}

.army-recruit-section .recruit-status {
    margin: 10px 0 4px 0;
    font-size: 12px;
    color: #9ec8ff;
    line-height: 1.45;
}

.army-recruit-section .recruit-per-card-label {
    margin: 4px 0 2px 0;
    font-size: 11px;
    color: #8a8580;
}

.army-recruit-section #recruit-per-card-list {
    margin: 0 0 0 16px;
    padding: 0;
    font-size: 11px;
    color: #b0a8a0;
}

@media (max-width: 720px) {
    .army-recruit-panel {
        grid-template-columns: 1fr;
    }

    .army-recruit-panel-side {
        order: -1;
    }
}

.army-slots {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    justify-content: center;
    align-items: flex-start;
}

.army-slot {
    width: 118px;
    min-height: 0;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

/* 位标签：六边形横幅感（纯 CSS） */
.army-slot-label {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 2px;
}

.army-slot-label-text {
    display: inline-block;
    min-width: 72px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #f2efe8;
    text-align: center;
    background: linear-gradient(180deg, #2a2420 0%, #1a1614 100%);
    border: 1px solid rgba(201, 162, 39, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.45);
    clip-path: polygon(8% 0%, 92% 0%, 100% 50%, 92% 100%, 8% 100%, 0% 50%);
}

.army-slot .slot-card,
.army-slot .slot-empty {
    flex: 1;
    width: 100%;
    min-height: 168px;
}

.slot-card {
    --slot-accent: #9b59b6;
    position: relative;
    width: 100%;
    padding: 0;
    background: linear-gradient(165deg, rgba(32, 28, 40, 0.95) 0%, rgba(14, 12, 18, 0.98) 100%);
    border: 1px solid rgba(180, 120, 220, 0.55);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(140, 80, 200, 0.35),
        inset 0 0 0 1px rgba(200, 140, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    cursor: pointer;
    overflow: hidden;
}

.slot-card:hover {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 0 16px rgba(160, 100, 220, 0.45),
        inset 0 0 0 1px rgba(220, 170, 255, 0.18);
}

.slot-card-frame {
    position: relative;
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 118px;
    align-items: stretch;
}

/* 部队槽位/选部队：立绘占满卡牌，名称/兵力叠在立绘上（参考 cardpool） */
.slot-card.slot-card--fullart .slot-card-frame {
    min-height: 156px;
    overflow: hidden;
}

.slot-card.slot-card--fullart .slot-card-portrait {
    position: absolute;
    inset: 0;
    margin-top: 0;
    min-height: 100%;
    width: 100%;
    height: 100%;
    border-radius: 0;
    filter: none;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    line-height: 1;
    color: #f1eee7;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.slot-card.slot-card--fullart .slot-card-portrait.has-art {
    color: transparent;
    text-shadow: none;
}

.slot-card.slot-card--fullart .slot-card-faction {
    left: 6px;
    top: 6px;
}

.slot-card.slot-card--fullart .slot-card-stars {
    top: 6px;
    right: 6px;
}

.slot-card.slot-card--fullart .slot-card-name-vertical {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: 28px;
    flex: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.slot-card-overlay-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px 6px 32px; /* 给左侧竖名条留空间 */
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.35) 25%, rgba(0, 0, 0, 0.78) 100%);
    color: #eee9e0;
    font-size: 11px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

.slot-card-overlay-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.slot-card-overlay-troops {
    flex-shrink: 0;
    font-weight: 700;
    color: #d7ecff;
}

.slot-card.slot-card--fullart .slot-card-bars,
.slot-card.slot-card--fullart .slot-card-meta,
.slot-card.slot-card--fullart .slot-card-main {
    display: none !important;
}

.slot-card-faction {
    position: absolute;
    top: 4px;
    left: 22px;
    z-index: 2;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(145deg, #3a6cb8 0%, #1e3f7a 100%);
    border: 1px solid rgba(120, 180, 255, 0.45);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.slot-card-name-vertical {
    flex: 0 0 22px;
    width: 22px;
    padding: 8px 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #f5f2ea;
    text-align: center;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.slot-card-main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: 4px 4px 4px 2px;
}

.slot-card-stars {
    position: absolute;
    top: 2px;
    right: 4px;
    z-index: 2;
    font-size: 9px;
    line-height: 1;
    letter-spacing: -1px;
    color: #e8c24a;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.slot-card-portrait {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    line-height: 1;
    min-height: 56px;
    margin-top: 16px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.slot-card-portrait.has-art {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: transparent;
    text-shadow: none;
}

.slot-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 6px;
    margin-top: auto;
    padding: 4px 2px 2px;
    font-size: 9px;
    line-height: 1.25;
    color: #d8d4cc;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.55) 40%, rgba(0, 0, 0, 0.72) 100%);
}

.slot-card-level {
    font-size: 9px;
    color: #f0ebe3;
    font-weight: 600;
}

.slot-card-cost {
    font-size: 8px;
    color: #c9c2b8;
    opacity: 0.95;
}

.slot-card-troop-ic {
    font-size: 10px;
    line-height: 1;
    color: #e8e0d4;
}

.slot-card-bars {
    flex-shrink: 0;
    padding: 6px 6px 4px;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.slot-card-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
    font-size: 9px;
    color: #b8b4ac;
}

.slot-card-bar-title {
    font-weight: 600;
    color: #9ec8ff;
}

.slot-card-bar-num {
    font-variant-numeric: tabular-nums;
    color: #e8e4dc;
}

.slot-card-bar-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.slot-card-bar-track > span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #3a7bd5 0%, #5aa0f0 100%);
    box-shadow: 0 0 6px rgba(80, 160, 255, 0.45);
    transition: width 0.2s ease;
}

.army-slot .remove-card-btn {
    position: absolute;
    right: 6px;
    top: 20px;
    z-index: 3;
    padding: 2px 6px;
    font-size: 9px;
    line-height: 1.2;
    border-radius: 2px;
    opacity: 0.88;
}

.remove-card-btn {
    padding: 4px 12px;
    background: #a33;
    border: none;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.remove-card-btn:hover {
    background: #c44;
}

.slot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #7a7670;
    font-size: 11px;
    border: 1px dashed rgba(139, 115, 85, 0.45);
    border-radius: 4px;
    background: rgba(20, 18, 16, 0.5);
}

.slot-empty span {
    display: block;
    margin-bottom: 6px;
    color: #908a82;
}

.add-card-btn {
    padding: 6px 14px;
    background: #3d6eae;
    border: none;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.add-card-btn:hover {
    background: #4a7fc4;
}

/* 槽位选卡弹层：上方可添加、下方已配置 */
.army-slot-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.army-slot-picker-panel {
    background: linear-gradient(180deg, #2a2520 0%, #1a1815 100%);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.army-slot-picker-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.army-slot-picker-panel h3 {
    font-size: 16px;
    color: #ffd700;
}
.slot-picker-section {
    margin-bottom: 14px;
}
.slot-picker-section h4 {
    font-size: 13px;
    color: #c9a227;
    margin-bottom: 6px;
}
.slot-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}
.slot-picker-list.addable .slot-picker-card-item:not(.disabled) {
    cursor: pointer;
}
.slot-picker-list.addable .slot-picker-card-item:not(.disabled):hover {
    background: rgba(139, 115, 85, 0.4);
    transform: translateY(-2px);
}
.slot-picker-card-item {
    padding: 6px 10px;
    background: rgba(139, 115, 85, 0.2);
    border: 2px solid;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.slot-picker-card-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.slot-picker-empty {
    color: #888;
    font-size: 13px;
}

.available-cards {
    margin-top: 16px;
}

.available-cards h4 {
    color: #ffd700;
    margin-bottom: 8px;
    font-size: 14px;
}

.available-cards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.available-card-item {
    padding: 6px 10px;
    background: rgba(139, 115, 85, 0.2);
    border: 2px solid;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.available-card-item:hover {
    background: rgba(139, 115, 85, 0.4);
    transform: translateY(-2px);
}

.available-card-item.in-army {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-portrait-small {
    font-size: 20px;
}

.card-name-small {
    color: #ffffff;
    font-size: 14px;
}

.card-level-small {
    font-size: 11px;
    color: #c9a227;
    margin-left: 4px;
}

.in-army-badge {
    font-size: 10px;
    color: #888;
    margin-left: auto;
}

.in-army-badge.other-army {
    color: #ffa726;
}

/* 部队选择面板（出征 / 驻守 / 调兵） */
.army-selection-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    padding: 20px;
    box-sizing: border-box;
}

.army-selection-content {
    background: linear-gradient(180deg, rgba(28, 26, 24, 0.98) 0%, rgba(20, 18, 16, 0.98) 100%);
    border: 1px solid rgba(184, 149, 107, 0.5);
    border-radius: 12px;
    padding: 0;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 215, 0, 0.08);
    width: 100%;
    overflow: hidden;
}

/* UIFramework.Panel 会包一层 panel-body，这里把它补成 flex 容器，保证列表区域 flex:1 生效 */
.army-selection-content .panel-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.army-selection-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.4);
    flex-shrink: 0;
}

.army-selection-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
    letter-spacing: 0.5px;
}

.army-selection-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(139, 115, 85, 0.25);
    color: #e0e0e0;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.army-selection-close:hover {
    background: rgba(200, 160, 100, 0.4);
    color: #fff;
}

.army-selection-target-card {
    margin: 14px 18px 0;
    padding: 12px 14px;
    background: rgba(139, 115, 85, 0.15);
    border: 1px solid rgba(139, 115, 85, 0.35);
    border-radius: 8px;
    flex-shrink: 0;
}

.army-selection-target-name {
    color: #ffd700;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 4px;
}

.army-selection-target-card .city-guard-info,
.army-selection-target-card .army-selection-source-hint {
    color: #c4b89a;
    font-size: 13px;
    margin: 4px 0 0 0;
}

.army-selection-list-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 18px;
    margin-top: 10px;
}

.army-selection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.army-selection-source-group {
    margin-bottom: 18px;
}

.army-selection-source-group:last-child {
    margin-bottom: 0;
}

.army-selection-source-group .source-city-name {
    color: #d4a84b;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.4);
    letter-spacing: 0.3px;
}

.army-selection-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.no-army-hint {
    color: #888;
    text-align: center;
    padding: 20px 12px;
    font-size: 13px;
}

.army-selection-item {
    background: rgba(30, 28, 26, 0.9);
    border: 1px solid rgba(139, 115, 85, 0.45);
    border-radius: 8px;
    padding: 5px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.army-selection-item:hover {
    background: rgba(139, 115, 85, 0.12);
    border-color: rgba(184, 149, 107, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.army-selection-item.empty {
    opacity: 0.6;
}

.army-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.army-selection-header h4 {
    color: #f0e0a8;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.empty-badge {
    background: #c44;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.army-selection-item.deployed {
    opacity: 0.7;
    pointer-events: none;
}

.deployed-badge {
    background: #757575;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.army-selection-units {
    margin-bottom: 10px;
}

/* 选择部队面板：复用部队管理的三槽卡牌样式 */
.army-selection-units .army-slots--selection {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 60%;
    margin: 0 auto;
}

.army-selection-units .army-slot {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.army-selection-units .army-slot .slot-card,
.army-selection-units .army-slot .slot-empty {
    min-height: 156px;
}

.slot-card.slot-card--selection {
    cursor: default;
}

.unit-health-preview {
    font-size: 11px;
    color: #b0b0b0;
    margin-top: 4px;
}

.card-health-small {
    font-size: 11px;
    color: #888;
    margin-left: 4px;
}

.unit-preview {
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid;
    border-radius: 6px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
}

.unit-portrait {
    font-size: 20px;
}

.unit-name {
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.unit-level-preview {
    font-size: 11px;
    color: #c9a227;
}

.empty-message {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 12px;
    font-size: 12px;
}

.select-army-btn {
    width: 100%;
    padding: 5px 6px;
    background: linear-gradient(135deg, #3d7bc2 0%, #2a6aa8 100%);
    border: 1px solid rgba(100, 160, 220, 0.5);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.select-army-btn:hover {
    background: linear-gradient(135deg, #4a8ed4 0%, #3d7bc2 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(60, 120, 200, 0.35);
}

.army-selection-footer {
    padding: 10px 12px;
    border-top: 1px solid rgba(139, 115, 85, 0.35);
    text-align: center;
    flex-shrink: 0;
}

.cancel-btn {
    padding: 7px 16px;
    background: rgba(139, 115, 85, 0.25);
    border: 1px solid rgba(139, 115, 85, 0.6);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.cancel-btn:hover {
    background: rgba(139, 115, 85, 0.45);
    border-color: #8b7355;
    color: #fff;
}

/* 战斗历史面板 */
.battle-history-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.battle-history-content {
    background: linear-gradient(180deg, rgba(22, 20, 18, 0.97) 0%, rgba(10, 9, 8, 0.99) 100%);
    border: 1px solid rgba(140, 125, 100, 0.45);
    border-radius: 4px;
    padding: 12px 12px;
    max-width: 760px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    width: 94%;
}

.battle-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

/* 战报列表项：左攻 / 中结果 / 右守（参考手游战报条） */
.battle-history-item {
    position: relative;
    background: linear-gradient(165deg, rgba(28, 26, 24, 0.92) 0%, rgba(12, 11, 10, 0.96) 100%);
    border: 1px solid rgba(120, 110, 95, 0.35);
    border-radius: 2px;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.battle-history-item:hover {
    border-color: rgba(200, 175, 120, 0.4);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.bh-meta-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 6px 10px;
    font-size: 11px;
    color: #a8a298;
    border-bottom: 1px solid rgba(70, 66, 60, 0.5);
    background: rgba(0, 0, 0, 0.25);
}

.bh-meta-icon {
    color: #c5a367;
    font-size: 12px;
}

.bh-meta-name {
    font-weight: 700;
    color: #e8e4dc;
}

.bh-meta-loc {
    color: #8fd4a8;
}

.bh-meta-def {
    margin-left: auto;
    color: #7dd3a0;
    font-weight: 600;
}

.bh-body {
    display: grid;
    grid-template-columns: 1fr minmax(120px, 140px) 1fr;
    gap: 6px 8px;
    align-items: start;
    padding: 8px 8px 10px;
}

.bh-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bh-troop-bar {
    width: 100%;
    height: 5px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.35);
}

.bh-troop-bar > span {
    display: block;
    height: 100%;
    border-radius: 1px;
    transition: width 0.25s ease;
}

.bh-troop-bar--att > span {
    background: linear-gradient(90deg, #4a7ab8 0%, #6a9ad8 100%);
}

.bh-troop-bar--def > span {
    background: linear-gradient(90deg, #8a3030 0%, #b04040 100%);
}

.bh-troop-bar-label {
    width: 100%;
    text-align: center;
    font-size: 10px;
    color: #9a948c;
    font-variant-numeric: tabular-nums;
}

.bh-col-center {
    position: relative;
    justify-content: center;
    padding: 6px 4px 10px;
    min-height: 120px;
}

.bh-col-center::before {
    content: '';
    position: absolute;
    inset: 8px 4px 28px;
    opacity: 0.08;
    pointer-events: none;
    background: radial-gradient(ellipse 80px 48px at 50% 80%, rgba(120, 90, 60, 0.5) 0%, transparent 70%);
}

.bh-result-char {
    position: relative;
    z-index: 1;
    font-family: var(--ui-font-display);
    font-size: 52px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.bh-result-char.victory {
    color: #e8c547;
    filter: drop-shadow(0 0 14px rgba(232, 197, 71, 0.25));
}

.bh-result-char.defeat {
    color: #b0a8a0;
}

.bh-result-char.draw {
    color: #9a9a98;
}

.bh-result-sub {
    position: relative;
    z-index: 1;
    margin-top: 6px;
    font-size: 12px;
    color: #dcd8d2;
    text-align: center;
}

.bh-result-time {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    font-size: 11px;
    color: #7a756c;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.battle-sweep-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    font-size: 10px;
    color: #e8c547;
    border: 1px solid rgba(232, 197, 71, 0.35);
    border-radius: 2px;
}

.history-formation-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

/* 战报迷你武将卡：竖名条 + 立绘区 + 星/等级/兵力 */
.history-card-slot {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-width: 72px;
    max-width: 88px;
    min-height: 86px;
    padding: 0;
    border: 1px solid rgba(110, 95, 80, 0.45);
    border-radius: 2px;
    background: rgba(8, 8, 10, 0.75);
    overflow: hidden;
}

.history-card-slot.history-card-slot--cardpool {
    /* 参考 cardpool 的 player-card-tile 质感（缩小版） */
    border: 2px solid var(--player-card-rarity, rgba(180, 140, 90, 0.8));
    background: linear-gradient(180deg, rgba(24, 22, 28, 0.98) 0%, rgba(8, 7, 10, 0.99) 100%);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 0 10px -6px var(--player-card-rarity, rgba(160, 100, 200, 0.25));
}

.history-card-slot--cardpool .history-card-tile-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 86px;
}

.history-card-slot--cardpool .history-card-art-wrap {
    position: relative;
    flex: 1;
    min-height: 58px;
    overflow: hidden;
    background: #1a1820;
}

.history-card-slot--cardpool .history-card-art-bg {
    position: absolute;
    inset: 0;
    background-color: #1a1820;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.history-card-slot--cardpool .history-card-portrait {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: rgba(245, 242, 234, 0.95);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.history-card-slot--cardpool .history-card-banner-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 2px 4px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 100%);
    border-right: 1px solid rgba(139, 115, 85, 0.28);
    z-index: 2;
    pointer-events: none;
}

.history-card-slot--cardpool .history-card-faction {
    font-size: 9px;
    font-weight: 800;
    color: var(--ui-text-primary);
    line-height: 1.1;
    margin-bottom: 2px;
}

.history-card-slot--cardpool .history-card-name-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 10px;
    font-weight: 700;
    color: var(--ui-accent-gold-bright);
    letter-spacing: 0.16em;
    max-height: 8em;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.history-card-slot--cardpool .history-card-stars {
    top: 2px;
    right: 2px;
    z-index: 3;
    font-size: 8px;
    padding: 1px 2px;
    background: rgba(0, 0, 0, 0.32);
    border-radius: 2px;
}

.history-card-slot--cardpool .history-card-overlay-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px; /* 让出 footer-bar（叠在立绘上） */
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 4px 4px 20px; /* 给左侧竖条留空间 */
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.35) 25%, rgba(0, 0, 0, 0.82) 100%);
    color: #eee9e0;
    font-size: 9px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

.history-card-slot--cardpool .history-card-overlay-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.history-card-slot--cardpool .history-card-footer-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 4px 4px 4px;
    min-height: 22px;
    background: linear-gradient(180deg, rgba(18, 14, 24, 0.18) 0%, rgba(6, 5, 10, 0.86) 70%, rgba(6, 5, 10, 0.96) 100%);
    border-top: 1px solid rgba(100, 80, 130, 0.25);
    font-size: 9px;
    color: var(--ui-text-primary);
    font-variant-numeric: tabular-nums;
    z-index: 4;
    pointer-events: none;
}

.history-card-slot--cardpool .history-card-level {
    font-size: 9px;
    color: #f0ebe3;
    font-weight: 700;
}

.history-card-slot--cardpool .history-card-troop-ic {
    font-size: 9px;
    font-weight: 800;
    color: #a09888;
    border: 1px solid rgba(120, 115, 108, 0.5);
    border-radius: 2px;
    padding: 0 3px;
    line-height: 1.2;
}

.history-card-slot--cardpool .history-card-troop-ic--empty {
    opacity: 0.55;
}

.history-card-slot-empty {
    border-style: dashed;
    color: #666;
    font-size: 11px;
    align-items: center;
    justify-content: center;
    min-height: 64px;
}

/* 旧版竖名条（保留给未加 history-card-slot--cardpool 的旧 DOM） */
.history-card-name {
    flex: 0 0 16px;
    width: 16px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 10px;
    font-weight: 700;
    color: #f0ebe4;
    text-align: center;
    padding: 4px 2px;
    background: linear-gradient(180deg, rgba(90, 28, 28, 0.75) 0%, rgba(40, 12, 12, 0.9) 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.35);
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-art {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 4px 6px;
    min-width: 0;
}

.history-card-stars {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
    font-size: 8px;
    line-height: 1;
    letter-spacing: -0.05em;
    color: #e8c547;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.history-card-portrait {
    font-size: 22px;
    line-height: 1.2;
    margin-top: 10px;
}

.history-card-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    width: 100%;
    margin-top: auto;
    padding-top: 4px;
}

.history-card-level {
    font-size: 9px;
    color: #c5a367;
    font-weight: 700;
}

.history-card-health {
    font-size: 9px;
    color: #c8c4bc;
    font-variant-numeric: tabular-nums;
}

.history-card-troop-ic {
    font-size: 9px;
    font-weight: 800;
    color: #a09888;
    border: 1px solid rgba(120, 115, 108, 0.5);
    border-radius: 2px;
    padding: 0 3px;
    line-height: 1.2;
}

.battle-history-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    padding: 8px 12px;
    font-size: 11px;
    color: #8a8580;
    border-top: 1px solid rgba(60, 58, 54, 0.55);
    background: rgba(0, 0, 0, 0.2);
}

.battle-exp {
    color: #9ec8ff;
}

.battle-time {
    margin-left: auto;
    color: #6a6560;
    font-variant-numeric: tabular-nums;
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: #888;
    font-style: italic;
}

@media (max-width: 640px) {
    .bh-body {
        grid-template-columns: 1fr;
    }

    .bh-col-center {
        order: -1;
        min-height: auto;
        padding-bottom: 4px;
    }

    .bh-result-char {
        font-size: 40px;
    }
}

/* 战斗详情面板 */
.battle-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.battle-detail-content {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 16px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    width: 90%;
}

.battle-detail-summary {
    background: rgba(139, 115, 85, 0.2);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.summary-item {
    display: flex;
    gap: 6px;
}

.summary-label {
    color: #a0a0a0;
    font-size: 13px;
}

.summary-value {
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
}

.summary-value.victory {
    color: #4a90e2;
}

.summary-value.defeat {
    color: #c44;
}

.battle-detail-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 2px solid #8b7355;
    padding-bottom: 6px;
}

.detail-tab {
    padding: 6px 12px;
    background: rgba(139, 115, 85, 0.2);
    border: 2px solid #8b7355;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.detail-tab:hover {
    background: rgba(139, 115, 85, 0.4);
}

.detail-tab.active {
    background: #8b7355;
    border-color: #a0826d;
}

.detail-tab-content {
    display: none;
}

.detail-tab-content.active {
    display: block;
}

/* 战斗详情 - 部队站位 */
.formation-section {
    margin-top: 8px;
}
.formation-section h3 {
    margin: 12px 0 6px;
    color: #ffd700;
    font-size: 14px;
}
.formation-section h3:first-child {
    margin-top: 0;
}
.formation-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.formation-slot {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
    padding: 10px;
    border: 2px solid #8b7355;
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.formation-slot-empty {
    border-style: dashed;
    color: #666;
}
.formation-slot-label {
    font-size: 12px;
    font-weight: bold;
    color: #c9a227;
}
.formation-portrait {
    font-size: 28px;
}
.formation-name {
    font-size: 13px;
    color: #e0e0e0;
    text-align: center;
}
.formation-level {
    font-size: 11px;
    color: #c9a227;
}
.formation-health {
    font-size: 11px;
    color: #a0a0a0;
}
.formation-empty {
    color: #666;
    font-size: 12px;
}
.formation-dead {
    font-size: 11px;
    color: #c44;
}
.formation-slot.unit-info-clickable {
    cursor: pointer;
}
.formation-slot.unit-info-clickable:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: #4a90e2;
}

/* 战斗详情 - 部队站位块（tab 上方，一排对峙） */
.battle-formation-block {
    margin: 12px 0;
    padding: 10px 0;
    border-top: 1px solid rgba(139, 115, 85, 0.5);
    border-bottom: 1px solid rgba(139, 115, 85, 0.5);
}
.battle-formation-block .units-hint {
    margin-bottom: 8px;
}
.formation-row-confront {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}
.formation-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1 1 240px;
    min-width: 0;
    max-width: 420px;
}
.formation-side-header {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}
.formation-side-troop-line {
    display: flex;
    gap: 8px;
    align-items: center;
}
.formation-side-troop-num {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #e8e4dc;
    min-width: 72px;
}
.formation-side-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    position: relative;
}
.formation-side-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--side-pct, 0%);
    border-radius: 3px;
    transition: width 0.2s ease;
}
.formation-side-bar--player::after {
    background: linear-gradient(90deg, #2a6cb8 0%, #4a9ef0 100%);
    box-shadow: 0 0 8px rgba(80, 160, 255, 0.35);
}
.formation-side-bar--enemy::after {
    background: linear-gradient(90deg, #9a3333 0%, #d85858 100%);
    box-shadow: 0 0 8px rgba(220, 80, 80, 0.3);
}
.formation-side-label {
    font-size: 12px;
    font-weight: bold;
    color: #c9a227;
}
.formation-side-label--block {
    display: block;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #d4c8a8;
    line-height: 1.35;
}
.formation-result-pillar {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px;
    min-width: 44px;
}
.formation-result-char {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.formation-result-char.victory {
    color: #e8c24a;
}
.formation-result-char.defeat {
    color: #c07070;
}
.formation-result-char.draw {
    color: #9e9e9e;
}
.battle-detail-army-slots.army-slots {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
}
.battle-detail-content .battle-detail-army-slot.army-slot {
    width: 100px;
}
.battle-detail-content .battle-detail-army-slot .slot-card--battle .slot-card-frame {
    min-height: 108px;
}
.battle-detail-content .battle-detail-army-slot .slot-card--battle .slot-card-portrait {
    font-size: 30px;
    min-height: 48px;
    margin-top: 14px;
}

/* 战史/战斗详情：槽位卡也使用 fullart（立绘占满 + 叠层姓名/兵力） */
.battle-detail-content .battle-detail-army-slot .slot-card--battle.slot-card--fullart .slot-card-frame {
    min-height: 118px;
}

.battle-detail-content .battle-detail-army-slot .slot-card--battle.slot-card--fullart .slot-card-name-vertical {
    width: 22px;
    font-size: 11px;
}

.battle-detail-content .battle-detail-army-slot .slot-card--battle.slot-card--fullart .slot-card-overlay-bottom {
    padding-left: 26px;
    font-size: 10px;
}
.battle-detail-content .slot-card.slot-card--dead {
    filter: grayscale(0.92) brightness(0.78);
    opacity: 0.95;
}
.battle-detail-content .slot-card-bar-troops--split {
    background: linear-gradient(
        to right,
        #3a7bd5 0,
        #3a7bd5 var(--bf-pct, 0%),
        rgba(160, 45, 45, 0.88) var(--bf-pct, 0%),
        rgba(160, 45, 45, 0.88) 100%
    );
    height: 5px;
}
.slot-card-loss {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    font-size: 8px;
    color: #a89888;
}
.slot-card-loss-num {
    font-size: 9px;
    font-weight: 700;
    color: #e05555;
    font-variant-numeric: tabular-nums;
}
.formation-slots {
    display: flex;
    gap: 6px;
    align-items: stretch;
    flex-wrap: wrap;
}
.formation-vs {
    font-size: 14px;
    color: #888;
    font-weight: bold;
    padding: 0 8px;
}
.formation-slot-multi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 80px;
}
.formation-slot-inner {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.formation-slot-inline {
    padding: 6px 8px;
    min-width: 70px;
}

.round-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(139, 115, 85, 0.1);
    border-radius: 6px;
}

.round-title {
    color: #ffd700;
    font-size: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid #8b7355;
    padding-bottom: 6px;
}
.round-health-inline {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    font-size: 12px;
    color: #b8a890;
}
.round-health-label {
    font-weight: bold;
    margin-right: 6px;
}
.round-health-team {
    margin-right: 12px;
    margin-top: 4px;
}
.round-health-team:first-of-type {
    margin-top: 0;
}
.damage-formula {
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 11px;
    color: #8b9a7a;
    background: rgba(0,0,0,0.25);
    border-radius: 4px;
    font-family: monospace;
}

.round-logs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.round-logs.round-logs-single {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-entry.log-player {
    background: rgba(46, 125, 50, 0.15);
    border-left: 3px solid #4caf50;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: left;
}

.log-entry.log-enemy {
    background: rgba(198, 40, 40, 0.15);
    border-right: 3px solid #e57373;
    border-left: none;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: right;
}

.log-entry.log-neutral {
    background: rgba(139, 115, 85, 0.2);
    border-left: 3px solid #8b7355;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: center;
}

.log-entry {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
}

.log-start, .log-end {
    color: #4a90e2;
    font-weight: bold;
}

.log-round {
    color: #ffd700;
    font-weight: bold;
}

.log-skill, .log-attack {
    color: #ffffff;
}

.log-source {
    color: #4a90e2;
    font-weight: bold;
}

.log-action {
    color: #ffaa00;
    margin: 0 4px;
}

.log-effect {
    color: #e0e0e0;
}

.log-stun {
    color: #c44;
    font-style: italic;
}

.units-section h3 {
    color: #ffd700;
    font-size: 16px;
    margin: 16px 0 8px 0;
}

.units-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.unit-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(139, 115, 85, 0.2);
    border-radius: 6px;
    border: 2px solid #8b7355;
}

.unit-info-item.alive {
    border-color: #4a90e2;
}

.unit-info-item.dead {
    border-color: #c44;
    opacity: 0.6;
}

.unit-portrait {
    font-size: 32px;
}

.unit-details {
    flex: 1;
}

.unit-name {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
}

.unit-health {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #a0a0a0;
}

.health-change {
    color: #4a90e2;
    font-weight: bold;
}

.unit-damage-dealt {
    font-size: 12px;
    color: #e0a040;
    margin-top: 4px;
}
.unit-damage-dealt strong {
    color: #f0c050;
}
.units-hint {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}
.unit-info-item.unit-info-clickable {
    cursor: pointer;
}
.unit-info-item.unit-info-clickable:hover {
    background: rgba(74, 144, 226, 0.15);
}

.health-round-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(139, 115, 85, 0.1);
    border-radius: 6px;
}

.health-round-section h3 {
    color: #ffd700;
    font-size: 14px;
    margin-bottom: 8px;
}

.health-teams {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.health-team h4 {
    color: #a0826d;
    font-size: 13px;
    margin-bottom: 6px;
}

.health-item {
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 12px;
    color: #e0e0e0;
    margin-bottom: 4px;
}

/* 出身城池选择面板 */
.birth-city-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.birth-city-content {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 16px;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    width: 90%;
}

.birth-city-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.birth-city-item {
    background: rgba(139, 115, 85, 0.2);
    border: 2px solid #8b7355;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.birth-city-item:hover {
    background: rgba(139, 115, 85, 0.4);
    border-color: #a0826d;
    transform: translateY(-2px);
}

.birth-city-name {
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
}

.birth-city-info {
    display: flex;
    justify-content: space-around;
    font-size: 12px;
    color: #a0a0a0;
    margin-top: 6px;
}

/* 调动部队面板 */
.troop-transfer-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.troop-transfer-content {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.transfer-hint {
    text-align: center;
    color: #a0a0a0;
    font-size: 13px;
    margin: 8px 0 12px 0;
}

.transfer-from-sections {
    max-height: 50vh;
    overflow-y: auto;
}
.transfer-section {
    margin-bottom: 16px;
}
.transfer-section h3 {
    color: #b8956b;
    font-size: 14px;
    margin-bottom: 8px;
}

.transfer-army-list,
.transfer-city-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.transfer-army-item,
.transfer-city-item {
    padding: 8px 14px;
    background: rgba(139, 115, 85, 0.2);
    border: 2px solid #8b7355;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.transfer-army-item:hover,
.transfer-city-item:hover {
    background: rgba(139, 115, 85, 0.4);
}

.transfer-army-item.selected,
.transfer-city-item.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
}

.transfer-confirm {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #8b7355;
    text-align: center;
}

.transfer-confirm span {
    display: block;
    color: #e0e0e0;
    font-size: 13px;
    margin-bottom: 10px;
}

.battle-result-content .auto-occupy-hint,
.battle-result-content .return-hint,
.battle-result-content .defender-return-hint {
    text-align: center;
    margin: 12px 0 8px 0;
    font-size: 13px;
    color: #4a90e2;
}

.battle-result-content .return-hint {
    color: #ffaa00;
}

.battle-result-content .defender-return-hint {
    color: #8bc34a;
}

