:root {
    --bg-color: #1a1a1a;
    --panel-bg: rgba(44, 62, 80, 0.9);
    --paper-color: #f3e5ab;
    --gold: #d4af37;
    --red: #c0392b;
    --blue: #2980b9;
    --green: #27ae60;
    --purple: #8e44ad;
    --text-color: #ecf0f1;
    --font-main: "Kaiti", "STKaiti", "KaiTi", "Georgia", serif;
}

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-main);
    background: var(--bg-color);
    background-image: radial-gradient(circle at center, #2c3e50 0%, #000000 100%);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* PC 上默认显示 480px 手机视图（最小窗口宽度 600px） */
@media (min-width: 600px) {
    body {
        width: 480px;
        height: 100vh;
        position: fixed;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
    }
}

/* --- 动画特效层 --- */
#fx-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 50;
}

/* PC 上限制特效层范围 */
@media (min-width: 600px) {
    #fx-layer {
        width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}
.fx-text {
    position: absolute;
    font-size: 32px; font-weight: bold; white-space: nowrap;
    color: #fff; text-shadow: 0 0 5px #000, 0 0 10px var(--gold);
    opacity: 0; transform: translate(-50%, -50%);
    animation: zoomFade 1.2s ease-out forwards;
}
.fx-damage { color: var(--red); font-size: 40px; text-shadow: 2px 2px 0 #000; }
.fx-skill { color: var(--blue); font-size: 24px; background: rgba(0,0,0,0.8); padding: 4px 10px; border-radius: 4px; border: 1px solid var(--blue); }
.fx-heal { color: var(--green); font-size: 36px; text-shadow: 2px 2px 0 #000; }

@keyframes zoomFade {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* --- 顶部栏 --- */
#top-bar {
    height: 40px; display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; background: rgba(0,0,0,0.6); border-bottom: 1px solid var(--gold);
    z-index: 10; flex-shrink: 0;
}
.game-title { font-size: 18px; font-weight: bold; color: var(--gold); letter-spacing: 2px; text-shadow: 0 0 5px #000; }
.top-btns { display: flex; gap: 10px; }
.icon-btn { 
    width: 32px; height: 32px; border-radius: 50%; font-size: 16px; 
    display: flex; justify-content: center; align-items: center; 
    background: #34495e; border: 1px solid var(--gold); color: var(--gold);
    cursor: pointer; transition: all 0.2s;
}
.icon-btn:hover { transform: scale(1.1); box-shadow: 0 0 10px var(--gold); }
.icon-btn:active { transform: scale(0.95); }

/* --- 战场区域 --- */
#enemy-zone {
    flex: 0 0 auto;
    max-height: 22vh;
    min-height: 100px;
    display: flex; justify-content: space-around; align-items: center;
    padding: 12px 6px; border-bottom: 2px solid #555;
    gap: 8px;
}

.enemy-card {
    width: 32%; height: 100%;
    min-height: 130px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border: 2.5px solid #555;
    border-radius: 8px;
    display: flex; flex-direction: column; align-items: center;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6), inset 0 0 10px rgba(0,0,0,0.8);
    padding: 5px;
}
.enemy-card.active-turn { border-color: var(--gold); box-shadow: 0 0 20px var(--gold), 0 5px 20px rgba(241, 196, 15, 0.3); transform: scale(1.08); z-index: 2; }
.enemy-card.dead { opacity: 0.4; filter: grayscale(100%); border-style: dashed; }
.enemy-card.targetable { border-color: var(--red); box-shadow: 0 0 20px var(--red), 0 0 30px rgba(192, 57, 43, 0.4); animation: shake 0.4s infinite; }
.enemy-card.selected-chain { border-color: var(--purple); box-shadow: 0 0 20px var(--purple); }
.enemy-card.skill-target-available { border-color: #3498db; box-shadow: 0 0 25px #3498db, 0 0 40px rgba(52, 152, 219, 0.5); animation: skillTargetPulse 0.6s infinite; cursor: pointer; }
.enemy-card.lord-border { border: 3px solid #f1c40f; box-shadow: 0 0 20px #f1c40f; }
.enemy-card:active { transform: scale(0.96); }

.avatar-frame {
    width: 100%; height: 60%;
    display: flex; justify-content: center; align-items: center;
    font-size: 64px;
    background: linear-gradient(135deg, #3a5a7a 0%, #2c4a5a 100%);
    border-bottom: 2px solid #777;
    position: relative;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
    animation: avatarGlow 3s ease-in-out infinite;
}

.enemy-avatar-img {
    width: 100%; height: 60%;
    object-fit: cover;
    object-position: center;
    border-bottom: 2px solid #777;
    position: relative;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
    animation: avatarGlow 3s ease-in-out infinite;
}

@keyframes avatarGlow {
    0%, 100% { filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5)) drop-shadow(0 0 8px rgba(212, 175, 55, 0.3)); }
    50% { filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5)) drop-shadow(0 0 20px rgba(212, 175, 55, 0.6)); }
}
.role-badge {
    position: absolute; top: 5px; right: 5px;
    font-size: 11px; padding: 3px 7px;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    border: 2px solid var(--gold);
    color: #fff; border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.status-icons {
    position: absolute; bottom: 3px; left: 3px; display: flex; gap: 3px;
}
.status-icon { font-size: 14px; background: rgba(0,0,0,0.8); padding: 2px 4px; border-radius: 3px; }

.info-block {
    width: 100%; flex: 1;
    display: flex; flex-direction: column;
    justify-content: space-around; align-items: center;
    padding: 3px;
    gap: 2px;
}
.general-name {
    font-size: 15px; font-weight: bold;
    color: var(--paper-color);
    text-shadow: 2px 2px 3px black;
    letter-spacing: 1px;
    line-height: 1.2;
}

.enemy-skill {
    font-size: 11px; color: #3498db; font-weight: bold;
    text-shadow: 1px 1px 2px black;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enemy-hand-count {
    font-size: 10px; color: #7f8c8d;
    line-height: 1.2;
}
    background: linear-gradient(135deg, var(--gold), #d4af37);
    color: #000; font-size: 11px; font-weight: bold;
    border-radius: 50%; text-align: center; line-height: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    margin-left: 5px;
}

/* --- 日志区域 --- */
#log-zone {
    flex: 1 1 auto;
    min-height: 90px;
    background: rgba(0, 0, 0, 0.4);
    overflow-y: auto; padding: 10px 12px;
    font-size: 14px; color: #bdc3c7;
    border-bottom: 2px solid #555;
    font-family: "Courier New", Courier, monospace;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}
.log-line { margin-bottom: 5px; line-height: 1.5; word-break: break-word; font-size: 13px; }
.log-turn { color: var(--gold); margin-top: 10px; border-top: 2px dashed #555; padding-top: 8px; font-weight: bold; font-size: 14px; }
.log-damage { color: var(--red); font-weight: bold; font-size: 13px; }
.log-skill { color: var(--blue); font-size: 13px; }
.log-system { color: #27ae60; font-style: italic; font-size: 13px; }
.log-heal { color: var(--green); font-weight: bold; font-size: 13px; }

/* --- 玩家区域 --- */
#player-zone {
    flex: 0 0 auto;
    min-height: 160px;
    display: flex; flex-direction: column;
    background: rgba(20, 20, 20, 0.95); padding: 6px;
    border-top: 3px solid var(--gold);
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
}

#player-status {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9), rgba(52, 73, 94, 0.9));
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 5px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    min-height: 45px;
    flex-wrap: wrap;
}
.my-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    flex: 0 0 auto;
    min-width: 0;
    flex-wrap: nowrap;
}
.my-info > span:first-child {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    flex-shrink: 0;
}
.my-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.avatar-container {
    position: relative;
    display: inline-block;
}

.lord-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 16px;
    background: radial-gradient(135deg, #f1c40f, #d68910);
    border: 2px solid #f39c12;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.6);
}

/* 敌方头像容器 - 用于放置头像和徽章 */
.enemy-avatar-container {
    width: 100%;
    height: 55%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #3a5a7a 0%, #2c4a5a 100%);
    border-bottom: 2px solid #777;
    position: relative;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
    animation: avatarGlow 3s ease-in-out infinite;
}

/* 敌方主公徽章 */
.enemy-lord-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.7), inset 0 0 5px rgba(255, 255, 255, 0.3);
    border: 2px solid #FFD700;
}

.my-name {
    font-size: 14px; font-weight: bold;
    color: var(--gold); text-shadow: 1px 1px 2px black;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.my-name-hp {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.my-name-hp .hp-bar {
    gap: 2px;
    max-width: 100px;
}

.my-skill-info {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}
#my-skill {
    font-size: 11px; color: #3498db;
    background: rgba(52, 152, 219, 0.2);
    padding: 2px 6px; border-radius: 3px;
    border-left: 2px solid #3498db;
    white-space: normal;
    word-break: break-word;
    max-width: 150px;
    flex-shrink: 0;
}
#my-skill-desc {
    font-size: 9px;
    color: #bdc3c7;
    white-space: normal;
    word-break: break-word;
    min-width: 100px;
    flex-shrink: 0;
    text-align: left;
    line-height: 1.2;
}
.my-role {
    font-size: 10px; padding: 2px 6px;
    border-radius: 3px; font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.role-lord { background: linear-gradient(135deg, #f1c40f, #f39c12); color: #000; border: 1px solid #d68910; }
.role-loyal { background: linear-gradient(135deg, #e67e22, #d35400); color: #fff; border: 1px solid #ba4a00; }
.role-rebel { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; border: 1px solid #229954; }
.role-spy { background: linear-gradient(135deg, #9b59b6, #8e44ad); color: #fff; border: 1px solid #76448a; }

.hp-bar {
    display: flex; gap: 2px; flex-wrap: nowrap; max-width: 100px;
    flex-shrink: 0;
}
.hp-point {
    width: 12px; height: 12px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2ecc71, #27ae60);
    border: 1.5px solid #fff; box-shadow: 0 0 4px rgba(46, 204, 113, 0.8);
    flex-shrink: 0;
}
.hp-lost { background: #444; border-color: #666; box-shadow: 0 0 3px rgba(0,0,0,0.8); }

/* 手牌 */
#hand-scroll-container {
    flex: 1; overflow-x: auto; white-space: nowrap;
    padding: 12px 8px; display: flex; align-items: center;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    border-bottom: 2px solid #444;
}

.card {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center;
    width: 75px; height: 105px;
    background: linear-gradient(135deg, #f5f5dc 0%, #f3e5ab 100%);
    border-radius: 10px; margin-right: 10px; flex-shrink: 0;
    position: relative;
    box-shadow: 0 6px 15px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #333; font-weight: bold; border: 2px solid #d7ccc8;
    cursor: pointer;
}
.card.selected {
    transform: translateY(-30px) scale(1.12) rotateZ(5deg);
    border: 3px solid var(--red);
    box-shadow: 0 0 30px var(--red), 0 10px 30px rgba(192, 57, 43, 0.5);
    filter: drop-shadow(0 0 8px rgba(192, 57, 43, 0.8));
}
.card:hover { transform: scale(1.08) translateY(-5px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.card:active { transform: scale(0.95); }

.card[data-type="杀"] { color: #8b0000; background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%); border-color: #8b0000; }
.card[data-type="闪"] { color: #154360; background: linear-gradient(135deg, #e6f2ff 0%, #cce6ff 100%); border-color: #154360; }
.card[data-type="桃"] { color: #d81b60; background: linear-gradient(135deg, #ffe6f0 0%, #ffccde 100%); border-color: #d81b60; }
.card[data-type="酒"] { color: #a04000; background: linear-gradient(135deg, #ffe6cc 0%, #ffcc99 100%); border-color: #a04000; }
.card[data-type="万箭"], .card[data-type="南蛮"] { color: #6c3483; background: linear-gradient(135deg, #f0e6ff 0%, #e6ccff 100%); border-color: #6c3483; }
.card[data-type="无中"], .card[data-type="五谷"] { color: #1e8449; background: linear-gradient(135deg, #e6ffe6 0%, #ccffcc 100%); border-color: #1e8449; }
.card[data-type="顺手"], .card[data-type="拆桥"] { color: #117864; background: linear-gradient(135deg, #e6fff9 0%, #ccfff0 100%); border-color: #117864; }
.card[data-type="决斗"] { color: #000; background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%); border: 2px solid #000; }
.card[data-type="火攻"] { color: #e74c3c; background: linear-gradient(135deg, #ffe6e6 0%, #ffb3b3 100%); border-color: #e74c3c; }
.card[data-type="乐不"] { color: #2c3e50; background: linear-gradient(135deg, #e6e6e6 0%, #d9d9d9 100%); border: 2px solid #2980b9; }
.card[data-type="铁索"] { color: #555; background: linear-gradient(135deg, #e6e6e6 0%, #d0d0d0 100%); border-color: #555; }
.card[data-type="无懈"] { color: #3498db; background: linear-gradient(135deg, #e6f5ff 0%, #cce6ff 100%); border-color: #3498db; }

.card-icon { font-size: 32px; margin-bottom: 3px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2)); }
.card-text { font-family: var(--font-main); font-size: 14px; font-weight: bold; text-shadow: 0 1px 1px rgba(255,255,255,0.5); }

/* 底部按钮 */
#controls { height: 50px; display: flex; gap: 10px; padding: 6px 10px; border-top: 2px solid #444; flex-shrink: 0; }
.btn-action {
    flex: 1; font-size: 15px; font-weight: bold; border-radius: 6px; color: white;
    border: 1px solid rgba(255,255,255,0.3); cursor: pointer; transition: all 0.2s;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.btn-action:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-action:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.4); }
.btn-action:not(:disabled):active { transform: translateY(0); }
#btn-confirm { background: linear-gradient(135deg, #d35400, #e67e22); }
#btn-end { background: linear-gradient(135deg, #27ae60, #2ecc71); }
#btn-cancel { background: linear-gradient(135deg, #7f8c8d, #95a5a6); }
#btn-skill { background: linear-gradient(135deg, #8e44ad, #9b59b6); }

/* --- 弹窗 --- */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 100;
    display: none; flex-direction: column; justify-content: center; align-items: center;
}

/* 选将/选身份界面 */
.select-container { width: 98%; max-width: 100%; text-align: center; max-height: 85vh; display: flex; flex-direction: column; }
.select-title { font-size: 28px; color: var(--gold); margin-bottom: 20px; flex-shrink: 0; font-weight: bold; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.role-options { display: grid; grid-template-columns: repeat(2, 1fr); justify-items: center; gap: 30px; flex: 1; padding: 20px; align-content: center; }

.hero-options {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    overflow-y: auto;
    max-height: 80vh;
    padding: 0px; flex: 1;
}

.role-card {
    width: 120px; height: 160px; background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border: 3px solid #7f8c8d;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer; color: white; border-radius: 16px;
    transition: all 0.3s;
    box-shadow: 0 6px 15px rgba(0,0,0,0.6);
    padding: 12px;
    text-align: center;
}
.role-icon {
    font-size: 48px;
    margin-bottom: 6px;
    display: block;
}
.role-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
}
.role-desc {
    font-size: 11px;
    color: #bdc3c7;
    line-height: 1.3;
    word-break: break-word;
}
.role-card:hover {
    border-color: var(--gold); background: linear-gradient(135deg, #2c3e50 0%, #1a2a3a 100%);
    transform: scale(1.12); box-shadow: 0 0 25px var(--gold), 0 6px 20px rgba(0,0,0,0.8);
}
.role-card:active { transform: scale(0.96); }

.hero-option {
    height: 240px;
    width: 100%;
    box-sizing: border-box;
    background: #34495e; border: 2px solid #7f8c8d; border-radius: 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    cursor: pointer; transition: all 0.2s;
    padding: 8px;
    aspect-ratio: 9 / 16;
}
.hero-option:hover { transform: scale(1.08); border-color: var(--gold); box-shadow: 0 0 18px var(--gold); z-index: 10; }
.hero-option:active { transform: scale(0.96); }
.hero-avatar { font-size: 56px; margin-bottom: 3px; }
.hero-avatar-img { width: 80px; height: 80px; margin-bottom: 4px; border-radius: 4px; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,0.7); }
.hero-name { font-weight: bold; color: white; font-size: 14px; margin-top: 2px; }
.hero-skill { font-size: 11px; color: #bdc3c7; margin-top: 1px; }
.hero-skill-brief { font-size: 8px; color: #95a5a6; margin-top: 1px; line-height: 1.1; max-width: 95%; word-break: break-word; }
.hero-hp { font-size: 10px; color: #2ecc71; margin-top: 2px; font-weight: bold; }

/* 英雄选择界面血量条 */
.hero-hp-bar .hp-point {
    width: 10px;
    height: 10px;
}

/* 结算界面 */
#result-title { font-size: 28px; margin-bottom: 10px; font-family: var(--font-main); }
.win { color: var(--gold); text-shadow: 0 0 10px var(--gold); }
.lose { color: var(--red); text-shadow: 0 0 10px var(--red); }

.result-table {
    width: 90%; max-width: 400px; background: rgba(0,0,0,0.6);
    border: 1px solid var(--gold); border-radius: 5px; padding: 10px;
    margin-bottom: 20px; font-size: 12px;
}
.result-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #555; align-items: center; }
.result-row:last-child { border-bottom: none; }
.result-header { font-weight: bold; color: var(--gold); border-bottom: 2px solid var(--gold); }
.res-role { width: 12%; text-align: center; }
.res-name { width: 20%; text-align: left; padding-left: 5px; }
.res-stat { width: 20%; text-align: center; }
.res-stat-small { width: 11%; text-align: center; font-size: 11px; }

/* 再战江湖按钮 */
.btn-restart {
    padding: 12px 40px; font-size: 20px; font-weight: bold; color: #fff;
    background: linear-gradient(45deg, #c0392b, #d35400);
    border: 2px solid #f1c40f; border-radius: 30px;
    cursor: pointer; box-shadow: 0 0 20px rgba(241, 196, 15, 0.5);
    transition: all 0.3s; animation: pulse 2s infinite;
    text-shadow: 1px 1px 2px black;
}
.btn-restart:hover { transform: scale(1.1); box-shadow: 0 0 30px rgba(241, 196, 15, 0.8); background: linear-gradient(45deg, #e74c3c, #e67e22); }
@keyframes pulse { 0% { box-shadow: 0 0 10px rgba(241, 196, 15, 0.3); } 50% { box-shadow: 0 0 25px rgba(241, 196, 15, 0.7); } 100% { box-shadow: 0 0 10px rgba(241, 196, 15, 0.3); } }
@keyframes skillTargetPulse { 0% { box-shadow: 0 0 15px #3498db, 0 0 30px rgba(52, 152, 219, 0.3); } 50% { box-shadow: 0 0 25px #3498db, 0 0 50px rgba(52, 152, 219, 0.6); } 100% { box-shadow: 0 0 15px #3498db, 0 0 30px rgba(52, 152, 219, 0.3); } }

/* 欢迎页 */
.welcome-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
}

.welcome-action-btn {
    flex: 1;
    max-width: 200px;
    padding: 12px 20px;
    background: rgba(52, 152, 219, 0.15);
    border: 2px solid rgba(52, 152, 219, 0.6);
    border-radius: 10px;
    color: #3498db;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-main);
}

.welcome-action-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.welcome-action-btn:active {
    transform: scale(0.98);
}

.action-icon {
    font-size: 20px;
}

.action-text {
    font-size: 13px;
    font-weight: 600;
}

.welcome-container {
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 30px 20px;
    max-width: 420px;
    width: 85%;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.5), inset 0 0 30px rgba(212, 175, 55, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 85vh;
    overflow-y: auto;
}

.welcome-logo {
    font-size: 100px;
    margin-bottom: 5px;
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.welcome-title {
    font-size: 36px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 3px 3px 0 #000, 0 0 15px var(--gold);
    margin: 0;
    letter-spacing: 4px;
}

.welcome-subtitle {
    font-size: 14px;
    color: #e67e22;
    margin: 0;
    letter-spacing: 2px;
    font-weight: 500;
    text-shadow: 2px 2px 0 #000;
}

.welcome-intro {
    margin: 10px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.intro-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: all 0.3s;
    gap: 12px;
}

.intro-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(212, 175, 55, 0.6);
    transform: scale(1.02);
}

.intro-icon {
    font-size: 28px;
    flex-shrink: 0;
    min-width: 28px;
}

.intro-text {
    font-size: 15px;
    color: #ecf0f1;
    line-height: 1.4;
    font-weight: 500;
}

.btn-start {
    padding: 16px 70px;
    font-size: 26px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 50%, #d35400 100%);
    border: 3px solid var(--gold);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.6), 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    margin-top: 10px;
    text-shadow: 2px 2px 4px black;
    animation: btnPulse 2s infinite;
    font-family: var(--font-main);
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(241, 196, 15, 0.5), 0 5px 15px rgba(0, 0, 0, 0.5); transform: scale(1); }
    50% { box-shadow: 0 0 35px rgba(241, 196, 15, 0.8), 0 5px 15px rgba(0, 0, 0, 0.5); transform: scale(1.03); }
}

.btn-start:hover {
    transform: scale(1.08);
    box-shadow: 0 0 45px rgba(241, 196, 15, 1), 0 8px 20px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #e74c3c 0%, #d35400 50%, #e67e22 100%);
}

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

.welcome-footer {
    margin-top: 5px;
    font-size: 13px;
    color: #95a5a6;
    letter-spacing: 1px;
    font-weight: 500;
}

/* 开始战斗覆盖层 */
.start-battle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px;
}

.start-battle-title {
    font-size: 28px;
    color: var(--gold);
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
}

.start-battle-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(212, 175, 55, 0.3);
    border-top: 4px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #ecf0f1;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btn-start-battle {
    padding: 15px 50px;
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 50%, #1abc9c 100%);
    border: 3px solid var(--gold);
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.5), 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    font-family: var(--font-main);
    text-shadow: 2px 2px 4px black;
}

.btn-start-battle:hover {
    transform: scale(1.08);
    box-shadow: 0 0 35px rgba(46, 204, 113, 0.8), 0 8px 20px rgba(0, 0, 0, 0.6);
}

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

.btn-start-battle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 帮助界面优化 */
.help-content {
    background: var(--paper-color); color: #333; padding: 20px;
    border-radius: 5px; width: 90%; height: 85%; overflow-y: auto;
    font-size: 14px; line-height: 1.6;
}
.help-section { margin-bottom: 20px; border-bottom: 1px solid #ccc; padding-bottom: 10px; }
.help-item {
    display: flex; align-items: flex-start;
    margin-bottom: 10px;
    word-break: break-word;
}
.help-icon {
    width: 30px; font-size: 20px; text-align: center; margin-right: 10px; flex-shrink: 0;
    padding-top: 2px;
}
.help-text { flex: 1; word-break: break-word; }

/* 统计面板 */
.stats-panel {
    position: fixed; top: 50px; right: 10px;
    background: rgba(0,0,0,0.8); border: 1px solid var(--gold);
    border-radius: 8px; padding: 10px; z-index: 20;
    display: none; min-width: 150px;
}
.stats-panel.show { display: block; }
.stats-title { color: var(--gold); font-size: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--gold); padding-bottom: 4px; }
.stats-item { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.stats-value { color: var(--gold); font-weight: bold; }

/* 游戏菜单 */
.game-menu {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95); border: 2px solid var(--gold);
    border-radius: 10px; padding: 20px; z-index: 200;
    display: none; flex-direction: column; gap: 10px; min-width: 200px;
}
.game-menu.show { display: flex; }
.menu-btn {
    padding: 10px 20px; background: #34495e; border: 1px solid var(--gold);
    color: white; border-radius: 5px; cursor: pointer; transition: all 0.2s;
}
.menu-btn:hover { background: #2c3e50; transform: scale(1.02); }

/* 技能提示 */
.skill-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.95), rgba(39, 174, 96, 0.95));
    border: 3px solid var(--gold);
    color: #fff;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    z-index: 200;
    text-align: center;
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.6), 0 10px 30px rgba(0,0,0,0.5);
    animation: toastFadeInOut 2s ease-in-out forwards;
}

@keyframes toastFadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* 技能按钮 */
.skill-btn {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border: 2px solid var(--gold);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    animation: skillPulse 1.5s infinite;
    display: block;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.4);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    min-width: 100px;
}
.skill-btn.show {
    display: block;
}
.skill-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(142, 68, 173, 0.6);
}
.skill-btn:active:not(:disabled) {
    transform: scale(0.98);
}
.skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
@keyframes skillPulse {
    0%, 100% { box-shadow: 0 0 5px var(--purple); }
    50% { box-shadow: 0 0 20px var(--purple); }
}

/* 触摸优化 - 手机响应式布局 */
@media (hover: none) and (pointer: coarse) {
    #top-bar { height: 40px; flex-shrink: 0; }

    #enemy-zone {
        flex: 0 0 auto;
        min-height: 100px;
        max-height: 22vh;
    }

    #log-zone {
        flex: 1 1 auto;
        min-height: 80px;
        overflow-y: auto;
        font-size: 14px;
        padding: 6px 8px;
    }

    .log-line {
        margin-bottom: 4px;
        line-height: 1.4;
    }

    #player-zone {
        flex: 0 0 auto;
        min-height: 150px;
        overflow-y: auto;
    }

    .card { width: 65px; height: 90px; }
    .card-icon { font-size: 24px; }
    .card-text { font-size: 13px; }
    .enemy-card { width: 32%; min-height: 110px; }
    .avatar-frame { font-size: 32px; }
    .general-name { font-size: 11px; }
    .enemy-skill { font-size: 8px; }
    .enemy-hand-count { font-size: 8px; }
    .hp-bar { gap: 2px; max-width: 100px; flex-wrap: wrap; }
    .hp-point { width: 10px; height: 10px; border-width: 1px; }

    #player-status { min-height: 38px; padding: 4px 8px; flex-direction: row; }
    .my-info { gap: 5px; font-size: 11px; }
    .my-info > span:first-child { font-size: 20px; }
    .my-name { font-size: 11px; }
    #my-skill { font-size: 9px; max-width: 100px; padding: 1px 4px; white-space: normal; word-break: break-word; }
    #my-skill-desc { font-size: 8px; min-width: 70px; white-space: normal; word-break: break-word; }
    .my-role { font-size: 8px; padding: 2px 4px; }

    #hand-scroll-container { flex: 1 1 auto; overflow-y: auto; }
    #controls { flex-shrink: 0; height: 45px; }

    .hero-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 1px;
        max-height: 60vh;
    }

    .hero-option {
        height: 220px;
        padding: 3px;
        aspect-ratio: 9 / 16;
    }

    .hero-avatar { font-size: 44px; margin-bottom: 2px; }
    .hero-avatar-img { width: 70px; height: 70px; margin-bottom: 3px; border-radius: 3px; object-fit: cover; }
    .hero-name { font-size: 12px; word-break: break-word; line-height: 1.2; }
    .hero-skill { font-size: 9px; word-break: break-word; line-height: 1.2; }
    .hero-skill-brief { font-size: 7px; }

    .hero-hp { font-size: 9px; }
}

/* 动画 */
@keyframes shake { 0% { transform: rotate(0deg); } 25% { transform: rotate(2deg); } 75% { transform: rotate(-2deg); } 100% { transform: rotate(0deg); } }
@keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slide-in { animation: slideIn 0.3s ease-out; }
.fade-in { animation: fadeIn 0.3s ease-out; }

/* 卡牌动画 */
.card-draw { animation: cardDraw 0.5s ease-out; }
@keyframes cardDraw { 
    0% { transform: translateY(-100px) scale(0.5); opacity: 0; }
    50% { transform: translateY(-20px) scale(1.1); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* 伤害动画 */
.damage-flash { animation: damageFlash 0.3s ease-out; }
@keyframes damageFlash { 
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(2) sepia(1) hue-rotate(-50deg) saturate(5); }
}

/* 治疗动画 */
.heal-glow { animation: healGlow 0.5s ease-out; }
@keyframes healGlow {
    0%, 100% { box-shadow: 0 0 0 transparent; }
    50% { box-shadow: 0 0 30px var(--green); }
}

/* 欢迎页在小屏幕上的响应式设计 */
@media (max-width: 768px) {
    .welcome-actions {
        gap: 10px;
        margin-bottom: 15px;
    }

    .welcome-action-btn {
        max-width: 150px;
        padding: 10px 15px;
        font-size: 12px;
    }

    .action-icon {
        font-size: 18px;
    }

    .action-text {
        font-size: 12px;
    }

    .welcome-container {
        padding: 30px 25px;
        max-width: 90%;
        gap: 15px;
    }

    .welcome-logo {
        font-size: 70px;
    }

    .welcome-title {
        font-size: 36px;
    }

    .welcome-subtitle {
        font-size: 16px;
    }

    .intro-item {
        font-size: 12px;
    }

    .intro-icon {
        font-size: 16px;
    }

    .btn-start {
        padding: 12px 40px;
        font-size: 18px;
    }

    .welcome-footer {
        font-size: 12px;
    }
}

/* PC 上的手机视图模式 - 现在是默认样式 */

#top-bar { height: 40px; flex-shrink: 0; }

#enemy-zone {
    flex: 0 0 auto;
    min-height: 100px;
    max-height: 22vh;
}

#log-zone {
    flex: 1 1 auto;
    min-height: 85px;
    overflow-y: auto;
    font-size: 13px;
    padding: 8px 10px;
}

#player-zone {
    flex: 0 0 auto;
    min-height: 160px;
    overflow-y: auto;
}

/* PC 上的手机视图优化样式 - 只在 min-width: 600px 时应用 */
@media (min-width: 600px) {
    .card { width: 70px; height: 98px; }
    .card-icon { font-size: 26px; }
    .card-text { font-size: 14px; }
    .enemy-card { width: 32%; min-height: 120px; }
    .avatar-frame { font-size: 36px; }
    .general-name { font-size: 12px; }
    .enemy-skill { font-size: 9px; }
    .enemy-hand-count { font-size: 9px; }
    .hp-bar { gap: 2px; max-width: 100px; flex-wrap: wrap; }
    .hp-point { width: 10px; height: 10px; border-width: 1px; }

    #player-status { min-height: 40px; padding: 5px 8px; flex-direction: row; }
    .my-info { gap: 6px; font-size: 11px; }
    .my-info > span:first-child { font-size: 22px; }
    .my-name { font-size: 12px; }
    #my-skill { font-size: 10px; max-width: 120px; white-space: normal; word-break: break-word; }
    #my-skill-desc { font-size: 9px; min-width: 100px; white-space: normal; word-break: break-word; }
    .my-role { font-size: 9px; padding: 2px 5px; }

    #hand-scroll-container { flex: 1 1 auto; overflow-y: auto; }
    #controls { flex-shrink: 0; }

    .hero-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 1px;
        max-height: 60vh;
    }

    .hero-option {
        aspect-ratio: 9 / 16;
        height: 200px;
        padding: 2px;
    }

    .hero-avatar {
        font-size: 40px;
        margin-bottom: 2px;
    }

    .hero-name {
        font-size: 13px;
        word-break: break-word;
        line-height: 1.2;
    }

    .hero-skill {
        font-size: 10px;
        color: #a8b3ba;
        margin-top: 1px;
        word-break: break-word;
        line-height: 1.2;
    }
}

.hero-hp {
    font-size: 9px;
    margin-top: 1px;
}

#game-log {
    font-size: 15px;
}

.log-entry {
    padding: 4px 6px;
    line-height: 1.4;
}

.btn-normal,
.btn-cancel,
#btn-skill,
.btn-confirm {
    padding: 8px 16px;
    font-size: 14px;
}

.result-table {
    font-size: 11px;
    width: 98%;
    max-width: none;
}

.result-row {
    padding: 6px 0;
}

.res-name {
    width: 20%;
    text-align: left;
    padding-left: 5px;
}

.welcome-actions {
    gap: 10px;
    margin-bottom: 15px;
}

.welcome-action-btn {
    max-width: 150px;
    padding: 10px 15px;
    font-size: 12px;
}

.action-icon {
    font-size: 18px;
}

.action-text {
    font-size: 12px;
}

.welcome-container {
    padding: 30px 25px;
    max-width: 90%;
    gap: 15px;
}

.welcome-logo {
    font-size: 70px;
}

.welcome-title {
    font-size: 36px;
}

.welcome-subtitle {
    font-size: 16px;
}

.intro-item {
    font-size: 12px;
}

.intro-icon {
    font-size: 16px;
}

.btn-start {
    padding: 12px 40px;
    font-size: 18px;
}

.welcome-footer {
    font-size: 12px;
}

/* 手机屏幕响应式设计 (768px以下) */
@media (max-width: 768px) {
    /* 英雄选择优化 - 3列布局 */
    .hero-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 1px;
        max-height: 60vh;
    }

    .hero-option {
        aspect-ratio: 9 / 16;
        height: 190px;
        padding: 2px;
    }

    .hero-avatar {
        font-size: 36px;
        margin-bottom: 1px;
    }

    .hero-name {
        font-size: 12px;
        word-break: break-word;
        line-height: 1.2;
    }

    .hero-skill {
        font-size: 9px;
        color: #a8b3ba;
        margin-top: 1px;
        word-break: break-word;
        line-height: 1.2;
    }

    .hero-hp {
        font-size: 7px;
        margin-top: 1px;
    }

    /* 日志文本缩小 */
    #game-log {
        font-size: 14px;
    }

    /* 敌方卡片优化 */
    .enemy-card { width: 32%; min-height: 115px; }
    .avatar-frame { font-size: 32px; }

    .log-entry {
        padding: 3px 5px;
        line-height: 1.3;
    }

    /* 按钮优化 */
    .btn-normal, .btn-cancel, #btn-skill, .btn-confirm {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* 结算表格优化 */
    .result-table {
        font-size: 11px;
        width: 98%;
        max-width: none;
    }

    .result-row {
        padding: 6px 0;
    }

    .res-name {
        width: 25%;
        font-size: 11px;
    }

    /* 技能说明提示优化 */
    .skill-toast {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 90%;
    }
}

/* 超小屏幕 (480px以下) 欢迎页优化 */
@media (max-width: 480px) {
    .welcome-actions {
        gap: 8px;
        flex-wrap: wrap;
    }

    .welcome-action-btn {
        max-width: 100%;
        flex: 0 1 48%;
        padding: 10px 12px;
        font-size: 11px;
    }

    .action-icon {
        font-size: 16px;
    }

    .welcome-container {
        padding: 20px 15px;
    }

    .welcome-logo {
        font-size: 60px;
        margin-bottom: 0;
    }

    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 14px;
    }

    .intro-text {
        font-size: 11px;
    }

    .btn-start {
        padding: 10px 30px;
        font-size: 16px;
    }
}

/* 小屏幕优化 (480px以下) - 保持3列布局 */
@media (max-width: 480px) {
    .hero-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 1px;
        max-height: 55vh;
    }

    .hero-option {
        aspect-ratio: 9 / 16;
        height: 180px;
        padding: 1px;
    }

    .hero-avatar {
        font-size: 36px;
        margin-bottom: 2px;
    }

    .hero-name {
        font-size: 12px;
        word-break: break-word;
        line-height: 1.2;
    }

    .hero-skill {
        font-size: 9px;
        margin-top: 1px;
        word-break: break-word;
        line-height: 1.2;
    }

    .btn-normal, .btn-cancel, #btn-skill, .btn-confirm {
        padding: 6px 12px;
        font-size: 12px;
    }

    .result-table {
        font-size: 10px;
    }

    .res-name {
        width: 30%;
    }
}

/* 桌面端大屏幕优化 (宽度 > 1024px, 高度 > 768px) */
@media (min-width: 1024px) and (min-height: 768px) {
    body {
        justify-content: center;
        align-items: center;
        padding: 20px;
    }

    /* 限制游戏区域最大宽度 */
    #top-bar {
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
        border-radius: 8px 8px 0 0;
    }

    #enemy-zone {
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
    }

    #log-zone {
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
        /* 限制日志区域高度，不要占满整个屏幕 */
        flex: 0 1 auto;
        max-height: 300px;
    }

    #player-zone {
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
        min-height: 280px;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    }

    /* 游戏界面加上圆角效果 */
    #fx-layer {
        border-radius: 8px;
    }

    /* 卡牌尺寸适当增大 */
    .card {
        width: 80px;
        height: 112px;
    }

    .card-icon {
        font-size: 32px;
    }

    .card-text {
        font-size: 12px;
    }

    /* 敌方卡片适当增大 */
    .enemy-card {
        width: 32%;
        min-height: 155px;
    }

    .avatar-frame {
        font-size: 64px;
    }

    .general-name {
        font-size: 14px;
    }

    .enemy-skill {
        font-size: 11px;
    }

    /* 按钮尺寸 */
    .btn-action {
        padding: 10px 24px;
        font-size: 16px;
    }

    #btn-confirm, #btn-cancel {
        flex: 1;
        max-width: 200px;
    }

    /* 欢迎页也应用宽度限制 */
    .welcome-container {
        max-width: 600px;
    }
}