/* ============================================
   非遗主题回合制游戏 · 墨韵篇
   全局样式 —— 宣纸背景 · 剪纸暗纹 · Q版画风
   ============================================ */

/* ----- 古风圆润字体 ----- */
@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap');

/* ----- CSS 变量：暖棕复古色板 ----- */
:root {
    /* 主色调 */
    --color-paper:        #f5ecd7;   /* 宣纸本色 */
    --color-paper-dark:   #e8dcc8;   /* 宣纸暗面 */
    --color-paper-deep:   #c4b393;   /* 宣纸深色 */
    --color-ink:          #4a3728;   /* 墨色 */
    --color-ink-light:    #6b5344;   /* 淡墨 */
    --color-ink-wash:     #8b7355;   /* 水墨灰 */
    --color-accent:       #c0392b;   /* 朱砂红 */
    --color-accent-soft:  #d4a574;   /* 檀木暖 */
    --color-gold:         #b8943e;   /* 泥金 */
    --color-cream:        #faf3e6;   /* 米白 */

    /* Q版风格参数 */
    --radius-xl:  24px;
    --radius-lg:  18px;
    --radius-md:  14px;
    --radius-sm:  10px;
    --radius-xs:  6px;

    /* 柔和阴影 */
    --shadow-soft:  0 4px 16px rgba(74, 55, 40, 0.12);
    --shadow-card:  0 6px 24px rgba(74, 55, 40, 0.15);
    --shadow-raise: 0 8px 32px rgba(74, 55, 40, 0.18);

    /* 柔和过渡 */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-soft:   cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   全局重置与自定义属性
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   Body —— 宣纸纹理 + 剪纸暗纹背景
   ============================================ */
body {
    /* 字体栈：圆润古风 → 楷体 → 衬线回退 */
    font-family:
        'ZCOOL KuaiLe',
        'STKaiti', 'KaiTi', '楷体',
        'Noto Serif SC', 'Source Han Serif SC',
        'SimSun', '宋体',
        serif;

    color: var(--color-ink);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;

    /* ---- 宣纸纹理背景 ---- */
    background-color: var(--color-paper);

    /* 第一层：宣纸纤维纹理（横向条纹模拟纸纤维） */
    background-image:
        /* 剪纸暗纹层 —— SVG 剪纸团花图案 */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'%3E%3Cg fill='none' stroke='%23c4b393' stroke-width='0.6' opacity='0.18'%3E%3Ccircle cx='160' cy='160' r='120'/%3E%3Ccircle cx='160' cy='160' r='90'/%3E%3Ccircle cx='160' cy='160' r='60'/%3E%3Ccircle cx='160' cy='160' r='30'/%3E%3Cline x1='160' y1='10' x2='160' y2='310'/%3E%3Cline x1='10' y1='160' x2='310' y2='160'/%3E%3Cline x1='54' y1='54' x2='266' y2='266'/%3E%3Cline x1='266' y1='54' x2='54' y2='266'/%3E%3C/g%3E%3Cg fill='none' stroke='%23c4b393' stroke-width='0.5' opacity='0.12'%3E%3Cpath d='M160,40 Q200,100 160,160 Q120,220 160,280'/%3E%3Cpath d='M40,160 Q100,200 160,160 Q220,120 280,160'/%3E%3Cpath d='M75,75 Q120,120 160,160 Q200,200 245,245'/%3E%3Cpath d='M245,75 Q200,120 160,160 Q120,200 75,245'/%3E%3C/g%3E%3C/svg%3E"),
        /* 宣纸纤维纹理 —— 细微横向与纵向噪点 */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(180, 160, 130, 0.04) 2px,
            rgba(180, 160, 130, 0.04) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(170, 150, 120, 0.03) 3px,
            rgba(170, 150, 120, 0.03) 4px
        );

    background-size:
        320px 320px,     /* 剪纸团花 */
        100% 100%,       /* 横纹 */
        100% 100%;       /* 竖纹 */

    background-position: center;
    background-repeat: repeat, repeat, repeat;
    background-attachment: fixed;
}

/* 全局半透明遮罩增加纸质感 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    /* 宣纸色温叠加 */
    background:
        radial-gradient(ellipse at 30% 20%, rgba(245, 236, 215, 0.6) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(235, 220, 195, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(250, 243, 230, 0.3) 0%, transparent 70%);
}

/* ============================================
   游戏主容器
   ============================================ */
#game-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

/* ============================================
   顶部信息栏
   ============================================ */
#game-header {
    width: 100%;
    max-width: 960px;
}

.header-inner {
    min-height: 60px;
    background: linear-gradient(180deg,
        rgba(250, 243, 230, 0.85) 0%,
        rgba(240, 230, 210, 0.8) 100%);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(180, 150, 110, 0.3);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 12px 24px;
}

/* ============================================
   主舞台区域
   ============================================ */
#game-stage {
    flex: 1;
    width: 100%;
    max-width: 960px;
}

.stage-inner {
    min-height: 420px;
    background: linear-gradient(180deg,
        rgba(252, 248, 238, 0.75) 0%,
        rgba(245, 236, 215, 0.7) 50%,
        rgba(235, 222, 198, 0.65) 100%);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(180, 150, 110, 0.25);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 24px;
}

/* ============================================
   底部操作栏
   ============================================ */
#game-footer {
    width: 100%;
    max-width: 960px;
}

.footer-inner {
    min-height: 80px;
    background: linear-gradient(180deg,
        rgba(250, 243, 230, 0.85) 0%,
        rgba(240, 228, 208, 0.8) 100%);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(180, 150, 110, 0.3);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 16px 24px;
}

/* ============================================
   剪纸装饰分隔线
   ============================================ */
.header-inner::after,
.footer-inner::before {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    margin: 8px 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 8px,
        var(--color-paper-deep) 8px,
        var(--color-paper-deep) 10px,
        transparent 10px,
        transparent 16px
    );
    opacity: 0.35;
    border-radius: 1px;
}

/* ============================================
   Q版通用元素预设样式
   ============================================ */

/* ---- Q版卡片 ---- */
.q-card {
    background: rgba(250, 243, 230, 0.85);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(180, 150, 110, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 16px 20px;
    transition: transform 0.3s var(--ease-bounce),
                box-shadow 0.3s var(--ease-soft);
}

.q-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-raise);
}

/* ---- Q版按钮 ---- */
.q-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--color-cream);
    background: linear-gradient(135deg, var(--color-ink-light), var(--color-ink));
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(74, 55, 40, 0.25);
    cursor: pointer;
    transition: all 0.25s var(--ease-soft);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.q-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(74, 55, 40, 0.35);
}

.q-btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(74, 55, 40, 0.2);
}

.q-btn--accent {
    background: linear-gradient(135deg, var(--color-accent), #a93226);
}

.q-btn--gold {
    background: linear-gradient(135deg, var(--color-gold), #9a7b2f);
    color: var(--color-cream);
}

/* ---- Q版标签/徽章 ---- */
.q-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    font-size: 0.8rem;
    background: rgba(180, 150, 110, 0.2);
    border: 1px solid rgba(180, 150, 110, 0.3);
    border-radius: 999px; /* 全圆角胶囊 */
    color: var(--color-ink-light);
}

/* ---- Q版头像/立绘容器 ---- */
.q-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(180, 150, 110, 0.4);
    box-shadow: var(--shadow-soft);
    background: linear-gradient(180deg, var(--color-paper) 0%, var(--color-paper-dark) 100%);
}

/* 立绘图片渲染规则：等比例居中显示、禁止拉伸、留白适配圆形框 */
.q-avatar img,
.q-portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: inherit;
    transition: transform 0.4s var(--ease-bounce);
}

.q-avatar:hover img,
.q-portrait:hover img {
    transform: scale(1.06);
}

/* ---- Q版立绘容器（大尺寸） ---- */
.q-portrait {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 2.5px solid rgba(180, 150, 110, 0.35);
    box-shadow: var(--shadow-card);
    background: linear-gradient(180deg,
        rgba(245, 236, 215, 0.5) 0%,
        rgba(235, 220, 195, 0.4) 100%);
}

/* 立绘底部投影光晕 */
.q-portrait::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 20%;
    background: radial-gradient(ellipse at center,
        rgba(74, 55, 40, 0.15) 0%,
        transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ---- Q版文字标题 ---- */
.q-title {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.6rem;
    color: var(--color-ink);
    text-shadow: 1px 1px 0 rgba(245, 236, 215, 0.6);
    letter-spacing: 0.08em;
}

.q-subtitle {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1rem;
    color: var(--color-ink-wash);
    letter-spacing: 0.06em;
}

/* ---- Q版分隔线（剪纸风格） ---- */
.q-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--color-paper-deep) 15%,
        var(--color-paper-deep) 50%,
        var(--color-paper-deep) 85%,
        transparent 100%);
    border-radius: 1px;
    opacity: 0.4;
    margin: 12px 0;
}

/* ---- Q版面板/容器 ---- */
.q-panel {
    background: rgba(250, 243, 230, 0.8);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(180, 150, 110, 0.28);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 20px;
}

/* ---- Q版状态条 ---- */
.q-bar {
    height: 14px;
    background: rgba(200, 180, 150, 0.3);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(180, 150, 110, 0.25);
}

.q-bar-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.5s var(--ease-soft);
}

.q-bar-fill--hp {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.q-bar-fill--mp {
    background: linear-gradient(90deg, #2980b9, #5dade2);
}

.q-bar-fill--exp {
    background: linear-gradient(90deg, var(--color-gold), #d4ac0d);
}

/* ============================================
   开始界面  #start-screen
   ============================================ */

/* ---- 开始界面容器 ---- */
#start-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    padding: 4px;
}

/* ---- 外框：半透深棕圆角底框 + 浅金色细边框 ---- */
.start-frame {
    position: relative;
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 36px 40px 28px;

    /* 半透明深棕底 */
    background:
        linear-gradient(180deg,
            rgba(58, 42, 28, 0.78) 0%,
            rgba(48, 34, 22, 0.82) 40%,
            rgba(38, 26, 16, 0.85) 100%);

    /* 浅金色细边框 */
    border: 1.5px solid rgba(184, 148, 62, 0.45);
    border-radius: var(--radius-xl);

    /* 多层柔和阴影 */
    box-shadow:
        0 0 0 6px rgba(184, 148, 62, 0.08),       /* 外发光 */
        0 0 40px rgba(184, 148, 62, 0.06),          /* 柔光弥散 */
        0 8px 40px rgba(20, 14, 8, 0.45),           /* 底部投影 */
        inset 0 1px 0 rgba(255, 255, 255, 0.04);    /* 内顶高光线 */

    /* 进场动画 */
    animation: fadeInUp 0.8s var(--ease-soft) forwards;
}

/* 框架内角装饰光泽 */
.start-frame::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: calc(var(--radius-xl) - 3px);
    border: 1px solid rgba(184, 148, 62, 0.12);
    pointer-events: none;
}

/* ---- 顶部 / 底部剪纸装饰 ---- */
.start-decoration {
    width: 100%;
    max-width: 260px;
    height: 40px;
    opacity: 0.7;
}

.start-decoration svg {
    width: 100%;
    height: 100%;
}

.start-decoration--bottom svg {
    transform: rotate(180deg);
}

/* ---- 游戏标题 ---- */
.start-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.start-title__main {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 2.8rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: #f0d78c;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.3),
        0 0 20px rgba(240, 200, 100, 0.25),
        0 0 40px rgba(200, 150, 50, 0.12);
    line-height: 1.2;
}

.start-title__sub {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    color: rgba(200, 170, 120, 0.8);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

/* ---- 描述文案 ---- */
.start-desc {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: center;
    color: rgba(210, 185, 145, 0.75);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    max-width: 360px;
}

/* ---- 开始游戏按钮 ---- */
.start-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 16px 56px;
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.25rem;
    letter-spacing: 0.18em;
    color: #4a3020;
    background: linear-gradient(180deg,
        #f5d78c 0%,
        #e8c05a 30%,
        #d4a830 60%,
        #c09828 100%);
    border: 1.5px solid rgba(240, 210, 140, 0.5);
    border-radius: var(--radius-md);
    box-shadow:
        0 4px 18px rgba(180, 120, 30, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.35s var(--ease-soft);
}

/* 悬浮发光效果 */
.start-btn:hover {
    transform: translateY(-3px) scale(1.04);
    color: #3a2214;
    background: linear-gradient(180deg,
        #fde8a8 0%,
        #f5d070 30%,
        #e8b840 60%,
        #d4a028 100%);
    border-color: rgba(250, 220, 150, 0.7);
    box-shadow:
        0 6px 30px rgba(220, 160, 50, 0.5),    /* 金色发光 */
        0 0 60px rgba(200, 140, 40, 0.2),       /* 远距离柔光 */
        0 2px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* 按钮按压 */
.start-btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow:
        0 2px 10px rgba(180, 120, 30, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.1s var(--ease-soft);
}

/* 按钮发光底层 */
.start-btn__glow {
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--radius-md) + 4px);
    background: radial-gradient(ellipse at center,
        rgba(240, 200, 100, 0.1) 0%,
        transparent 70%);
    opacity: 0;
    transition: opacity 0.35s var(--ease-soft);
    pointer-events: none;
}

.start-btn:hover .start-btn__glow {
    opacity: 1;
}

/* 按钮文字 */
.start-btn__text {
    position: relative;
    z-index: 1;
}

/* ---- 传承者一览 ---- */
.start-inheritors {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
    margin-top: 2px;
}

/* 传承者一览标题 */
.start-inheritors__title {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: rgba(210, 185, 145, 0.8);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

/* ---- 传承者网格 ---- */
.inheritors-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px 32px;
    width: 100%;
}

/* ---- 单个传承者项 ---- */
.inheritor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* ---- 大号圆形Q版头像容器 ---- */
.inheritor-avatar {
    position: relative;
    width: 116px;
    height: 116px;
    border-radius: 50%;                    /* 正圆形 */
    background: linear-gradient(180deg,
        rgba(245, 236, 215, 0.3) 0%,
        rgba(220, 200, 170, 0.25) 100%);
    border: 3px solid rgba(184, 148, 62, 0.5);
    box-shadow:
        0 0 0 5px rgba(184, 148, 62, 0.1),   /* 外圈光环 */
        0 4px 16px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    cursor: default;
    transition: transform 0.35s var(--ease-bounce),
                border-color 0.35s var(--ease-soft),
                box-shadow 0.35s var(--ease-soft);
}

/* 悬浮效果：微微放大 + 金色边框发光 */
.inheritor-avatar:hover {
    transform: translateY(-4px) scale(1.08);
    border-color: rgba(220, 180, 90, 0.75);
    box-shadow:
        0 0 0 7px rgba(184, 148, 62, 0.18),
        0 8px 28px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(200, 150, 60, 0.15);
}

/* 头像内层（立绘预留位）—— 留白适配圆形框 */
.inheritor-avatar__inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 10px;  /* 留白，图片不贴边 */
}

/* 立绘占位文字（无图片回退） */
.inheritor-avatar__placeholder {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.2rem;
    color: rgba(210, 185, 145, 0.5);
    letter-spacing: 0.1em;
    transition: color 0.3s var(--ease-soft);
}

.inheritor-avatar:hover .inheritor-avatar__placeholder {
    color: rgba(240, 210, 150, 0.7);
}

/* ---- 立绘图片渲染（Q版圆形裁切、等比例居中、禁止拉伸） ---- */
.inheritor-avatar__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;                /* 保持比例完整显示，不裁切 */
    object-position: center;            /* 正中央对齐 */
    border-radius: 50%;                 /* 圆形容器同步裁切 */
    image-rendering: auto;              /* 浏览器自动选择最佳缩放算法 */
    transition:
        transform 0.4s var(--ease-bounce),
        opacity 0.45s var(--ease-soft),
        filter 0.45s var(--ease-soft);
}

/* hover 时立绘微微放大 */
.inheritor-avatar:hover .inheritor-avatar__img {
    transform: scale(1.08);
}

/* ---- 队伍选中态：金色光晕强调 ---- */
.inheritor-item--selected .inheritor-avatar {
    border-color: rgba(220, 180, 70, 0.8);
    box-shadow:
        0 0 0 5px rgba(200, 155, 60, 0.2),    /* 外圈金色光环 */
        0 0 20px rgba(200, 150, 40, 0.25),     /* 柔和金色弥散 */
        0 4px 16px rgba(0, 0, 0, 0.3);
    animation: inheritorPulse 3s ease-in-out infinite;
}

.inheritor-item--selected .inheritor-avatar:hover {
    border-color: rgba(245, 200, 80, 0.9);
    box-shadow:
        0 0 0 7px rgba(220, 170, 60, 0.28),
        0 0 32px rgba(220, 170, 50, 0.35),
        0 8px 28px rgba(0, 0, 0, 0.4);
}

.inheritor-item--selected .inheritor-name {
    color: rgba(240, 210, 140, 0.95);
    text-shadow:
        0 0 8px rgba(220, 170, 60, 0.35),
        0 1px 0 rgba(0, 0, 0, 0.3);
}

/* ---- 队伍未选中态：略微半透明 ---- */
.inheritor-item--dimmed .inheritor-avatar__img {
    opacity: 0.45;
    filter: grayscale(15%);
}

.inheritor-item--dimmed .inheritor-name {
    color: rgba(180, 155, 120, 0.45);
}

/* ---- 选中态呼吸动画 ---- */
@keyframes inheritorPulse {
    0%, 100% {
        box-shadow:
            0 0 0 4px rgba(200, 155, 60, 0.2),
            0 0 20px rgba(200, 150, 40, 0.25),
            0 4px 16px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 0 7px rgba(220, 170, 60, 0.26),
            0 0 32px rgba(220, 170, 50, 0.35),
            0 4px 20px rgba(0, 0, 0, 0.35);
    }
}

/* ---- 传承者名称 ---- */
.inheritor-name {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: rgba(210, 185, 145, 0.7);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* ============================================
   角色选择界面  #select-screen
   ============================================ */

/* ---- 选择界面容器 ---- */
#select-screen {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4px;
}

/* ---- 整体外框 ---- */
.select-frame {
    width: 100%;
    max-width: 780px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 28px 28px 24px;

    /* 半透深棕底（比start-frame略浅） */
    background: linear-gradient(180deg,
        rgba(52, 38, 26, 0.72) 0%,
        rgba(44, 32, 20, 0.76) 100%);

    /* 浅金细边框 */
    border: 1.5px solid rgba(184, 148, 62, 0.4);
    border-radius: var(--radius-xl);
    box-shadow:
        0 4px 24px rgba(20, 14, 8, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);

    animation: fadeInUp 0.7s var(--ease-soft) forwards;
}

/* ---- 标题区域 ---- */
.select-header {
    text-align: center;
}

.select-title {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.7rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: #e8d5a3;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.25),
        0 0 14px rgba(200, 160, 80, 0.15);
    margin-bottom: 6px;
}

.select-desc {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.9rem;
    color: rgba(200, 175, 135, 0.65);
    letter-spacing: 0.06em;
}

/* ---- 卡片网格 ---- */
.select-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

/* ============================================
   角色卡片  .char-card
   ============================================ */

.char-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 18px 18px;

    /* 米白底 + 棕褐色描边 */
    background: linear-gradient(180deg,
        rgba(252, 248, 240, 0.92) 0%,
        rgba(248, 240, 228, 0.9) 40%,
        rgba(240, 230, 215, 0.88) 100%);
    border: 2px solid rgba(140, 110, 70, 0.35);
    border-radius: var(--radius-xl);
    box-shadow:
        0 4px 16px rgba(60, 40, 20, 0.12),
        0 1px 4px rgba(0, 0, 0, 0.06);

    cursor: pointer;
    user-select: none;
    transition:
        transform 0.3s var(--ease-bounce),
        border-color 0.35s var(--ease-soft),
        box-shadow 0.35s var(--ease-soft),
        background 0.35s var(--ease-soft);

    animation: fadeInUp 0.6s var(--ease-soft) forwards;
}

/* 卡片交错的进场延迟 */
.char-card:nth-child(1) { animation-delay: 0.05s; }
.char-card:nth-child(2) { animation-delay: 0.12s; }
.char-card:nth-child(3) { animation-delay: 0.19s; }
.char-card:nth-child(4) { animation-delay: 0.26s; }

/* ---- hover 状态 ---- */
.char-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(180, 140, 80, 0.6);
    box-shadow:
        0 8px 28px rgba(60, 40, 20, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 20px rgba(180, 140, 80, 0.12);
    background: linear-gradient(180deg,
        rgba(255, 252, 245, 0.95) 0%,
        rgba(252, 245, 235, 0.93) 40%,
        rgba(245, 235, 220, 0.9) 100%);
}

/* ---- 选中状态 ---- */
.char-card--selected,
.char-card.selected {
    border-color: rgba(200, 155, 60, 0.8);
    border-width: 2.5px;
    background: linear-gradient(180deg,
        rgba(255, 252, 240, 0.95) 0%,
        rgba(252, 243, 225, 0.93) 40%,
        rgba(248, 235, 210, 0.9) 100%);
    box-shadow:
        0 0 0 4px rgba(200, 155, 60, 0.12),
        0 6px 24px rgba(60, 40, 20, 0.16),
        0 0 18px rgba(200, 155, 60, 0.18);
}

.char-card--selected .char-card__check,
.char-card.selected .char-card__check {
    opacity: 1;
    transform: scale(1);
}

/* ---- 选中勾选标记 ---- */
.char-card__check {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-cream);
    background: linear-gradient(135deg, #c09828, #d4a830);
    border: 2px solid rgba(240, 210, 140, 0.6);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(160, 120, 30, 0.3);
    opacity: 0;
    transform: scale(0.6);
    transition:
        opacity 0.3s var(--ease-bounce),
        transform 0.3s var(--ease-bounce);
    z-index: 2;
}

.char-card__check svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   角色卡片 — 立绘区域（圆形裁切）
   ============================================ */

.char-portrait {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: transparent;
    border: 2.5px solid rgba(160, 130, 90, 0.45);
    box-shadow:
        0 0 0 5px rgba(180, 150, 110, 0.08),
        0 4px 14px rgba(60, 40, 20, 0.15);
    overflow: hidden;
    flex-shrink: 0;
    transition:
        border-color 0.35s var(--ease-soft),
        box-shadow 0.35s var(--ease-soft);
}

.char-card:hover .char-portrait {
    border-color: rgba(200, 155, 60, 0.7);
    box-shadow:
        0 0 0 8px rgba(180, 150, 110, 0.14),
        0 6px 20px rgba(60, 40, 20, 0.22);
}

/* 立绘内层 —— 图片铺满圆形，无边距裁切 */
.char-portrait__inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
}

/* 立绘占位文字 */
.char-portrait__placeholder {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1rem;
    color: rgba(140, 110, 70, 0.45);
    letter-spacing: 0.1em;
    transition: color 0.3s var(--ease-soft);
}

.char-card:hover .char-portrait__placeholder {
    color: rgba(160, 130, 90, 0.55);
}

/* 图片渲染规则：铺满圆形、居中裁切、无边距 */
.char-portrait__inner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

/* ============================================
   角色卡片 — 信息区域
   ============================================ */

.char-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* ---- 角色名称 ---- */
.char-name {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #4a3528;
    letter-spacing: 0.08em;
}

/* ---- 角色类型标签 ---- */
.char-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 14px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    border-radius: 999px;
    color: var(--color-cream);
}

.char-type--gold  { background: linear-gradient(135deg, #b8943e, #8a6e2e); }
.char-type--dark  { background: linear-gradient(135deg, #5e4e6e, #3a2e46); }
.char-type--wood  { background: linear-gradient(135deg, #6b8e5a, #4a6e3a); }
.char-type--earth { background: linear-gradient(135deg, #9e7d5e, #6e503e); }

/* ---- 属性星级 ---- */
.char-attributes {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    max-width: 170px;
}

.char-attr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.char-attr__label {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.82rem;
    color: var(--color-ink-wash);
    min-width: 2.4em;
}

.char-attr__stars {
    display: flex;
    gap: 3px;
}

/* 星星图标（CSS绘制） */
.star {
    display: inline-block;
    width: 13px;
    height: 13px;
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%,
        68% 57%, 79% 91%,
        50% 70%, 21% 91%, 32% 57%,
        2% 35%, 39% 35%
    );
}

.star--fill  { background: linear-gradient(135deg, #d4a830, #c09828); }
.star--empty { background: rgba(180, 150, 110, 0.25); }

/* ---- 技能信息 ---- */
.char-skill {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    margin-top: 2px;
    background: rgba(200, 180, 150, 0.12);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(180, 150, 110, 0.18);
}

.char-skill__icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.char-skill__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.char-skill__name {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.88rem;
    color: var(--color-ink);
    letter-spacing: 0.06em;
}

.char-skill__desc {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.76rem;
    color: var(--color-ink-wash);
    line-height: 1.4;
}

/* ============================================
   选择界面 — 底部操作栏
   ============================================ */

.select-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
    padding-top: 4px;
    flex-wrap: wrap;
}

/* ---- 返回首页按钮 ---- */
.select-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: rgba(190, 160, 130, 0.7);
    background: transparent;
    border: 1px solid rgba(160, 120, 70, 0.28);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.25s var(--ease-soft);
}

.select-back-btn:hover {
    border-color: rgba(200, 150, 80, 0.5);
    color: rgba(220, 180, 130, 0.85);
    background: rgba(180, 130, 70, 0.06);
}

.select-back-btn:active {
    transform: scale(0.96);
    transition: all 0.08s var(--ease-soft);
}

/* ---- 选择计数 ---- */
.select-count {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.95rem;
    color: rgba(200, 175, 135, 0.7);
    letter-spacing: 0.08em;
}

.select-count__num {
    font-size: 1.2rem;
    color: #e8c060;
    text-shadow: 0 0 8px rgba(220, 170, 60, 0.3);
}

/* ---- 确认队伍按钮 ---- */
.select-confirm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 40px;
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.1rem;
    letter-spacing: 0.14em;
    color: var(--color-cream);

    /* 暖黄渐变 */
    background: linear-gradient(180deg,
        #e8c970 0%,
        #d4a830 50%,
        #b88820 100%);

    border: 1.5px solid rgba(240, 210, 140, 0.45);
    border-radius: var(--radius-md);
    box-shadow:
        0 4px 16px rgba(180, 130, 30, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.35s var(--ease-soft);
}

.select-confirm-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
    background: linear-gradient(180deg,
        #f0d880 0%,
        #e0b840 50%,
        #c89828 100%);
    border-color: rgba(250, 220, 150, 0.6);
    box-shadow:
        0 6px 24px rgba(200, 150, 40, 0.45),
        0 0 40px rgba(200, 150, 40, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.select-confirm-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
    box-shadow:
        0 2px 8px rgba(180, 130, 30, 0.25),
        inset 0 2px 4px rgba(0, 0, 0, 0.12);
    transition: all 0.1s var(--ease-soft);
}

/* 禁用态 */
.select-confirm-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(20%);
}

/* ============================================
   角色文化介绍面板  .culture-intro
   ============================================ */
.culture-intro {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px 14px;

    /* 浅米色半透明背景 */
    background: linear-gradient(180deg,
        rgba(252, 248, 240, 0.78) 0%,
        rgba(248, 240, 228, 0.72) 100%);

    /* 细棕边框 */
    border: 1.5px solid rgba(160, 130, 90, 0.3);
    border-radius: var(--radius-lg);         /* Q版圆角 */

    box-shadow:
        0 2px 12px rgba(60, 40, 20, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* 高度动画 */
    transition:
        opacity 0.4s var(--ease-soft),
        transform 0.4s var(--ease-soft);
}

/* 面板标题栏 */
.culture-intro__header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.culture-intro__icon {
    font-size: 1rem;
    line-height: 1;
}

.culture-intro__label {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.88rem;
    letter-spacing: 0.1em;
    color: rgba(160, 130, 90, 0.75);
}

/* 面板正文区域 */
.culture-intro__body {
    min-height: 40px;
    display: flex;
    align-items: flex-start;
}

.culture-intro__text {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.9rem;
    line-height: 1.75;
    color: #5a4535;
    letter-spacing: 0.04em;
    margin: 0;
}

/* 默认提示文案 */
.culture-intro__text--hint {
    color: rgba(140, 120, 90, 0.5);
    font-style: italic;
    text-align: center;
    width: 100%;
}

/* 更新时文字淡入效果 */
.culture-intro--updating .culture-intro__text {
    animation: cultureFadeIn 0.45s var(--ease-soft) forwards;
}

@keyframes cultureFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 底部装饰线 */
.culture-intro__decoration {
    width: 100%;
    max-width: 180px;
    height: 12px;
    align-self: center;
    opacity: 0.5;
}

.culture-intro__decoration svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   关卡选择界面  #level-screen
   —— 宣纸底 + 水墨风关卡卡片
   ============================================ */

/* ---- 关卡界面容器 ---- */
#level-screen {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding: 8px 12px 18px;
}

/* ---- 关卡框架（宣纸底 + 暗金边框） ---- */
.level-frame {
    width: 100%;
    max-width: 720px;
    background: linear-gradient(180deg,
        rgba(44, 32, 18, 0.72) 0%,
        rgba(52, 40, 24, 0.74) 40%,
        rgba(38, 28, 16, 0.76) 100%);
    border: 2px solid rgba(160, 120, 70, 0.35);
    border-radius: var(--radius-lg);
    padding: 28px 32px 24px;
    box-shadow:
        0 0 0 1px rgba(180, 140, 80, 0.15) inset,
        0 8px 32px rgba(16, 8, 4, 0.45);
    backdrop-filter: blur(4px);
}

/* ---- 关卡标题区 ---- */
.level-header {
    text-align: center;
    margin-bottom: 28px;
}

.level-title {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.5rem;
    letter-spacing: 0.18em;
    color: rgba(230, 195, 120, 0.88);
    margin: 0 0 6px;
    text-shadow: 0 1px 3px rgba(16, 6, 2, 0.5);
}

.level-desc {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.82rem;
    color: rgba(190, 160, 130, 0.7);
    margin: 0;
    letter-spacing: 0.06em;
}

/* ---- 关卡卡片网格 ---- */
.level-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

/* ---- 单张关卡卡片 ---- */
.level-card {
    position: relative;
    background: linear-gradient(180deg,
        rgba(252, 248, 238, 0.92) 0%,
        rgba(245, 238, 222, 0.94) 100%);
    border: 1.5px solid rgba(160, 130, 90, 0.4);
    border-radius: var(--radius-md);
    padding: 20px 16px 16px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.35s var(--ease-soft);
    box-shadow: 0 2px 10px rgba(16, 8, 4, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-card:hover {
    transform: translateY(-5px);
    border-color: rgba(200, 150, 80, 0.65);
    box-shadow:
        0 6px 22px rgba(16, 8, 4, 0.3),
        0 0 18px rgba(200, 150, 80, 0.1);
}

.level-card:active {
    transform: translateY(-2px) scale(0.97);
    transition: all 0.08s var(--ease-soft);
}

/* 关卡难度色条（卡片顶部） */
.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.level-card--easy::before {
    background: linear-gradient(90deg, #8a9b6a, #a5b880, #8a9b6a);
}

.level-card--medium::before {
    background: linear-gradient(90deg, #c8983c, #d4a840, #c8983c);
}

.level-card--hard::before {
    background: linear-gradient(90deg, #a04040, #c05050, #a04040);
}

/* 关卡序号徽章 */
.level-card__badge {
    align-self: flex-start;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, var(--color-ink-light), var(--color-ink));
    border-radius: 8px;
    padding: 2px 10px;
    margin-top: 2px;
}

/* 关卡名称 */
.level-card__name {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    color: var(--color-ink);
    margin: 0;
    text-align: center;
}

/* 关卡描述 */
.level-card__desc {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--color-ink-wash);
    margin: 0;
    text-align: center;
    flex-grow: 1;
}

/* 敌方标签区 */
.level-card__enemies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.level-card__enemy-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.7rem;
    color: rgba(74, 55, 40, 0.8);
    background: rgba(200, 180, 150, 0.3);
    border: 1px solid rgba(160, 120, 80, 0.3);
    border-radius: 12px;
    padding: 3px 10px 3px 6px;
}

/* 敌方缩略头像 */
.level-card__enemy-avatar {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(100, 70, 40, 0.4);
    flex-shrink: 0;
}

.enemy-thumb--ink {
    background: linear-gradient(135deg, #3a2a3a, #221a22);
    box-shadow: 0 0 4px rgba(120, 60, 120, 0.3) inset;
}

.enemy-thumb--paper {
    background: linear-gradient(135deg, #6a5a4a, #4a3a2a);
    box-shadow: 0 0 4px rgba(180, 140, 100, 0.3) inset;
}

.enemy-thumb--stone {
    background: linear-gradient(135deg, #5a4a3a, #3a2a1a);
    box-shadow: 0 0 4px rgba(140, 100, 60, 0.3) inset;
}

/* 关卡底部信息栏 */
.level-card__footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 6px;
    border-top: 1px dashed rgba(160, 120, 80, 0.25);
}

.level-card__diff {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.level-card__diff--easy {
    color: #7a8a5a;
}

.level-card__diff--medium {
    color: #b88830;
}

.level-card__diff--hard {
    color: #a04040;
}

/* ---- 返回按钮 ---- */
.level-back-btn {
    display: block;
    margin: 0 auto;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: rgba(190, 160, 130, 0.75);
    background: transparent;
    border: 1px solid rgba(160, 120, 70, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 36px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.25s var(--ease-soft);
}

.level-back-btn:hover {
    border-color: rgba(200, 150, 80, 0.55);
    color: rgba(220, 180, 130, 0.9);
    background: rgba(180, 130, 70, 0.08);
}

.level-back-btn:active {
    transform: scale(0.96);
    transition: all 0.08s var(--ease-soft);
}

/* ---- 移动端适配 ---- */
@media screen and (max-width: 640px) {
    .level-frame {
        padding: 20px 16px 18px;
    }

    .level-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .level-title {
        font-size: 1.25rem;
    }

    .level-card {
        padding: 16px 14px 14px;
    }
}

/* ============================================
   回合制战斗界面  #battle-screen
   —— 深棕红古风暗纹专属背景
   ============================================ */

/* ---- 战斗界面容器 ---- */
#battle-screen {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4px;
}

/* ---- 战斗外框：深棕红古风暗纹背景 ---- */
.battle-frame {
    position: relative;
    width: 100%;
    max-width: 780px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 28px 20px;

    /* 深棕红渐变底层 */
    background:
        /* 暗纹层 —— 古典回纹/雷纹图案 */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%237a3a36' stroke-width='0.8' opacity='0.15'%3E%3Cpath d='M10,10 L110,10 L110,110 L10,110 Z'/%3E%3Cpath d='M25,25 L95,25 L95,95 L25,95 Z'/%3E%3Cpath d='M40,10 L40,25 M80,10 L80,25 M40,95 L40,110 M80,95 L80,110'/%3E%3Cpath d='M10,40 L25,40 M95,40 L110,40 M10,80 L25,80 M95,80 L110,80'/%3E%3Ccircle cx='60' cy='10' r='3' fill='%2390403a' opacity='0.4'/%3E%3Ccircle cx='60' cy='110' r='3' fill='%2390403a' opacity='0.4'/%3E%3Ccircle cx='10' cy='60' r='3' fill='%2390403a' opacity='0.4'/%3E%3Ccircle cx='110' cy='60' r='3' fill='%2390403a' opacity='0.4'/%3E%3C/g%3E%3C/svg%3E") 0 0/120px 120px,
        linear-gradient(180deg,
            rgba(45, 20, 18, 0.92) 0%,
            rgba(38, 16, 14, 0.94) 25%,
            rgba(30, 12, 10, 0.96) 50%,
            rgba(35, 15, 12, 0.95) 75%,
            rgba(42, 18, 15, 0.93) 100%);

    /* 暗铜色细边框 */
    border: 2px solid rgba(140, 80, 60, 0.45);
    border-radius: var(--radius-xl);
    box-shadow:
        0 0 0 6px rgba(120, 50, 30, 0.15),
        0 0 40px rgba(100, 30, 15, 0.2),
        0 8px 40px rgba(10, 5, 3, 0.5),
        inset 0 1px 0 rgba(255, 200, 180, 0.04),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);

    animation: fadeInUp 0.7s var(--ease-soft) forwards;
}

/* 内角装饰线 */
.battle-frame::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: calc(var(--radius-xl) - 4px);
    border: 1px solid rgba(160, 100, 70, 0.1);
    pointer-events: none;
}

/* ============================================
   回合提示栏
   ============================================ */
.battle-turn-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 10px 24px;
    background: linear-gradient(180deg,
        rgba(100, 40, 30, 0.5) 0%,
        rgba(80, 30, 20, 0.55) 50%,
        rgba(60, 20, 12, 0.5) 100%);
    border: 1.5px solid rgba(180, 100, 60, 0.3);
    border-radius: var(--radius-lg);
    box-shadow:
        0 2px 10px rgba(20, 8, 4, 0.3),
        inset 0 1px 0 rgba(255, 180, 140, 0.05);
}

/* 回合信息居中区 */
.battle-turn__center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

/* ---- 撤退按钮 ---- */
.battle-retreat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px 18px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: rgba(200, 160, 140, 0.6);
    background: rgba(80, 30, 15, 0.45);
    border: 1px solid rgba(160, 80, 60, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.25s var(--ease-soft);
}

.battle-retreat-btn:hover {
    color: rgba(230, 180, 150, 0.85);
    background: rgba(120, 40, 20, 0.55);
    border-color: rgba(200, 90, 60, 0.5);
    box-shadow: 0 0 12px rgba(180, 60, 30, 0.15);
}

.battle-retreat-btn:active {
    transform: scale(0.94);
    transition: all 0.08s var(--ease-soft);
}

.battle-turn__icon {
    font-size: 1.1rem;
    margin-right: 2px;
}

.battle-turn__text {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.9rem;
    color: rgba(220, 180, 150, 0.7);
    letter-spacing: 0.06em;
}

.battle-turn__num {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.6rem;
    color: #f0c070;
    text-shadow:
        0 0 12px rgba(240, 180, 80, 0.4),
        0 1px 0 rgba(0, 0, 0, 0.3);
    line-height: 1;
    min-width: 1.2em;
    text-align: center;
}

.battle-turn__phase {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.85rem;
    color: rgba(240, 180, 120, 0.6);
    letter-spacing: 0.08em;
    margin-left: 6px;
}

/* ============================================
   战斗分区标签
   ============================================ */
.battle-zone__label {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-align: center;
    margin-bottom: 4px;
}

.battle-zone__label--enemy {
    color: rgba(200, 140, 130, 0.55);
}

.battle-zone__label--ally {
    color: rgba(200, 170, 120, 0.6);
}

/* ============================================
   战斗单位行（敌方/己方）
   ============================================ */
.battle-enemy-zone,
.battle-ally-zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.battle-units-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
}

/* ============================================
   单个战斗单位  .battle-unit
   ============================================ */
.battle-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 14px;

    /* 半透深色底 */
    background: rgba(30, 15, 10, 0.45);
    border: 1px solid rgba(140, 100, 70, 0.15);
    border-radius: var(--radius-lg);
    transition: transform 0.3s var(--ease-bounce),
                background 0.3s var(--ease-soft),
                box-shadow 0.3s var(--ease-soft);
    cursor: pointer;
    user-select: none;
}

.battle-unit:hover {
    background: rgba(45, 20, 14, 0.6);
    transform: translateY(-3px);
}

.battle-unit--ally:hover {
    box-shadow: 0 0 18px rgba(200, 150, 50, 0.12);
}

.battle-unit--enemy:hover {
    box-shadow: 0 0 18px rgba(190, 55, 45, 0.12);
}

/* ============================================
   战斗单位 —— Q版圆形头像
   ============================================ */
.battle-unit__avatar {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    padding: 9px;                         /* 留白，图片不贴边适配圆形框 */
    box-sizing: border-box;               /* padding 包含在尺寸内 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s var(--ease-bounce),
                border-color 0.35s var(--ease-soft),
                box-shadow 0.35s var(--ease-soft);
}

/* ---- 己方：红色圆形外边框 ---- */
.battle-unit__avatar--ally {
    background: linear-gradient(180deg,
        rgba(245, 236, 215, 0.2) 0%,
        rgba(220, 200, 170, 0.15) 100%);
    border: 3.5px solid rgba(200, 80, 50, 0.55);
    box-shadow:
        0 0 0 6px rgba(200, 80, 50, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

.battle-unit--ally:hover .battle-unit__avatar--ally {
    border-color: rgba(220, 90, 55, 0.75);
    box-shadow:
        0 0 0 8px rgba(200, 80, 50, 0.18),
        0 6px 22px rgba(0, 0, 0, 0.4),
        0 0 24px rgba(200, 80, 50, 0.1);
}

/* ---- 敌方：暗红色装饰边框（圆形留白一致） ---- */
.battle-unit__avatar--enemy {
    background: linear-gradient(180deg,
        rgba(60, 30, 28, 0.35) 0%,
        rgba(45, 20, 18, 0.28) 100%);
    border: 3.5px solid rgba(190, 55, 45, 0.55);
    box-shadow:
        0 0 0 6px rgba(190, 55, 45, 0.14),
        0 4px 16px rgba(0, 0, 0, 0.35);
}

.battle-unit--enemy:hover .battle-unit__avatar--enemy {
    border-color: rgba(210, 70, 55, 0.75);
    box-shadow:
        0 0 0 8px rgba(190, 55, 45, 0.2),
        0 6px 22px rgba(0, 0, 0, 0.42),
        0 0 26px rgba(200, 55, 40, 0.12);
}

/* 头像内层 */
.battle-unit__avatar-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* 立绘图片渲染（等比例居中、禁止拉伸） */
.battle-unit__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
    transition: transform 0.4s var(--ease-bounce);
}

.battle-unit:hover .battle-unit__img {
    transform: scale(1.1);
}

/* 占位符号 */
.battle-unit__placeholder {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.4rem;
    color: rgba(200, 170, 140, 0.35);
    letter-spacing: 0.1em;
    transition: color 0.3s var(--ease-soft);
}

.battle-unit:hover .battle-unit__placeholder {
    color: rgba(220, 190, 155, 0.5);
}

/* ============================================
   战斗单位 —— 信息区域
   ============================================ */
.battle-unit__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 110px;
}

/* ---- 名称 ---- */
.battle-unit__name {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.battle-unit__name--ally {
    color: rgba(235, 200, 150, 0.85);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.battle-unit__name--enemy {
    color: rgba(210, 170, 160, 0.75);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

/* ============================================
   血量条 —— 大圆角 Q版样式
   ============================================ */
.battle-unit__hp-bar {
    width: 100%;
    height: 12px;                        /* 加粗血量条，Q版比例 */
    border-radius: 999px;                /* 全圆角胶囊 */
    overflow: hidden;
    position: relative;
}

.battle-unit__hp-bar--ally {
    background: rgba(60, 20, 15, 0.45);
    border: 1px solid rgba(180, 100, 70, 0.25);
}

.battle-unit__hp-bar--enemy {
    background: rgba(50, 30, 25, 0.4);
    border: 1px solid rgba(140, 90, 70, 0.2);
}

/* 血量填充 */
.battle-unit__hp-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s var(--ease-soft);
}

.battle-unit__hp-fill--ally {
    background: linear-gradient(90deg,
        #c0392b 0%,
        #e74c3c 30%,
        #f06050 60%,
        #e74c3c 100%);
    box-shadow: inset 0 1px 0 rgba(255, 180, 160, 0.25);
}

.battle-unit__hp-fill--enemy {
    background: linear-gradient(90deg,
        #7b3a3a 0%,
        #a04040 30%,
        #c05050 60%,
        #a04040 100%);
    box-shadow: inset 0 1px 0 rgba(255, 160, 140, 0.15);
}

/* 血量文字 */
.battle-unit__hp-text {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: rgba(200, 170, 150, 0.55);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* ============================================
   状态徽章（Buff / Debuff）—— Q版小圆角
   ============================================ */
.battle-unit__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 22px;
    padding: 0 2px;
}

/* 单个状态徽章 */
.battle-unit__badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    line-height: 1.4;
    border-radius: var(--radius-xs);
    white-space: nowrap;
    cursor: default;
    user-select: none;
    animation: badgePopIn 0.35s var(--ease-bounce) forwards;
}

/* 增益徽章：暖金琥珀调 */
.battle-unit__badge--buff {
    color: rgba(60, 35, 10, 0.9);
    background: linear-gradient(135deg,
        rgba(240, 200, 100, 0.7) 0%,
        rgba(220, 170, 60, 0.65) 100%);
    border: 1px solid rgba(210, 160, 50, 0.5);
    box-shadow:
        0 1px 4px rgba(200, 150, 40, 0.2),
        inset 0 1px 0 rgba(255, 240, 180, 0.3);
}

/* 减益徽章：朱砂暗红调 */
.battle-unit__badge--debuff {
    color: rgba(255, 220, 210, 0.9);
    background: linear-gradient(135deg,
        rgba(180, 40, 30, 0.72) 0%,
        rgba(130, 25, 18, 0.68) 100%);
    border: 1px solid rgba(220, 80, 60, 0.45);
    box-shadow:
        0 1px 4px rgba(160, 30, 15, 0.25),
        inset 0 1px 0 rgba(255, 180, 150, 0.1);
}

/* 徽章持续时间小字 */
.battle-unit__badge-dur {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.6rem;
    opacity: 0.75;
}

/* 徽章弹出动画 */
@keyframes badgePopIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(4px);
    }
    60% {
        transform: scale(1.12) translateY(-1px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   技能面板 —— 大圆角 Q版样式
   ============================================ */
.battle-skill-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px 14px;

    /* 深棕半透明底 */
    background: linear-gradient(180deg,
        rgba(60, 28, 20, 0.55) 0%,
        rgba(45, 20, 14, 0.6) 100%);
    border: 1.5px solid rgba(160, 100, 60, 0.25);
    border-radius: var(--radius-lg);

    box-shadow:
        0 2px 10px rgba(15, 6, 3, 0.25),
        inset 0 1px 0 rgba(255, 180, 140, 0.03);
}

/* 技能面板标题 */
.battle-skill__header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.battle-skill__icon {
    font-size: 1rem;
    line-height: 1;
}

.battle-skill__title {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: rgba(210, 170, 130, 0.65);
}

/* 技能卡片行 */
.battle-skill__cards {
    display: flex;
    gap: 12px;
    width: 100%;
}

/* 单张技能卡片 */
.battle-skill-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 10px 10px;

    font-family: inherit;
    color: rgba(210, 180, 150, 0.7);

    /* 暖棕底 */
    background: linear-gradient(180deg,
        rgba(80, 40, 25, 0.5) 0%,
        rgba(60, 28, 16, 0.55) 100%);
    border: 1.5px solid rgba(160, 110, 70, 0.25);
    border-radius: var(--radius-md);     /* 大圆角 */

    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s var(--ease-soft);
}

.battle-skill-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg,
        rgba(100, 50, 30, 0.55) 0%,
        rgba(80, 35, 20, 0.6) 100%);
    border-color: rgba(200, 140, 80, 0.5);
    box-shadow:
        0 4px 14px rgba(20, 8, 4, 0.3),
        0 0 16px rgba(200, 130, 60, 0.1);
    color: rgba(240, 200, 160, 0.85);
}

.battle-skill-card:active {
    transform: translateY(0) scale(0.97);
    transition: all 0.08s var(--ease-soft);
}

/* 选中状态：加深底色 + 深红色边框高亮 */
.battle-skill-card--selected {
    background: linear-gradient(180deg,
        rgba(135, 55, 25, 0.72) 0%,
        rgba(105, 35, 15, 0.75) 100%) !important;
    border-color: rgba(210, 55, 55, 0.75) !important;
    box-shadow:
        0 0 0 2px rgba(200, 50, 50, 0.25),
        0 3px 12px rgba(20, 6, 2, 0.4),
        0 0 20px rgba(180, 40, 40, 0.15) !important;
    color: rgba(248, 220, 175, 0.93) !important;
    transform: translateY(-1px);
}

/* 冷却状态：置灰锁定（仅此状态才触发视觉禁用） */
.battle-skill-card--cooldown {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* 技能名称 */
.battle-skill-card__name {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    color: inherit;
}

/* 技能描述 */
.battle-skill-card__desc {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: inherit;
    opacity: 0.65;
    text-align: center;
}

/* ============================================
   操作栏 —— 确认按钮
   ============================================ */
.battle-action-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

.battle-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 52px;
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1.15rem;
    letter-spacing: 0.14em;
    color: #4a2018;

    /* 铜金色渐变 */
    background: linear-gradient(180deg,
        #e8c870 0%,
        #d4a430 45%,
        #b88a20 100%);
    border: 1.5px solid rgba(240, 200, 130, 0.45);
    border-radius: var(--radius-md);

    box-shadow:
        0 4px 18px rgba(160, 100, 20, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.35s var(--ease-soft);
}

.battle-action-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.03);
    color: #3a1810;
    background: linear-gradient(180deg,
        #f0d880 0%,
        #deb840 45%,
        #c89828 100%);
    border-color: rgba(250, 220, 150, 0.6);
    box-shadow:
        0 6px 28px rgba(200, 140, 30, 0.5),
        0 0 50px rgba(200, 140, 30, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.battle-action-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
    transition: all 0.08s var(--ease-soft);
}

.battle-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(20%);
}

/* ============================================
   滚动条美化（Q版圆润风格）
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(200, 180, 150, 0.15);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background: rgba(180, 150, 110, 0.4);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 130, 90, 0.55);
    background-clip: padding-box;
}

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 768px) {
    :root {
        --radius-xl: 18px;
        --radius-lg: 14px;
        --radius-md: 10px;
        --radius-sm: 8px;
    }

    #game-container {
        padding: 12px;
        gap: 14px;
    }

    .stage-inner {
        min-height: 300px;
        padding: 16px;
    }

    .q-title {
        font-size: 1.3rem;
    }

    /* 开始界面响应式 */
    .start-frame {
        padding: 24px 16px 20px;
        gap: 8px;
    }

    .start-title__main {
        font-size: 2rem;
    }

    .start-title__sub {
        font-size: 0.8rem;
    }

    .start-desc {
        font-size: 0.82rem;
        max-width: 260px;
    }

    .start-btn {
        padding: 14px 40px;
        font-size: 1.1rem;
    }

    .inheritor-avatar {
        width: 88px;
        height: 88px;
    }

    .inheritors-grid {
        gap: 20px 22px;
    }

    /* 角色选择界面响应式 */
    .select-frame {
        padding: 20px 12px 18px;
        gap: 14px;
    }

    .select-title {
        font-size: 1.3rem;
    }

    .select-desc {
        font-size: 0.78rem;
    }

    .select-cards {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .char-card {
        flex-direction: row;
        gap: 14px;
        padding: 16px 14px;
        align-items: flex-start;
    }

    .char-portrait {
        width: 82px;
        height: 82px;
    }

    .char-body {
        align-items: flex-start;
        gap: 6px;
    }

    .char-attributes {
        max-width: 140px;
    }

    /* 文化介绍面板移动端 */
    .culture-intro {
        padding: 12px 14px 10px;
        gap: 8px;
    }

    .culture-intro__text {
        font-size: 0.82rem;
        line-height: 1.65;
    }

    .select-footer {
        flex-direction: column;
        gap: 10px;
    }

    .select-back-btn {
        align-self: center;
    }

    .select-confirm-btn {
        padding: 12px 32px;
        font-size: 1rem;
    }

    /* 战斗界面移动端 */
    .battle-frame {
        padding: 16px 12px 14px;
        gap: 10px;
    }

    .battle-turn-indicator {
        padding: 8px 12px;
        gap: 4px;
    }

    .battle-retreat-btn {
        padding: 5px 12px;
        font-size: 0.7rem;
    }

    .battle-turn__num {
        font-size: 1.3rem;
    }

    .battle-units-row {
        gap: 10px;
    }

    .battle-unit {
        padding: 10px 10px 12px;
        gap: 6px;
    }

    .battle-unit__avatar {
        width: 80px;
        height: 80px;
    }

    .battle-unit__avatar--ally {
        border-width: 3px;
    }

    .battle-unit__avatar--enemy {
        border-width: 3px;
    }

    .battle-unit__hp-bar {
        height: 10px;
    }

    .battle-unit__name {
        font-size: 0.72rem;
    }

    .battle-unit__hp-text {
        font-size: 0.65rem;
    }

    .battle-unit__badges {
        min-height: 18px;
        gap: 3px;
    }

    .battle-unit__badge {
        padding: 1px 7px;
        font-size: 0.58rem;
    }

    .battle-unit__badge-dur {
        font-size: 0.54rem;
    }

    .battle-skill-panel {
        padding: 12px 12px 10px;
    }

    .battle-skill__cards {
        flex-direction: column;
        gap: 8px;
    }

    .battle-skill-card {
        padding: 10px 12px;
    }

    .battle-action-btn {
        padding: 12px 36px;
        font-size: 1rem;
    }
}

/* ============================================
   战斗结果弹窗  .battle-result-overlay
   —— 宣纸水墨风遮罩 + 古典模态框
   ============================================ */

/* 遮罩层：全屏覆盖，半透深棕底 */
.battle-result-overlay {
    display: none;                          /* 默认隐藏 */
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(18, 10, 6, 0.72);      /* 深棕半透遮罩 */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: overlayFadeIn 0.35s var(--ease-soft) forwards;
}

/* 遮罩淡入 */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- 模态框主体：宣纸底 + 暗金边框 ---- */
.battle-result-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 36px 32px 28px;

    /* 宣纸暖棕渐变底 */
    background: linear-gradient(180deg,
        rgba(252, 248, 238, 0.94) 0%,
        rgba(248, 240, 228, 0.92) 40%,
        rgba(240, 228, 210, 0.9) 100%);

    /* 暗金外框 + 内发光 */
    border: 2px solid rgba(184, 148, 62, 0.5);
    border-radius: var(--radius-xl);
    box-shadow:
        0 0 0 8px rgba(184, 148, 62, 0.1),
        0 8px 48px rgba(10, 5, 2, 0.55),
        0 0 60px rgba(184, 148, 62, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);

    /* 弹入动画 */
    animation: modalPopIn 0.45s var(--ease-bounce) forwards;
}

/* 模态框弹入 */
@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    60% {
        transform: translateY(-4px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 框内角装饰 */
.battle-result-modal::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: calc(var(--radius-xl) - 4px);
    border: 1px solid rgba(184, 148, 62, 0.15);
    pointer-events: none;
}

/* ---- 胜利/失败标题 ---- */
.battle-result__title {
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    color: var(--color-ink);
    text-shadow: 1px 1px 0 rgba(245, 236, 215, 0.4);
    margin: 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* ---- 描述文字 ---- */
.battle-result__desc {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-ink-wash);
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* ---- 按钮操作区 ---- */
.battle-result__actions {
    display: flex;
    gap: 14px;
    width: 100%;
    position: relative;
    z-index: 1;
    margin-top: 4px;
}

/* ---- 结果弹窗按钮通用 ---- */
.battle-result-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 20px;
    font-family: 'ZCOOL KuaiLe', 'STKaiti', 'KaiTi', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s var(--ease-soft);
    white-space: nowrap;
}

/* "下一关" 按钮：铜金色渐变 */
.battle-result-btn--next {
    color: #4a2018;
    background: linear-gradient(180deg,
        #f0d878 0%,
        #d4a830 45%,
        #b88820 100%);
    border: 1.5px solid rgba(240, 200, 130, 0.5);
    box-shadow:
        0 4px 16px rgba(180, 120, 30, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.battle-result-btn--next:hover {
    transform: translateY(-2px) scale(1.03);
    background: linear-gradient(180deg,
        #fae888 0%,
        #e0b840 45%,
        #c89828 100%);
    border-color: rgba(250, 220, 150, 0.65);
    box-shadow:
        0 6px 24px rgba(200, 140, 30, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.battle-result-btn--next:active {
    transform: translateY(0) scale(0.97);
    transition: all 0.08s var(--ease-soft);
}

/* 箭头图标 */
.battle-result-btn__arrow {
    font-size: 1.1rem;
    line-height: 1;
}

/* "返回关卡选择" 按钮：檀木色 */
.battle-result-btn--back {
    color: rgba(200, 175, 140, 0.9);
    background: linear-gradient(180deg,
        rgba(100, 60, 35, 0.7) 0%,
        rgba(75, 42, 22, 0.75) 100%);
    border: 1.5px solid rgba(160, 120, 70, 0.35);
    box-shadow:
        0 3px 12px rgba(20, 10, 4, 0.3),
        inset 0 1px 0 rgba(255, 220, 180, 0.06);
}

.battle-result-btn--back:hover {
    transform: translateY(-2px) scale(1.03);
    color: rgba(230, 200, 160, 0.95);
    background: linear-gradient(180deg,
        rgba(115, 70, 40, 0.75) 0%,
        rgba(88, 50, 28, 0.8) 100%);
    border-color: rgba(200, 150, 80, 0.5);
    box-shadow:
        0 5px 20px rgba(20, 10, 4, 0.4),
        inset 0 1px 0 rgba(255, 220, 180, 0.1);
}

.battle-result-btn--back:active {
    transform: translateY(0) scale(0.97);
    transition: all 0.08s var(--ease-soft);
}

/* ---- 弹窗移动端适配 ---- */
@media screen and (max-width: 640px) {
    .battle-result-modal {
        max-width: 92vw;
        padding: 28px 20px 22px;
        gap: 14px;
    }

    .battle-result__title {
        font-size: 1.5rem;
    }

    .battle-result__desc {
        font-size: 0.82rem;
    }

    .battle-result__actions {
        flex-direction: column;
        gap: 10px;
    }

    .battle-result-btn {
        padding: 12px 18px;
        font-size: 0.92rem;
    }
}

/* ============================================
   战斗特效动画 —— Q版柔和打击感
   ============================================ */

/* 攻击方发光缩放（头像）—— 金芒绽放 */
@keyframes attackGlowPulse {
    0%   { transform: scale(1); box-shadow: 0 0 0 rgba(240,200,80,0); }
    30%  { transform: scale(1.14); box-shadow: 0 0 22px rgba(240,200,80,0.55), 0 0 44px rgba(220,150,40,0.28); }
    55%  { transform: scale(1.05); box-shadow: 0 0 12px rgba(240,200,80,0.3), 0 0 24px rgba(220,150,40,0.12); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(240,200,80,0); }
}

.battle-unit__avatar--attacking {
    animation: attackGlowPulse 0.4s var(--ease-bounce);
    z-index: 2;
}

/* 受击震动（战斗单位整体） */
@keyframes hitShake {
    0%, 100% { transform: translateX(0); }
    12%      { transform: translateX(-5px); }
    25%      { transform: translateX(5px); }
    37%      { transform: translateX(-4px); }
    50%      { transform: translateX(3px); }
    62%      { transform: translateX(-2px); }
    75%      { transform: translateX(2px); }
    87%      { transform: translateX(-1px); }
}

.battle-unit--hit {
    animation: hitShake 0.4s ease;
}

/* 受击红色闪烁（头像）—— 边框泛红 */
@keyframes hitFlashRed {
    0%   { filter: brightness(1); }
    25%  { filter: brightness(1.7) saturate(1.4) hue-rotate(-15deg); }
    55%  { filter: brightness(1.25) saturate(1.1) hue-rotate(-5deg); }
    100% { filter: brightness(1); }
}

.battle-unit__avatar--hit {
    animation: hitFlashRed 0.4s ease;
}

/* 增益柔和光环（头像）—— 金色呼吸 */
@keyframes buffAuraPulse {
    0%   { transform: scale(1); box-shadow: 0 0 0 rgba(240,210,120,0); }
    35%  { transform: scale(1.06); box-shadow: 0 0 18px rgba(240,210,120,0.5), 0 0 36px rgba(200,170,80,0.28); }
    70%  { transform: scale(1.02); box-shadow: 0 0 10px rgba(240,210,120,0.25), 0 0 20px rgba(200,170,80,0.1); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(240,210,120,0); }
}

.battle-unit__avatar--buffing {
    animation: buffAuraPulse 0.5s var(--ease-bounce);
}

/* ============================================
   动画关键帧
   ============================================ */

/* 淡入上浮 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 宣纸展开效果 */
@keyframes paperUnfold {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

/* Q版弹跳 */
@keyframes bounceIn {
    0%   { transform: scale(0.3); opacity: 0; }
    50%  { transform: scale(1.08); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

/* 轻微浮动 */
@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* 超限抖动 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(3px); }
}

/* 通用动画类 */
.anim-fade-in-up {
    animation: fadeInUp 0.6s var(--ease-soft) forwards;
}

.anim-bounce-in {
    animation: bounceIn 0.5s var(--ease-bounce) forwards;
}

.anim-float {
    animation: gentleFloat 3s ease-in-out infinite;
}

/* ============================================
   工具类
   ============================================ */
.u-text-center  { text-align: center; }
.u-flex-center  { display: flex; align-items: center; justify-content: center; }
.u-flex-between { display: flex; align-items: center; justify-content: space-between; }
.u-flex-col     { display: flex; flex-direction: column; }
.u-gap-sm       { gap: 8px; }
.u-gap-md       { gap: 16px; }
.u-gap-lg       { gap: 24px; }
