/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', sans-serif;
}

body {
    background-color: #ffecd2;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="3" fill="%23ffb6c1" opacity="0.5"/><circle cx="80" cy="20" r="3" fill="%2387cefa" opacity="0.5"/><circle cx="50" cy="50" r="3" fill="%2398fb98" opacity="0.5"/><circle cx="20" cy="80" r="3" fill="%23ffffe0" opacity="0.5"/><circle cx="80" cy="80" r="3" fill="%23d8bfd8" opacity="0.5"/></svg>');
    color: #5a3921;
    overflow-x: hidden;
}

/* 游戏容器 */
#game-container {
    width: 100%;
    max-width: 1000px;
    margin: 10px auto;
    padding: 15px;
    background-color: #fff9c4;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1), 0 0 0 6px #ffd54f, 0 0 0 8px #ff8f00;
    border-radius: 20px;
    min-height: calc(100vh - 20px);
    position: relative;
    overflow: hidden;
    contain: content;
}

#game-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: repeating-linear-gradient(45deg, #ffeb3b, #ffeb3b 10px, #ffd700 10px, #ffd700 20px);
    z-index: -1;
    border-radius: 35px;
}

/* 屏幕样式 */
.screen {
    display: block;
}

.hidden {
    display: none !important;
}

.test-panel.hidden { display: none; }

/* 标题样式 */
h1, h2, h3, h4 {
    color: #5a3921;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #ffd54f;
}

h1 {
    font-size: 36px;
    text-align: center;
    margin-bottom: 20px;
    color: #d84315;
    text-shadow: 2px 2px 0px #ffeb3b;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

h2 {
    font-size: 24px;
    border-bottom: 3px dashed #ff8f00;
    padding-bottom: 6px;
    background-color: #ffecb3;
    padding: 8px 15px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 15px;
}

h3 {
    font-size: 24px;
    margin-top: 20px;
    background-color: #fffde7;
    padding: 8px 15px;
    border-radius: 15px;
    border: 2px solid #ffd54f;
    display: inline-block;
}

h4 {
    font-size: 20px;
    color: #8d6e63;
    background-color: #f9fbe7;
    padding: 5px 10px;
    border-radius: 10px;
    border: 1px dashed #cddc39;
}

/* 按钮样式 */
button {
    background-color: #4caf50;
    color: white;
    border: 2px solid #388e3c;
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin: 6px;
    transition: all 0.3s;
    box-shadow: 0 4px 0 #388e3c, 0 4px 12px rgba(0, 0, 0, 0.1);
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #388e3c, 0 7px 15px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #388e3c, 0 2px 10px rgba(0, 0, 0, 0.1);
}

button:disabled {
    background-color: #aed581;
    border-color: #8bc34a;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 性格测试界面样式 */
.personality-test-button {
    margin: 10px;
    background-color: #9c27b0;
    border-color: #7b1fa2;
}

.personality-test-button:hover {
    background-color: #7b1fa2;
    transform: translateY(-5px);
    box-shadow: 0 10px 0 #6a1b9a, 0 10px 20px rgba(0, 0, 0, 0.2);
}

#personality-test-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #f3e5f5;
    border-radius: 24px;
    border: 4px solid #ba68c8;
    padding: 28px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    text-align: center;
}

.test-header {
    margin-bottom: 24px;
    position: relative;
    padding-right: 40px;
}

.test-header h2 {
    color: #4a148c;
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
}

.test-progress {
    margin: 20px 0;
}

#progress-bar-container {
    width: 100%;
    height: 25px;
    background-color: #e1bee7;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 3px solid #ce93d8;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #9c27b0, #e040fb);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.6);
}

#progress-text {
    font-size: 18px;
    font-weight: bold;
    color: #4a148c;
}

.test-content {
    max-width: 800px;
    margin: 0 auto;
}

.question {
    background-color: white;
    border-radius: 30px;
    padding: 40px;
    border: 4px solid #e1bee7;
    box-shadow: 0 8px 0 #ce93d8, 0 15px 20px rgba(0, 0, 0, 0.1);
}

#question-text {
    font-size: 24px;
    color: #6a1b9a;
    margin-bottom: 30px;
    line-height: 1.4;
}

.options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.test-option {
    padding: 15px 25px;
    border-radius: 25px;
    background-color: #e1bee7;
    border: 3px solid #ce93d8;
    color: #4a148c;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.test-option:hover {
    background-color: #ce93d8;
    transform: translateY(-5px);
    box-shadow: 0 8px 0 #ba68c8, 0 10px 15px rgba(0, 0, 0, 0.1);
}

.test-option:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #ba68c8;
}

/* 测试结果界面样式 */
#test-result-screen {
    background-color: #e8f5e9;
    border-radius: 40px;
    border: 5px solid #81c784;
    padding: 40px;
    margin: 20px;
    text-align: center;
}

.result-header {
    margin-bottom: 20px;
    position: relative;
    padding-right: 40px;
}

.result-header h2 {
    color: #2e7d32;
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
}

.result-header button {
    margin: 10px 5px;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.result-card {
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    border: 3px solid #a5d6a7;
    box-shadow: 0 4px 0 #66bb6a, 0 8px 16px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 100%;
}

.result-mbti {
    font-size: 36px;
    font-weight: bold;
    padding: 12px 28px;
    border-radius: 16px;
    margin-bottom: 12px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    display: inline-block;
}

#result-title {
    font-size: 22px;
    color: #2e7d32;
    margin-bottom: 8px;
}

.result-date {
    font-size: 12px;
    color: #999;
}

.result-details {
    background-color: white;
    border-radius: 20px;
    padding: 16px;
    border: 3px solid #a5d6a7;
    box-shadow: 0 4px 0 #66bb6a, 0 8px 16px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 100%;
    text-align: left;
}

.result-details h4 {
    font-size: 18px;
    color: #2e7d32;
    margin-bottom: 12px;
    text-align: center;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 6px;
    background-color: #f1f8e9;
    border-radius: 10px;
    font-size: 14px;
}

/* 测试历史界面样式 */
#test-history-screen {
    background-color: #e3f2fd;
    border-radius: 40px;
    border: 5px solid #64b5f6;
    padding: 40px;
    margin: 20px;
    text-align: center;
}

.history-header {
    margin-bottom: 16px;
    position: relative;
}

.history-header h2 {
    color: #1565c0;
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
}

.history-content {
    max-width: 800px;
    margin: 0 auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.no-history {
    font-size: 20px;
    color: #64b5f6;
    font-style: italic;
    padding: 40px;
}

.history-item {
    background-color: white;
    border-radius: 20px;
    padding: 25px;
    border: 3px solid #90caf9;
    box-shadow: 0 6px 0 #42a5f5, 0 10px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 0 #42a5f5, 0 15px 20px rgba(0, 0, 0, 0.1);
}

.history-mbti {
    font-size: 28px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 15px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.history-info {
    flex: 1;
    margin: 0 20px;
    text-align: left;
}

.history-title {
    font-size: 18px;
    font-weight: bold;
    color: #1565c0;
    margin-bottom: 5px;
}

.history-date {
    font-size: 14px;
    color: #757575;
}

.history-use-button {
    background-color: #4caf50;
    border-color: #388e3c;
    padding: 10px 20px;
    border-radius: 15px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-use-button:hover {
    background-color: #388e3c;
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #2e7d32;
}

/* 开始界面 */
#start-screen {
    text-align: center;
    padding: 60px 20px;
    background-color: #f0f4c3;
    border-radius: 40px;
    border: 5px solid #cddc39;
    margin: 20px;
}

#start-screen p {
    font-size: 24px;
    margin-bottom: 40px;
    color: #689f38;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
}

/* 角色创建界面 */
.mbti-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.mbti-type {
    background-color: #fff3e0;
    border: 4px solid #ff9800;
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 6px 0 #f57c00, 0 8px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.mbti-type::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 10px;
    background: repeating-linear-gradient(90deg, #ff9800, #ff9800 10px, #ffb74d 10px, #ffb74d 20px);
    border-radius: 10px 10px 0 0;
}

.mbti-type:hover {
    border-color: #e65100;
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 12px 0 #ef6c00, 0 15px 20px rgba(0, 0, 0, 0.2);
}

/* 角色头像样式 - 卡通风格 */
.character-image {
    width: 120px;
    height: 120px;
    margin: 15px auto 20px;
    margin-left: -10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: bold;
    border: 4px solid white;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 0 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.character-image:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
}

.character-image::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

/* 卡通头像样式 */
.cartoon-avatar {
    border: 3px solid white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.character-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
    background-color: #f0f0f0;
    overflow: hidden;
    will-change: transform;
}

/* PNG图片样式 */
.character-png-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.cartoon-avatar:hover .character-png-image {
    transform: scale(1.1);
}

/* 战斗中的角色图片样式 */
.character-battle-png-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
    will-change: transform;
}

/* MBTI类型选择时的头像预览 */
.mbti-preview-avatar {
    width: 50px;
    height: 50px;
    margin: 10px auto;
}

/* 角色详情中的大头像 */
.preview-large {
    width: 150px;
    height: 150px;
}

/* 主游戏界面中的角色显示 */
#player-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 战斗界面中的角色显示 */
.battle-character-image {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
}

.cartoon-avatar:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.4);
}

.avatar-face {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 眼睛样式 */
.avatar-eyes {
    display: flex;
    justify-content: space-between;
    width: 40px;
    margin-bottom: 10px;
}

.avatar-eyes::before,
.avatar-eyes::after {
    content: '';
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    position: relative;
}

.avatar-eyes-triangle::before,
.avatar-eyes-triangle::after {
    background-color: white;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    border-radius: 0;
    width: 15px;
    height: 15px;
}

.avatar-eyes-square::before,
.avatar-eyes-square::after {
    border-radius: 0;
    width: 10px;
    height: 10px;
}

.avatar-eyes-oval::before,
.avatar-eyes-oval::after {
    border-radius: 50%;
    width: 15px;
    height: 8px;
}

/* 嘴巴样式 */
.avatar-mouth {
    width: 30px;
    height: 10px;
    border-radius: 50%;
    background-color: white;
    position: relative;
}

.avatar-mouth-思考 {
    width: 20px;
    height: 5px;
    background-color: transparent;
    border: 2px solid white;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
}

.avatar-mouth-疑惑 {
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 50%;
}

.avatar-mouth-坚定 {
    width: 25px;
    height: 5px;
    background-color: white;
    border-radius: 2px;
}

.avatar-mouth-微笑 {
    width: 30px;
    height: 15px;
    background-color: transparent;
    border: 2px solid white;
    border-top: none;
    border-radius: 0 0 15px 15px;
}

.avatar-mouth-神秘 {
    width: 20px;
    height: 5px;
    background-color: transparent;
    border: 2px solid white;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
}

/* MBTI卡片卡通风格 */
.cartoon-card {
    border: 4px solid #ff9800;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 152, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cartoon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff9800, #ffeb3b, #4caf50, #2196f3, #9c27b0);
}

.card-hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 152, 0, 0.5);
    z-index: 10;
}

#character-details {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

.character-stats p {
    margin-bottom: 10px;
    font-size: 16px;
}

/* 卡通通知样式 */
.cartoon-notification {
    background-color: #ffeb3b;
    color: #333;
    border: 3px solid #ffc107;
    border-radius: 15px;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 235, 59, 0.5);
    animation: notification-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cartoon-notification.success {
    background-color: #4caf50;
    border-color: #45a049;
    color: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 0 20px rgba(76, 175, 80, 0.5);
}

.cartoon-notification.error {
    background-color: #f44336;
    border-color: #da190b;
    color: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 0 20px rgba(244, 67, 54, 0.5);
}

.notification-icon {
    font-size: 24px;
    margin-right: 10px;
    display: inline-block;
    animation: icon-bounce 1s infinite alternate;
}

@keyframes notification-bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-10px);
    }
}

@keyframes icon-bounce {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

/* 战斗角色 - 卡通小人样式 */
.battle-character-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: transparent;
}

.battle-character-image .character-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.player-main-avatar,
.enemy-main-avatar {
    transition: transform 0.3s ease;
}

.player-main-avatar:hover {
    transform: scale(1.05);
}

.enemy-main-avatar:hover {
    transform: scale(1.05);
}

.battle-character {
    width: 80px;
    height: 100px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

/* 角色面部 */
.character-face {
    width: 40px;
    height: 40px;
    background-color: #FFD7B5;
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

.character-eye {
    width: 6px;
    height: 6px;
    background-color: #333;
    border-radius: 50%;
    position: absolute;
    top: 12px;
}

.character-eye:first-child {
    left: 10px;
}

.character-eye:last-child {
    right: 10px;
}

.character-mouth {
    width: 15px;
    height: 5px;
    border-bottom: 3px solid #333;
    border-radius: 50%;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

/* 角色肢体 */
.character-arm {
    width: 40px;
    height: 12px;
    background-color: #42A5F5;
    position: absolute;
    top: 40px;
    border-radius: 6px;
    transform-origin: left center;
    z-index: 1;
}

.player-character .character-arm {
    background-color: #42A5F5;
    right: -10px;
    transform-origin: right center;
}

.enemy-character .character-arm {
    background-color: #EF5350;
    left: -10px;
    transform-origin: left center;
}

.character-leg {
    width: 12px;
    height: 40px;
    background-color: #42A5F5;
    position: absolute;
    bottom: 0;
    border-radius: 6px;
}

.player-character .character-leg {
    background-color: #42A5F5;
}

.enemy-character .character-leg {
    background-color: #EF5350;
}

.player-character .character-leg:first-child {
    left: 15px;
}

.player-character .character-leg:last-child {
    right: 15px;
}

.enemy-character .character-leg:first-child {
    left: 15px;
}

.enemy-character .character-leg:last-child {
    right: 15px;
}

/* 角色武器 */
.character-weapon {
    width: 30px;
    height: 10px;
    background-color: #795548;
    position: absolute;
    top: 40px;
    border-radius: 5px;
    transform: rotate(45deg);
    z-index: 0;
}

.player-character .character-weapon {
    right: -20px;
    transform: rotate(45deg);
}

.enemy-character .character-weapon {
    left: -20px;
    transform: rotate(-135deg);
}

/* 角色装饰 */
.character-accessory {
    position: absolute;
    z-index: 3;
}

.accessory-energetic {
    width: 20px;
    height: 5px;
    background-color: #FFD700;
    top: -10px;
    border-radius: 3px;
}

.accessory-calm {
    width: 50px;
    height: 5px;
    background-color: #87CEEB;
    top: -10px;
    border-radius: 3px;
}

/* 战斗动画效果 */
.attack-animation {
    animation: attack-move 0.5s ease-out;
}

@keyframes attack-move {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-20px) rotate(-10deg);
    }
    100% {
        transform: translateX(0);
    }
}

/* 玩家攻击动画 - 更生动的打斗动作 */
.player-attack-animation {
    animation: player-attack 0.8s ease-out;
}

@keyframes player-attack {
    0% {
        transform: translateX(0);
    }
    30% {
        transform: translateX(20px); /* 向前冲 */
    }
    50% {
        transform: translateX(20px) rotate(15deg); /* 旋转身体 */
    }
    70% {
        transform: translateX(20px) rotate(-5deg); /* 反向旋转 */
    }
    100% {
        transform: translateX(0); /* 回到原位 */
    }
}

.player-attack-animation .character-arm {
    animation: player-swing 0.8s ease-out;
}

@keyframes player-swing {
    0% {
        transform: rotate(-20deg);
    }
    40% {
        transform: rotate(100deg); /* 大幅度挥动武器 */
    }
    80% {
        transform: rotate(-40deg); /* 回摆 */
    }
    100% {
        transform: rotate(-20deg);
    }
}

/* 敌人受击动画 */
.enemy-hit-animation {
    animation: enemy-hit 0.5s ease-out;
}

@keyframes enemy-hit {
    0% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(-30px) rotate(-20deg); /* 向后仰 */
    }
    70% {
        transform: translateX(-10px) rotate(10deg); /* 反弹 */
    }
    100% {
        transform: translateX(0); /* 回到原位 */
    }
}

/* 敌人攻击动画 */
.enemy-attack-animation {
    animation: enemy-attack 0.8s ease-out;
}

@keyframes enemy-attack {
    0% {
        transform: translateX(0);
    }
    30% {
        transform: translateX(-20px); /* 向前冲 */
    }
    50% {
        transform: translateX(-20px) rotate(-15deg); /* 旋转身体 */
    }
    70% {
        transform: translateX(-20px) rotate(5deg); /* 反向旋转 */
    }
    100% {
        transform: translateX(0); /* 回到原位 */
    }
}

.enemy-attack-animation .character-arm {
    animation: enemy-swing 0.8s ease-out;
}

@keyframes enemy-swing {
    0% {
        transform: rotate(20deg);
    }
    40% {
        transform: rotate(-100deg); /* 大幅度挥动武器 */
    }
    80% {
        transform: rotate(40deg); /* 回摆 */
    }
    100% {
        transform: rotate(20deg);
    }
}

/* 玩家受击动画 */
.player-hit-animation {
    animation: player-hit 0.5s ease-out;
}

@keyframes player-hit {
    0% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(30px) rotate(20deg); /* 向后仰 */
    }
    70% {
        transform: translateX(10px) rotate(-10deg); /* 反弹 */
    }
    100% {
        transform: translateX(0); /* 回到原位 */
    }
}

/* 打击效果 */
.hit-effect {
    position: absolute;
    font-size: 24px;
    color: #FF6B6B;
    animation: hit-effect-pop 0.5s ease-out;
    z-index: 10;
    pointer-events: none;
}

@keyframes hit-effect-pop {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* 魔法攻击 - 远程粒子发射效果 */

/* 施法动画 */
.casting-animation {
    animation: casting-spell 1s ease-out;
}

@keyframes casting-spell {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1);
    }
}

.casting-animation .character-arm {
    animation: casting-motion 1s ease-out;
}

@keyframes casting-motion {
    0% {
        transform: rotate(-20deg);
    }
    30% {
        transform: rotate(40deg); /* 举起手臂 */
    }
    50% {
        transform: rotate(40deg); /* 保持施法姿势 */
    }
    100% {
        transform: rotate(-20deg);
    }
}

/* 魔法投射物 */
.magic-projectile {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 0 60px currentColor;
    animation: projectile-glow 0.5s ease-out infinite alternate;
    filter: blur(2px);
}

@keyframes projectile-glow {
    0% {
        box-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
        opacity: 0.8;
    }
    100% {
        box-shadow: 0 0 30px currentColor, 0 0 60px currentColor, 0 0 80px currentColor;
        opacity: 1;
    }
}

/* 魔法粒子 */
.magic-particle {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
    filter: blur(1px);
    opacity: 0.8;
}

/* 爆炸粒子 */
.explosion-particle {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    box-shadow: 0 0 15px currentColor, 0 0 25px currentColor;
    filter: blur(1px);
    opacity: 0.9;
}

/* 魔法效果光晕 */
.magic-projectile::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-color: currentColor;
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(10px);
    animation: projectile-aura 0.3s ease-out infinite alternate;
}

@keyframes projectile-aura {
    0% {
        transform: scale(1);
        opacity: 0.2;
    }
    100% {
        transform: scale(1.2);
        opacity: 0.4;
    }
}

/* 魔法轨迹效果 */
.magic-projectile-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.3;
    filter: blur(4px);
    transform: translateY(-50%);
    animation: trail-fade 0.5s ease-out;
}

@keyframes trail-fade {
    0% {
        opacity: 0.3;
        width: 0;
        left: 0;
    }
    50% {
        opacity: 0.3;
        width: 100%;
        left: 0;
    }
    100% {
        opacity: 0;
        width: 100%;
        left: 100%;
    }
}

.magic-animation {
    animation: magic-pulse 1s ease-out;
    box-shadow: 0 0 30px currentColor;
}

@keyframes magic-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 30px currentColor;
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 50px currentColor, 0 0 70px currentColor;
    }
}

/* 卡通背景动画 */
.cartoon-bg-animation {
    animation: bg-pattern-move 20s linear infinite;
    background-image: radial-gradient(circle, #ffeb3b 10px, transparent 10px),
                      radial-gradient(circle, #4caf50 10px, transparent 10px),
                      radial-gradient(circle, #2196f3 10px, transparent 10px);
    background-size: 50px 50px, 80px 80px, 60px 60px;
    background-position: 0 0, 20px 20px, 40px 40px;
    background-repeat: repeat;
    opacity: 0.05;
}

@keyframes bg-pattern-move {
    0% {
        background-position: 0 0, 20px 20px, 40px 40px;
    }
    100% {
        background-position: 100px 100px, 120px 120px, 140px 140px;
    }
}

/* 主游戏界面 */
.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #e3f2fd;
    border-radius: 25px;
    border: 3px solid #2196f3;
    gap: 10px;
    display: none;
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 800px;
    font-weight: bold;
    font-size: 16px;
}

.player-name-display {
    text-align: center;
    margin-bottom: 15px;
}

.player-name-display h2 {
    margin: 0;
    color: #333;
    font-family: 'Bubblegum Sans', cursive;
    font-size: 28px;
}

.mbti-type {
    font-family: 'Comic Neue', cursive;
    font-size: 18px;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    background-color: #f0f0f0;
    margin-left: 10px;
}

.player-stats {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
    font-size: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-weight: bold;
    color: #666;
}

.stat-value {
    color: #333;
    font-weight: bold;
}

/* 资源条样式 */
.resource-bars {
    width: 100%;
    max-width: 350px;
    margin: 0 auto 10px;
    gap: 10px;
    display: flex;
    flex-direction: column;
}

.resource-bar {
    background-color: white;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    margin-bottom: 8px;
}

.resource-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 14px;
}

.bar-container {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ddd;
}

.hp-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    transition: width 0.3s ease;
}

.magic-bar {
    height: 100%;
    background: linear-gradient(90deg, #4444ff, #6666ff);
    transition: width 0.3s ease;
}

/* MBTI专属加成信息 */
.mbti-bonus-info {
    background-color: rgba(255, 240, 200, 0.8);
    padding: 10px;
    border-radius: 10px;
    border-left: 5px solid #ffcc00;
    font-size: 14px;
    margin-bottom: 10px;
}

/* 技能区域样式 */
.skills-section {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    border: 3px solid #99ccff;
    margin-top: 15px;
}

.skills-section h3 {
    margin-top: 0;
    color: #333;
    font-family: 'Bubblegum Sans', cursive;
    font-size: 20px;
    text-align: center;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.skill-button {
    background-color: #e3f2fd;
    border: 2px solid #90caf9;
    border-radius: 15px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 60px;
    position: relative;
    box-shadow: 0 3px 0 #64b5f6;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.skill-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: #339af0;
}

.skill-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
    color: #2c3e50;
    word-wrap: break-word;
}

.skill-cost {
    font-size: 12px;
    color: #495057;
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
    .skills-container {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
    }
    
    .skill-button {
        padding: 10px;
        min-height: 70px;
    }
    
    .skill-name {
        font-size: 13px;
    }
    
    .skill-cost {
        font-size: 11px;
    }
    
    .skills-section h3 {
        font-size: 18px;
    }
    
    /* 调整游戏主界面布局为垂直堆叠 */
    .game-main {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    /* 调整角色面板宽度 */
    .character-panel {
        width: 100% !important;
    }
    
    /* 在小屏幕上调整角色内容为垂直堆叠 */
    .character-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .character-section {
        min-height: auto;
    }
}

.skill-type-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

/* 不同技能类型的颜色标识 */
.skill-type-magic {
    background-color: #9c27b0;
}

.skill-type-physical {
    background-color: #f44336;
}

.skill-type-buff {
    background-color: #4caf50;
}

.skill-type-heal {
    background-color: #00bcd4;
}

.skill-type-debuff {
    background-color: #ff9800;
}

.skill-type-defense {
    background-color: #607d8b;
}

.skill-type-mixed {
    background: linear-gradient(45deg, #f44336, #9c27b0);
}

.skill-type-random {
    background: linear-gradient(45deg, #ff5722, #e91e63);
}

/* 技能不可用状态样式 */
.skill-button.skill-unavailable {
    background-color: #f0f0f0;
    border-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.skill-button.skill-unavailable:hover {
    transform: none;
    box-shadow: none;
    border-color: #cccccc;
}

.skill-cost.cost-insufficient {
    color: #ff4757;
    font-weight: bold;
}

/* 技能按钮禁用状态 */
.skill-button:disabled {
    background-color: #f0f0f0;
    border-color: #cccccc;
    cursor: not-allowed;
}

/* 动画效果 */
.skill-button {
    transition: all 0.3s ease;
}

/* 技能使用时的脉动效果 */
@keyframes skill-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.skill-button:active:not(:disabled) {
    animation: skill-pulse 0.3s ease;
}

.player-info p {
    background-color: #bbdefb;
    padding: 10px 15px;
    border-radius: 20px;
    border: 2px solid #64b5f6;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.8);
}

.game-main {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 15px;
    margin-top: 15px;
}

/* 技能类型图标优化 */
.skill-type-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* 角色面板 */
.character-panel {
    background-color: #f3e5f5;
    border-radius: 15px;
    padding: 15px;
    border: 2px solid #ce93d8;
    box-shadow: 0 3px 0 #ab47bc, 0 5px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.character-panel::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    height: 10px;
    background: repeating-linear-gradient(90deg, #e1bee7, #e1bee7 15px, #ce93d8 15px, #ce93d8 30px);
    border-radius: 15px 15px 0 0;
}

.character-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
}

.character-display .character-image {
    width: 70px;
    height: 70px;
    margin-left: 5px;
    border: 2px solid white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 0 8px rgba(0, 0, 0, 0.2);
    font-size: 20px;
}

.character-info p {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: bold;
    color: #6a1b9a;
}

.character-content {
    display: flex;
    flex-direction: row;
    gap: 15px;
    background-color: white;
    padding: 15px;
    border-radius: 15px;
    border: 2px solid #e1bee7;
}

.character-section {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    min-height: 200px;
}

.character-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #6a1b9a;
    font-size: 16px;
    text-align: center;
}

#player-character.character-section {
    display: flex;
    flex-direction: column;
}

.stats-panel, .equipment-panel {
    margin-top: 0;
    background-color: transparent;
    padding: 0;
    border: none;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 5px 8px;
    background-color: #fff9c4;
    border-radius: 10px;
    border: 1px solid #ffeb3b;
    font-size: 13px;
    font-weight: bold;
}

/* 装备槽样式 */
.equipment-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.equip-slot {
    background-color: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.equip-slot:hover {
    border-color: #2979FF;
    background-color: #e3f2fd;
}

.equip-slot.has-item {
    border-style: solid;
    border-color: #8bc34a;
    background-color: #f1f8e9;
}

.equip-slot .slot-icon {
    font-size: 24px;
    display: block;
}

.equip-slot .slot-name {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.equip-slot .slot-item {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.equip-slot .item-name-label {
    font-size: 11px;
    color: #333;
    margin-top: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 套装效果显示 */
.set-bonus-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
}

.set-bonus-display h5 {
    margin: 0 0 4px 0;
    font-size: 13px;
}

.set-bonus-display p {
    margin: 2px 0;
    font-size: 11px;
    opacity: 0.9;
}

/* 背包按钮 */
.small-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

.small-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* 背包 Modal */
#backpack-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#backpack-modal h3 {
    text-align: center;
    margin-top: 0;
    color: #333;
}

.backpack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.backpack-header .fragments-count {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

#close-backpack-btn {
    background: #ff5252;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 30px;
}

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

.backpack-item {
    background-color: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.backpack-item:hover {
    transform: scale(1.03);
    border-color: #2979FF;
}

.backpack-item.rarity-common { border-color: #9e9e9e; background-color: #fafafa; }
.backpack-item.rarity-优秀 { border-color: #00C853; background-color: #e8f5e9; }
.backpack-item.rarity-rare { border-color: #2979FF; background-color: #e3f2fd; }
.backpack-item.rarity-epic { border-color: #aa00ff; background-color: #f3e5f5; }
.backpack-item.rarity-legendary { border-color: #ff6d00; background-color: #fff3e0; }

.backpack-item .item-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}

.backpack-item .item-name {
    font-size: 11px;
    color: #333;
    margin-bottom: 4px;
}

.backpack-item .item-level {
    font-size: 10px;
    color: #666;
}

.backpack-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    grid-column: 1 / -1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* 装备详情弹窗 */
#equipment-detail-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#equipment-detail-modal h3 {
    text-align: center;
    margin-top: 0;
}

.detail-rarity {
    text-align: center;
    font-size: 12px;
    margin-bottom: 15px;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.detail-affixes {
    margin: 15px 0;
}

.detail-affix {
    padding: 6px 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

.detail-affix.special {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.detail-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.detail-actions .equip-btn { background: #4caf50; color: white; }
.detail-actions .unequip-btn { background: #ff9800; color: white; }
.detail-actions .sell-btn { background: #ff5252; color: white; }
.detail-actions .close-btn { background: #9e9e9e; color: white; }

.detail-actions button:hover { opacity: 0.9; transform: scale(1.02); }

#equipment-list {
    min-height: 100px;
}

.equipment-item {
    background-color: #e9ecef;
    border-radius: 5px;
    padding: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    transition: all 0.3s ease;
}

/* 已装备的装备样式 */
.equipment-item.equipped {
    background-color: #dcedc8;
    border: 2px solid #8bc34a;
    box-shadow: 0 0 10px rgba(139, 195, 74, 0.3);
}

/* 已装备标记 */
.equipped-badge {
    background-color: #4caf50;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 6px;
    font-weight: bold;
    display: inline-block;
    vertical-align: middle;
}

/* 升级面板 */
#level-up-panel {
    background-color: #fff3e0;
    border: 4px solid #ff9800;
    border-radius: 25px;
    padding: 25px;
    margin-top: 25px;
    position: relative;
    box-shadow: 0 8px 0 #f57c00, 0 0 20px rgba(255, 152, 0, 0.3);
    animation: glow 2s infinite alternate;
    contain: content;
}

@keyframes glow {
    from {
        box-shadow: 0 8px 0 #f57c00, 0 0 20px rgba(255, 152, 0, 0.3);
    }
    to {
        box-shadow: 0 8px 0 #f57c00, 0 0 30px rgba(255, 152, 0, 0.6);
    }
}

#level-up-panel h4 {
    color: #e65100;
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8);
}

.attribute-points {
    margin: 20px 0;
}

.point-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 12px;
    background-color: white;
    border-radius: 15px;
    border: 3px solid #ffcc80;
    font-size: 16px;
    font-weight: bold;
}

.point-item button {
    background-color: #ff5722;
    border-color: #e64a19;
    box-shadow: 0 4px 0 #e64a19;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
}

.point-item button:hover {
    background-color: #f4511e;
    box-shadow: 0 6px 0 #e64a19;
}

/* 天赋树面板 */
.talent-panel {
    background-color: #f3e5f5;
    border-radius: 15px;
    padding: 15px;
    border: 2px solid #ab47bc;
    box-shadow: 0 3px 0 #7b1fa2, 0 5px 10px rgba(0,0,0,0.15);
    margin-top: 10px;
}

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

.talent-header h3 {
    margin: 0;
    color: #6a1b9a;
    font-size: 18px;
}

.talent-points-display {
    background: linear-gradient(135deg, #ab47bc, #7b1fa2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.talent-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.talent-tab {
    flex: 1;
    min-width: 60px;
    padding: 6px 8px;
    border: 2px solid #ce93d8;
    border-radius: 10px;
    background: white;
    color: #7b1fa2;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.talent-tab:hover {
    background: #f3e5f5;
}

.talent-tab.active {
    background: linear-gradient(135deg, #ab47bc, #7b1fa2);
    color: white;
    border-color: #7b1fa2;
}

.talent-content {
    background: white;
    border-radius: 12px;
    padding: 10px;
    min-height: 120px;
    max-height: 280px;
    overflow-y: auto;
    border: 2px solid #e1bee7;
}

.talent-category {
    margin-bottom: 8px;
}

.talent-category-name {
    font-size: 11px;
    font-weight: bold;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.talent-node {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    margin-bottom: 5px;
    border-radius: 10px;
    border: 2px solid #ddd;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.talent-node:hover:not(.locked) {
    border-color: #ab47bc;
    background: #f3e5f5;
}

.talent-node.active {
    border-color: #7b1fa2;
    background: #ede7f6;
}

.talent-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.talent-node.maxed {
    border-color: #ffd700;
    background: #fff8e1;
}

.talent-node-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 8px;
    font-weight: bold;
}

.talent-node-info {
    flex: 1;
}

.talent-node-name {
    font-weight: bold;
    color: #333;
    font-size: 13px;
}

.talent-node-desc {
    font-size: 10px;
    color: #888;
    margin-top: 1px;
}

.talent-node-level {
    font-size: 10px;
    color: #ab47bc;
    font-weight: bold;
    min-width: 30px;
    text-align: right;
}

.talent-node-requires {
    font-size: 9px;
    color: #e57373;
    margin-top: 2px;
}

.talent-footer {
    margin-top: 10px;
    text-align: right;
}

/* 行动面板 */
.action-panel {
    background-color: #e8f5e9;
    border-radius: 20px;
    padding: 15px;
    border: 3px solid #81c784;
    box-shadow: 0 5px 0 #4caf50, 0 8px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.action-panel::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    height: 10px;
    background: repeating-linear-gradient(90deg, #a5d6a7, #a5d6a7 15px, #81c784 15px, #81c784 30px);
    border-radius: 15px 15px 0 0;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.action-buttons button {
    flex: 1;
    min-width: 100px;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 25px;
    margin: 5px;
}

#battle-button {
    background-color: #ff5722;
    border-color: #e64a19;
    box-shadow: 0 5px 0 #e64a19;
}

#mission-button {
    background-color: #2196f3;
    border-color: #1976d2;
    box-shadow: 0 5px 0 #1976d2;
}

#shop-button {
    background-color: #ff9800;
    border-color: #f57c00;
    box-shadow: 0 5px 0 #f57c00;
}

#save-button {
    background-color: #9c27b0;
    border-color: #7b1fa2;
    box-shadow: 0 5px 0 #7b1fa2;
}

#social-button {
    background-color: #4caf50;
    border-color: #388e3c;
    box-shadow: 0 5px 0 #388e3c;
    display: none;
}

#action-content {
    min-height: 120px;
    padding: 15px;
    background-color: white;
    border-radius: 15px;
    border: 2px solid #c8e6c9;
    font-size: 16px;
    text-align: center;
    line-height: 1.4;
}

/* 对战界面 */
.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #ffebee;
    border-radius: 25px;
    border: 3px solid #ef5350;
}

.battle-arena {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    background-color: #f5f5f5;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><path d="M0,0 L25,0 L25,50 L0,50 Z" fill="%23f1f8e9" opacity="0.7"/><path d="M25,0 L50,0 L50,50 L25,50 Z" fill="%23e8f5e9" opacity="0.7"/></svg>');
    padding: 40px;
    border-radius: 30px;
    border: 5px solid #9e9e9e;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2) inset;
    position: relative;
    overflow: hidden;
}

.player-battle-area, .enemy-battle-area {
    text-align: center;
}

.battle-character-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.player-battle-area .battle-character-image {
    background-color: #3498db;
}

.enemy-battle-area .battle-character-image {
    background-color: #e74c3c;
}

.battle-stats {
    margin-top: 10px;
    text-align: center;
    color: #333;
    font-weight: bold;
}

/* 对话气泡样式 */
.speech-bubble {
    position: absolute;
    background-color: white;
    border: 2px solid #333;
    border-radius: 15px;
    padding: 8px 12px;
    max-width: 200px;
    font-size: 14px;
    line-height: 1.4;
    z-index: 9999; /* 提高z-index确保显示在最上层 */
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateX(-50%); /* 固定水平居中 */
}

.speech-bubble::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* 玩家对话气泡 */
.player-speech-bubble {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
}

.player-speech-bubble::after {
    border-width: 10px 10px 0 10px;
    border-color: white transparent transparent transparent;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* 敌人对话气泡 */
.enemy-speech-bubble {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
}

.enemy-speech-bubble::after {
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent white transparent;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

.speech-bubble.fade-out {
    animation: fadeOut 0.3s ease-in;
}

.battle-log {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

#battle-log-content {
    font-family: monospace;
    font-size: 14px;
}

/* 战斗界面套装效果状态条 */
.battle-set-effects {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffd700;
    padding: 8px 15px;
    margin: 8px 0;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    border: 2px solid #ffd700;
}

.battle-set-effects:empty {
    display: none;
}

.battle-set-effects .set-tag {
    display: inline-block;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #ffd700;
    border-radius: 20px;
    padding: 2px 10px;
    margin: 0 4px;
    font-size: 12px;
}

.battle-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* 任务界面 */
.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mission-list, .active-missions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.mission-item {
    background-color: #e3f2fd;
    border: 4px solid #2196f3;
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 6px 0 #1976d2, 0 0 20px rgba(33, 150, 243, 0.2);
    transition: all 0.3s ease;
}

.mission-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 0 #1976d2, 0 0 30px rgba(33, 150, 243, 0.3);
}

.mission-item h4 {
    margin-bottom: 15px;
    color: #0d47a1;
    font-size: 22px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
}

.mission-item .rewards {
    color: #ff6f00;
    font-weight: bold;
    margin: 15px 0;
    font-size: 18px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #ff9800;
    display: inline-block;
}

.mission-item .status {
    font-style: italic;
    margin-bottom: 15px;
    font-size: 16px;
}

.mission-item p {
    margin-bottom: 10px;
    color: #7f8c8d;
}

.mission-item button {
    background-color: #4caf50;
    border-color: #388e3c;
    box-shadow: 0 4px 0 #388e3c;
    font-size: 18px;
    padding: 12px 24px;
}

/* 商店界面 */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.shop-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

/* 商店 */
.shop-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

#shop-refresh-info {
    margin: 5px 0;
    font-size: 12px;
}

.shop-item {
    background-color: #fff8e1;
    border: 4px solid #ffd54f;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 6px 0 #ffca28, 0 0 20px rgba(255, 213, 79, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.shop-item::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    height: 10px;
    background: repeating-linear-gradient(90deg, #ffeb3b, #ffeb3b 20px, #ffc107 20px, #ffc107 40px);
    border-radius: 15px 15px 0 0;
}

.shop-item:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 12px 0 #ffca28, 0 0 30px rgba(255, 213, 79, 0.4);
}

.shop-item h4 {
    margin-top: 15px;
    color: #ff6f00;
    font-size: 22px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
}

.shop-item .price {
    color: #c62828;
    font-weight: bold;
    margin: 15px 0;
    font-size: 20px;
}

.shop-item .attributes {
    text-align: left;
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 15px;
    border: 2px dashed #ffcc80;
    font-size: 16px;
}

/* 消耗品样式 */
.consumables-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.consumable-btn {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #81c784;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #2e7d32;
    transition: all 0.3s;
    position: relative;
    min-width: 50px;
    text-align: center;
}

.consumable-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
}

.consumable-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.consumable-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff5722;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 11px;
    text-align: center;
}

.consumable-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #81c784, #4caf50);
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.consumable-btn:hover:not(:disabled)::before {
    opacity: 0.5;
}

/* 消耗品活跃状态提示 */
.consumable-active-indicator {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 3px solid #ffd700;
    border-radius: 16px;
    animation: consumable-pulse 1.5s infinite;
    pointer-events: none;
}

@keyframes consumable-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* 消耗品效果提示 */
.consumable-effect-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    color: white;
    padding: 15px 30px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: consumable-effect 1.5s ease-out forwards;
}

@keyframes consumable-effect {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    30% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-30px);
    }
}

/* 社交聊天界面 */
.social-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    background-color: #f3e5f5;
    border-radius: 30px;
    padding: 25px;
    border: 4px solid #9575cd;
    box-shadow: 0 8px 0 #7e57c2, 0 0 20px rgba(156, 39, 176, 0.2);
}

#chat-container h3 {
    color: #6a1b9a;
    text-align: center;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
}

#chat-messages {
    flex: 1;
    background-color: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 15px;
    overflow-y: auto;
    border: 3px solid #ce93d8;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="2" fill="%23f3e5f5" opacity="0.4"/></svg>');
}

.chat-input {
    display: flex;
    gap: 15px;
}

#message-input {
    flex: 1;
    padding: 15px;
    border: 3px solid #ba68c8;
    border-radius: 30px;
    font-size: 18px;
    background-color: white;
}

#send-chat {
    background-color: #e91e63;
    border-color: #c2185b;
    box-shadow: 0 4px 0 #c2185b;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding: 0;
}

.chat-message {
    margin-bottom: 15px;
    padding: 15px 20px;
    border-radius: 30px;
    max-width: 80%;
    position: relative;
    font-size: 16px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.player-message {
    background-color: #dcf8c6;
    color: #333;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.player-message::after {
    top: 0;
    right: -10px;
    border-width: 10px 0 10px 15px;
    border-color: transparent transparent transparent #dcf8c6;
}

.other-message {
    background-color: #e3f2fd;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.other-message::after {
    top: 0;
    left: -10px;
    border-width: 10px 15px 10px 0;
    border-color: transparent #e3f2fd transparent transparent;
}

.chat-message .sender {
    font-weight: bold;
    margin-bottom: 5px;
    color: #673ab7;
}

/* 通知 */
#notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #2ecc71;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-main {
        grid-template-columns: 1fr;
    }
    
    /* 保持战斗区域水平布局，但缩小内容 */
    .battle-arena {
        flex-direction: row;
        padding: 20px 10px;
        gap: 10px;
    }
    
    /* 缩小角色头像 */
    .battle-character-image {
        width: 80px;
        height: 80px;
        margin: 0 auto 10px;
        font-size: 18px;
    }
    
    /* 调整战斗统计信息字体大小 */
    .battle-stats {
        font-size: 14px;
        margin-top: 5px;
    }
    
    /* 确保对战区域内容居中并适应小屏幕 */
    .player-battle-area, .enemy-battle-area {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    /* 针对更小屏幕(如手机竖屏)的优化 */
    @media (max-width: 480px) {
        .battle-character-image {
            width: 60px;
            height: 60px;
            font-size: 14px;
        }
        
        .battle-stats {
            font-size: 12px;
        }
        
        .battle-stats p {
            margin: 2px 0;
        }
        
        .battle-arena {
            padding: 15px 5px;
        }
    }
    
    .player-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-buttons button {
        min-width: 100px;
    }
}

/* 真人匹配界面样式 */
#online-battle-screen {
    background-color: #e3f2fd;
    border-radius: 40px;
    border: 5px solid #1976d2;
    padding: 40px;
    margin: 20px;
    text-align: center;
    contain: content;
}

.online-header {
    margin-bottom: 40px;
}

.online-header h2 {
    color: #0d47a1;
    font-size: 36px;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.online-status {
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    border: 3px solid #64b5f6;
    margin-bottom: 30px;
    display: inline-block;
}

.online-status p {
    color: #1976d2;
    font-size: 18px;
    margin: 5px 0;
}

.online-users {
    font-weight: bold;
    color: #0d47a1;
}

.match-controls {
    margin-top: 40px;
}

#match-button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid #388e3c;
    box-shadow: 0 8px 0 #388e3c;
    margin-bottom: 20px;
}

#match-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 11px 0 #388e3c;
}

#match-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 5px 0 #388e3c;
}

#match-button:disabled {
    background-color: #cccccc;
    border-color: #999999;
    box-shadow: 0 5px 0 #999999;
    cursor: not-allowed;
}

#cancel-match-button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid #d32f2f;
    box-shadow: 0 6px 0 #d32f2f;
    margin-bottom: 20px;
}

#cancel-match-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #d32f2f;
}

#cancel-match-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 0 #d32f2f;
}

.match-status {
    background-color: #fff3e0;
    border-radius: 20px;
    padding: 25px;
    border: 3px solid #ff9800;
    margin-top: 30px;
    display: inline-block;
    min-width: 300px;
}

.match-status p {
    color: #e65100;
    font-size: 18px;
    font-weight: bold;
}

/* 真人对战界面样式 */
#player-battle-screen {
    background-color: #f0f4c3;
    border-radius: 40px;
    border: 5px solid #cddc39;
    padding: 40px;
    margin: 20px;
    contain: content;
}

.player-battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #e8f5e9;
    border-radius: 25px;
    border: 3px solid #8bc34a;
}

.player-battle-header h2 {
    color: #33691e;
    font-size: 28px;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
}

.player-battle-arena {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    background-color: #f5f5f5;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><path d="M0,0 L25,0 L25,50 L0,50 Z" fill="%23f1f8e9" opacity="0.7"/><path d="M25,0 L50,0 L50,50 L25,50 Z" fill="%23e8f5e9" opacity="0.7"/></svg>');
    padding: 40px;
    border-radius: 30px;
    border: 5px solid #9e9e9e;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2) inset;
}

.player1-battle-area, .player2-battle-area {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player1-battle-area .battle-character-image {
    background-color: #3498db;
}

.player2-battle-area .battle-character-image {
    background-color: #e74c3c;
}

.battle-opponent-info {
    background-color: white;
    border-radius: 20px;
    padding: 15px;
    border: 2px solid #64b5f6;
    margin-bottom: 15px;
}

.battle-opponent-info h4 {
    color: #1976d2;
    margin-bottom: 10px;
    font-size: 20px;
}

.battle-log {
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    border: 3px solid #ce93d8;
    height: 200px;
    overflow-y: auto;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

.battle-log-entry {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    background-color: #f8f9fa;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.battle-log-player {
    color: #2196f3;
    font-weight: bold;
}

.battle-log-opponent {
    color: #f44336;
    font-weight: bold;
}

.player-battle-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.player-skill-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 600px;
}

.player-skill-button {
    background-color: #e3f2fd;
    border: 3px solid #64b5f6;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 5px 0 #42a5f5;
}

.player-skill-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #42a5f5;
    border-color: #1976d2;
}

.player-skill-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 0 #42a5f5;
}

.player-skill-button:disabled {
    background-color: #f0f0f0;
    border-color: #cccccc;
    box-shadow: 0 3px 0 #999999;
    cursor: not-allowed;
    opacity: 0.7;
}

#forfeit-button {
    background-color: #ff5722;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid #e64a19;
    box-shadow: 0 6px 0 #e64a19;
}

#forfeit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #e64a19;
}

#forfeit-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 0 #e64a19;
}

/* 战斗结果弹窗样式 */
.battle-result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.battle-result-content {
    background-color: white;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    border: 5px solid #ffd700;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

.battle-result-content h3 {
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.battle-result-win h3 {
    color: #4caf50;
}

.battle-result-lose h3 {
    color: #f44336;
}

.battle-result-content p {
    font-size: 20px;
    margin-bottom: 15px;
    color: #666;
}

.battle-result-content button {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid #1976d2;
    box-shadow: 0 6px 0 #1976d2;
    margin-top: 20px;
}

.battle-result-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #1976d2;
}

/* 匹配动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.matching-animation {
    animation: pulse 2s infinite;
}

/* 响应式设计 - 真人匹配和对战界面 */
@media (max-width: 768px) {
    #online-battle-screen,
    #player-battle-screen {
        padding: 20px;
        margin: 10px;
    }
    
    .online-header h2,
    .player-battle-header h2 {
        font-size: 24px;
    }
    
    .player-battle-arena {
        padding: 20px 10px;
        gap: 10px;
    }
    
    .player1-battle-area, .player2-battle-area {
        min-width: 0;
    }
    
    .battle-log {
        height: 150px;
        font-size: 14px;
    }
    
    .player-skill-buttons {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    #match-button {
        padding: 15px 30px;
        font-size: 20px;
    }
    
    #cancel-match-button,
    #forfeit-button {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .battle-result-content {
        padding: 30px 20px;
    }
    
    .battle-result-content h3 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .battle-opponent-info h4 {
        font-size: 16px;
    }
    
    .match-status {
        min-width: auto;
        width: 90%;
    }
    
    .player-battle-header {
        flex-direction: column;
        gap: 15px;
    }
}

/* 生涯模式样式 */
#career-screen {
    background-color: #f0f4c3;
    border-radius: 30px;
    border: 4px solid #cddc39;
    padding: 25px;
    margin: 20px;
    min-height: calc(100vh - 100px);
    position: relative;
}

#career-screen h2 {
    color: #689f38;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
    text-align: center;
}

#career-progress-container {
    margin-bottom: 30px;
    background-color: white;
    padding: 20px;
    border-radius: 20px;
    border: 3px solid #aed581;
    box-shadow: 0 6px 0 #8bc34a, 0 10px 15px rgba(0, 0, 0, 0.1);
}

#career-progress-bar {
    width: 100%;
    height: 25px;
    background-color: #e8f5e9;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid #c8e6c9;
}

#career-progress {
    height: 100%;
    background: linear-gradient(90deg, #8bc34a, #cddc39);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 15px rgba(139, 195, 74, 0.6);
}

#progress-text {
    font-size: 16px;
    font-weight: bold;
    color: #388e3c;
    text-align: center;
}

.story-selection {
    margin-bottom: 30px;
}

.story-selection h3 {
    color: #689f38;
    margin-bottom: 20px;
    text-align: center;
}

#story-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.story-item {
    background-color: white;
    border-radius: 20px;
    padding: 25px;
    border: 3px solid #cddc39;
    box-shadow: 0 6px 0 #aed581, 0 10px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.story-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 0 #aed581, 0 15px 20px rgba(0, 0, 0, 0.1);
}

.story-item h5 {
    font-size: 20px;
    color: #689f38;
    margin-bottom: 15px;
    background-color: #f9fbe7;
    padding: 8px 15px;
    border-radius: 15px;
    border: 2px dashed #cddc39;
}

.story-mbti-tag {
    font-size: 18px;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 15px;
    color: white;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    display: inline-block;
    background-color: #9c27b0;
}

.story-item .start-story {
    background-color: #689f38;
    border-color: #388e3c;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 20px;
}

.story-item .start-story:hover {
    background-color: #388e3c;
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #2e7d32, 0 10px 15px rgba(0, 0, 0, 0.1);
}

#story-content {
    background-color: white;
    border-radius: 25px;
    padding: 30px;
    border: 3px solid #cddc39;
    box-shadow: 0 8px 0 #aed581, 0 15px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px dashed #cddc39;
}

#story-title {
    font-size: 24px;
    color: #689f38;
    background-color: #f9fbe7;
    padding: 10px 20px;
    border-radius: 15px;
    border: 2px solid #cddc39;
    display: inline-block;
}

#story-mbti {
    font-size: 20px;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 15px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    background-color: #9c27b0;
}

#story-scene {
    font-size: 18px;
    color: #555;
    background-color: #fffde7;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #fff9c4;
    margin-bottom: 25px;
    line-height: 1.6;
}

#story-character {
    font-size: 18px;
    font-weight: bold;
    color: #689f38;
    background-color: #e8f5e9;
    padding: 10px 15px;
    border-radius: 15px;
    border: 2px dashed #aed581;
    margin-bottom: 15px;
    display: inline-block;
}

#story-dialogue {
    font-size: 20px;
    color: #333;
    background-color: #f0f4c3;
    padding: 25px;
    border-radius: 20px;
    border: 3px solid #cddc39;
    margin-bottom: 25px;
    line-height: 1.6;
    font-style: italic;
}

#dialogue-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.dialogue-option {
    background-color: #4caf50;
    color: white;
    border: 3px solid #388e3c;
    padding: 15px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
    transition: all 0.3s ease;
    box-shadow: 0 6px 0 #388e3c, 0 10px 15px rgba(0, 0, 0, 0.1);
}

.dialogue-option:hover {
    background-color: #388e3c;
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #2e7d32, 0 12px 18px rgba(0, 0, 0, 0.15);
}

.story-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

#back-from-career, #end-story {
    background-color: #f44336;
    border-color: #d32f2f;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
}

#back-from-career:hover, #end-story:hover {
    background-color: #d32f2f;
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #b71c1c, 0 10px 15px rgba(0, 0, 0, 0.15);
}

/* 响应式设计 - 生涯模式 */
@media (max-width: 768px) {
    #career-screen {
        padding: 15px;
        margin: 10px;
    }
    
    #career-screen h2 {
        font-size: 24px;
    }
    
    #story-list {
        grid-template-columns: 1fr;
    }
    
    .story-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    #story-title {
        font-size: 20px;
    }
    
    #story-mbti {
        font-size: 16px;
    }
    
    #story-dialogue {
        font-size: 18px;
    }
    
    .story-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    #career-progress-container {
        padding: 15px;
    }

    .story-item {
        padding: 20px;
    }

    #story-content {
        padding: 20px;
    }

    .dialogue-option {
        font-size: 14px;
        padding: 12px 15px;
    }
}

/* 被动技能显示样式 */
.passive-skill-container {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.15));
    border: 2px solid #FFD700;
    border-radius: 12px;
    padding: 12px 15px;
    margin-top: 15px;
}

.passive-skill-title {
    color: #FFD700;
    font-size: 14px;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.passive-skill-title::before {
    content: '⭐';
    font-size: 12px;
}

.passive-skill-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.passive-skill-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

.passive-skill-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.passive-skill-desc {
    font-size: 13px;
    color: #ccc;
    margin: 6px 0;
    line-height: 1.4;
}

.passive-skill-trigger {
    font-size: 11px;
    color: #888;
    font-style: italic;
    margin: 4px 0 0 0;
}

/* 角色详情中的被动技能样式 */
#character-details .passive-skill-container {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.15), rgba(75, 0, 130, 0.2));
    border-color: #9370DB;
}

#character-details .passive-skill-title {
    color: #DDA0DD;
}

#character-details .passive-skill-icon {
    filter: drop-shadow(0 0 4px rgba(147, 112, 219, 0.6));
}

#character-details .passive-skill-name {
    color: #E6E6FA;
}

/* ==================== 每日签到系统样式 ==================== */

/* 签到按钮 */
.signin-button {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.signin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.signin-button:active {
    transform: translateY(0);
}

/* 签到弹窗 */
.signin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.signin-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #f39c12;
    border-radius: 16px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(243, 156, 18, 0.3);
}

.signin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.signin-header h2 {
    color: #f39c12;
    margin: 0;
    font-size: 24px;
}

.signin-streak {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
}

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

.signin-close {
    background: none;
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.signin-close:hover {
    color: #fff;
}

/* 日历样式 */
.signin-calendar {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.calendar-nav {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

#calendar-month {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    color: #888;
    font-size: 12px;
    padding: 5px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
    cursor: default;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    border: 2px solid #f39c12;
    font-weight: bold;
}

.calendar-day.signed {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
}

.calendar-day.signed::after {
    content: '✓';
    font-size: 10px;
    margin-left: 2px;
}

/* 奖励预览 */
.signin-rewards {
    margin-bottom: 20px;
}

.signin-rewards h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
}

.rewards-preview {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.reward-day {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reward-day:hover {
    background: rgba(255, 255, 255, 0.1);
}

.reward-day.current {
    border: 2px solid #f39c12;
}

.reward-day.claimed {
    background: rgba(39, 174, 96, 0.2);
    border: 1px solid #27ae60;
}

.reward-day .day-num {
    color: #888;
    font-size: 11px;
    margin-bottom: 4px;
}

.reward-day .day-reward {
    font-size: 18px;
    margin-bottom: 2px;
}

.reward-day .day-desc {
    color: #666;
    font-size: 10px;
}

/* 签到操作区 */
.signin-action {
    text-align: center;
}

.today-reward {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.today-reward h4 {
    color: #f39c12;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.today-reward .reward-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-size: 18px;
}

.today-reward .reward-info .reward-icon {
    font-size: 28px;
}

.signin-claim-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.signin-claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5);
}

.signin-claim-btn:disabled {
    background: #555;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.signin-claim-btn.signed {
    background: #27ae60;
}

/* 响应式 */
@media (max-width: 480px) {
    .signin-content {
        padding: 16px;
    }

    .rewards-preview {
        grid-template-columns: repeat(4, 1fr);
    }

    .signin-header h2 {
        font-size: 20px;
    }
}