/**
 * 战斗系统样式 - 全屏布局
 * combatService驱动心跳，前端只负责显示
 */

/* ==================== 战斗面板 - 全屏 ==================== */
.combat-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    background: linear-gradient(180deg, rgba(8,5,20,0.99), rgba(15,10,35,0.99));
    z-index: 8000 !important;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    overflow: hidden;
}

/* 增强版战斗面板 */
.combat-panel.enhanced {
    animation: combatFadeIn 0.3s ease-out;
}

@keyframes combatFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== 战斗顶部时间条 ==================== */
.combat-header-bar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(90deg, transparent, rgba(251,191,36,0.08), transparent);
    border-bottom: 1px solid rgba(251,191,36,0.2);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-right {
    display: flex;
    align-items: center;
}
.auto-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 1px solid rgba(102,126,234,0.5);
    border-radius: 15px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.auto-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}
.auto-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f39c12);
    border-color: #fbbf24;
    color: #000;
}
.combat-header-bar .battle-label {
    color: #fbbf24;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(251,191,36,0.5);
}
.combat-header-bar .timer {
    color: #60a5fa;
    font-size: 14px;
    font-weight: bold;
    background: rgba(96,165,250,0.15);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(96,165,250,0.3);
}

/* ==================== 敌人区域 - 上方 ==================== */
.enemy-area {
    flex-shrink: 0;
    padding: 16px 20px 12px;
    background: radial-gradient(ellipse at 50% 30%, rgba(220,38,38,0.08), transparent 70%);
    border-bottom: 1px solid rgba(239,68,68,0.2);
}
.enemy-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.enemy-avatar {
    font-size: 48px;
    filter: drop-shadow(0 0 10px rgba(248,113,113,0.5));
    margin-right: 12px;
}
.enemy-details {
    flex: 1;
}
.enemy-name-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.enemy-name-text {
    color: #f87171;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(248,113,113,0.5);
}
.enemy-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}
.enemy-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}
.enemy-lv {
    color: #9ca3af;
    font-size: 13px;
    background: rgba(156,175,195,0.15);
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 600;
}
.enemy-realm-tag {
    color: #a78bfa;
    font-size: 12px;
    font-weight: 600;
}
.hp-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.bar-label {
    color: #f87171;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
}
.hp-track {
    flex: 1;
    height: 22px;
    background: #1a0a0a;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(248,113,113,0.3);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
    border-radius: 5px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(239,68,68,0.4);
}
.spirit-track {
    height: 14px;
    background: #0a0a1a;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(96,165,250,0.3);
    margin-top: 4px;
}
.spirit-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.hp-val {
    color: #f87171;
    font-size: 13px;
    font-weight: bold;
    min-width: 80px;
    text-align: right;
}
.spirit-val {
    float: right;
    color: #60a5fa;
    font-size: 11px;
    margin-top: -12px;
}
.status-effects-container {
    margin-top: 6px;
    min-height: 20px;
    font-size: 11px;
    color: #fbbf24;
}

/* ==================== 战斗日志 - 可折叠 ==================== */
.log-area {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.log-area.collapsible {
    max-height: 150px;
    transition: max-height 0.3s ease;
}
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0,0,0,0.3);
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #888;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.toggle-icon {
    transition: transform 0.3s;
}
.log-area.collapsed .toggle-icon {
    transform: rotate(-90deg);
}
.log-scroll {
    flex: 1;
    overflow-y: auto;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.7;
    color: #d1d5db;
}
.log-scroll::-webkit-scrollbar { width: 5px; }
.log-scroll::-webkit-scrollbar-track { background: transparent; }
.log-scroll::-webkit-scrollbar-thumb { background: rgba(251,191,36,0.3); border-radius: 3px; }

/* ==================== 玩家区域 - 下方 ==================== */
.player-area {
    flex-shrink: 0;
    padding: 12px 20px 14px;
    background: radial-gradient(ellipse at 50% 70%, rgba(22,163,74,0.06), transparent 70%);
    border-top: 1px solid rgba(34,197,94,0.2);
}
.player-avatar {
    font-size: 48px;
    filter: drop-shadow(0 0 10px rgba(96,165,250,0.5));
    margin-right: 12px;
}
.player-name-text {
    color: #60a5fa;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(96,165,250,0.4);
}
.player-lv {
    color: #4ade80;
    background: rgba(74,222,128,0.15);
}
.player-realm-tag {
    color: #60a5fa;
}
.player-label {
    color: #4ade80;
}
.player-track {
    border-color: rgba(74,222,128,0.3);
}
.player-hp-val {
    color: #4ade80;
}
.player-spirit-track {
    border-color: rgba(96,165,250,0.3);
}
.player-spirit-val {
    color: #60a5fa;
}
.player-effects {
    color: #4ade80;
}
.player-hp-fill {
    background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
    box-shadow: 0 0 10px rgba(34,197,94,0.4);
}
.player-spirit-fill {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.enemy-hp-fill {
    box-shadow: 0 0 10px rgba(239,68,68,0.4);
}
.enemy-spirit-fill {
    /* 保持默认 */
}

/* ==================== 行动按钮 - 移动端优化 ==================== */
.action-grid {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
}
.action-grid.enhanced {
    gap: 10px;
    padding: 14px 18px;
}
.act-btn {
    padding: 16px 8px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
}
.act-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s;
}
.act-btn:active::before {
    opacity: 1;
}
.act-btn:active { 
    transform: scale(0.95); 
}
.act-icon {
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.act-text {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}
.key-hint {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    opacity: 0.4;
    font-weight: normal;
    background: rgba(0,0,0,0.3);
    padding: 2px 5px;
    border-radius: 4px;
}

/* 按钮颜色主题 */
.btn-attack { 
    background:linear-gradient(135deg,#dc2626,#b91c1c); 
    color:#fff; 
    border:2px solid rgba(248,113,113,0.4);
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}
.btn-attack:hover { 
    background:linear-gradient(135deg,#ef4444,#dc2626); 
    transform: translateY(-2px);
    box-shadow:0 6px 20px rgba(239,68,68,0.4); 
}
.btn-attack.primary {
    grid-column: span 1;
    background:linear-gradient(135deg,#991b1b,#7f1d1d);
    border-color: rgba(252,165,165,0.5);
}

.btn-skill { 
    background:linear-gradient(135deg,#7c3aed,#5b21b6); 
    color:#e9d5ff; 
    border:2px solid rgba(167,139,250,0.4);
    box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}
.btn-skill:hover { 
    background:linear-gradient(135deg,#8b5cf6,#7c3aed); 
    transform: translateY(-2px);
    box-shadow:0 6px 20px rgba(139,92,246,0.4); 
}

.btn-artifact { 
    background:linear-gradient(135deg,#a855f7,#7c3aed); 
    color:#f3e8ff; 
    border:2px solid rgba(192,132,252,0.4);
    box-shadow: 0 4px 12px rgba(168,85,247,0.3);
}
.btn-artifact:hover { 
    background:linear-gradient(135deg,#c084fc,#a855f7); 
    transform: translateY(-2px);
    box-shadow:0 6px 20px rgba(192,132,252,0.4); 
}

.btn-potion { 
    background:linear-gradient(135deg,#65a30d,#4d7c0f); 
    color:#ecfccb; 
    border:2px solid rgba(132,204,22,0.4);
    box-shadow: 0 4px 12px rgba(101,163,13,0.3);
}
.btn-potion:hover { 
    background:linear-gradient(135deg,#84cc16,#65a30d); 
    transform: translateY(-2px);
    box-shadow:0 6px 20px rgba(132,204,22,0.4); 
}

/* 次要操作按钮 */
.secondary-actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    padding: 0 16px 12px;
    background: rgba(0,0,0,0.2);
}
.sec-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #aaa;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.sec-icon {
    font-size: 18px;
}
.sec-key {
    font-size: 10px;
    opacity: 0.5;
    background: rgba(0,0,0,0.3);
    padding: 2px 5px;
    border-radius: 4px;
}
.sec-btn.defend:hover {
    background: rgba(56,189,248,0.15);
    border-color: rgba(56,189,248,0.3);
    color: #7dd3fc;
}
.sec-btn.flee:hover {
    background: rgba(251,146,60,0.15);
    border-color: rgba(251,146,60,0.3);
    color: #fed7aa;
}
.sec-btn:active {
    transform: scale(0.95);
}

/* ==================== 统计栏 ==================== */
.stats-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    padding: 6px 16px 8px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 11px;
    color: #9ca3af;
}
.stats-footer .s-stat span:last-child {
    font-weight: bold;
    margin-left: 3px;
}
.stats-footer .s-dmg span:last-child { color: #f87171; }
.stats-footer .s-dps span:last-child { color: #fbbf24; }
.stats-footer .s-heal span:last-child { color: #4ade80; }

/* ==================== 菜单弹层 ==================== */
#combat-item-menu {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9000 !important;
    background: rgba(0,0,0,0.92) !important;
}

/* 响应式 */
@media (max-width: 600px) {
    .action-grid { gap: 4px; padding: 6px 10px; }
    .act-btn { padding: 10px 0; font-size: 13px; }
    .enemy-name-text { font-size: 15px; }
    .player-name-text { font-size: 15px; }
}

/* ==================== 简洁版战斗界面（参考伊洛纳） ==================== */
.combat-panel.simple {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
}

/* 敌人信息区 */
.enemy-info-area {
    padding: 14px 16px;
    background: rgba(255, 68, 68, 0.08);
    border-bottom: 1px solid rgba(255, 68, 68, 0.15);
}

.enemy-header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.enemy-icon {
    font-size: 28px;
}

.enemy-name {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b6b;
}

.enemy-lv {
    font-size: 12px;
    color: #888;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 战斗状态栏 */
.combat-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-item {
    font-size: 12px;
    color: #aaa;
}

.status-item.heartbeat {
    color: #ff4444;
    animation: pulse 1s infinite;
}

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

.heart-icon {
    font-size: 14px;
}

.status-item.turn-info {
    color: #ffd700;
}

.combat-log-btn {
    cursor: pointer;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: all 0.2s;
}

.combat-log-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 快捷开关 */
.quick-switches {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.switch-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.switch-btn.active {
    background: rgba(124, 200, 80, 0.15);
    border-color: rgba(124, 200, 80, 0.4);
    color: #7ec850;
}

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

/* 行动按钮区 */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 16px;
    flex: 1;
    align-content: start;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 64px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 160, 233, 0.4);
}

.action-btn:active {
    transform: scale(0.95);
    background: rgba(0, 160, 233, 0.15);
}

.action-btn.primary {
    border-color: rgba(124, 200, 80, 0.5);
    background: rgba(124, 200, 80, 0.1);
}

.action-btn.primary:hover {
    background: rgba(124, 200, 80, 0.2);
}

.action-btn.warning {
    border-color: rgba(255, 165, 0, 0.4);
    background: rgba(255, 165, 0, 0.08);
}

.btn-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.btn-label {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.btn-cost {
    font-size: 11px;
    color: #00a0e9;
    margin-top: 2px;
}

/* 玩家状态区 */
.player-status-area {
    padding: 12px 16px;
    background: rgba(68, 200, 120, 0.08);
    border-top: 1px solid rgba(68, 200, 120, 0.15);
}

.player-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.player-avatar {
    font-size: 24px;
}

.player-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.player-lv {
    font-size: 11px;
    color: #7ec850;
    background: rgba(124, 200, 80, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 血条样式（通用） */
.hp-bar {
    position: relative;
    height: 24px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
}

.hp-bar.enemy-hp {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.3);
}

.hp-bar.player-hp {
    background: rgba(68, 200, 120, 0.2);
    border-color: rgba(68, 200, 120, 0.3);
}

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

.hp-fill.player-hp-fill {
    background: linear-gradient(90deg, #44c878, #66da96);
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* 灵力条 */
.spirit-bar {
    position: relative;
    height: 18px;
    background: rgba(0, 100, 200, 0.15);
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid rgba(0, 160, 233, 0.25);
}

.spirit-fill {
    height: 100%;
    background: linear-gradient(90deg, #0088cc, #00a0e9);
    transition: width 0.3s ease;
    border-radius: 8px;
}

.spirit-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* 战斗日志面板 */
.combat-log-panel {
    max-height: 150px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    font-size: 13px;
    font-weight: 600;
    color: #ffd700;
}

.log-close {
    background: none;
    border: none;
    color: #ffd700;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}

.log-content {
    padding: 8px 12px;
    max-height: 110px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.6;
    color: #ccc;
}

.log-entry {
    margin-bottom: 4px;
    padding: 2px 0;
}

.log-entry.player-action {
    color: #7ec850;
}

.log-entry.enemy-action {
    color: #ff6b6b;
}

.log-entry.system {
    color: #ffd700;
}

/* ==================== V2战斗界面 - 全新设计 ==================== */
.combat-panel.v2 {
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
}

/* V2敌人信息区 */
.v2-enemy-section {
    flex-shrink: 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    border-bottom: 2px solid rgba(239, 68, 68, 0.3);
}

.v2-enemy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.v2-enemy-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.6));
    margin-right: 8px;
}

.v2-enemy-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.v2-enemy-name {
    font-size: 18px;
    font-weight: bold;
    color: #f87171;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

.v2-enemy-lv {
    font-size: 12px;
    color: #9ca3af;
    background: rgba(156, 175, 195, 0.15);
    padding: 2px 8px;
    border-radius: 8px;
    width: fit-content;
    margin-top: 2px;
}

.v2-heartbeat {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(251, 191, 36, 0.15);
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.v2-heart-icon {
    font-size: 14px;
    animation: v2-pulse 1s infinite;
}

@keyframes v2-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

#v2-heartbeat-text {
    font-size: 12px;
    color: #fbbf24;
    font-weight: 600;
}

/* V2血条通用样式 */
.v2-hp-bar {
    position: relative;
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.v2-hp-bar.v2-enemy-hp {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.v2-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
    transition: width 0.3s ease;
    border-radius: 9px;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.v2-hp-fill.v2-hp-green {
    background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.v2-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* V2行动按钮网格 */
.v2-action-grid {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
}

.v2-act-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 70px;
    -webkit-tap-highlight-color: transparent;
}

.v2-act-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(124, 200, 80, 0.4);
    transform: translateY(-2px);
}

.v2-act-btn:active {
    transform: scale(0.95);
    background: rgba(124, 200, 80, 0.15);
}

.v2-btn-icon {
    font-size: 24px;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.v2-btn-label {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

/* V2按钮颜色主题 */
.v2-btn-attack {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(185, 28, 28, 0.2));
    border-color: rgba(239, 68, 68, 0.4);
}

.v2-btn-attack:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.3));
    border-color: rgba(248, 113, 113, 0.6);
}

.v2-btn-skill {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(91, 33, 182, 0.2));
    border-color: rgba(167, 139, 250, 0.4);
}

.v2-btn-skill:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(124, 58, 237, 0.3));
    border-color: rgba(192, 132, 252, 0.6);
}

.v2-btn-artifact {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.2));
    border-color: rgba(192, 132, 252, 0.4);
}

.v2-btn-artifact:hover {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.3), rgba(168, 85, 247, 0.3));
    border-color: rgba(216, 180, 254, 0.6);
}

.v2-btn-potion {
    background: linear-gradient(135deg, rgba(101, 163, 13, 0.2), rgba(77, 124, 15, 0.2));
    border-color: rgba(132, 204, 22, 0.4);
}

.v2-btn-potion:hover {
    background: linear-gradient(135deg, rgba(132, 204, 22, 0.3), rgba(101, 163, 13, 0.3));
    border-color: rgba(163, 230, 53, 0.6);
}

.v2-btn-defend {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.2));
    border-color: rgba(56, 189, 248, 0.4);
}

.v2-btn-defend:hover {
    background: linear-gradient(135deg, rgba(125, 211, 252, 0.3), rgba(56, 189, 248, 0.3));
    border-color: rgba(125, 211, 252, 0.6);
}

.v2-btn-flee {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(245, 158, 11, 0.2));
    border-color: rgba(251, 146, 60, 0.4);
}

.v2-btn-flee:hover {
    background: linear-gradient(135deg, rgba(253, 186, 116, 0.3), rgba(251, 146, 60, 0.3));
    border-color: rgba(253, 186, 116, 0.6);
}

/* V2技能快捷栏 */
.v2-skill-bar {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.08), rgba(168, 85, 247, 0.08));
    border-top: 1px solid rgba(167, 139, 250, 0.2);
    border-bottom: 1px solid rgba(167, 139, 250, 0.2);
}

.v2-skill-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 65px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.v2-skill-slot:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(167, 139, 250, 0.4);
    transform: translateY(-2px);
}

.v2-skill-slot:active {
    transform: scale(0.95);
}

.v2-skill-slot.v2-skill-ready {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(74, 222, 128, 0.1);
}

.v2-skill-slot.v2-skill-cding {
    opacity: 0.6;
    border-color: rgba(156, 175, 195, 0.3);
}

.v2-skill-slot.v2-skill-no-mana {
    opacity: 0.7;
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(96, 165, 250, 0.08);
}

.v2-skill-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.v2-skill-name {
    font-size: 10px;
    font-weight: 600;
    color: #e9d5ff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.v2-skill-cost {
    font-size: 9px;
    color: #60a5fa;
    font-weight: 600;
    margin-top: 1px;
}

.v2-skill-cd {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.6);
    padding: 1px 4px;
    border-radius: 4px;
}

/* V2玩家状态区 */
.v2-player-section {
    flex-shrink: 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(22, 163, 74, 0.05) 100%);
    border-top: 2px solid rgba(74, 222, 128, 0.3);
}

.v2-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.v2-player-avatar {
    font-size: 24px;
    margin-right: 6px;
}

.v2-player-name {
    font-size: 16px;
    font-weight: bold;
    color: #60a5fa;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

.v2-player-lv {
    font-size: 11px;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
}

.v2-turn-info {
    font-size: 11px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.v2-hp-bar.v2-player-hp {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(74, 222, 128, 0.3);
    margin-bottom: 6px;
}

/* V2灵力条 */
.v2-spirit-bar {
    position: relative;
    height: 16px;
    background: rgba(37, 99, 235, 0.15);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.v2-spirit-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width 0.3s ease;
    border-radius: 7px;
    box-shadow: 0 0 6px rgba(96, 165, 250, 0.4);
}

.v2-spirit-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 9px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* V2战斗信息流 */
.v2-combat-log {
    flex: 1;
    min-height: 0;
    max-height: 120px;
    overflow-y: auto;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    line-height: 1.6;
}

.v2-combat-log::-webkit-scrollbar {
    width: 4px;
}

.v2-combat-log::-webkit-scrollbar-track {
    background: transparent;
}

.v2-combat-log::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.3);
    border-radius: 2px;
}

.v2-log-entry {
    margin-bottom: 3px;
    padding: 2px 0;
    animation: v2-log-fadeIn 0.3s ease-out;
}

@keyframes v2-log-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.v2-log-entry.v2-log-player {
    color: #4ade80;
}

.v2-log-entry.v2-log-enemy {
    color: #f87171;
}

.v2-log-entry.v2-log-system {
    color: #fbbf24;
}

.v2-log-entry.v2-log-error {
    color: #ef4444;
}

/* V2快捷开关 */
.v2-quick-switches {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.v2-switch-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.v2-switch-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.v2-switch-btn.active {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.4);
    color: #4ade80;
}

.v2-switch-btn:active {
    transform: scale(0.98);
}

/* V2详细日志面板 */
.v2-log-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9500;
    display: flex;
    flex-direction: column;
}

.v2-log-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(251, 191, 36, 0.1);
    border-bottom: 2px solid rgba(251, 191, 36, 0.3);
    font-size: 14px;
    font-weight: bold;
    color: #fbbf24;
}

.v2-log-close {
    background: none;
    border: none;
    color: #fbbf24;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.v2-log-close:hover {
    background: rgba(251, 191, 36, 0.2);
}

.v2-log-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.7;
    color: #d1d5db;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .v2-action-grid {
        gap: 6px;
        padding: 10px 12px;
    }
    
    .v2-act-btn {
        padding: 12px 6px;
        min-height: 60px;
    }
    
    .v2-btn-icon {
        font-size: 20px;
    }
    
    .v2-btn-label {
        font-size: 12px;
    }
    
    .v2-skill-bar {
        gap: 4px;
        padding: 8px 12px;
    }
    
    .v2-skill-slot {
        min-height: 55px;
        padding: 6px 2px;
    }
    
    .v2-skill-icon {
        font-size: 16px;
    }
    
    .v2-skill-name {
        font-size: 9px;
    }
    
    .v2-combat-log {
        max-height: 100px;
        font-size: 10px;
    }
}
