/* 桌面端特有样式 */
body {
    padding: 20px;
}

.container {
    max-width: 1200px;
}

.round-input {
    width: 60px;
}

/* 行动栏样式 */
.action-bar {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.action-bar-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-bar-characters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.action-character {
    background-color: var(--light-color);
    border-radius: 6px;
    padding: 6px 8px;
    min-width: 80px;
    max-width: 100px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 70px;
    justify-content: space-between;
}

.action-character.slow-speed {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.action-character:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.action-character-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.action-character-speed {
    color: var(--speed-color);
    font-weight: bold;
    font-size: 0.9rem;
    background-color: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
    padding: 2px 4px;
    min-width: 20px;
    text-align: center;
}

.action-character-team {
    font-size: 0.65rem;
    color: #666;
    padding: 2px 4px;
    border-radius: 10px;
    display: inline-block;
    max-width: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team1-indicator {
    background-color: rgba(74, 111, 165, 0.1);
    color: var(--team1-color);
}

.team2-indicator {
    background-color: rgba(217, 83, 79, 0.1);
    color: var(--team2-color);
}

.action-character-name {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.2;
    margin-top: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.teams-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.team {
    flex: 1;
    min-width: 300px;
}

.character-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
}

.character-actions-panel {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: none;
    flex-direction: row;
    gap: 5px;
    width: auto;
    margin-top: 5px;
}

.character-actions-panel button {
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    width: 36px;
    height: 36px;
}

.edit-character-btn {
    background-color: var(--primary-color);
    color: white;
}

.move-character-btn {
    background-color: var(--secondary-color);
    color: white;
}

.delete-character-btn {
    background-color: var(--danger-color);
    color: white;
}

.close-panel-btn {
    background-color: #e0e0e0;
    color: #333;
}

.character-actions-panel button:hover {
    opacity: 0.9;
}

.dragging {
    opacity: 0.7;
    z-index: 1000;
    position: relative;
    transform: rotate(5deg);
}

.drop-target {
    background-color: rgba(74, 111, 165, 0.1);
    border: 2px dashed var(--primary-color);
}

/* 批量操作样式 */
.batch-controls {
    display: none;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.batch-controls.active {
    display: flex;
}

.batch-selection-count {
    font-weight: 600;
    color: var(--primary-color);
}

.batch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-action-btn {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.batch-action-btn:hover {
    background-color: var(--secondary-color);
}

.batch-cancel-btn {
    background-color: #e0e0e0;
    color: #333;
}

.batch-cancel-btn:hover {
    background-color: #d0d0d0;
}

.character-checkbox {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 18px;
    height: 18px;
    z-index: 10;
    display: none;
}

.batch-mode .character-checkbox {
    display: block;
}

.batch-mode .character {
    padding-top: 25px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .teams-container {
        flex-direction: column;
    }
    
    .team {
        min-width: 100%;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .character-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .character-actions-panel {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: auto;
        max-width: 300px;
    }
    
    .action-bar-characters {
        padding-bottom: 15px;
    }
    
    .action-character {
        min-width: 70px;
        padding: 5px 6px;
    }
    
    .batch-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .batch-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .batch-action-btn {
        flex: 1;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .short-input {
        width: 100%;
    }
    
    .dice-pool-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dice-pool-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .character-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .character {
        padding: 10px;
    }
    
    .action-character {
        min-width: 65px;
        padding: 4px 5px;
    }
    
    .character-name {
        font-size: 0.85rem;
    }
    
    button {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .batch-action-btn {
        padding: 10px 12px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .character {
        padding: 15px;
    }
    
    .character-actions-panel button {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .character-checkbox {
        width: 22px;
        height: 22px;
    }
}